Re: [PATCH 1/8] lockdep: fix recursive read lock validation

From: Bart Van Assche
Date: Tue Apr 29 2008 - 13:45:59 EST


On Tue, Apr 29, 2008 at 7:04 PM, Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/