Received: by 10.213.65.68 with SMTP id h4csp1602287imn; Thu, 29 Mar 2018 07:42:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx4++gvjoIsrq2kSS65kbF26DPJ/hLOKcLBnb45lfLWwot3izCC4A/GJnnNvly33REDNe9ahC X-Received: by 10.98.29.145 with SMTP id d139mr6523014pfd.165.1522334529072; Thu, 29 Mar 2018 07:42:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522334529; cv=none; d=google.com; s=arc-20160816; b=kW5TKVBZqTJHq1aaejlIOv73oeiri/hyjzmyDyP0vvHqlxzwrBL/ZHlgdBEyDBFEuH iRH4V/qreZWbkwcj7dtE2tDdIpeN7FcbXyZklfMDvF5h1UhNPwvkVS+SgBjSL7a0YbVd Oqiclj7GArUf1bwL2JE4t7b8yZL82n8PiRtGVFAmUeYkX9x5yhfEsNjy0bp3ycqOgduQ yJvQnIElu31d+mXCKuk5OiLf4wsZC9mCff5IbSE77jSyMjkpgf8mFTpBuFjGw3hsazlt Mll1OI2vDT6Vu4DjUIGSbMLxCkyiA0A+R9B4f1Y7Qs7xpqvLWf8/lvYGIa9HueuyFoai BucQ== 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=2XcQUE8WCYDcrTUfUSi9x64Zgdvef7QP1acxB+Wz3wk=; b=xDHskiuJ65THwvh3m1SwoTnJ0KsBJMV3S4O82Cgexbzoe445naxnOuUzOhQkRUl1U4 nooBmGmmeD80iFFbVtXao+6WtPpoRS6Nw6s1dvRnuyF4JEvIKeGXijId5sToGATbgqWG r4Z2M8bB/ksroRhpMkRGyxkpTLEOXUB8d612IsjFnsjsZTvQ3VmEEom5xwgfn9OeuhH7 WgoejGRFbL5215sI+DC2IXewhQfIJcdKidH3hL/01myNvnBnCkQ3XOt41pdaJEnZX/rk 8OEKcLjMDpYA5DJ1xtu+Aifmdi4iseIgZOlImxq3fgF+rIsPz9mIM9cQJ1miw/v2tyaa pOjw== 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 31-v6si3550470plz.467.2018.03.29.07.41.54; Thu, 29 Mar 2018 07:42:09 -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 S1751191AbeC2Okp (ORCPT + 99 others); Thu, 29 Mar 2018 10:40:45 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:35216 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750884AbeC2Oko (ORCPT ); Thu, 29 Mar 2018 10:40:44 -0400 Received: (qmail 1370 invoked by uid 2102); 29 Mar 2018 10:40:43 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 29 Mar 2018 10:40:43 -0400 Date: Thu, 29 Mar 2018 10:40:43 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: "Paul E. McKenney" cc: schwidefsky@de.ibm.com, , , , , , , , , , , , Subject: Re: [PATCH RFC tools/memory-model] Add s390.{cfg,cat} In-Reply-To: <20180329021812.GV3675@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 Wed, 28 Mar 2018, Paul E. McKenney wrote: > > > In the meantime, does the cat file look to you like it correctly > > > models the combination of TSO and multicopy atomicity? Do the > > > fences really work, or did I just get lucky with my choice of > > > litmus tests? > > > > You got lucky. Try creating an SB litmus test where, instead of an > > smp_mb() fence between the write and the read, each thread executes > > some other kind of fence. > > Ah, it does indeed get "Never" in that case, which I do not believe > to e correct. > > > The acyclicity condition should have been written more like this: > > > > let po_ghb = ([R] ; po ; [M]) | ([M] ; po ; [W]) > > > > acyclic mfence | po_ghb | rf | fr | co as tso-mca > > > > I don't know what the fence instruction is on s390; change the "mfence" > > above accordingly. The main difference between this and the > > corresponding expression in x86tso.cat is that I replaced rfe with rf. > > The s390 fence instruction is "bcr 14,0" or "bcr 15,0", depending on > how recent of hardware you are running. The latter works everywhere, > if I recall correctly. But I do not believe that herd knows about either > instruction yet. Herd does not need to understand s390 assembly in order to handle the things defined in linux.def, such as "smp_mb()". linux.def doesn't contain any x86 assembly language stuff either (or PPC or ARM). > Ah, and I need to lose the "empty rmw & (fre;coe)". > That appears to be where my spurious ordering was coming from, strange > though that seems to me. No, don't drop it; it was not the source of your spurious ordering. The extra ordering came from your "(po \ (W * R))" term, which unintentionally matches fences as well as memory accesses. > And your use of "rf" instead of "rfe" makes sense, as that is what makes > the read-from-write provide ordering, correct? And that should also cover > the "Uniproc check" that would otherwise be required, right? I don't think so... > Except that I get "Sometimes" on CoWR+poonceonce+Once.litmus... Exactly. > Which I can fix by unioning po-loc into po-ghb. Or is there some > better way to do this? You could just keep the "uniproc" check. These two approaches accept the same set of litmus tests. Logically, I think of these as two distinct categories of ordering. po_ghb and tso-mca have to do with the order in which stores reach the cache, whereas "uniproc" (AKA sequential consistency per variable) has to do with enforcement of the cache coherence requirements. Clearly they are related, but they aren't the same thing. > > This doesn't account for atomic operations properly; see the "implied" > > term in x86tso.cat. > > I will look at this more later, reaching end of both battery and useful > attention span... Alan