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 DD024C38159 for ; Wed, 18 Jan 2023 17:08:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229646AbjARRIp (ORCPT ); Wed, 18 Jan 2023 12:08:45 -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: 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