Messages in this thread | | | Date | Tue, 29 Apr 2008 19:45:43 +0200 | From | "Bart Van Assche" <> | Subject | Re: [PATCH 1/8] lockdep: fix recursive read lock validation |
| |
On Tue, Apr 29, 2008 at 7:04 PM, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote: > > I think the critical part is: > > > It really is invalid when considered against write locks. > > Aside from that it just states that inversion of lock order will be > treated as invalid - even for read locks.
Inversion of recursive reader locks can't trigger a deadlock, even when considered against write locks, as long as the rules are followed I posted earlier. I invite anyone to come up with an example that proves me wrong.
Let's return to the starting point of this discussion. The patch at the start of this thread forbids to invert the lock order of reader locks. Why to forbid this if it can't trigger a deadlock ? At least in user space code, it's quite easy to trigger such inversion. In sufficiently complex code where functions call other functions while holding a reader lock, reader lock inversion can be hard to avoid.
Bart.
| |