Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp670776pxb; Thu, 30 Sep 2021 14:37:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9kOlg4kQiy9YiCRMJeXQtHccEDZlwvHsAJjXoaRRK0PZ52fi8FlLwM1HwtYot4QU/KBmt X-Received: by 2002:a50:d84e:: with SMTP id v14mr9692122edj.85.1633037841521; Thu, 30 Sep 2021 14:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633037841; cv=none; d=google.com; s=arc-20160816; b=0v+ZHDRSmc7bNI2eON91rJ1jaYKwbqgsu7+WaU05lehwxk2/ZaKvHBVqiZXJDVoWuG Zuk1Gcj1PO/Cmb18KFyU05mfpfbItIRlh34QoFoFBhzjS+Yq6S0AG9AtVMq8ijMxi6YI ZTlOQsnEOYhwwISdc4NYLZVxTMvzBMukRzsjRQs3DLJVlayhBUJdgspWdg69XZm/8VBz WOYa/Xku6e2plPaWy0znWW1wRg5t8klFrWNwIQdIN76Hu23vr631Eki3/ExcI468PCh8 qDSS4wq3G3JJH7Of/rpGaCIkJxtdkP9PSHbJgOBYKy99MKKoGa540/rJVWSzyaPcVp0G iZOQ== 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=/BqfDumWK+yrSoIgcUc6OWR3Rd9FxbG+SuMDN979Y3U=; b=Zl57nR6hieOu8cKnare+H0ifN2bUYBU8SAorAqt9CIw5tcaqScNIItPGrYhNmJQ8SY 7DxJmnnTYrQsDkKiRHhcTyyl8/NasW2Cx7h547qChwZrl909R2MR/KAxtzUI4pTTYFu7 TxhIcqAVpJXMqlJDSv24ebomZuFijeOqAMZRB25f2qZwm7vKsYWVuY4+Ktoidzq+IsFn 50pKLtdCHvjzGztOc7l0/D3zC+gS297I2lOcKcYoIWd+ieqcSeOsQmxEiKD/nCcJ0ba6 CMyavQFoZueYYL8xGoGwTpnHY4EwPxa7q5I5MFojM3E53+JLclqyzSVGrNoRnEPZQJBo l1sA== 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 p7si4656660ejb.33.2021.09.30.14.36.37; Thu, 30 Sep 2021 14:37:21 -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; 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 S245363AbhI3UsS (ORCPT + 99 others); Thu, 30 Sep 2021 16:48:18 -0400 Received: from netrider.rowland.org ([192.131.102.5]:37527 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S229948AbhI3UsR (ORCPT ); Thu, 30 Sep 2021 16:48:17 -0400 Received: (qmail 483443 invoked by uid 1000); 30 Sep 2021 16:46:34 -0400 Date: Thu, 30 Sep 2021 16:46:34 -0400 From: Alan Stern To: "Paul E. McKenney" Cc: Boqun Feng , Linux Kernel Mailing List , Dan Lustig , Will Deacon , Peter Zijlstra , Linus Torvalds , Alexander Shishkin , Peter Anvin , Andrea Parri , Ingo Molnar , Vince Weaver , Thomas Gleixner , Jiri Olsa , Arnaldo Carvalho de Melo , Stephane Eranian , palmer@dabbelt.com, paul.walmsley@sifive.com, mpe@ellerman.id.au Subject: Re: [PATCH] tools/memory-model: Provide extra ordering for unlock+lock pair on the same CPU Message-ID: <20210930204634.GB482974@rowland.harvard.edu> References: <20210930130823.2103688-1-boqun.feng@gmail.com> <20210930152033.GD464826@rowland.harvard.edu> <20210930181753.GH880162@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210930181753.GH880162@paulmck-ThinkPad-P17-Gen-1> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 30, 2021 at 11:17:53AM -0700, Paul E. McKenney wrote: > On Thu, Sep 30, 2021 at 11:20:33AM -0400, Alan Stern wrote: > > On Thu, Sep 30, 2021 at 09:08:23PM +0800, Boqun Feng wrote: > > > A recent discussion[1] shows that we are in favor of strengthening the > > > ordering of unlock + lock on the same CPU: a unlock and a po-after lock > > > should provide the so-called RCtso ordering, that is a memory access S > > > po-before the unlock should be ordered against a memory access R > > > po-after the lock, unless S is a store and R is a load. > > > > > > The strengthening meets programmers' expection that "sequence of two > > > locked regions to be ordered wrt each other" (from Linus), and can > > > reduce the mental burden when using locks. Therefore add it in LKMM. > > > > > > [1]: https://lore.kernel.org/lkml/20210909185937.GA12379@rowland.harvard.edu/ > > > > > > Co-developed-by: Alan Stern > > > Signed-off-by: Alan Stern > > > Signed-off-by: Boqun Feng > > > --- > > > Alan, > > > > > > I added the "Co-developed-by" and "Signed-off-by" tags since most of the > > > work is done by you. Feel free to let me know if you want to change > > > anything. > > > > It looks good to me. However, do we really want to add these litmus > > tests to the kernel source, or would it be better to keep them with > > the thousands of other tests in Paul's archives? > > Either way works for me. But if they are referred to from within the > kernel, it is best to have them in the kernel source. Which might be seen > as a reason to minimize referring to litmus tests from the kernel. ;-) In this case the litmus tests are not referred to within the kernel source. Alan