Re: [RFC][PATCH 3/7] lockdep: Annotate read/write states

From: Steven Rostedt
Date: Mon Apr 18 2011 - 12:31:19 EST


On Sun, 2011-04-17 at 11:45 +0200, Peter Zijlstra wrote:
> #ifdef CONFIG_DEBUG_LOCK_ALLOC
> # ifdef CONFIG_PROVE_LOCKING
> -# define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i)
> -# define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 2, NULL, i)
> +# define rwlock_acquire(l, s, t, i) \
> + lock_acquire(l, s, t, STATE_WRITE, 2, NULL, i)
> +# define rwlock_acquire_read(l, s, t, i) \
> + lock_acquire(l, s, t, STATE_RECURSIVE_READ, 2, NULL, i)
> # else
> -# define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i)
> -# define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 1, NULL, i)
> +# define rwlock_acquire(l, s, t, i) \
> + lock_acquire(l, s, t, STATE_WRITE, 1, NULL, i)
> +# define rwlock_acquire_read(l, s, t, i) \
> + lock_acquire(l, s, t, STATE_RECURSIVE_READ, 1, NULL, i)
> # endif
> # define rwlock_release(l, n, i) lock_release(l, n, i)
> #else

OT, I like this, we need to get rid of that other 2 and 1 too, as it is
very confusing to what they mean. But that can be done in a later clean
up.

-- Steve


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