Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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>
  • Loading branch information...
commit c5fdcec927ee31fc96e92339c3a83ac6e0725289 1 parent c0cfbbb
Paul E. McKenney authored paulmck committed

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. +7 1 kernel/lockdep.c
8 kernel/lockdep.c
@@ -4176,7 +4176,13 @@ void lockdep_rcu_suspicious(const char *file, const int line, const char *s)
4176 4176 printk("-------------------------------\n");
4177 4177 printk("%s:%d %s!\n", file, line, s);
4178 4178 printk("\nother info that might help us debug this:\n\n");
4179   - printk("\nrcu_scheduler_active = %d, debug_locks = %d\n", rcu_scheduler_active, debug_locks);
  4179 + printk("\n%srcu_scheduler_active = %d, debug_locks = %d\n",
  4180 + !rcu_lockdep_current_cpu_online()
  4181 + ? "RCU used illegally from offline CPU!\n"
  4182 + : rcu_is_cpu_idle()
  4183 + ? "RCU used illegally from idle CPU!\n"
  4184 + : "",
  4185 + rcu_scheduler_active, debug_locks);
4180 4186
4181 4187 /*
4182 4188 * If a CPU is in the RCU-free window in idle (ie: in the section

0 comments on commit c5fdcec

Please sign in to comment.
Something went wrong with that request. Please try again.