Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp635660pxb; Thu, 30 Sep 2021 13:41:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyxsShP+S5llozrSwUEAzGZTkJexwsiNYsaS/sbKXt+08H7isA/+U7jiapkYVqwfUU7s3J X-Received: by 2002:a17:906:9392:: with SMTP id l18mr1552554ejx.52.1633034517860; Thu, 30 Sep 2021 13:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633034517; cv=none; d=google.com; s=arc-20160816; b=h/mdBk76d6pGRVd2SqTYa1Jh816aR1wEKdIZ/4WBnt9153Y4BnXpuQEpRDbqM5j4aT PvZz5RkvSTHYmyBM5Q+Aj/GdAavIz2J7vMRxoMMv6PAAK/oxXJT845Jfs+nUsw9c9HCL nobfCrIEFyONiIUV4zjfn2tATuEx1JrvRXvklSYTFqsNm2RoCAyCn77UnsRKEHu6lOTO znCG2MUN5pvwXFE+/zADEEqdV9kDbq1I4L5ZVy+g8+ApILwCH4SEvW4KsIrDRPL3R889 HQTktSx0SuayO5p1vINABvIp02HJD2FGJfPyP1R1c+qiloNHyFW4e2jWLQ6vMKPb4tf0 YBcA== 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=H+Bb1Wl1X5SIWPZtElHt3hRePEUDE+cv2pC2pNmrtAE=; b=su0u/8725HtNIaZREBHIV3jlz/na+KYjFM7rLk8x1byLNkXUxKvghXmDz7wkmBhiDH zuZe1feF2HJtRIX8tkm+C5GycKK9AnEs9nXqSAPafIfznDXVjJiXzVcs0g4BcPd93MfL 8pU0ckzBoOrh10FqBZ+z+Mr6R7PcALd6Vj4jGWisSH81hR9Fgpoz7d2jj2rCmc/+sObP CEffjCNr4zcOiWcdTsSpz5YlytHSMHLwtpQsNeGpF6CXwo2MyUmX28+Nhx1Zzt8VhMXU tiFDuCIfunZMXhqNbubkm7MnwBBVzKUxuKANjN9oY1YFoHTujlJIaWkLjfK8IfNR2KLY dgwQ== 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 30si4131610ejm.409.2021.09.30.13.41.32; Thu, 30 Sep 2021 13:41:57 -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 S245624AbhI3PWR (ORCPT + 99 others); Thu, 30 Sep 2021 11:22:17 -0400 Received: from netrider.rowland.org ([192.131.102.5]:57475 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S245411AbhI3PWR (ORCPT ); Thu, 30 Sep 2021 11:22:17 -0400 Received: (qmail 472306 invoked by uid 1000); 30 Sep 2021 11:20:33 -0400 Date: Thu, 30 Sep 2021 11:20:33 -0400 From: Alan Stern To: Boqun Feng Cc: Linux Kernel Mailing List , "Paul E . McKenney " , 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: <20210930152033.GD464826@rowland.harvard.edu> References: <20210930130823.2103688-1-boqun.feng@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210930130823.2103688-1-boqun.feng@gmail.com> 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 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? Alan > Regards, > Boqun