Received: by 10.223.176.5 with SMTP id f5csp1729194wra; Sun, 4 Feb 2018 10:39:39 -0800 (PST) X-Google-Smtp-Source: AH8x225DhWocWEZNmrEtK6qEer/pPxcGnhHBI8q4+1VgD2NyYUNx3O5LgpVpr0HIVAIGh9d3Awbm X-Received: by 2002:a17:902:34e:: with SMTP id 72-v6mr42309102pld.126.1517769579325; Sun, 04 Feb 2018 10:39:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517769579; cv=none; d=google.com; s=arc-20160816; b=V6GLNn0SE1QnJu2wSSzEv4WajkwBv/KbU8W88UheYu7z+4nwaglZGHyjaUUIfnFgnd 9kQsYzgL86mSoLR72GuuvrJFml1U1O7SwMr/UErC4NU8+vfX9KuTpGOOZOYH7PjYeex3 WgTcNnZifokAKrIrf2FX74qGIph86pfOrbd9tWjZZzH1dopE7Z3iwZEiRplLElsbE72H dsjoGeBVShCvJKF2hgRlrfPD4n/F6rzWRv0SVEr09YO1GU5rccrgwn7RBiJf4pNITLAd BVhy36yBWOKwIuFMrqJrhQyJ2jn6Pr+g4EkyWiQ2vB+CG3asyJW5O/rDdn2xMeHdgLMO c1xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=lrdIdh2eC2nXsK28pRvI0L4luAjEW/JHferP6zi1gac=; b=QkYCzZaFocHGhJ920Y+XxoiJ4EmqBK8fPsuP3ttawWrzJ1JzNHzxJS7XR0n9qgwjFx 5bpk2AO5H8gzIky4WAD4lbSdvLFzAPXMY5XEtsuCD4zUmJ14kJTcARXRFY6+wgnMpdQS xBjayKXiT5DnWbqFIvOpfMB3go5dIJwCl7sh3OcSWPLNgCzmooucGlSX557Q7XDLLeH7 EEzfpJ+ESUaKmbuSAuVHjKABG7GxrzkbUiyiksZ2RkuRH8PAfnPtBlQz34Z2bWNRRQ+Y fK+OmR9i+3LW+vhgseEHdrfNEF6Oaec3BBN9l4WLVMey8L0UtSGkxxmZ20/8OBo//QK1 QGAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JXSaWyOO; 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=NONE 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 w11-v6si1360817plz.782.2018.02.04.10.39.23; Sun, 04 Feb 2018 10:39:39 -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=JXSaWyOO; 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=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752031AbeBDShZ (ORCPT + 99 others); Sun, 4 Feb 2018 13:37:25 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:46143 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751577AbeBDShQ (ORCPT ); Sun, 4 Feb 2018 13:37:16 -0500 Received: by mail-wr0-f196.google.com with SMTP id 35so550775wrb.13; Sun, 04 Feb 2018 10:37:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lrdIdh2eC2nXsK28pRvI0L4luAjEW/JHferP6zi1gac=; b=JXSaWyOObC089Ww33DD+GZRvf3u2wCAb+tP7KyjAXExT7lct7DV+PQwAdxVTPhlXRH efHd+xQVfaMwsIOYKF4K5C44TIH+ujSwUR0XVwXV9oiTgbwzfRrRzgEX02xtfwautboy jeocigN7PKKG9LRferPF37S0K7dx0/zwDlbc1kF8cqQ0t6D4hdozWr8BYylj/2ZvJKcA cReFodrvmNo5pEPji6+CqZHP6mjyDbhm2ueiQ+ppi5Cd80RnBl0OmDGigMGSg+AlM/DV 8kf8WtNZTnEXKyq6p09ayWl0B1A3hdUpd2v0CAJPiElaIHw8y90FkQdTcyp6Raa3bLVo Izpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lrdIdh2eC2nXsK28pRvI0L4luAjEW/JHferP6zi1gac=; b=at1nSkiRBI+74e2ApsoUKNnzRgIgb2yu3OAEglzOUCn8KZ9B4Y+/+4GwuBHs7A2jrY DDaRYmQi+eosmZ1VjWrsyuq+LQTPjRMTOTAtOmzO5NGMYrf8DqFk+8yBg8eO1vUVl5mI GJfKs9rARvRwHEtCK/HJwHYICuQEcCOaYka+y9NQMVnARerefchmJe7IrDBA8UgJwgwc xIePbXsVQN8vojn7f/mee957ZvhaH5ST9EgptWMFG3+Y5Zs1jsMEoiHABtfxhUploLck 30IaNZsh1TKg0BqXcqlan4Gk9l9pAigAOZ/YrE98nGWZ3HVjQKWFyScpqQz3m2Hqf7IO gADw== X-Gm-Message-State: AKwxytc1DspOlN+Rz0C0ygqaK+Dpb93hkHQUqGvo++qGRh7hnsas1b3P zbcDDXwFyKABxL9/fNhUapY= X-Received: by 10.223.184.161 with SMTP id i30mr27818818wrf.253.1517769435112; Sun, 04 Feb 2018 10:37:15 -0800 (PST) Received: from andrea (86.100.broadband17.iol.cz. [109.80.100.86]) by smtp.gmail.com with ESMTPSA id r136sm3368261wmf.6.2018.02.04.10.37.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Feb 2018 10:37:14 -0800 (PST) Date: Sun, 4 Feb 2018 19:37:08 +0100 From: Andrea Parri To: Akira Yokosawa Cc: paulmck@linux.vnet.ibm.com, 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 Subject: Re: [PATCH 1/2] Documentation/memory-barriers.txt: cross-reference "tools/memory-model/" Message-ID: <20180204183708.GA10437@andrea> References: <20180203012103.GD3617@linux.vnet.ibm.com> <8b4db282-2705-ed96-cf23-b0cdf94bbac8@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8b4db282-2705-ed96-cf23-b0cdf94bbac8@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Andrea > > The tag use in the change log may need adjustments. I'm not familiar with the > manner in modifying other persons' patches. Of course, the wording itself can > be improved further. Any feedback is welcome. > > Thanks, Akira > > >> The purpose of this document is twofold: > >> > >> -- > >> 2.7.4 > >> > > ----8<------- > From 714e8c4b09acd6e965de116532dce05070b9e636 Mon Sep 17 00:00:00 2001 > From: Akira Yokosawa > Date: Mon, 5 Feb 2018 00:28:36 +0900 > Subject: [PATCH] Documentation/memory-barriers.txt: cross-reference "tools/memory-model/" > > 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 > Signed-off-by: Akira Yokosawa > --- > 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 479ecec..975488d 100644 > --- a/Documentation/memory-barriers.txt > +++ b/Documentation/memory-barriers.txt > @@ -14,7 +14,9 @@ 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. For clarification of such > +doubt, 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/". > > To repeat, this document is not a specification of what Linux expects from > hardware. > -- > 2.7.4 > > >