Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp83544lqi; Wed, 6 Mar 2024 10:38:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU0sxMJGmcU+T9hxSfbnkL185JKE6Ml699OslnMRT1GcTIytSUkTDcQ9ZTR+kgLHBv5rULQ1MDyOs8HRujI0PvlRqQiTHIgS8z9PREuXw== X-Google-Smtp-Source: AGHT+IGJk3S7lKFeC2jxlGSKWgwu36Wh63t9DRz4RPMOYxCUAoRblPShhi4bM40S95o7LyFeFacJ X-Received: by 2002:a05:6830:607:b0:6e4:fa5a:d832 with SMTP id w7-20020a056830060700b006e4fa5ad832mr5411498oti.13.1709750299397; Wed, 06 Mar 2024 10:38:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709750299; cv=pass; d=google.com; s=arc-20160816; b=ciKgTg38//IMgSFormarWCCn2wmCYDSXNUv8hUJRNPN5DGkVI1Oxd2Uj3YNjR6C3a/ G1lStdtwzUmfN/KbPN4SxpLpEPQ/Jex6842w+9z2Wag1MgjFQ/wPHuM/oDQn4XtXve+P H4dydof0+/GTtYw6x4mK4ZnDPRCF/RYMyJme3mvxjjqotkd8q4NxUZqYvrdJqWWPSrDm 23xau9hk/uJPQ5Zk/T/eBlhatRinaIRtJKXZSOJa/+bGS9dAKfExtldVM0f+DrdSUo+O Mzz2UYNkwJPER1dWbToN+HRPOgo/KpCUYjAkQQdAEyTLh7gxEvFcrOs22XNr4G1VCP+L 9CtQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=QdJuiM5LRVbG8XdBu3uVMRmipZJzHeAGsoSuTAdrdP4=; fh=vclOy54vrc4go6iMECrcor6hAewGQ03f2X+1SnH2p10=; b=HuBrvJ/uvm/k9wy0UIL3jtCEwjAq3VQzYJr/0JC5Pq9vlgGO3WIbFL3IJBAmXdUzZ8 SfMscyIzBwkqVTWvRvSODIW/XrbsPr+QMk4u1b8RQv2xqG6q3soxZvXsBriixfP5oUa9 ckak2gm4nZWtZYYleyYqswGJA3NiKC3oyMurjr8Ah680sLDLHMGcpknkUoTVRTZjrVpF KdY8Qye24Xs4d6scxMm4L3ns9Vmt4rgTisWVeIDPg0wvSEtWNqMFZcfjkJ6L3CGkVPpK +sKyLIginNREzZ/JJJh4o2X9oX/9kW5RdTwQnjJR7oRRoDydm8viEreUAoevfGH+8m2/ xK6g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=netrider.rowland.org); spf=pass (google.com: domain of linux-kernel+bounces-94431-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94431-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i38-20020a632226000000b005dc84ba3c3asi12268439pgi.287.2024.03.06.10.38.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 10:38:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94431-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=netrider.rowland.org); spf=pass (google.com: domain of linux-kernel+bounces-94431-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94431-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 29BA0281B53 for ; Wed, 6 Mar 2024 18:38:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DEAA113E7EE; Wed, 6 Mar 2024 18:29:22 +0000 (UTC) Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by smtp.subspace.kernel.org (Postfix) with SMTP id 0F4E313BAD5 for ; Wed, 6 Mar 2024 18:29:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.131.102.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709749762; cv=none; b=jghHCPKpoZBMAzumg6//mIAdUCRfwrVZYFWf1P3AZqeNBvcp6Eyp78M03KR3Wy8SEACaSidQjXtv8IUMrwffhnn5Ofhm/7FchNgF8EO8F5PxaLbUn3MkPsQ9n0WuS905hz0qRP3cjsPVbhWhmuInjVIZtD4H8tkRWO2/OncXQ5w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709749762; c=relaxed/simple; bh=dvxdswckegKPT2ix/+RQU7uUQfyieyXa0TGvSNHnaXQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=J+VkliXAfE2sXEJyAQUApQbGMXA14TOgDOTXj/C1P2MAklp5AU6eJZGxUpMOahF9p8F6INTPA++RV5A42S6vDjUkajbSLPIDY181Fvu3OFmCtjRuJ+V3x6EGTfX7bbGNyQVdF+IOcr/UEAc+9RRrbgozkgSLmA4rGZ/YP6xHTHQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=rowland.harvard.edu; spf=pass smtp.mailfrom=netrider.rowland.org; arc=none smtp.client-ip=192.131.102.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netrider.rowland.org Received: (qmail 197785 invoked by uid 1000); 6 Mar 2024 13:29:12 -0500 Date: Wed, 6 Mar 2024 13:29:12 -0500 From: Alan Stern To: Andrea Parri Cc: Kenneth-Lee-2012@foxmail.com, linux-kernel@vger.kernel.org, paulmck@kernel.org Subject: Re: Question about PB rule of LKMM Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Mar 06, 2024 at 06:36:09PM +0100, Andrea Parri wrote: > > > In this sense, the propagation rule (like other "acyclicity"-constraints of > > > the LKMM) expresses "temporal ordering", and any pb-link is (by definition) > > > an "execute-before"-link. The file explanation.txt can provide additional > > > context/information, based on the (informal) operational model described in > > > that file, about this matter. > > > > So it is just a rule in the sence of mathematics? I think it would be better > > if there were some explaination in the explaination file. It is > > descripted in nature language, the reader might not notify it is just a > > mathematics rule. And you cannot say an action executes before another > > because they are in the pb link. It becomes a cycling in logic... This _is_ described in the explanation.txt file. The first paragraph in the section named "THE PROPAGATES-BEFORE RELATION: pb" mentions the mathematical rule: --------------------------------------------------------------------- The propagates-before (pb) relation capitalizes on the special features of strong fences. It links two events E and F whenever some store is coherence-later than E and propagates to every CPU and to RAM before F executes. The formal definition requires that E be linked to F via a coe or fre link, an arbitrary number of cumul-fences, an optional rfe link, a strong fence, and an arbitrary number of hb links. Let's see how this definition works out. --------------------------------------------------------------------- Later on, the file includes this paragraph, which answers the question you were asking: --------------------------------------------------------------------- The existence of a pb link from E to F implies that E must execute before F. To see why, suppose that F executed first. Then W would have propagated to E's CPU before E executed. If E was a store, the memory subsystem would then be forced to make E come after W in the coherence order, contradicting the fact that E ->coe W. If E was a load, the memory subsystem would then be forced to satisfy E's read request with the value stored by W or an even later store, contradicting the fact that E ->fre W. --------------------------------------------------------------------- Alan Stern > I think you're on to something, explaining mathematical axioms or rules has > never been an easy task AFAIU. ;-) (and that's why feedback is welcome) > > The remark could be to continue to consider such rules "generalizations" of > properties met by several hardware models or other specific contexts, rather > than (mere) logically-derived facts. > > Andrea