Received: by 10.223.176.5 with SMTP id f5csp766017wra; Fri, 9 Feb 2018 06:54:51 -0800 (PST) X-Google-Smtp-Source: AH8x225hyWPbiZmdIHwVvJHfEtFicW7W6qVdasITelTXejGRhc/MMTQmcBfE5TITtkUSfRBTkODL X-Received: by 2002:a17:902:6809:: with SMTP id h9-v6mr2852944plk.46.1518188091494; Fri, 09 Feb 2018 06:54:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518188091; cv=none; d=google.com; s=arc-20160816; b=vrg0LaEbwk8SciChQwdOqPictfW1ZseSd6ffzrSLpLm5rO8R9MD1+7Jf79IYm/8BLN 4GR3lwP3OzX6coOa+g0Tz0C6H0gdU9h+RUQ0osW0E7mR3CKbnWoBixRnAlIzObW1m1dD lhdq2n/ly8n+dyv3Y8Pul9kEtiEz7i6G9cizUR9/dkhIBxVQv5d6NwulhfhI6KUTV6IV 5YjYrEtyrG1neoA+u2MeLPQwvx/RP7I2VPrmViql1/5FwmRw2BdEXiix7pn34+lPVon9 K7SuNnf/thALg6wiluNehOvh9ZZIygzvD/qjGmRbMlYJqv/2eYnEw/jZVcH+5mWFuU/s LZFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=+j3+uviV2dMrwjmCH4Y+lPG8Rw1e8QM52B2MQBSUmpI=; b=TQ0nT/7EtWkOgKrzlJq1DNQuWWWZl/VnGrBa/PxhBjRcwy8t9ufbv+zWQe6jjNtJBZ M6u1OHOrKBFAVPCCMN4W3ueprczxh0MvAsQfAgnbxOHzndu3ICzXhhS8PtVdJOvNSJDV UYYKA5I3EQRQnNOkdb1f82H56yq3bhEfPkHnP1xIYncKPKrgrDN78bTomOa4ZeZq+g8j WwvA7cQV6KUmiSo6QVdkf2pA6b8qLysifEFdEpn9ercwn7SdfYqFdC7nc80o1ve8U+Eg 0MCKg1WuGlxFf95o0mCI4yMEncARQBGOzik9ZKgYYQY7qNYE/xEgux6/mmJ/P/x4lJKP gNhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mRZL3FlE; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p64si1814025pfg.334.2018.02.09.06.54.37; Fri, 09 Feb 2018 06:54:51 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mRZL3FlE; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752293AbeBIOxi (ORCPT + 99 others); Fri, 9 Feb 2018 09:53:38 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:46131 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751189AbeBIOxg (ORCPT ); Fri, 9 Feb 2018 09:53:36 -0500 Received: by mail-io0-f194.google.com with SMTP id f34so9880715ioi.13; Fri, 09 Feb 2018 06:53:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=+j3+uviV2dMrwjmCH4Y+lPG8Rw1e8QM52B2MQBSUmpI=; b=mRZL3FlEi4LW44HPLUAcNNO8BznTcijqXoag7FF9NdMV5jrwWB8mSpI/V04FjjWsr1 QxvB9F1lh2efl/1HDKrMzsYhj5eAyV2+D3CMj34j+wWxBuxBR7C1JpVyDda+/O8RI5Rf z1Kw3Z0Wk4Tfmd4Uzuoj9Ty3bwH5ZnCY4s9kvzXTuVfOOf2I+jzofG5NTbGDIQV+X/48 cu5mFb5csrMG3g804at1IE3SULLpGUT620NvXaS6ZJ32klgvvBDtwVqQ4x9z/B/Gqka8 CIoC5Io7ttZ+2sG724TZTiIy+Xk+ikIlKwPyGUodDkoGBInZsfqc3vb6XimWmFuzBpTd xNHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+j3+uviV2dMrwjmCH4Y+lPG8Rw1e8QM52B2MQBSUmpI=; b=WF9LZoPx11RgqFEFlfCkbEhb/+f21YFTuSskSxrSItPzcPXlBFbd3JhN3A2vRDbVK6 23oxHBjY8zO2+gMTkr4n3Ey5KAvSb0IZux8DRwnTZWpt5LX0aoYr7dzEy/NJIjTSGEQk wSnznNHrN8/zVXYr9ivl4W/LbgWcA5aTowfSErGL0p3GwtDJ6OixlCkyzXgFJ5c00voZ lbPvdInwGJczrDC/kM99MLcyqHDRyR+1nIZrRKcwvv7VVvCoYsUgLo0pASAm41qRsSVy tvKqrHLLgcdpe0AtdkVrbJk7d3i8sVFn1XcUDKxVScrx297wnoy+bT61CC/SU1pOJMPN wNjw== X-Gm-Message-State: APf1xPCt9bhH8YCev3cLX7PcJuCx5/sIwvXkzPxZoiRSAo0U77w33dv7 JrXXi8l/ep9HrZ5mzvcPi2U= X-Received: by 10.107.192.2 with SMTP id q2mr3520851iof.112.1518188015627; Fri, 09 Feb 2018 06:53:35 -0800 (PST) Received: from [192.168.11.4] (KD106167171201.ppp-bb.dion.ne.jp. [106.167.171.201]) by smtp.gmail.com with ESMTPSA id j10sm3377032ioo.24.2018.02.09.06.53.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 06:53:35 -0800 (PST) Subject: Re: [PATCH 1/2] Documentation/memory-barriers.txt: cross-reference "tools/memory-model/" To: paulmck@linux.vnet.ibm.com, Andrea Parri Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, stern@rowland.harvard.edu, will.deacon@arm.com, peterz@infradead.org, boqun.feng@gmail.com, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, corbet@lwn.net, Akira Yokosawa References: <20180203012103.GD3617@linux.vnet.ibm.com> <8b4db282-2705-ed96-cf23-b0cdf94bbac8@gmail.com> <20180204183708.GA10437@andrea> <20180209123100.GY3617@linux.vnet.ibm.com> <20180209125051.GA21678@andrea> <20180209142923.GB3617@linux.vnet.ibm.com> From: Akira Yokosawa Message-ID: <632f38b1-4789-6282-a878-61dec98a6d44@gmail.com> Date: Fri, 9 Feb 2018 23:53:29 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180209142923.GB3617@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/02/09 23:29, Paul E. McKenney wrote: > On Fri, Feb 09, 2018 at 01:50:51PM +0100, Andrea Parri wrote: >> On Fri, Feb 09, 2018 at 04:31:00AM -0800, Paul E. McKenney wrote: >>> On Sun, Feb 04, 2018 at 07:37:08PM +0100, Andrea Parri wrote: >>>> Hi Akira, >>>> >>>> On Mon, Feb 05, 2018 at 01:14:10AM +0900, Akira Yokosawa wrote: >>>>> Hi Paul, >>>>> CC: Andrea >>>>> >>>>> This is intentionally off the list, as I was not cc'd in the thread. >>>>> If you think it is worthwhile, could you help me join the thread by >>>>> forwarding the following part as a reply to your message, plus CC: to me. >>>> >>>> [CCing lists and other people] >>>> >>>> >>>>> >>>>> On Fri, Feb 02, 2018 at 17:21:03AM -0800, Paul E. McKenney wrote: >>>>>> On Fri, Feb 02, 2018 at 10:12:48AM +0100, Andrea Parri wrote: >>>>>>> Recent efforts led to the specification of a memory consistency model >>>>>>> for the Linux kernel [1], which "can (roughly speaking) be thought of >>>>>>> as an automated version of memory-barriers.txt" and which is (in turn) >>>>>>> "accompanied by extensive documentation on its use and its design". >>>>>>> >>>>>>> Make sure that the (occasional) reader of memory-barriers.txt will be >>>>>>> aware of these developments. >>>>>>> >>>>>>> [1] https://marc.info/?l=linux-kernel&m=151687290114799&w=2 >>>>>>> >>>>>>> Signed-off-by: Andrea Parri >>>>>> >>>>>> I am inclined to pull in something along these lines, but would like >>>>>> some feedback on the wording, especially how "official" we want to >>>>>> make the memory model to be. >>>>>> >>>>>> Thoughts? >>>>> >>>>> The change log of commit e7720af5f9ac ("locking/Documentation: Add disclaimer") says: >>>>> >>>>> It appears people are reading this document as a requirements list for >>>>> building hardware. This is not the intent of this document. Nor is it >>>>> particularly suited for this purpose. >>>>> >>>>> The primary purpose of this document is our collective attempt to define >>>>> a set of primitives that (hopefully) allow us to write correct code on >>>>> the myriad of SMP platforms Linux supports. >>>>> >>>>> Its a definite work in progress as our understanding of these platforms, >>>>> and memory ordering in general, progresses. >>>>> >>>>> Nor does being mentioned in this document mean we think its a >>>>> particularly good idea; the data dependency barrier required by Alpha >>>>> being a prime example. Yes we have it, no you're insane to require it >>>>> when building new hardware. >>>>> >>>>> My take on the Linux Kernel memory-consistency model is a supplement of >>>>> memory-barriers.txt and the disclaimer also applies to the memory model. >>>>> >>>>>> >>>>>> If I don't hear otherwise in a couple of days, I will pull this as is. >>>>>> >>>>>> Thanx, Paul >>>>>> >>>>>>> --- >>>>>>> Documentation/memory-barriers.txt | 4 +++- >>>>>>> 1 file changed, 3 insertions(+), 1 deletion(-) >>>>>>> >>>>>>> diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt >>>>>>> index a863009849a3b..8cc3f098f4a7d 100644 >>>>>>> --- a/Documentation/memory-barriers.txt >>>>>>> +++ b/Documentation/memory-barriers.txt >>>>>>> @@ -17,7 +17,9 @@ meant as a guide to using the various memory barriers provided by Linux, but >>>>>>> in case of any doubt (and there are many) please ask. >>>>>>> >>>>>>> To repeat, this document is not a specification of what Linux expects from >>>>>>> -hardware. >>>>>>> +hardware. For such a specification, in the form of a memory consistency >>>>>>> +model, and for documentation about its usage and its design, the reader is >>>>>>> +referred to "tools/memory-model/". >>>>>>> >>>>> >>>>> Adding cross-reference in this way can _weaken_ the message of the disclaimer. >>>> >>>> Thank you for your remarks; I do share the same concern. >>>> >>>>> What about adding it in the previous sentence as the patch appended bellow? >>>> >>>> I do like this idea: I believe that my phrasing (and that "what Linux >>>> expects from hardware") may be easily subject to misinterpretation... >>>> which your solution can avoid. >>> >>> Any objections to Akira's patch below? (Give or take the usual >>> wordsmithing.) >>> >>> Andrea, should I interpret your paragraph above ask an Acked-by? >> >> Well, I am among the Signed-off-by: of the patch; it didn't seem too fair >> to me to Ack my own patch... ;-) Is the wording sound? other suggestions? > > Good point, too many all-day meetings last week. ;-) > > How about the following? > > Thanx, Paul > > ------------------------------------------------------------------------ > > commit 9370f98c312d658afe88e548d469549d8f31e402 > Author: Andrea Parri > Date: Fri Feb 9 06:26:08 2018 -0800 > > Documentation/memory-barriers.txt: Cross-reference "tools/memory-model/" > > A memory consistency model is now available for the Linux kernel [1], > which "can (roughly speaking) be thought of as an automated version of > memory-barriers.txt" and which is (in turn) "accompanied by extensive > documentation on its use and its design". > > Inform the (occasional) reader of memory-barriers.txt of these > developments. > > [1] https://marc.info/?l=linux-kernel&m=151687290114799&w=2 > > Co-developed-by: Andrea Parri > Co-developed-by: Akira Yokosawa > Signed-off-by: Andrea Parri > Signed-off-by: Akira Yokosawa > Signed-off-by: Paul E. McKenney > > diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt > index 479ecec80593..74ad222d11ed 100644 > --- a/Documentation/memory-barriers.txt > +++ b/Documentation/memory-barriers.txt > @@ -14,7 +14,11 @@ DISCLAIMER > This document is not a specification; it is intentionally (for the sake of > brevity) and unintentionally (due to being human) incomplete. This document is > meant as a guide to using the various memory barriers provided by Linux, but > -in case of any doubt (and there are many) please ask. > +in case of any doubt (and there are many) please ask. Some doubts may be > +resolved by referring to the formal memory consistency model and related > +documentation at tools/memory-model/. Nevertheless, even this memory > +model should be viewed as the collective opinion of its maintainers rather > +than as an infallible oracle. It's impossible for me to come up with the words "infallible oracle"! Looks nice. Thanks, Akira > > To repeat, this document is not a specification of what Linux expects from > hardware. >