Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754907AbdDLVu6 (ORCPT ); Wed, 12 Apr 2017 17:50:58 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:35700 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751587AbdDLVu4 (ORCPT ); Wed, 12 Apr 2017 17:50:56 -0400 Date: Wed, 12 Apr 2017 23:50:45 +0200 (CEST) From: Thomas Gleixner To: Borislav Petkov cc: "Verma, Vishal L" , "Williams, Dan J" , "linux-kernel@vger.kernel.org" , "linux-nvdimm@lists.01.org" , "Luck, Tony" , "ross.zwisler@linux.intel.com" , "x86@kernel.org" , "Paul E. McKenney" , Peter Zijlstra Subject: Re: [RFC PATCH] x86, mce: change the mce notifier to 'blocking' from 'atomic' In-Reply-To: <20170412211302.3d2cxe34sgiu3dag@pd.tnic> Message-ID: References: <20170411224457.24777-1-vishal.l.verma@intel.com> <20170412091442.dwonfr4dwyta7nvx@pd.tnic> <20170412195903.GA29506@omniknight.lm.intel.com> <20170412202238.5d327vmwjqvbzzop@pd.tnic> <1492028744.2738.14.camel@intel.com> <20170412211302.3d2cxe34sgiu3dag@pd.tnic> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 920 Lines: 31 On Wed, 12 Apr 2017, Borislav Petkov wrote: > On Wed, Apr 12, 2017 at 08:27:05PM +0000, Verma, Vishal L wrote: > > But isn't the atomic notifier call chain always called in atomic > > context? > > No, it isn't. We're calling it in normal process context in > mce_gen_pool_process() too. > > So this early exit will avoid any sleeping in atomic context. And since > there's nothing you can do about the errors reported in atomic context, > we can actually use that fact. No, you can't. CONFIG_RCU_PREEMPT=n + CONFIG_PREEMPT_COUNT will disable preemption from within __atomic_notifier_call_chain() via rcu_read_lock(). Ergo you wont ever enter the handler. The behaviour in the RCU code is inconsistent. CONFIG_RCU_PREEMPT=y does obviouly not disable preemption, but it should still trigger the might_sleep() check when a blocking function is called from within a rcu read side critical section. Thanks, tglx