Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3828253ybt; Tue, 30 Jun 2020 12:00:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydjZYtjVfv80nFs82Lz267oxD17h+G4HBte77Oa6d9RUTXHLtBr+nzK+P5lZw53YZbc6mL X-Received: by 2002:a50:f418:: with SMTP id r24mr19441976edm.382.1593543246379; Tue, 30 Jun 2020 11:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593543246; cv=none; d=google.com; s=arc-20160816; b=N8Rd9MUf7sDvB34i8+PKqBLHgk8t4RM+pBrzee9W/lb8XAGvzVMD2rDrxYoR68jI+4 sPDmGXsIH4u/wbVsuguy46F+X9NNclTjTzNbk6op4bM8+LudAyD4spskawkxJ95Fbi/1 mTYohu/klFoH00iZNmnfTEt+W3bRSlNgCWJ8Lfz6d8eP8RP5GkLH8sTxdr+gwOAITr0W pmDuXkawsyY40WAkJEf45o2ALV5e+tZB3FC+uHmzONoOpnjuYgba3DkaSetccEik0D1j EA089Jc3nr24Cfa61klp+6b1EJEqGurpkFGcaDcum7lAitjbS+JJGjX3bxoxDOVZ3i2d Rc/A== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qwEJuE8EPTG/SkqhDvVPzXfgy9QxtFB3cuZ1fTrbZSk=; b=GeVYtp3Zew1/SQtmdSPs7uZnZlcw1iRP0+as4S2BYd/SWxyeb6Msa5MPYgCsXqlHWT J3gnbB8nsf/oU+gJskkKaCecCTeHlJv2bFnH6m0TY7fFVuC9x3njXi6ke9f81pNrc3EU VirnupvWjTPV8gmujXGtG1bTke2Bw2RgwUl/E7HA6GOeYa2BPC9AO9TpTg9DCCD/OSAi ehCWByj5QFGQL+AA9KvKagxluQhpym3bSNFeryUEOyMOCVvDjfsQpYLiGhWd7XYLnvHd tW1z+B6IUEajl8zw77951/XArWwtQzWf0fC+h5dEXWW3zXEsl4yhZLZuBGg10TYHaS5r 40DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q0keKuHs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lu12si2197644ejb.269.2020.06.30.11.53.43; Tue, 30 Jun 2020 11:54:06 -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; dkim=pass header.i=@kernel.org header.s=default header.b=q0keKuHs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390417AbgF3Rie (ORCPT + 99 others); Tue, 30 Jun 2020 13:38:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:51552 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388211AbgF3Ria (ORCPT ); Tue, 30 Jun 2020 13:38:30 -0400 Received: from localhost.localdomain (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7D7A220829; Tue, 30 Jun 2020 17:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593538710; bh=qoEfU3b1y4/xeEqvyt+YVXOv4viPb6BcJ15Sl3Ij7bg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q0keKuHsfsfAgKC1LtX9sks7jRJHDQZZ1ezB73t7AIUcDYxJr7j4+9TF1D35lERby Nj+pl0uHaslag6jrJXtgEsQmSbKqbY/SCiZy0EA85EepoyuxPrS4RPnoAn9tocRTT0 faKEZLt+fjG+6/EJXnJJbTOWCm/N3A81o5uuyGgU= From: Will Deacon To: linux-kernel@vger.kernel.org Cc: Will Deacon , Sami Tolvanen , Nick Desaulniers , Kees Cook , Marco Elver , "Paul E. McKenney" , Josh Triplett , Matt Turner , Ivan Kokshaysky , Richard Henderson , Peter Zijlstra , Alan Stern , "Michael S. Tsirkin" , Jason Wang , Arnd Bergmann , Boqun Feng , Catalin Marinas , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org, virtualization@lists.linux-foundation.org, kernel-team@android.com Subject: [PATCH 11/18] tools/memory-model: Remove smp_read_barrier_depends() from informal doc Date: Tue, 30 Jun 2020 18:37:27 +0100 Message-Id: <20200630173734.14057-12-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200630173734.14057-1-will@kernel.org> References: <20200630173734.14057-1-will@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org smp_read_barrier_depends() has gone the way of mmiowb() and so many esoteric memory barriers before it. Drop the two mentions of this deceased barrier from the LKMM informal explanation document. Acked-by: Alan Stern Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- .../Documentation/explanation.txt | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/tools/memory-model/Documentation/explanation.txt b/tools/memory-model/Documentation/explanation.txt index e91a2eb19592..01adf9e0ebac 100644 --- a/tools/memory-model/Documentation/explanation.txt +++ b/tools/memory-model/Documentation/explanation.txt @@ -1122,12 +1122,10 @@ maintain at least the appearance of FIFO order. In practice, this difficulty is solved by inserting a special fence between P1's two loads when the kernel is compiled for the Alpha architecture. In fact, as of version 4.15, the kernel automatically -adds this fence (called smp_read_barrier_depends() and defined as -nothing at all on non-Alpha builds) after every READ_ONCE() and atomic -load. The effect of the fence is to cause the CPU not to execute any -po-later instructions until after the local cache has finished -processing all the stores it has already received. Thus, if the code -was changed to: +adds this fence after every READ_ONCE() and atomic load on Alpha. The +effect of the fence is to cause the CPU not to execute any po-later +instructions until after the local cache has finished processing all +the stores it has already received. Thus, if the code was changed to: P1() { @@ -1146,14 +1144,14 @@ READ_ONCE() or another synchronization primitive rather than accessed directly. The LKMM requires that smp_rmb(), acquire fences, and strong fences -share this property with smp_read_barrier_depends(): They do not allow -the CPU to execute any po-later instructions (or po-later loads in the -case of smp_rmb()) until all outstanding stores have been processed by -the local cache. In the case of a strong fence, the CPU first has to -wait for all of its po-earlier stores to propagate to every other CPU -in the system; then it has to wait for the local cache to process all -the stores received as of that time -- not just the stores received -when the strong fence began. +share this property: They do not allow the CPU to execute any po-later +instructions (or po-later loads in the case of smp_rmb()) until all +outstanding stores have been processed by the local cache. In the +case of a strong fence, the CPU first has to wait for all of its +po-earlier stores to propagate to every other CPU in the system; then +it has to wait for the local cache to process all the stores received +as of that time -- not just the stores received when the strong fence +began. And of course, none of this matters for any architecture other than Alpha. -- 2.27.0.212.ge8ba1cc988-goog