[openib-general] Fwd: issues in ipoib

Michael S. Tsirkin mst at mellanox.co.il
Thu Aug 3 12:12:07 PDT 2006


Quoting r. Roland Dreier <rdreier at cisco.com>:
> Subject: Re: Fwd: issues in ipoib
> 
>  > +	if (atomic_dec_and_test(&client->users))
>  > +		wake_up(&client->wait);
> 
>  > +	wait_event(client->wait, atomic_read(&client->users) == 0);
> 
> I think this is vulnerable to the race we fixed up all over the place
> a few months ago, where wait_event runs between the
> atomic_dec_and_test() and the wake_up().

No, I think there's no problem  - user callback has finished running
and that's all we care about.

But I'd like to point out that using rwsem gets all these corners right
automatically. Reconsider that approach?

-- 
MST




More information about the general mailing list