Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2767752ybx; Fri, 8 Nov 2019 09:04:03 -0800 (PST) X-Google-Smtp-Source: APXvYqxAk+lkTB/Vi4c1Yj9R0YxDiDpCOvIcHpjgjtE70k+laRW5g34SjBh7FNajBvNDwI4SH3FK X-Received: by 2002:a50:b6cb:: with SMTP id f11mr11292612ede.299.1573232643602; Fri, 08 Nov 2019 09:04:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573232643; cv=none; d=google.com; s=arc-20160816; b=MSEc+yxGcwoIHOj8QS3FPZM4T0580mXZXzYpATS0VMLx2o9amilvO+1Gaxfisiw5po TsaWAmAEtTWsAwFjnkw1jq7ESsdetG48xmPee529Zj3TRhwgFwpNIv6nA4RIf6VgLp7X h5fXapGZW9F7A6xJ32iQf8nDoLmjPbYC/eFQi3TNZGL4SNFtEx1yWCzO4P/ig7YHG4xK b1uYPuEdBenNNrxwfgG4h9+QYRl7tYZfnk60/D6CnvmvScucWdRG9oGCE08FtuVWm1uo WJMDbrm+A0a3ShGdv4+EtwMspClhJSZD+3VLaO5YSv9crYLr0weuVjB8UjQuUc/jXyPo XQJg== 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=fspRtqAXxHKgPNVK03eWVLjWCg44Rm4QF7eK1rwiuSw=; b=pncCv1Ugz63tZHYEzepRkfHlBCQs95E7Qm4K1rcYI0WkKZs/VCLCTufUGgp7BtGDE2 LubeFY9bhBVOIcvoKNXpG/Wfr8LeME3KHK9OKiqFQz3IWhS/SeJFi20pFX3TIjfReKzT UggTyb1vhy2xpYrjW2C5V5viIifixCwQzbikGdJsroKW+CK9irp6sGZVzxJ98jqrYSyX BEsJmrFWd8oUH+kvxWWz+ub0HeZRWE4/lJG34xyo87ln4N0bLMzhNYv/wyAi/I9Fj8jY XpjCNvOv3522tB6I9WYFyqnvNsyzxEFuEJBJZraeNXRFYxlDzWrN8JgsLxSjVNL764L4 tLuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MAKtRC+R; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si4446725ejr.371.2019.11.08.09.03.39; Fri, 08 Nov 2019 09:04:03 -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=@kernel.org header.s=default header.b=MAKtRC+R; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731278AbfKHRCH (ORCPT + 99 others); Fri, 8 Nov 2019 12:02:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:46162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731163AbfKHRCF (ORCPT ); Fri, 8 Nov 2019 12:02:05 -0500 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 46088222C5; Fri, 8 Nov 2019 17:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573232524; bh=wCL903ScuiGofElDf7EX9mpRBQ2yI6oD2F0VBzIhMiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MAKtRC+RFnOPFfR4QyCGaTOzj4F+z/r+5QEkX66W3MQdu1xPBVYek4UJmHra0op04 e4o7aS6/9iO9gOqLrnywDYUUkfJppi3EUPo5JXIRfHpargTMHQjCYN2EdNOsQO/+3u NJ8X4Q6h7xFJrtdqq5EciOWZizRB/aadRDMwGttk= From: Will Deacon To: linux-kernel@vger.kernel.org Cc: Will Deacon , Yunjae Lee , SeongJae Park , "Paul E. McKenney" , Josh Triplett , Matt Turner , Ivan Kokshaysky , Richard Henderson , Peter Zijlstra , Alan Stern , Michael Ellerman , "Michael S. Tsirkin" , Jason Wang , Arnd Bergmann , Joe Perches , Boqun Feng , linux-alpha@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH 10/13] tools/memory-model: Remove smp_read_barrier_depends() from informal doc Date: Fri, 8 Nov 2019 17:01:17 +0000 Message-Id: <20191108170120.22331-11-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108170120.22331-1-will@kernel.org> References: <20191108170120.22331-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. 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 488f11f6c588..3050bf67b8d0 100644 --- a/tools/memory-model/Documentation/explanation.txt +++ b/tools/memory-model/Documentation/explanation.txt @@ -1118,12 +1118,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() { @@ -1142,14 +1140,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.24.0.rc1.363.gb1bccd3e3d-goog