From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752861AbdIXTmf (ORCPT ); Sun, 24 Sep 2017 15:42:35 -0400 Received: from mail-it0-f54.google.com ([209.85.214.54]:47113 "EHLO mail-it0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752753AbdIXTmd (ORCPT ); Sun, 24 Sep 2017 15:42:33 -0400 X-Google-Smtp-Source: AOwi7QCnqgeazWEQbCunhnyc7r/h3dnv8fKcXyn9odpUzvvjWXTna8jW36mp00d5scAW3WeWVr5UDD/KQVxQ4JvJUnQ= MIME-Version: 1.0 In-Reply-To: <20170923205804.098759069@goodmis.org> References: <20170923205621.811805556@goodmis.org> <20170923205804.098759069@goodmis.org> From: Linus Torvalds Date: Sun, 24 Sep 2017 12:42:32 -0700 X-Google-Sender-Auth: n0j3dpvBFSgoJdxWl1Qz85WlQ3s Message-ID: Subject: Re: [PATCH 1/4] rcu: Allow for page faults in NMI handlers To: Steven Rostedt Cc: Linux Kernel Mailing List , Ingo Molnar , Andrew Morton , "Paul E. McKenney" , stable Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Linus