Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2146316iof; Tue, 7 Jun 2022 21:17:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKvq/opP/uVPoUoS6ujnL0YjI4V0wzBlZN2a6oFOyNCebI544xJHmfnd6/P68Khdk4uG+Z X-Received: by 2002:a17:903:44f:b0:168:4d1b:49c3 with SMTP id iw15-20020a170903044f00b001684d1b49c3mr4108174plb.145.1654661869247; Tue, 07 Jun 2022 21:17:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654661869; cv=none; d=google.com; s=arc-20160816; b=KDOpy6GZFhWcwkUkOwtYoC04h8r/YSkBm+ihvZ4qQbVq3YYaubXLzr4mnUiXH1vxBt YDLC3cAtDr1g18znD14Di9tpwh2z8rhOAoUFrpobeItnm3qh630zpqxdcmNkhjxLMrqD 5wRz2V3nARyXwYJhgE3AW0yocp4kmG3b+vGzHfZLIZbo611PvSAIfRBjlPPQZHQmKlgO RWmMqTE6HKGiYdn8yqF44rYne7MP+RoGWoiKy965uFDamunxAaDdOWW8LGBYV8qulQwO MW1o5RkEVFNdDiUqySIwaOGxEcjqRtwtUYlrvSNclWprgJhPucD2Fv8YyTiG+0V0OOCI hO9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=rrlBEqWbGb8BQI/OGFnxCm29J5acRaKjqCuiJUyetHE=; b=SNFrs2J+YOk+NNtvWfPOyZXqY60/DKzEPNMVaR8hPvd9ynbnGWhHKY/WWzyQ6Yis5O FbveeuQUcRmQBqR1EZVkrbSM3gvh6KRToFW9RUhegN2i2AmFJBxplD8q9IG+wGTlnhAY Rka9nAhM8qD0XHo8hXg2qahFcL7yb4Gg+IcHOIcKTLbide4ETm8WU4jBqG40UjyJZ7lg PgOtIutoTH3JfDvLJnMatHtcvFeVM3kqCCekN/Y1R3hqjtB5fI2cVYdeZROK2Y8F7O9g CmHSa8J9teldTD+fp52kSyQU8VBiXXuo8N78j/TsVuX6E+UqucqoalfSHKMwx21BdTi4 VpVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id jc18-20020a17090325d200b00163ed1aff09si24473798plb.337.2022.06.07.21.17.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:17:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4D85A3249A8; Tue, 7 Jun 2022 20:48:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245580AbiFGOeT (ORCPT + 99 others); Tue, 7 Jun 2022 10:34:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245179AbiFGOeN (ORCPT ); Tue, 7 Jun 2022 10:34:13 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 0A305B714D for ; Tue, 7 Jun 2022 07:34:10 -0700 (PDT) Received: (qmail 405325 invoked by uid 1000); 7 Jun 2022 10:34:08 -0400 Date: Tue, 7 Jun 2022 10:34:08 -0400 From: Alan Stern To: Will Deacon Cc: Akira Yokosawa , "Paul E. McKenney" , "Michael S. Tsirkin" , Peter Zijlstra , Boqun Feng , Andrea Parri , Nicholas Piggin , David Howells , Daniel Lustig , Joel Fernandes , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [RFC PATCH -lkmm] docs/memory-barriers: Fix inconsistent name of 'data dependency barrier' Message-ID: References: <20220607133432.GA32701@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220607133432.GA32701@willie-the-truck> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 07, 2022 at 02:34:33PM +0100, Will Deacon wrote: > On Sat, May 28, 2022 at 01:15:30PM +0900, Akira Yokosawa wrote: > > The term "data dependency barrier", which has been in > > memory-barriers.txt ever since it was first authored by David Howells, > > has become confusing due to the fact that in LKMM's explanations.txt > > and elsewhere, "data dependency" is used mostly for load-to-store data > > dependency. > > > > To prevent further confusions, do the following changes: > > > > - substitute "address-dependency barrier" for "data dependency barrier"; > > - add note on the removal of kernel APIs for explicit address- > > dependency barriers in kernel release v5.9; > > - add note on the section title rename; > > - use READ_ONCE_OLD() for READ_ONCE() of pre-4.15 (no address- > > dependency implication) in code snippets; > > - fix number of CPU memory barrier APIs; > > - and a few more context adjustments. > I suppose this isn't really a comment on your patch, as I much prefer the > updated terminology, but the way this section is now worded really makes it > sounds like address dependencies only order load -> load, whereas they > equally order load -> store. Saying that "An address-dependency barrier... > is not required to have any effect on stores" is really confusing to me: the > barrier should only ever be used in conjunction with an address-dependency > _anyway_ so whether or not it's the barrier or the dependency giving the > order is an implementation detail. It would be more accurate to say that address-dependency barriers are not _needed_ for load->store ordering because the dependencies themselves already provide this ordering (even on Alpha). > Perhaps the barrier should be called a "Read-read-address-dependency > barrier", an "Address-dependency read barrier" or even a "Consume barrier" > (:p) instead? Dunno, Alan is normally much better at naming these things > than I am. Well, "load-load-address-dependency barrier" would be okay as a generic name, albeit unwieldy. Note however that on Alpha -- the only architecture to need these barriers -- they aren't anything special; the actual instruction is the equivalent of an ordinary smp_rmb(). (Please correct me if my memory about this is wrong.) So in principle you could simply call them "read memory barriers" while pointing out the need for special use on demented architectures where address dependencies do not guarantee load->load ordering. > Alternatively, maybe we should be removing the historical stuff from the > document altogether if it's no longer needed. We don't have any occurrences > of read_barrier_depends() anymore, so why confuse people with it? How about relegating discussion of these barriers to a special "historical" or "niche architecture" section of the document? In a separate patch, of course. Alan