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

Michael S. Tsirkin mst at mellanox.co.il
Sat May 14 12:19:30 PDT 2005


Quoting r. Libor Michalek <libor at topspin.com>:
> Subject: Re: Re: [PATCH] (repost) sdp: replace mlock with get_user_pages
> 
> On Fri, May 13, 2005 at 04:51:45PM +0300, Michael S. Tsirkin wrote:
> > Quoting r. Roland Dreier <roland at topspin.com>:
> > > 
> > >     Libor>   Always call aio_complete() immediately when
> > >     Libor> iocb_complete() is called, and only spawn the work thread
> > >     Libor> to unlock the memory after the aio_complete() call. The
> > >     Libor> patch is below.
> > 
> > Libor, I dont think its a good idea - this will break other assumptions,
> > like the assumption that the task mm isnt destroyed before we unlock
> > the memory.
> 
>   That's a good point.
> 
> > > 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.

> Also,
> since we don't have to do get_user_pages a second time on the send
> path, this would only need to be done on the recv path.
> 
> -Libor
> 

I agree this is a possible optimization, although of course everything
still works if we do this for both send and receive.

-- 
MST - Michael S. Tsirkin



More information about the general mailing list