Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp780730ybb; Fri, 20 Mar 2020 08:00:47 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuPj0g0tIy+RDdVNfYRYti/CfN7bgVizJ2NJgNqfHQSYjxSEkIA9zdW7yf0efOJXk+jJGut X-Received: by 2002:a9d:4d8a:: with SMTP id u10mr7095657otk.148.1584716447003; Fri, 20 Mar 2020 08:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584716446; cv=none; d=google.com; s=arc-20160816; b=Vxtd+y4TsboTp8yKdj0ZySNUMFcs/RR71s/7ivp4Dfyq7NCwVJaBjtmZfc1wzj3D7y nan81awUQPfOrjLDOBmSx4NZRBPTkkPS7opZniAeQMdl7CRW9Bhlru9jQ0wjO6dTcndW 27hPwn0P4QgScy+WvpaPjV4M7gOkFtkaaDdypoxV3glpKKXGI2o8vgb0gcDR2k2BBrbf Lop0tQ4HxN5do86+G2cy03h/MY+Xe663ijChQQYgYxtVimUjjz3S1KkFBdBa8P7hARaM /XDthS0x8f+C2M6DAEyFHki8g08xDHD4PuSSM3AlAc3OsG2zmWYr4w2JxvlBK5VOdIUL b98g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=gmPr8UkBOHkqxKmLh8nbJ+2+grNWm3fvAmujsFBA8B4=; b=cEeM/dIepYWeI/c/G5fkDkOxX2/jExXdUXPob/Vj+Hbweoi6q9jfgFoPpD0Qhy/D+N AeqztRsq0RK6Wj1KXnwQ3lKVFGNT/XQE5B3HrJxq7W9UUqpWxYqg88NS7gTROJD9QWSF LaIAc1O8pq2qwSA4Gt46/bWAjQOgCQhdqcR2H4Kj7Ri4j5CehLF51siGBj7c6TmkMbQL ieYtjwc3tdf1NuQXrJNNHuhLZA2d9c+AVRCiA1a3SL6xAG1XkJQuzJoe4xs5enqos2km 7x1ifV/g8zHG7HGv+4Sj1AmFYnXEXtLCsqv+mIbNInr/pVvqmuzer95ngv0cxHgvMZHA WK+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x26si2990034otq.220.2020.03.20.08.00.32; Fri, 20 Mar 2020 08:00:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727177AbgCTO74 (ORCPT + 99 others); Fri, 20 Mar 2020 10:59:56 -0400 Received: from netrider.rowland.org ([192.131.102.5]:60257 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726778AbgCTO74 (ORCPT ); Fri, 20 Mar 2020 10:59:56 -0400 Received: (qmail 28990 invoked by uid 500); 20 Mar 2020 10:59:55 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 20 Mar 2020 10:59:55 -0400 Date: Fri, 20 Mar 2020 10:59:55 -0400 (EDT) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: "Joel Fernandes (Google)" cc: linux-kernel@vger.kernel.org, Akira Yokosawa , Andrea Parri , Boqun Feng , Daniel Lustig , David Howells , Jade Alglave , , Luc Maranget , Nicholas Piggin , "Paul E. McKenney" , Peter Zijlstra , Will Deacon Subject: Re: [PATCH 1/3] LKMM: Add litmus test for RCU GP guarantee where updater frees object In-Reply-To: <20200320065552.253696-1-joel@joelfernandes.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Mar 2020, Joel Fernandes (Google) wrote: > This adds an example for the important RCU grace period guarantee, which > shows an RCU reader can never span a grace period. > > Signed-off-by: Joel Fernandes (Google) > --- > .../litmus-tests/RCU+sync+free.litmus | 40 +++++++++++++++++++ > 1 file changed, 40 insertions(+) > create mode 100644 tools/memory-model/litmus-tests/RCU+sync+free.litmus > > diff --git a/tools/memory-model/litmus-tests/RCU+sync+free.litmus b/tools/memory-model/litmus-tests/RCU+sync+free.litmus > new file mode 100644 > index 0000000000000..c4682502dd296 > --- /dev/null > +++ b/tools/memory-model/litmus-tests/RCU+sync+free.litmus > @@ -0,0 +1,40 @@ > +C RCU+sync+free > + > +(* > + * Result: Never > + * The following comment needs some rewriting. The grammar is somewhat awkward and a very important "not" is missing. > + * This litmus test demonstrates that an RCU reader can never see a write after > + * the grace period, if it saw writes that happen before the grace period. An RCU reader can never see a write that follows a grace period if it did _not_ see writes that precede the grace period. > This > + * is a typical pattern of RCU usage, where the write before the grace period > + * assigns a pointer, and the writes after destroy the object that the pointer > + * points to. ... that the pointer used to point to. > + * > + * This guarantee also implies, an RCU reader can never span a grace period and > + * is an important RCU grace period memory ordering guarantee. Unnecessary comma, and it is not clear what "This" refers to. The whole sentence should be phrased differently: This is one implication of the RCU grace-period guarantee, which says (among other things) that an RCU reader cannot span a grace period. Alan