[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1224791072.6002.63.camel@johannes.berg>
Date: Thu, 23 Oct 2008 21:44:32 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Linux Kernel list <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...e.hu>
Subject: [PATCH 1/2] lockdep: implement full check without irq checking
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@...solutions.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:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists