From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41E6EC32793 for ; Wed, 18 Jan 2023 17:00:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230365AbjARRAZ (ORCPT ); Wed, 18 Jan 2023 12:00:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229818AbjARRAW (ORCPT ); Wed, 18 Jan 2023 12:00:22 -0500 Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7441458BD for ; Wed, 18 Jan 2023 09:00:20 -0800 (PST) Received: by mail-vs1-xe30.google.com with SMTP id l125so17048745vsc.2 for ; Wed, 18 Jan 2023 09:00:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=gVS0ttI/4bB+mxtYXUXdE9Vy1l0C8qSZnW3LXzS45yM=; b=XDeY55Q6iWV3pDYpheM1QUBJdMuDvKiPLlLDrBKxY2OrVKXgCTUHzOXYin7LwtCEwo aE595vrT732LnIndSSJmoMG1YzzDhi6nRZrU34VkQjZyy+nnMaS8H6IxDmgBQyAQJzOE z95duu7DtZbNBtBJrXJ9BAhrWSCjw9mxcsX4/caB+OaY4LPkBcwvItrDXd6g4Zq2In2z 4Ab8gr/ZBkeVJfAZ7If9LEoEU/aZXNpBJVPudQ+nGRaXHEAWh0WOF4nhMyj0kZh2t00a efXvH7i1NW/F9SXBCm8GVKxMr14j6F9xs375H9DbnhnClUBdso7Flp7qaZOH4V2JZNd+ 0BLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gVS0ttI/4bB+mxtYXUXdE9Vy1l0C8qSZnW3LXzS45yM=; b=NP6gOr+Mf47Tuf13vZo0sQPvSbq0Rw9cpSsSYPZPhVg4sOIwakFxHOzYaGoMzGtt0e zy3E4LB04DokvY1dbCEONnaQKezFv6EgZqNPC/v97QK1gBXmz9yoywKi+Dz354mlUU23 57KWEe4886NQ9KTpVW6hUNX8oHxIVzEbbJ/nwusKiS/2Zzvc5X3zXYbs5Zuh96E2MIuV lGRpjJ63mSPlav5/iDl1eDw350+n/BCxm/csAf1yKL5DggS4+pHBKPhYLoVyfzCEt2Ib E+A0ni4fcK6c+VRJcL8v0q411J1UWhsvesSWebOSpfEdhv4vVkQoY+Ug0ShGFWNzsSYu BgDQ== X-Gm-Message-State: AFqh2krqK/Bz9DQ+ojL3KLLuMcIYY4TFE0wiiDpCN25ze/DSynp2RQUl YWC3LjryHRtm1VHpRIbBNEU= X-Google-Smtp-Source: AMrXdXud3IrhSSd7y9EKMeFVoOK7kAjqlf/wSvqtUPI8QnK9N0g3Ouj/pyZ5R2fAE63zGLiPMrCvWQ== X-Received: by 2002:a05:6102:a49:b0:3d2:3263:e637 with SMTP id i9-20020a0561020a4900b003d23263e637mr5847959vss.30.1674061219721; Wed, 18 Jan 2023 09:00:19 -0800 (PST) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id d136-20020ae9ef8e000000b006ef1a8f1b81sm22314218qkg.5.2023.01.18.09.00.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 09:00:19 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 8625D27C0054; Wed, 18 Jan 2023 12:00:18 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 18 Jan 2023 12:00:18 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddtkedgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpeehudfgudffffetuedtvdehueevledvhfelleeivedtgeeuhfegueeviedu ffeivdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdei gedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfih igmhgvrdhnrghmvg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 Jan 2023 12:00:16 -0500 (EST) Date: Wed, 18 Jan 2023 08:59:55 -0800 From: Boqun Feng To: Alan Stern Cc: "Paul E. McKenney" , Andrea Parri , Jonas Oberhauser , Peter Zijlstra , will , npiggin , dhowells , "j.alglave" , "luc.maranget" , akiyks , dlustig , joel , urezki , quic_neeraju , frederic , Kernel development list Subject: Re: Internal vs. external barriers (was: Re: Interesting LKMM litmus test) Message-ID: References: <20230116190652.GZ2948950@paulmck-ThinkPad-P17-Gen-1> <20230116221357.GA2948950@paulmck-ThinkPad-P17-Gen-1> <20230117151416.GI2948950@paulmck-ThinkPad-P17-Gen-1> <20230117174308.GK2948950@paulmck-ThinkPad-P17-Gen-1> <20230118051704.GX2948950@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 18, 2023 at 11:03:35AM -0500, Alan Stern wrote: > On Tue, Jan 17, 2023 at 09:17:04PM -0800, Paul E. McKenney wrote: > > On Tue, Jan 17, 2023 at 09:15:15PM -0500, Alan Stern wrote: > > > Maybe we don't. Please test the patch below; I think it will do what > > > you want -- and it doesn't rule out nesting. > > > > It works like a champ on manual/kernel/C-srcu*.litmus in the litmus > > repository on github, good show and thank you!!! > > > > I will make more tests, and am checking this against the rest of the > > litmus tests in the repo, but in the meantime would you be willing to > > have me add your Signed-off-by? > > I'll email a real patch submission in the not-too-distant future, > assuming you don't find any problems with the new code. I haven't tested the following, but I think we also need it to avoid (although rare) mixing srcu_struct with normal memory access? Since you are working on a patch, I think I better mention this ;-) Regards, Boqun diff --git a/tools/memory-model/lock.cat b/tools/memory-model/lock.cat index 6b52f365d73a..c134c2027224 100644 --- a/tools/memory-model/lock.cat +++ b/tools/memory-model/lock.cat @@ -37,7 +37,7 @@ let RU = try RU with emptyset let LF = LF | RL (* There should be no ordinary R or W accesses to spinlocks *) -let ALL-LOCKS = LKR | LKW | UL | LF | RU +let ALL-LOCKS = LKR | LKW | UL | LF | RU | Srcu-lock | Srcu-unlock flag ~empty [M \ IW] ; loc ; [ALL-LOCKS] as mixed-lock-accesses (* Link Lock-Reads to their RMW-partner Lock-Writes *) > > Alan