Re: suspend-related lockdep warning

From: Ingo Molnar
Date: Thu Dec 06 2007 - 07:04:55 EST



* Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> It would be nice to make that warning tell us that - we've hit it a
> few times and I never knew this was the reason.

i'm a mind-reader and a time-traveler as well, so i've got the patch
below lined up in my sched.git queue already :-)

Ingo

-------------->
Subject: lockdep: make cli/sti annotation warnings clearer
From: Ingo Molnar <mingo@xxxxxxx>

make cli/sti annotation warnings easier to interpret.

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
---
kernel/lockdep.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

Index: linux/kernel/lockdep.c
===================================================================
--- linux.orig/kernel/lockdep.c
+++ linux/kernel/lockdep.c
@@ -2654,10 +2654,15 @@ static void check_flags(unsigned long fl
if (!debug_locks)
return;

- if (irqs_disabled_flags(flags))
- DEBUG_LOCKS_WARN_ON(current->hardirqs_enabled);
- else
- DEBUG_LOCKS_WARN_ON(!current->hardirqs_enabled);
+ if (irqs_disabled_flags(flags)) {
+ if (DEBUG_LOCKS_WARN_ON(current->hardirqs_enabled)) {
+ printk("possible reason: unannotated irqs-off.\n");
+ }
+ } else {
+ if (DEBUG_LOCKS_WARN_ON(!current->hardirqs_enabled)) {
+ printk("possible reason: unannotated irqs-on.\n");
+ }
+ }

/*
* We dont accurately track softirq state in e.g.
--
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/