Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1379206pxk; Mon, 31 Aug 2020 18:24:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2v8nORviG0IVZzGkkxu/tirvcYxIWExeoMLt6zPXA17YbnKFuKUqI0BjZ/ArGUxCcwDS2 X-Received: by 2002:a17:906:150b:: with SMTP id b11mr3347764ejd.234.1598923492041; Mon, 31 Aug 2020 18:24:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598923492; cv=none; d=google.com; s=arc-20160816; b=dsKJ7VC8sPR89cPFMyuwiG9l0PtYLe/ECH51We1rgaplp8fWH2qkwHwQA2zshaHgzI u9HsLpctjW0aJuphlUh21H8zZ+ujjCuuTxh58iMOdOGihqwz2adXCFa7VrNo8RHtZkuN AgSb5+6QuIQJO7ryaNFGvkRrzumtIaBEVy4d4ER+ekcxkGZy4fa3yYjrL0wDcUdsdgAB aXowkinDWoFVv9KmRJlkV4XOmHet+xPV8UFAD+p5vNCLiTyqMtMRvwkF+oslWHLVBk21 4PMhpeUCfVWtqaWgl5wfRWr2+AcZGp93OC5+wKngeQ8EieJ/6oCde2y76CKkvD33SeOa rQZA== 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; bh=rnDWddmExLM+L+wSoMrQiB0FpjvhmzaLDy2wytXWaJM=; b=i91gcqFqmGcWBs+ds/mBgsGaWM4hm9Qeo/PGUm7nqawh+76mLkqhus0lSCRHTbFV6A j/kAusqQ7ofyAcvLDIp+msi4gKJWF0vnQZdfpPaG3nS9V8giSvp/dVvkGbbNNOY028xJ 06rZAhQN8gO/H2mVJuSJzKntB09RhQ2PKEsF3TZRiMAzlUNluxGTUn12EgE/cul0LSjw m3Ed8jxwsMYIyF0j2uUSAxAV5Kk6PKvlS1KjGsjOfee+QHqMp/4be+bM51MMis6xtRIp uNLCky/cWsKOa4yzikWaR2iPQyd21+7WKNm6RQIl65hYnLzA3H1S8BN67YrUAqeawvxD 1lTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu19si6656698ejb.305.2020.08.31.18.24.28; Mon, 31 Aug 2020 18:24:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726131AbgIABXK (ORCPT + 99 others); Mon, 31 Aug 2020 21:23:10 -0400 Received: from netrider.rowland.org ([192.131.102.5]:39509 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1725941AbgIABXK (ORCPT ); Mon, 31 Aug 2020 21:23:10 -0400 Received: (qmail 571107 invoked by uid 1000); 31 Aug 2020 21:23:09 -0400 Date: Mon, 31 Aug 2020 21:23:09 -0400 From: Alan Stern To: paulmck@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, parri.andrea@gmail.com, will@kernel.org, peterz@infradead.org, boqun.feng@gmail.com, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, akiyks@gmail.com Subject: Re: [PATCH kcsan 8/9] tools/memory-model: Document categories of ordering primitives Message-ID: <20200901012309.GA571008@rowland.harvard.edu> References: <20200831182012.GA1965@paulmck-ThinkPad-P72> <20200831182037.2034-8-paulmck@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200831182037.2034-8-paulmck@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 31, 2020 at 11:20:36AM -0700, paulmck@kernel.org wrote: > From: "Paul E. McKenney" > > The Linux kernel has a number of categories of ordering primitives, which > are recorded in the LKMM implementation and hinted at by cheatsheet.txt. > But there is no overview of these categories, and such an overview > is needed in order to understand multithreaded LKMM litmus tests. > This commit therefore adds an ordering.txt as well as extracting a > control-dependencies.txt from memory-barriers.txt. It also updates the > README file. > > Signed-off-by: Paul E. McKenney > --- This document could use some careful editing. But one pair of errors stands out in particular: > diff --git a/tools/memory-model/Documentation/ordering.txt b/tools/memory-model/Documentation/ordering.txt > new file mode 100644 > index 0000000..4b2cc55 > --- /dev/null > +++ b/tools/memory-model/Documentation/ordering.txt > +2. Ordered memory accesses. These operations order themselves > + against some or all of the CPUs prior or subsequent accesses, > + depending on the category of operation. > + > + a. Release operations. This category includes > + smp_store_release(), atomic_set_release(), > + rcu_assign_pointer(), and value-returning RMW operations > + whose names end in _release. These operations order > + their own store against all of the CPU's subsequent ---------------------------------------------------------^^^^^^^^^^ > + memory accesses. > + > + b. Acquire operations. This category includes > + smp_load_acquire(), atomic_read_acquire(), and > + value-returning RMW operations whose names end in > + _acquire. These operations order their own load against > + all of the CPU's prior memory accesses. ---------------------------------^^^^^ Double-oops! Alan