Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6821621rwb; Wed, 18 Jan 2023 09:45:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXtFgtDF3i8wlsdp/b6HBvknuJIr8GiRgrszd4fYmPUg/wjLIJNN032PFo9P1lPLdJkrqHkz X-Received: by 2002:a05:6a20:1601:b0:b8:c659:9d51 with SMTP id l1-20020a056a20160100b000b8c6599d51mr9079123pzj.56.1674063922824; Wed, 18 Jan 2023 09:45:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674063922; cv=none; d=google.com; s=arc-20160816; b=ugu7Hzh1VAyzpEfpEwdxo/i6yCf0A2kLuB1YboIPACMa0qVJUlBWr1Eb2p43myzpHN 1pOp84iSjGSFBufaMZXP+lOxXdUQcl8vojLgJuETUeY7Th5wlTao6zU/muAA/smxv8Bf 2O9fDEz6OA8ctpwu28IVJAuADAzw/K6zWHatJAFS67wc16wLphNd++3mX7Vbf3U00Umi Z3f2QarzsBcDRgnARO07VI02ZXPnRGUOD53tpcZb5b4oXi32KBZOl/BzUCKosPhAcoLU Tx1AgYHKVvwfAEwja5WGrn2oGTzSH/pSi/aRnbh7WiVNOsZ7azYbOcyj5wrqgyb0ig0J kF/Q== 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; bh=sCzQ6YtQrVeAJMD79jkjW0XuwhhIC9b998DupWa+rY0=; b=mjGuXsBSyrtNc/KoSwuG/Ln3CIqHjrRJNjFBERYi2Di73IBCoKM+DHgSlBCgOqiuqi kipp1MC4cbYJdYMTFc2GHJ3IiHMzJOqk6/SVMg/oGoPjqEOt85pNB4CwA0Yi987i9xVb ZTIDOt8XO8dn6iiauioi6LtFjejO3/0NBqN84KvsngYbQIahRXHqIvKf3SrgnPRXUj0H DeMZiM1TabS7AcCv2ofFTUHwT0Qa7m47zNJg1AmiF/TFyfFCbDn5Y8U1WNmEtjhv2tUk vAiRly3c+uBnV4F0sk93tLYn+1RQJTfkku8JvJE5U/31+BlMbDMJ0MzQiyoeDB1E6+n8 gzkA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z22-20020a656116000000b004a804c6d77dsi39580741pgu.186.2023.01.18.09.45.16; Wed, 18 Jan 2023 09:45:22 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229947AbjARRIo (ORCPT + 47 others); Wed, 18 Jan 2023 12:08:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbjARRIh (ORCPT ); Wed, 18 Jan 2023 12:08:37 -0500 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id B3701577F0 for ; Wed, 18 Jan 2023 09:08:35 -0800 (PST) Received: (qmail 214860 invoked by uid 1000); 18 Jan 2023 12:08:34 -0500 Date: Wed, 18 Jan 2023 12:08:34 -0500 From: Alan Stern To: Boqun Feng 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: <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=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS autolearn=no 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 08:59:55AM -0800, Boqun Feng wrote: > 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 *) Great point! I'll at this to the patch, thanks. Alan