Quoting r. Roland Dreier <[EMAIL PROTECTED]>: > Subject: Re: [PATCH] ipoib: device removal races > > Michael> Something like: > > Michael> Remove it from the idr before completing, under a > Michael> spinlock. Now if its in idr its not completing. > > Michael> Could this work? > > I think you have to hold the spinlock across the consumer callback to > avoid all races.
Hmm. I think I see what you mean. Would setting the completion callback to NULL in the query structure under the idr spinlock work? It now seems to me it will. > And that's kind of a bummer, because it means you > can't do anything that might sleep (like modify a QP) from the > callback. Its an sa query, so I'm not sure why would you want to modify a QP there. Further, please note that in the current API the callback is always called even if the query is cancelled. And clearly you cant allow cancel under a spinlock and at the same time ensure callback is performed and is allowed to sleep. I think its not a big problem to let cancel return a code meaning "completion was cancelled, perform the callback yourself if you want to". I imagine ulps may special-case cancellation, anyway. Would such an API change be OK? -- MST _______________________________________________ openib-general mailing list [email protected] http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
