Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp572803pxb; Thu, 30 Sep 2021 12:08:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRRgAMcPjbpNXwA4/td7xUm+nd0tI9tiVtrMYGuRao0hAlLFPbKVh1m6jWWHkzC0adwweL X-Received: by 2002:aa7:9395:0:b0:438:9980:5c94 with SMTP id t21-20020aa79395000000b0043899805c94mr7067791pfe.81.1633028904378; Thu, 30 Sep 2021 12:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633028904; cv=none; d=google.com; s=arc-20160816; b=y1cebc1pQ3nhJrg0e0NBqr9d89UPOMQIYnm7OZ6Z/+c3iw4sgKGjEJxHVVJCYfT89N p+n+MMJB05OD1d/fFK4SPKZUwD1Uh5590ednzLvnC2mtBmdTmooaqQQhOIDULiF/QHE0 boHKlq5pMwpmsM1B6ww41+GLVpW/nl595XRAk5ABHKOoK9T3CSz8VgfsReqpPF2aHQ9G vEbIUMDgF5udNp3Y+h5AEnLPejNbi0gj3EWldjbOcrA9LxPm+Av+dTUCSSLFw6Mnkl/F BoAts18+CDCVMwHB5kuwOLaiRe27ctaEG/QPeFwSVl1h5bsAyUsrzKduB+63fV6sIjaf q69Q== 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:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=nMMopDN4ZvAd2NtGSjVuV++oHNibSAJHFlG3Vdle5C0=; b=Aby3SeIq+H1rTAMw9MmsrOjo8A8jzOiKRf7sfQdU4ZCFpbZGqvyBOstoWUhr3zwms8 ROPkZ9zoe3LS6caYbxvb33TkJ1Hk7EpcOjNEEhycGA9ssSCOfvfnAo/2pRZT6SnPCh3B lpSA/18iiL2ENnijQi5d6Vj4pR/AogOHyCm171wcbWSWMuVDDj6CEspLKyRsVrF+wbtV JuFlov9IfLQPuFKBr/ntMLgjS/l0+FskBraQSsKPhUze+dd1N2MDAJHw8fL06VEj6iS+ xO4Gvp3nL+QBEdXRJrbcq52H62MGEzVn7Q/X0Ko+sDUwEeobQqAbkOsuTcSENW75oh4w L4FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NcMcIOIV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 127si5506771pgf.290.2021.09.30.12.08.09; Thu, 30 Sep 2021 12:08:24 -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=@kernel.org header.s=k20201202 header.b=NcMcIOIV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353383AbhI3STj (ORCPT + 99 others); Thu, 30 Sep 2021 14:19:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:57718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353361AbhI3STg (ORCPT ); Thu, 30 Sep 2021 14:19:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3D872619F6; Thu, 30 Sep 2021 18:17:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633025873; bh=4RQ1qh5PQ7XM7RwFtMMOsRZbOrpcEDqV2LixdSXaqaQ=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=NcMcIOIVUYpLNdjieMCxW9vTCZQkAPA1RTJIT+vAMSCii54OoZLqYFL1QDtG400Da s1rb2RbSVw3N8vQgqrk/0btNwqIT/wGpQFKpotYEeOFivMbN57aHGYp59s/ZtUZ0B2 sEskWcLRzTHv8tV4HNUM78y9tmMYtnd2aFLP3bAwS3A2EOnpe85/Dk9m0LW1/mE9xx HTdCrrVQMghy4IKs6ixn+TxCODgibDVhBc/li+66lPTKhmxrY6BAdDussWa3ADpa6O kRbyhUNjbH15m6SuxTOL5moe0FCYOKWEsRiGk+e/r962eb4Ts6SqpIcfm8E+9yzsHw dCTbPDWB35JZw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 0E6EA5C0433; Thu, 30 Sep 2021 11:17:53 -0700 (PDT) Date: Thu, 30 Sep 2021 11:17:53 -0700 From: "Paul E. McKenney" To: Alan Stern 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: <20210930181753.GH880162@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20210930130823.2103688-1-boqun.feng@gmail.com> <20210930152033.GD464826@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210930152033.GD464826@rowland.harvard.edu> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. ;-) Thanx, Paul