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

From: Peter Zijlstra
Date: Tue Apr 29 2008 - 13:59:42 EST


On Tue, 2008-04-29 at 19:45 +0200, Bart Van Assche wrote:

> 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.

Sure, but the whole point is: lockdep cannot track those rules. _that_
is why I'm choosing to forbid them.

Also, on Linux only rwlock_t allows reader recursion, and that lock type
really ought to die, all users should convert to RCU (if possible).

So I'm not thinking placing this restriction on kernel code is going to
be painful.

--
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/