Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1646385pxb; Fri, 10 Sep 2021 10:22:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybuP6k/fBv+g5YfrsQfPw26V33052MjSdpnZQvGpySVf4gLMgBfkKFCLE8sCJ33Rd6WHnM X-Received: by 2002:a6b:1d0:: with SMTP id 199mr7952409iob.20.1631294565805; Fri, 10 Sep 2021 10:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631294565; cv=none; d=google.com; s=arc-20160816; b=ajDBl1OVOxu/e/TM8NtbKZeX7TVMqmRdSOQpKfMQ4cAX+WvFn+I9rdivr0ZjxwVPVE E1lw7q9FweU5JhHTcEGoXRj5I+3zdl1+rp8Wp1vSgNcCY3ea1xflqQAb6Hv4yzLyjq4A KFjuJJxjcVmYSM9Ym2iVPgdissKYbxm/rLivpjBLGKVgnDXQrZQsSPfO2liNtvSzwDNt mAPMjegGnwTBnARfjJXIMlc28rKL4VC2QDXMg9NCVdH0CS1wa7vWA9Q1nqavASOso31W w/+Kl49fpHT/Y6MfeR5n70o0k22Szx1oDkPwbiSu/xiO4ItMYHPRFdyY0URVZr18uBlU CW5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ywULsRgfl8spdk+6KG6of6ltCKMxYqZsF0ZGMeKFOPI=; b=NazVpWXnFfuVxja5ebt3AM/+0zLuaX5pPZ8RVeme/P8VoyKE6gbVfAlXZXWX1mxnT2 M6YdKRHPTgABhDyuceS2dUX3wS/AvuwkKlhVvQdiHpVsWQmt+A0zi0Psix2QNru7NMP0 Xn0UQFBQZ1zDkd9uVCKsslzMkGJzOvk/Og6C4+NFH7ThCBYGf9b35MWon8JfVqxkWrc9 G8l7FVgheIExDraxKlG03F1j4/cmnx3PWegDIQpQpK4XrKUO05FwIQq0b9i8Q5dZxiG9 ast/saUPGON/HI01Ds+gJzdqe+uvQZWMjWhkUqjvUIxj/cBov7z7qWpaLr2lgLWZVdo8 t1TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=IayTb0La; 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 i3si5500143ilb.141.2021.09.10.10.22.33; Fri, 10 Sep 2021 10:22:45 -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=@infradead.org header.s=casper.20170209 header.b=IayTb0La; 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 S231327AbhIJRV6 (ORCPT + 99 others); Fri, 10 Sep 2021 13:21:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230440AbhIJRV5 (ORCPT ); Fri, 10 Sep 2021 13:21:57 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07778C061574; Fri, 10 Sep 2021 10:20:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ywULsRgfl8spdk+6KG6of6ltCKMxYqZsF0ZGMeKFOPI=; b=IayTb0LaLtscPPiQJNM/Zb2SlP 50FTGWXO4tTPVMv/fY5tFF80bNvrzVh9qfafBtaJxO8BuSE+TJawu+BQhFo81i9Ig+m7/qqYPJecu ivkovF9HPaHMMtqCeJgqWc51g0up1ZVjXf5BvZ8qoYgipQXKp2zlvRRmxv30H5u+dyrtS2K2DvrlM +iJ7K5KpF7Kcyv2w79oI3PFZ68/d99Ujnf7gHgZkN6RjhWbHW2pi1M3iHjZD/mPwU3Wx11jtNoDAB 3ZQow7/npcatWcKwCyOHIuVtk5oEZ3xM6zVxPlxq1ql6FHWVBYIE1aRcb5vpHpMv32zWx2BXdHt1q 1r3J5fNg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mOk9o-00BCfe-M4; Fri, 10 Sep 2021 17:18:15 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id AC83D98627A; Fri, 10 Sep 2021 19:17:43 +0200 (CEST) Date: Fri, 10 Sep 2021 19:17:43 +0200 From: Peter Zijlstra To: Alan Stern Cc: Boqun Feng , "Paul E. McKenney" , Dan Lustig , Will Deacon , Linus Torvalds , Alexander Shishkin , Peter Anvin , Andrea Parri , Ingo Molnar , Vince Weaver , Thomas Gleixner , Jiri Olsa , Arnaldo Carvalho de Melo , Linux Kernel Mailing List , Stephane Eranian , linux-tip-commits@vger.kernel.org, palmer@dabbelt.com, paul.walmsley@sifive.com, mpe@ellerman.id.au Subject: Re: [tip:locking/core] tools/memory-model: Add extra ordering for locks and remove it for ordinary release/acquire Message-ID: <20210910171743.GO4323@worktop.programming.kicks-ass.net> References: <20210908144217.GA603644@rowland.harvard.edu> <20210909133535.GA9722@willie-the-truck> <5412ab37-2979-5717-4951-6a61366df0f2@nvidia.com> <20210909180005.GA2230712@paulmck-ThinkPad-P17-Gen-1> <20210910163632.GC39858@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210910163632.GC39858@rowland.harvard.edu> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 10, 2021 at 12:36:32PM -0400, Alan Stern wrote: > --- usb-devel.orig/tools/memory-model/Documentation/explanation.txt > +++ usb-devel/tools/memory-model/Documentation/explanation.txt > @@ -1813,15 +1813,16 @@ spin_trylock() -- we can call these thin > lock-acquires -- have two properties beyond those of ordinary releases > and acquires. > > +First, when a lock-acquire reads from or is po-after a lock-release, > +the LKMM requires that every instruction po-before the lock-release > +must execute before any instruction po-after the lock-acquire. This > +would naturally hold if the release and acquire operations were on > +different CPUs and accessed the same lock variable, but the LKMM says > +it also holds when they are on the same CPU, even if they access > +different lock variables. For example: Could be I don't understand this right, but the way I'm reading it, it seems to imply RCsc. Which I don't think we're actually asking at this time.