summaryrefslogtreecommitdiff
path: root/kernel/lockdep.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paul.mckenney@linaro.org>2012-01-30 08:46:32 -0800
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-02-21 09:06:06 -0800
commitc5fdcec927ee31fc96e92339c3a83ac6e0725289 (patch)
tree65511a65eb71990d51b46c7a88a35d51f0662e58 /kernel/lockdep.c
parentc0cfbbb0d4fca14b828a7635a59784adfba8989d (diff)
downloadlinux-3.10-c5fdcec927ee31fc96e92339c3a83ac6e0725289.tar.gz
linux-3.10-c5fdcec927ee31fc96e92339c3a83ac6e0725289.tar.bz2
linux-3.10-c5fdcec927ee31fc96e92339c3a83ac6e0725289.zip
lockdep: Add CPU-idle/offline warning to lockdep-RCU splat
It is illegal to use RCU from a CPU that has reported idleness or offlinedness to RCU. However, it can be quite difficult to determine from a stack trace whether or not a given CPU is idle or offline. Therefore, this commit adds idle/offline diagnostics to the lockdep-RCU error message. Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r--kernel/lockdep.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 8889f7dd7c4..ea9ee4518c3 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -4176,7 +4176,13 @@ void lockdep_rcu_suspicious(const char *file, const int line, const char *s)
printk("-------------------------------\n");
printk("%s:%d %s!\n", file, line, s);
printk("\nother info that might help us debug this:\n\n");
- printk("\nrcu_scheduler_active = %d, debug_locks = %d\n", rcu_scheduler_active, debug_locks);
+ printk("\n%srcu_scheduler_active = %d, debug_locks = %d\n",
+ !rcu_lockdep_current_cpu_online()
+ ? "RCU used illegally from offline CPU!\n"
+ : rcu_is_cpu_idle()
+ ? "RCU used illegally from idle CPU!\n"
+ : "",
+ rcu_scheduler_active, debug_locks);
/*
* If a CPU is in the RCU-free window in idle (ie: in the section