Re: [RFC][PATCH 4/7] lockdep: Seperate lock ids for read/writeacquires

From: Peter Zijlstra
Date: Mon Apr 18 2011 - 18:07:44 EST


On Sun, 2011-04-17 at 11:45 +0200, Peter Zijlstra wrote:
> In order to support recursive read locks we need to support the
> previously mentioned lock state conflict matrix:
>
> Conflicting_states(WRITE): RECURSIVE_READ | READ | WRITE
> Conflicting_states(READ): READ | WRITE
> Conflicting_states(RECURSIVE_READ): WRITE
>
> Since this introduces asymmetry between recursive read and write, we
> need to split the lock dependency chains such that we can traverse
> WRITE chains without observing RECURSIVE_READ|READ chains.

So while we split off the WRITE chain from the RECURSIVE_READ|READ
chains, shouldn't we split it in three, because the READ conflict state
only has READ|WRITE, not RECURSIVE_READ.

Therefore a RECURSIVE_READ dependency in the READ chain could throw the
regular READ cycle detector, no?


A(r) -> B(r) -> C(rr)

C(w) -> B(r)

would close the cycle and report a problem, but doesn't match the
conflict states.
--
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/