Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6873689rwb; Wed, 18 Jan 2023 10:23:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXvDKzFJ3od0lCMCgP+9lIfWA4ZA0ClAHK0iPo009ZODJ0rU0gqLHBPXESvRFdO8jKiu9EyA X-Received: by 2002:a17:907:989c:b0:86f:cdb1:ea00 with SMTP id ja28-20020a170907989c00b0086fcdb1ea00mr7852891ejc.65.1674066192673; Wed, 18 Jan 2023 10:23:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674066192; cv=none; d=google.com; s=arc-20160816; b=gJLKy4bXla32YZnrJH5Ffd0WBxgNwuciH9xJK/F2sgNEmqNRVjiuW/2+G9WQrdgfoW MAoEB5W9YXgs3tp1l7IkXCMu7RdVUIw9V5HY9rYfV8hCcbG3AWUgsUUhTWlTMXE5iMox gvFLJPe9EythZpdnF83JhjZo3Ef7mRGTZl1miICYtiIDMiCoNSBDzpR7jXpiUr7jTrXJ T1Lhz4oQVMCgBFyPsFNnE7sy2wU79D84htyKGp9UmW2xH9veP/qZ7m+frjf2zNALcS2L AmwuFHS4zNDixGo5rkg6H79SyNGZkUjfPA7RLKAFd1kpTBgj97WVRCWyW4BIsBpPcR0k r+Dw== 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:feedback-id :dkim-signature; bh=gVS0ttI/4bB+mxtYXUXdE9Vy1l0C8qSZnW3LXzS45yM=; b=Awp5YJW0Gj0n4zY7tDZ9qtipK/6k08AvGTGXHTI22CddJSMOWpSoscgjeumSexYnPo svR6yTxJN6l38B3Ii/tdyqvrhfUBFxUzxoGLu5E8V8j3d5r5HrBlTV4cc1EzPURKB1CP hNa1jDU6A1QgUoZ7E3YztDvTlj0ou2N1V3oIgUvJx1FQ/Xvr7Y0Y+ZaZxcVuTWTKZ0vy 01dYgeBLxe9/I/xcAMLyZkm39Lj6OH6y+Numap2I5Tj/IeniB/y9Y1Hs5tCeP7gG7Xt8 4sWshLHWzPboc7Fro52FbFKmm7rKvngJPAaJnxVwXVRvcUamywTFrRaPqsvjKNJdsLOz Pyww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XDeY55Q6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd15-20020a170907628f00b007da4fe085desi40475989ejc.157.2023.01.18.10.23.01; Wed, 18 Jan 2023 10:23:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XDeY55Q6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230336AbjARRAY (ORCPT + 45 others); Wed, 18 Jan 2023 12:00:24 -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-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: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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