[lkml]   [2011]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH tip/core/rcu 50/55] rcu: Inform the user about dynticks-idle mode on PROVE_RCU warning
From: Frederic Weisbecker <>

Inform the user if an RCU usage error is detected by lockdep while in
an extended quiescent state (in this case, dyntick-idle mode). This
is accomplished by adding a line to the RCU lockdep splat indicating
whether or not the splat occurred in dyntick-idle mode.

Signed-off-by: Frederic Weisbecker <>
Cc: Paul E. McKenney <>
Cc: Ingo Molnar <>
Cc: Peter Zijlstra <>
Cc: Thomas Gleixner <>
Cc: Lai Jiangshan <>
Signed-off-by: Paul E. McKenney <>
kernel/lockdep.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index df2ad37..ef5dd69 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -4008,6 +4008,26 @@ void lockdep_rcu_suspicious(const char *file, const int line, const char *s)
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);
+ /*
+ * If a CPU is in dyntick-idle mode (CONFIG_NO_HZ), then RCU
+ * considers that CPU to be in an "extended quiescent state",
+ * which means that RCU will be completely ignoring that CPU.
+ * Therefore, rcu_read_lock() and friends have absolutely no
+ * effect on a dyntick-idle CPU. In other words, even if a
+ * dyntick-idle CPU has called rcu_read_lock(), RCU might well
+ * delete data structures out from under it. RCU really has no
+ * choice here: if it were to consult the CPU, that would wake
+ * the CPU up, and the whole point of dyntick-idle mode is to
+ * allow CPUs to enter extremely deep sleep states.
+ *
+ * So complain bitterly if someone does call rcu_read_lock(),
+ * rcu_read_lock_bh() and so on from extended quiescent states
+ * such as dyntick-idle mode.
+ */
+ if (rcu_check_extended_qs())
+ printk("RCU used illegally from extended quiescent state!\n");
printk("\nstack backtrace:\n");

 \ /
  Last update: 2011-09-07 08:25    [W:0.310 / U:4.812 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site