[openib-general] Fwd: issues in ipoib

Michael S. Tsirkin mst at mellanox.co.il
Wed Aug 2 10:57:18 PDT 2006


Quoting r. Roland Dreier <rdreier at cisco.com>:
> Subject: Re: Fwd: issues in ipoib
> 
>     Roland> It's not lockdep, it's just general lock debugging.  And
>     Roland> freeing a locked lock is bad practice anyway.
>                                    
>     Michael> Fine, although I wander why exactly.  I'll just respin
>     Michael> with up_read then? But won't down_read up_read look weird
>     Michael> too?  Is there some other way to flush out all readers?
> 
> It's bad practice because in general you don't know who else is
> blocked on the lock getting freed, so freeing it could lead to
> deadlock or use-after-free.
> 
> In this case using an rwsem seems sort of awkward anyway.  Wouldn't it
> match better with what's really going on to have a reference count,
> and wait for it to go to zero?

So basically a kref + a waitqueue? Fine.

-- 
MST




More information about the general mailing list