From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756309AbbFVLh2 (ORCPT ); Mon, 22 Jun 2015 07:37:28 -0400 Received: from mail.skyhub.de ([78.46.96.112]:47614 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933047AbbFVLg7 (ORCPT ); Mon, 22 Jun 2015 07:36:59 -0400 Date: Mon, 22 Jun 2015 13:36:50 +0200 From: Borislav Petkov To: Andy Lutomirski Cc: x86@kernel.org, linux-kernel@vger.kernel.org, =?utf-8?B?RnLDqWTDqXJpYw==?= Weisbecker , Rik van Riel , Oleg Nesterov , Denys Vlasenko , Kees Cook , Brian Gerst , paulmck@linux.vnet.ibm.com Subject: Re: [PATCH v2 03/14] notifiers: Assert that RCU is watching in notify_die Message-ID: <20150622113649.GB20244@pd.tnic> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 18, 2015 at 12:08:35PM -0700, Andy Lutomirski wrote: > 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 > --- > 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); > } Ok, we're about to die and we will prepend what would be a more important splat possibly hinting at the problem is with a lockdep splat. I think we should do the assertion and make the rcu_lockdep splat come last I but don't see how to do this easily from all the notify_die() call sites. Or am I missing something...? -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/