diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2011-10-07 12:22:01 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2011-12-11 13:31:30 -0500 |
commit | 0464e937485f15d2add78e3b0f498469f4e6600d (patch) | |
tree | 4007c0643436591850ac8bc87e03601afb8f1920 /kernel/lockdep.c | |
parent | e6b80a3b0994ea6c3d876d72464f2debbfcfeb05 (diff) |
rcu: Inform the user about extended quiescent state on PROVE_RCU warning
Inform the user if an RCU usage error is detected by lockdep while in
an extended quiescent state (in this case, the RCU-free window in idle).
This is accomplished by adding a line to the RCU lockdep splat indicating
whether or not the splat occurred in extended quiescent state.
Uses of RCU from within extended quiescent state mode are totally ignored
by RCU, hence the importance of this diagnostic.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r-- | kernel/lockdep.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index b2e08c932d91..f45c6817770e 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -4170,6 +4170,28 @@ void lockdep_rcu_suspicious(const char *file, const int line, const char *s) | |||
4170 | printk("%s:%d %s!\n", file, line, s); | 4170 | printk("%s:%d %s!\n", file, line, s); |
4171 | printk("\nother info that might help us debug this:\n\n"); | 4171 | printk("\nother info that might help us debug this:\n\n"); |
4172 | printk("\nrcu_scheduler_active = %d, debug_locks = %d\n", rcu_scheduler_active, debug_locks); | 4172 | printk("\nrcu_scheduler_active = %d, debug_locks = %d\n", rcu_scheduler_active, debug_locks); |
4173 | |||
4174 | /* | ||
4175 | * If a CPU is in the RCU-free window in idle (ie: in the section | ||
4176 | * between rcu_idle_enter() and rcu_idle_exit(), then RCU | ||
4177 | * considers that CPU to be in an "extended quiescent state", | ||
4178 | * which means that RCU will be completely ignoring that CPU. | ||
4179 | * Therefore, rcu_read_lock() and friends have absolutely no | ||
4180 | * effect on a CPU running in that state. In other words, even if | ||
4181 | * such an RCU-idle CPU has called rcu_read_lock(), RCU might well | ||
4182 | * delete data structures out from under it. RCU really has no | ||
4183 | * choice here: we need to keep an RCU-free window in idle where | ||
4184 | * the CPU may possibly enter into low power mode. This way we can | ||
4185 | * notice an extended quiescent state to other CPUs that started a grace | ||
4186 | * period. Otherwise we would delay any grace period as long as we run | ||
4187 | * in the idle task. | ||
4188 | * | ||
4189 | * So complain bitterly if someone does call rcu_read_lock(), | ||
4190 | * rcu_read_lock_bh() and so on from extended quiescent states. | ||
4191 | */ | ||
4192 | if (rcu_is_cpu_idle()) | ||
4193 | printk("RCU used illegally from extended quiescent state!\n"); | ||
4194 | |||
4173 | lockdep_print_held_locks(curr); | 4195 | lockdep_print_held_locks(curr); |
4174 | printk("\nstack backtrace:\n"); | 4196 | printk("\nstack backtrace:\n"); |
4175 | dump_stack(); | 4197 | dump_stack(); |