locking: Add WARN_ON_ONCE lock assertion
PATCH 1/1 locking: Add WARN_ON_ONCE lock assertion
An interface may need to assert a lock invariant and not flood the system logs; add a lockdep helper macro equivalent to lockdep_assert_held() which only WARNs once.
--- include/linux/lockdep.h | 5 +++++ 1 file changed, 5 insertions(+)
include/linux/lockdep.h +5 -0
@@ -362,6 +362,10 @@ extern void lockdep_trace_alloc(gfp_t mask);WARN_ON (debug_locks && !lockdep_is_held (l)); \ } while (0) +#define lockdep_assert_held_once (l) do { \ + WARN_ON_ONCE(debug_locks && !lockdep_is_held(l)); \ + } while (0) +#define lockdep_recursing (tsk) ((tsk)->lockdep_recursion)#else /* !CONFIG_LOCKDEP */
@@ -412,6 +416,7 @@ struct lock_class_key { };#define lockdep_depth (tsk) (0)#define lockdep_assert_held (l) do { (void)(l); } while (0) +#define lockdep_assert_held_once (l) do { (void)(l); } while (0)#define lockdep_recursing (tsk) (0)
Signature · 1 line
2.1.0
Quoted 6 lines · Peter Hurley
An interface may need to assert a lock invariant and not flood the system logs; add a lockdep helper macro equivalent to
lockdep_assert_held()which only WARNs once.cc Greg Kroah-Hartman <[email protected]>Signed-off-by Peter Hurley <[email protected]>
Thanks,
Ingo
Quoted 11 lines · Ingo Molnar
Quoted 6 lines · Peter Hurley
An interface may need to assert a lock invariant and not flood the system logs; add a lockdep helper macro equivalent to
lockdep_assert_held()which only WARNs once.cc Greg Kroah-Hartman <[email protected]>Signed-off-by Peter Hurley <[email protected]>Acked-by Ingo Molnar <[email protected]>
Any objection for me taking this through the TTY tree due to the dependancies on future tty patches that use the function in this patch?
thanks,
greg k-h
Quoted 8 lines · Greg Kroah-Hartman
Quoted 7 lines · Ingo Molnar
Quoted 4 lines · Peter Hurley
An interface may need to assert a lock invariant and not flood the system logs; add a lockdep helper macro equivalent to
lockdep_assert_held()which only WARNs once.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
cc Greg Kroah-Hartman <[email protected]>Signed-off-by Peter Hurley <[email protected]>Acked-by Ingo Molnar <[email protected]>Any objection for me taking this through the TTY tree due to the dependancies on future tty patches that use the function in this patch?
Now that the patch is correct I have no objection whatsoever, feel free!
Thanks,
Ingo
Quoted 14 lines · Ingo Molnar
Quoted 11 lines · Greg Kroah-Hartman
Quoted 10 lines · Ingo Molnar
Quoted 6 lines · Peter Hurley
An interface may need to assert a lock invariant and not flood the system logs; add a lockdep helper macro equivalent to
lockdep_assert_held()which only WARNs once.cc Greg Kroah-Hartman <[email protected]>Signed-off-by Peter Hurley <[email protected]>
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Acked-by Ingo Molnar <[email protected]>Any objection for me taking this through the TTY tree due to the dependancies on future tty patches that use the function in this patch?
Now that the patch is correct I have no objection whatsoever, feel free!
Thanks, will do.
greg k-h