Received: by 10.223.176.5 with SMTP id f5csp1640663wra; Sun, 4 Feb 2018 08:39:48 -0800 (PST) X-Google-Smtp-Source: AH8x226InI0f0uP7mDywGs4vd+kQ2kKOjohZC6bQ6YNrrmU62xOt1DTLYQ7Z35hGrukvketuEiSh X-Received: by 10.99.127.21 with SMTP id a21mr6589545pgd.178.1517762388228; Sun, 04 Feb 2018 08:39:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517762388; cv=none; d=google.com; s=arc-20160816; b=z3JP5QZsDG4UYtF4lqJ72qvcfQad/3UNOwygpFD4nee8g7tn7/73LgtpZ1oEwXL4yH XGsAbg3V7Tgk+B1zb1dieCWf3x0QDcs6cmZuQ8TwFELOBBKC+mvv58gDWlloBPpyXYSZ eQZat9ZCLKrpczoCtw2cQUJSUl7lKG++AaZuE/rmnExpBNJqN1rpSAWlFpc/RHdS6mLj bCx8VfFz2esiQZXrpdB8T2pvMSr8N4hCLlP8OnNY1QJkziDCPms59XsGposghfYNrMxN 5d0jvdU1w+qat7csyn9zLFaJsC3lC2gptTvB6vOvo9WdrQpLHNvhfkHBfeFJq+tDw4On KaNA== 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:arc-authentication-results; bh=UHsuUz0MB6saktMMmdWUnc7QnPAa4fIpE8xL0LMkLus=; b=ArOb9fZl1ghoeZrIdEI8ycp9pgCmb+lrfMlwqV9YiIMDP4LBxVRvBN5MV4ZoTg7M71 UJ3EWbP3mGGM9sxjix7qCgIVyV7rvmbZFEBhBNzM7AD0OmqYbisSJhWeaCm9d1l9MUI8 YBKOGLHqsKquDwcDJ0KcMoDlRz6kFW2rHsvPUw+Lh/1Ad9x2idkLJG8YDI9ihCv18nWW pbxuSI+sOWGtL5Ea8JKVcKTGDzNgeYs73PuPX5YwszRmx2RNg5xMUo+cg+q1Ylbevrh3 xfCTmGsg64NXsnjYnIWH/N7yaN4qpHrxZcpUihcHeEL9xA5No2HPeQuTaxNOjHEGkq02 /rCA== 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 a190si1014604pgc.708.2018.02.04.08.39.32; Sun, 04 Feb 2018 08:39:48 -0800 (PST) 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 S1752043AbeBDQiH (ORCPT + 99 others); Sun, 4 Feb 2018 11:38:07 -0500 Received: from netrider.rowland.org ([192.131.102.5]:35367 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751546AbeBDQiA (ORCPT ); Sun, 4 Feb 2018 11:38:00 -0500 Received: (qmail 16679 invoked by uid 500); 4 Feb 2018 11:37:59 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 4 Feb 2018 11:37:59 -0500 Date: Sun, 4 Feb 2018 11:37:59 -0500 (EST) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: "Paul E. McKenney" cc: Ingo Molnar , , , , , , , , , , , , , , Thomas Gleixner , Peter Zijlstra , Linus Torvalds Subject: Re: [GIT PULL tools] Linux kernel memory model In-Reply-To: <20180204101700.GA25520@linux.vnet.ibm.com> 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 Sun, 4 Feb 2018, Paul E. McKenney wrote: > --- a/tools/memory-model/litmus-tests/CoRW+poonceonce+Once.litmus > +++ b/tools/memory-model/litmus-tests/CoRW+poonceonce+Once.litmus > @@ -1,5 +1,11 @@ > C CoRW+poonceonce+Once > > +(* > + * Test of read-write coherence, that is, whether or not a read from a > + * given variable followed by a write to that same variable are ordered. The syntax of this sentence is a little tortured. Suggestion: ... whether or not a read from a given variable and a later write to that same variable are ordered. > + * This should be ordered, that is, this test should be forbidden. s/This/They/ > --- a/tools/memory-model/litmus-tests/CoWR+poonceonce+Once.litmus > +++ b/tools/memory-model/litmus-tests/CoWR+poonceonce+Once.litmus > @@ -1,5 +1,11 @@ > C CoWR+poonceonce+Once > > +(* > + * Test of write-read coherence, that is, whether or not a write to a > + * given variable followed by a read from that same variable are ordered. Same syntax issue as above. > --- a/tools/memory-model/litmus-tests/ISA2+poonceonces.litmus > +++ b/tools/memory-model/litmus-tests/ISA2+poonceonces.litmus > @@ -1,5 +1,13 @@ > C ISA2+poonceonces > > +(* > + * Given a release-acquire chain ordering the first process's store > + * against the last process's load, is ordering preserved if all of the > + * smp_store_release() invocations be replaced by WRITE_ONCE() and all s/be/are/ > + * of the smp_load_acquire() invocations be replaced by READ_ONCE()? s/be/are/ > --- a/tools/memory-model/litmus-tests/LB+ctrlonceonce+mbonceonce.litmus > +++ b/tools/memory-model/litmus-tests/LB+ctrlonceonce+mbonceonce.litmus > @@ -1,5 +1,14 @@ > C LB+ctrlonceonce+mbonceonce > > +(* > + * This litmus test demonstrates that lightweight ordering suffices for > + * the load-buffering pattern, in other words, preventing all processes > + * reading from the preceding process's write. In this example, the > + * combination of a control dependency and a full memory barrier are to do s/are to/are enough to/ > --- a/tools/memory-model/litmus-tests/MP+polocks.litmus > +++ b/tools/memory-model/litmus-tests/MP+polocks.litmus > @@ -1,5 +1,14 @@ > C MP+polocks > > +(* > + * This litmus test demonstrates how lock acquisitions and releases can > + * stand in for smp_load_acquire() and smp_store_release(), respectively. > + * In other words, when holding a given lock (or indeed after relaasing a s/relaasing/releasing/ > + * given lock), a CPU is not only guaranteed to see the accesses that other > + * CPOs made while previously holding that lock, it are also guaranteed s/CPO/CPU/ s/are/is/ > + * to see all prior accesses by those other CPUs. Doesn't say whether the test should be allowed. This is true of several other litmus tests too. > --- a/tools/memory-model/litmus-tests/MP+porevlocks.litmus > +++ b/tools/memory-model/litmus-tests/MP+porevlocks.litmus > @@ -1,5 +1,14 @@ > C MP+porevlocks > > +(* > + * This litmus test demonstrates how lock acquisitions and releases can > + * stand in for smp_load_acquire() and smp_store_release(), respectively. > + * In other words, when holding a given lock (or indeed after relaasing a s/relaasing/releasing > + * given lock), a CPU is not only guaranteed to see the accesses that other > + * CPOs made while previously holding that lock, it are also guaranteed s/CPO/CPU/ s/are/is/ > --- a/tools/memory-model/litmus-tests/R+poonceonces.litmus > +++ b/tools/memory-model/litmus-tests/R+poonceonces.litmus > @@ -1,5 +1,11 @@ > C R+poonceonces > > +(* > + * This is the unordered (via smp_mb()) version of one of the classic Does "unordered (via smp_mb())" mean that the test uses smp_mb() to "unorder" the accesses, or does it mean that the test doesn't use smp_mb() to order the accesses? > --- a/tools/memory-model/litmus-tests/S+poonceonces.litmus > +++ b/tools/memory-model/litmus-tests/S+poonceonces.litmus > @@ -1,5 +1,13 @@ > C S+poonceonces > > +(* > + * Starting with a two-process release-acquire chain ordering P0()'s > + * first store against P1()'s final load, if the smp_store_release() > + * is replaced by WRITE_ONCE() and the smp_load_acquire() replaced by > + * READ_ONCE(), is ordering preserved. The answer is "of course not!", s/./?/ > --- a/tools/memory-model/litmus-tests/SB+mbonceonces.litmus > +++ b/tools/memory-model/litmus-tests/SB+mbonceonces.litmus > @@ -1,5 +1,12 @@ > C SB+mbonceonces > > +(* > + * This litmus test demonstrates that full memory barriers suffice to > + * order the store-buffering pattern, where each process writes to the > + * variable that the preceding process read. (Locking and RCU can also s/read/reads/ > --- a/tools/memory-model/litmus-tests/SB+poonceonces.litmus > +++ b/tools/memory-model/litmus-tests/SB+poonceonces.litmus > @@ -1,5 +1,11 @@ > C SB+poonceonces > > +(* > + * This litmus test demonstrates that at least some ordering is required > + * to order the store-buffering pattern, where each process writes to the > + * variable that the preceding process read. This test should be allowed. s/read/reads/ > --- a/tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus > +++ b/tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus > @@ -1,5 +1,11 @@ > C Z6.0+pooncelock+pooncelock+pombonce > > +(* > + * This example demonstrates that a pair of accesses made by different > + * processes each while holding a given lock will not necessarily be > + * seen as ordered by a third process not holding that lock. > + *) Note that the outcome of this test will be changed by one of the patches in our "pending" list. Alan