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 4B59EC3DA78 for ; Sun, 15 Jan 2023 16:23:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231233AbjAOQXg (ORCPT ); Sun, 15 Jan 2023 11:23:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231318AbjAOQXd (ORCPT ); Sun, 15 Jan 2023 11:23:33 -0500 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 27977CC3F for ; Sun, 15 Jan 2023 08:23:32 -0800 (PST) Received: (qmail 101139 invoked by uid 1000); 15 Jan 2023 11:23:31 -0500 Date: Sun, 15 Jan 2023 11:23:31 -0500 From: Alan Stern To: "Paul E. McKenney" Cc: Jonas Oberhauser , Peter Zijlstra , "parri.andrea" , will , "boqun.feng" , 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: <4c1abc7733794519ad7c5153ae8b58f9@huawei.com> <20230113200706.GI4028633@paulmck-ThinkPad-P17-Gen-1> <20230113203241.GA2958699@paulmck-ThinkPad-P17-Gen-1> <136d019d8c8049f6b737627df830e66f@huawei.com> <20230114175343.GF2948950@paulmck-ThinkPad-P17-Gen-1> <20230114181537.GA493203@paulmck-ThinkPad-P17-Gen-1> <20230115051510.GG2948950@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230115051510.GG2948950@paulmck-ThinkPad-P17-Gen-1> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 14, 2023 at 09:15:10PM -0800, Paul E. McKenney wrote: > On Sat, Jan 14, 2023 at 03:19:06PM -0500, Alan Stern wrote: > > On Sat, Jan 14, 2023 at 10:15:37AM -0800, Paul E. McKenney wrote: > > > Nevertheless, here is the resulting .bell fragment: > > > > > > ------------------------------------------------------------------------ > > > > > > (* Compute matching pairs of Srcu-lock and Srcu-unlock *) > > > let srcu-rscs = ([Srcu-lock] ; data ; [Srcu-unlock]) & loc > > > > > > (* Validate nesting *) > > > flag ~empty Srcu-lock \ domain(srcu-rscs) as unbalanced-srcu-locking > > > flag ~empty Srcu-unlock \ range(srcu-rscs) as unbalanced-srcu-locking > > > > > > (* Check for use of synchronize_srcu() inside an RCU critical section *) > > > flag ~empty rcu-rscs & (po ; [Sync-srcu] ; po) as invalid-sleep > > > > > > (* Validate SRCU dynamic match *) > > > flag ~empty different-values(srcu-rscs) as srcu-bad-nesting > > > > I forgot to mention... An appropriate check for one srcu_read_lock() > > matched to more than one srcu_read_unlock() would be something like > > this: > > > > flag ~empty (srcu-rscs^-1 ; srcu-rscs) \ id as multiple-unlocks > > I have added this, thank you! > > > Alan > > > > PS: Do you agree that we should change the names of the first two flags > > above to unbalanced-srcu-lock and unbalanced-srcu-unlock, respectively > > (and similarly for the rcu checks)? It might help to be a little more > > specific about how the locking is wrong when we detect an error. > > I have made this change, again, thank you! > > But I also added this: > > flag empty srcu-rscs as no-srcu-readers > > And it is always flagged. So far, I have not found any sort of relation > that connects Srcu-lock to Srcu-unlock other than po. I tried data, > ctrl, addr, rf, rfi, and combinations thereof. > > What am I missing here? I don't think you're missing anything. This is a matter for Boqun or Luc; it must have something to do with the way herd treats the srcu_read_lock() and srcu_read_unlock() primitives. Alan