notifiers, RCU: Assert that RCU is watching in notify_die()
authorAndy Lutomirski <[email protected]>
Fri, 3 Jul 2015 19:44:22 +0000 (12:44 -0700)
committerIngo Molnar <[email protected]>
Tue, 7 Jul 2015 08:59:04 +0000 (10:59 +0200)
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 <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Paul E. McKenney <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/1f5fe6c23d5b432a23267102f2d72b787d80fdd8.1435952415.git.luto@kernel.org
Signed-off-by: Ingo Molnar <[email protected]>
kernel/notifier.c

index ae9fc7cc360ebea6088db4ae0206e452d856214b..980e4330fb596d8acc54eee45afcd372e8e9e82e 100644 (file)
@@ -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);