Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1233527ybe; Fri, 13 Sep 2019 13:10:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOqoyRabVtOPlzJjgPdXGJVsz4KqHz9+PWtlaxXn9Juv9bmhvh+9khixXATvWxAbqrFrlj X-Received: by 2002:a17:906:bb0f:: with SMTP id jz15mr40171436ejb.264.1568405412096; Fri, 13 Sep 2019 13:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568405412; cv=none; d=google.com; s=arc-20160816; b=Fb4LfUSGcs3OXgDBxmthHSxX/AOnydZCzOQlj6oxF6thogef/c6TNiJeP40cXxcb1P pTaIwvVlk5H2o9IoqfUiNiGHekafifpZvOsBcbDDQU7jChyK3Xuog6SrsiXWO8LF3L6q P9svTnHOmOFm3+csQrFZa0+7IjYDUSkd7I+617YgMs9l9+dTm4rHb0/SfelAPFflxtxi PFZm21MhBJGU86IGHtc8ft575taXfFHoplSI6sCA+dPxd6onwNy6qjrTWfPrLzV1pMBi Jo7bbY8EjrlAgbrFLAPS9dbTGmMpuS0SvpyS/OL7yhz1pppDka9uHJYUU0WCGRNNBCRC kEyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=ExG2HgL3I7BtJFnkRXhJ/bL7RtChCN42adrdHqTyGGc=; b=0EWoIMv4lJjJk7saRvH/eOyc7dmbNf6zlkyJUcFM9+Su8A1RrZCzD9OWb+93+QC+Pf QSCuFMk6VNJDcW3iv0YPwhm3OErM3w+pJ/MCts6LCu60sseNpeiRDQHCxKZnpOPmWeeQ hsAPwQIaUJ4kA97GdiZOfhKiXh2ooXqVkKPEdIZe6PxVwqu1uab+iVuJubtKCpJgrR6L LdIzyEV1w6oDDcD3pGRkmetn0aEjpv6H6zkCLsIQSCcVsBLrtyUCNAwiIg6Dz7nFVUNW grk+FMzD8GcBcvpu+VqvVCbVdY07joqqg2fiJ5zGR7SXqe7C6hDRh9PNjDc/nWdaKJt4 HCAQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si17265817edd.140.2019.09.13.13.09.47; Fri, 13 Sep 2019 13:10:12 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388809AbfIMTN1 (ORCPT + 99 others); Fri, 13 Sep 2019 15:13:27 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:54112 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1725536AbfIMTN1 (ORCPT ); Fri, 13 Sep 2019 15:13:27 -0400 Received: (qmail 5375 invoked by uid 2102); 13 Sep 2019 15:13:26 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 13 Sep 2019 15:13:26 -0400 Date: Fri, 13 Sep 2019 15:13:26 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: "Paul E. McKenney" cc: LKMM Maintainers -- Akira Yokosawa , Andrea Parri , Boqun Feng , Daniel Lustig , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , Peter Zijlstra , Will Deacon , Kernel development list Subject: Re: Documentation for plain accesses and data races In-Reply-To: <20190912220126.GA14560@paulmck-ThinkPad-P72> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 12 Sep 2019, Paul E. McKenney wrote: > On Fri, Sep 06, 2019 at 02:11:29PM -0400, Alan Stern wrote: > > To this end, the LKMM imposes three extra restrictions, together > > called the "plain-coherence" axiom because of their resemblance to the > > coherency rules: > > > > If R and W conflict and it is possible to link R to W by one > > of the xb* sequences listed above, then W ->rfe R is not > > allowed (i.e., a load cannot read from a store that it > > executes before, even if one or both is plain). > > > > If W and R conflict and it is possible to link W to R by one > > of the vis sequences listed above, then R ->fre W is not > > allowed (i.e., if a store is visible to a load then the load > > must read from that store or one coherence-after it). > > > > If W and W' conflict and it is possible to link W to W' by one > > of the vis sequences listed above, then W' ->co W is not > > allowed (i.e., if one store is visible to another then it must > > come after in the coherence order). > I will need to read this last section again. Perhaps more than once. ;-) I decided this part could use some improvement. Here is the updated text: To this end, the LKMM imposes three extra restrictions, together called the "plain-coherence" axiom because of their resemblance to the rules used by the operational model to ensure cache coherence (that is, the rules governing the memory subsystem's choice of a store to satisfy a load request and its determination of where a store will fall in the coherence order): If R and W conflict and it is possible to link R to W by one of the xb* sequences listed above, then W ->rfe R is not allowed (i.e., a load cannot read from a store that it executes before, even if one or both is plain). If W and R conflict and it is possible to link W to R by one of the vis sequences listed above, then R ->fre W is not allowed (i.e., if a store is visible to a load then the load must read from that store or one coherence-after it). If W and W' conflict and it is possible to link W to W' by one of the vis sequences listed above, then W' ->co W is not allowed (i.e., if one store is visible to a second then the second must come after the first in the coherence order). Alan