Return-Path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43946 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932569AbdIYADI (ORCPT ); Sun, 24 Sep 2017 20:03:08 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8ONxRxx125517 for ; Sun, 24 Sep 2017 20:03:08 -0400 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0b-001b2d01.pphosted.com with ESMTP id 2d64q8m0gn-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 24 Sep 2017 20:03:07 -0400 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 24 Sep 2017 20:03:07 -0400 Date: Sun, 24 Sep 2017 17:03:03 -0700 From: "Paul E. McKenney" To: Linus Torvalds Cc: Steven Rostedt , Linux Kernel Mailing List , Ingo Molnar , Andrew Morton , stable Subject: Re: [PATCH 1/4] rcu: Allow for page faults in NMI handlers Reply-To: paulmck@linux.vnet.ibm.com References: <20170923205621.811805556@goodmis.org> <20170923205804.098759069@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Message-Id: <20170925000303.GJ3521@linux.vnet.ibm.com> Sender: stable-owner@vger.kernel.org List-ID: On Sun, Sep 24, 2017 at 12:42:32PM -0700, Linus Torvalds wrote: > On Sat, Sep 23, 2017 at 1:56 PM, Steven Rostedt wrote: > > + > > + /* Page faults can happen in NMI handlers, so check... */ > > + if (READ_ONCE(rdtp->dynticks_nmi_nesting)) > > + return; > > + > > What is the reason for the READ_ONCE() here (and in the other case)? > > It doesn't seem to have any actual reason. It's a "stable" per-cpu > value in that even if an NMI were to happen, it gets incremented and > then decremented, so there is nothing really volatile about it > anywhere that I can see. > > So the READ_ONCE() seems to be just pure confusion. > > What am I missing? Mostly just paranoia on my part. I would be happy to remove it if you prefer. Or you or Steve can do so if that is more convenient. And yes, consistency would dictate that the uses in rcu_nmi_enter() and rcu_nmi_exit() should be _ONCE(), particularly the stores to ->dynticks_nmi_nesting. But I am not too worried about that right now because I suspect that I should be able to combine rcu_irq_{enter,exit}() and rcu_nmi_{enter,exit}(), which would be a good simplification. Thanx, aul