From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933194AbdIYAD7 (ORCPT ); Sun, 24 Sep 2017 20:03:59 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48686 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932937AbdIYADJ (ORCPT ); Sun, 24 Sep 2017 20:03:09 -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: User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17092500-0044-0000-0000-00000394B235 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007786; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000231; SDB=6.00921887; UDB=6.00463307; IPR=6.00702029; BA=6.00005602; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017261; XFM=3.00000015; UTC=2017-09-25 00:03:07 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17092500-0045-0000-0000-000007C3B8AF Message-Id: <20170925000303.GJ3521@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-09-24_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709240367 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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