[openib-general] Re: Re: [PATCH] (repost) sdp: replace mlock with get_user_pages

Michael S. Tsirkin mst at mellanox.co.il
Tue May 17 15:33:34 PDT 2005


Quoting r. Libor Michalek <libor at topspin.com>:
> Subject: Re: Re: [PATCH] (repost) sdp: replace mlock with get_user_pages
> 
> On Sat, May 14, 2005 at 10:19:30PM +0300, Michael S. Tsirkin wrote:
> > Quoting r. Libor Michalek <libor at topspin.com>:
> > > 
> > > > > Another alternative would be to always complete aios asynchronously,
> > > > > which should preserve the order.  I guess this would hurt latency for
> > > > > small ios...
> > > > 
> > > > To avoid hurting latency, lets count the number of outstanding
> > > > asynchronous AIOs, and if there are asynchronous AIOs complete
> > > > all of them asynchronously.
> > > > 
> > > > Does this make sense?
> > > 
> > >   Yes, except that the current iocb code does not reference individual
> > > sockets anywhere, and do_iocb_complete would have to be the function
> > > which decremented the per connection counter of outstanding AIOs.
> > 
> > But do_iocb_complete is always called with socket locked, is it not?
> > If so its not hard to add that counting.
> 
>   iocb_complete() is always called with the socket locked, but by the
> time do_iocb_complete() executes it's unknown what the socket is doing
> since it's not referenced anywhere in sdp_iocb.
> 
> -Libor
> 

Wait, thats exactly the case we were trying to handle -
spawning a thread to complete the iocb.
So if we add a conn pointer to the iocb, we can increment
a counter before spawning a thread to complete the iocb
and decrement after the iocb is complete.

If counter > 0, spawn a thread to complete synchronous io.
  
-- 
MST - Michael S. Tsirkin



More information about the general mailing list