[openib-general] Re: [PATCH (draft)] sdp: fix aio/sync completion race

Michael S. Tsirkin mst at mellanox.co.il
Fri Jul 1 05:07:00 PDT 2005


Quoting r. Libor Michalek <libor at topspin.com>:
> Subject: Re: [PATCH (draft)] sdp: fix aio/sync completion race
> 
> On Tue, Jun 28, 2005 at 11:18:57PM +0300, Michael S. Tsirkin wrote:
> > Libor, here's a stub at solving an old problem.
> > Most of the patch is passing sdp_opt to iocb complete and cancel functions.
> > 
> > I didnt yet test it, and I wont have the time today,
> > but maybe you could tell me whether I'm going in the right
> > direction with this.
> 
>   I'm wondering if we should prevent a new call from proceeding until
> all IOCBs have been completed, like the patch you have, or if we should
> force the creation of an IOCB when there are any IOCBs outstanding,
> even if the call can be processed synchronously.
> 
>   Remember the original problem was IOCB completes in the work queue
> completing after a call to send/recv that was processed synchronously.
> Either forcing an IOCB or waiting on the lock should prevent the
> ordering issue.

You mean using zcopy for packets below zcopy threshold?

>   I think either case if means passing the sdp_opt to iocb_complete. In
> do_iocb_complete you cannot call conn_unlock unconditionally since
> the lock.users variable is only incremented in_atomic() or irqs_disabled()
> Also, I think the conn reference needs to be incremented before
> creating the work request, and decremeneted upon completion since
> nothing prevents it from going away before the thread is scheduled.
> 

Libor, thanks for the comments.
I'll work on addressing them.

-- 
MST



More information about the general mailing list