Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1171044

[PATCH v3 03/15] notifiers: Assert that RCU is watching in notify_die

Path csiph.com!aioe.org!goblin3!goblin.stu.neva.ru!news-2.dfn.de!news.dfn.de!storethat.news.telefonica.de!telefonica.de!news.panservice.it!bofh.it!news.nic.it!robomod
From Andy Lutomirski <luto@kernel.org>
Newsgroups linux.kernel
Subject [PATCH v3 03/15] notifiers: Assert that RCU is watching in notify_die
Date Wed, 24 Jun 2015 04:50:02 +0200
Message-ID <pEIVc-554-25@gated-at.bofh.it> (permalink)
References <pEIVb-554-3@gated-at.bofh.it>
X-Original-To x86@kernel.org, linux-kernel@vger.kernel.org
X-Mailer git-send-email 2.4.3
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 30
Organization linux.* mail to news gateway
X-Original-Cc Frédéric Weisbecker <fweisbec@gmail.com>, Rik van Riel <riel@redhat.com>, Oleg Nesterov <oleg@redhat.com>, Denys Vlasenko <vda.linux@googlemail.com>, Borislav Petkov <bp@alien8.de>, Kees Cook <keescook@chromium.org>, Brian Gerst <brgerst@gmail.com>, paulmck@linux.vnet.ibm.com, Andy Lutomirski <luto@kernel.org>
X-Original-Date Tue, 23 Jun 2015 19:46:06 -0700
X-Original-Message-ID <c9b5f7d2525e17192a983a31f2f0d8eeec6c4c74.1435113808.git.luto@kernel.org>
X-Original-References <cover.1435113808.git.luto@kernel.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1171044

Show key headers only | View raw


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.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v3 03/15] notifiers: Assert that RCU is watching in notify_die Andy Lutomirski <luto@kernel.org> - 2015-06-24 04:50 +0200

csiph-web