Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1630685pxb; Thu, 4 Mar 2021 16:58:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwG3AIvfNxu45q6hRiHFmc025HPReiGXYsu/d7I5HyXcgbxbnP71cEus6HXkDnl2EcuEOh X-Received: by 2002:a05:6638:582:: with SMTP id a2mr6866697jar.133.1614905924226; Thu, 04 Mar 2021 16:58:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614905924; cv=none; d=google.com; s=arc-20160816; b=EmvFwUynOD0P6jQUG0zSNP3LY8zdPfqyu6nn1gaGwY1g7bgoRqpvd7v+uEwftfF3XB dN7psiBOjpb5g3km1tWBImti0+yvT8EIKegiPllxr3vWqaag1lZDsxfeBLFKY9dCECaZ L9+D6igaL+jzMkD8WV2S3f7RbOkVwSJrql6R7a8+u6g0VLBegX7WrMOm0YlX0XoMxcmS 0p3oLqcgPARR0YpPSxsopfmpHWsovEvKZ1+d4TtF+n4oQyhH8+w2R52kcRRDze6jenNg FtXbPwzwDsnOgBtro/PCUQhcYGNjNKqDdldEBrLTIb3vn3ffH+xt0HzABi0S7mbu6dvh FItQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=msclD7wMXEET6loboZJQOmYQZZABxZI/J2w/zSBr7xk=; b=h+0oawDCzzBUAazteOBvRQMvA6eBSv0zfS66J/tBdQdW5f3Of2C6PzMagE9bt6AjeI mV6Z4wmAzbKZgAUH0nnSqjIysH5efaJOm1C1zYBRQDA8jqT1XVQ+FJ9GnicJJ4UpIlW7 /M8zuAPXSFLKLh50VA0bISk+4cUeZbBTQjnyFO69Z2gtMe71gSmMRtGWiMUMRB/+GExl aZomOn7Bygs2MiPafVu7fiGqTFhwEIfJFBELCIS+9UqrF6oRR8bmtqD+ABYGdW/WGDW3 YmgqzJe/oH2Thf4KAkbjczUi04ib6qpPVjTSaV9YVCGOj7l9hIcXeTqFJANeeissj9/Z viug== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c4si756545ioa.65.2021.03.04.16.58.31; Thu, 04 Mar 2021 16:58:44 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231149AbhCDV2q (ORCPT + 99 others); Thu, 4 Mar 2021 16:28:46 -0500 Received: from netrider.rowland.org ([192.131.102.5]:34359 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S239444AbhCDV2e (ORCPT ); Thu, 4 Mar 2021 16:28:34 -0500 Received: (qmail 15607 invoked by uid 1000); 4 Mar 2021 16:27:53 -0500 Date: Thu, 4 Mar 2021 16:27:53 -0500 From: Alan Stern To: "Paul E. McKenney" Cc: =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , bpf , LKML , parri.andrea@gmail.com, Will Deacon , Peter Zijlstra , boqun.feng@gmail.com, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, akiyks@gmail.com, dlustig@nvidia.com, joel@joelfernandes.org, Toke =?iso-8859-1?Q?H=F8iland-J=F8rgensen?= , "Karlsson, Magnus" Subject: Re: XDP socket rings, and LKMM litmus tests Message-ID: <20210304212753.GB14408@rowland.harvard.edu> References: <20210302211446.GA1541641@rowland.harvard.edu> <20210302235019.GT2696@paulmck-ThinkPad-P72> <20210303171221.GA1574518@rowland.harvard.edu> <20210303174022.GD2696@paulmck-ThinkPad-P72> <20210303202246.GC1582185@rowland.harvard.edu> <20210303220348.GL2696@paulmck-ThinkPad-P72> <20210304032101.GB1594980@rowland.harvard.edu> <20210304050407.GN2696@paulmck-ThinkPad-P72> <20210304153524.GA1612307@rowland.harvard.edu> <20210304190515.GS2696@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210304190515.GS2696@paulmck-ThinkPad-P72> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 04, 2021 at 11:05:15AM -0800, Paul E. McKenney wrote: > On Thu, Mar 04, 2021 at 10:35:24AM -0500, Alan Stern wrote: > > On Wed, Mar 03, 2021 at 09:04:07PM -0800, Paul E. McKenney wrote: > > > On Wed, Mar 03, 2021 at 10:21:01PM -0500, Alan Stern wrote: > > > > On Wed, Mar 03, 2021 at 02:03:48PM -0800, Paul E. McKenney wrote: > > > > > On Wed, Mar 03, 2021 at 03:22:46PM -0500, Alan Stern wrote: > > > > > > > > > And I cannot immediately think of a situation where > > > > > > > this approach would break that would not result in a data race being > > > > > > > flagged. Or is this yet another failure of my imagination? > > > > > > > > > > > > By definition, an access to a local variable cannot participate in a > > > > > > data race because all such accesses are confined to a single thread. > > > > > > > > > > True, but its value might have come from a load from a shared variable. > > > > > > > > Then that load could have participated in a data race. But the store to > > > > the local variable cannot. > > > > > > Agreed. My thought was that if the ordering from the initial (non-local) > > > load mattered, then that initial load must have participated in a > > > data race. Is that true, or am I failing to perceive some corner case? > > > > Ordering can matter even when no data race is involved. Just think > > about how much of the memory model is concerned with ordering of > > marked accesses, which don't participate in data races unless there is > > a conflicting plain access somewhere. > > Fair point. Should I have instead said "then that initial load must > have run concurrently with a store to that same variable"? I'm losing track of the point you were originally trying to make. Does ordering matter when there are no conflicting accesses? Sure. Consider this: A: r1 = READ_ONCE(x); B: WRITE_ONCE(y, r1); smp_wmb(); C: WRITE_ONCE(z, 1); Even if there are no other accesses to y at all (let alone any conflicting ones), the mere existence of B forces A to be ordered before C, and this is easily detectable by a litmus test. Alan