lkml.org 
[lkml]   [2008]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/2] lockdep: implement full check without irq checking
From
Date
This patch implements a new check type "3" which means "full validation
but without irq tracing" in order to allow some certain fake locks that
are only added for deadlock detection to not cause inconsistent state
warnings which would be inappropriate for them.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/linux/lockdep.h | 4 ++++
kernel/lockdep.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)

--- wireless-testing.orig/include/linux/lockdep.h 2008-10-23 21:06:25.837224864 +0200
+++ wireless-testing/include/linux/lockdep.h 2008-10-23 21:32:09.889809433 +0200
@@ -301,6 +301,7 @@ extern void lockdep_init_map(struct lock
* 0: disabled
* 1: simple checks (freeing, held-at-exit-time, etc.)
* 2: full validation
+ * 3: full validation without irq tracing
*/
extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
int trylock, int read, int check,
@@ -471,12 +472,15 @@ static inline void print_irqtrace_events
#ifdef CONFIG_DEBUG_LOCK_ALLOC
# ifdef CONFIG_PROVE_LOCKING
# define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 2, NULL, _THIS_IP_)
+# define lock_map_acquire_noirq(l) lock_acquire(l, 0, 0, 0, 3, NULL, _THIS_IP_)
# else
# define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 1, NULL, _THIS_IP_)
+# define lock_map_acquire_noirq(l) lock_acquire(l, 0, 0, 0, 1, NULL, _THIS_IP_)
# endif
# define lock_map_release(l) lock_release(l, 1, _THIS_IP_)
#else
# define lock_map_acquire(l) do { } while (0)
+# define lock_map_acquire_noirq(l) do { } while (0)
# define lock_map_release(l) do { } while (0)
#endif

--- wireless-testing.orig/kernel/lockdep.c 2008-10-23 21:06:25.881976762 +0200
+++ wireless-testing/kernel/lockdep.c 2008-10-23 21:13:43.460100511 +0200
@@ -1695,7 +1695,7 @@ static int validate_chain(struct task_st
* (If lookup_chain_cache() returns with 1 it acquires
* graph_lock for us)
*/
- if (!hlock->trylock && (hlock->check == 2) &&
+ if (!hlock->trylock && (hlock->check >= 2) &&
lookup_chain_cache(curr, hlock, chain_key)) {
/*
* Check whether last held lock:



\
 
 \ /
  Last update: 2008-10-24 11:47    [W:0.063 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site