linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] notifiers: Assert that RCU is watching in notify_die
@ 2015-06-05  0:17 Andy Lutomirski
  0 siblings, 0 replies; only message in thread
From: Andy Lutomirski @ 2015-06-05  0:17 UTC (permalink / raw)
  To: mingo
  Cc: linux-kernel, Borislav Petkov, Frédéric Weisbecker,
	Paul McKenney, Andy Lutomirski

Low-level arch entries often call notify_die, and it's easy for arch
code to fail to exit an RCU quiescent state first.  Assert that
we're not quiescent in notify_die.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 kernel/notifier.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/notifier.c b/kernel/notifier.c
index ae9fc7cc360e..980e4330fb59 100644
--- a/kernel/notifier.c
+++ b/kernel/notifier.c
@@ -544,6 +544,8 @@ int notrace notify_die(enum die_val val, const char *str,
 		.signr	= sig,
 
 	};
+	rcu_lockdep_assert(rcu_is_watching(),
+			   "notify_die called but RCU thinks we're quiescent");
 	return atomic_notifier_call_chain(&die_chain, val, &args);
 }
 NOKPROBE_SYMBOL(notify_die);
-- 
2.4.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-06-05  0:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-05  0:17 [PATCH] notifiers: Assert that RCU is watching in notify_die Andy Lutomirski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).