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 871E1C46467 for ; Sat, 14 Jan 2023 20:19:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230309AbjANUTK (ORCPT ); Sat, 14 Jan 2023 15:19:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbjANUTH (ORCPT ); Sat, 14 Jan 2023 15:19:07 -0500 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 049846597 for ; Sat, 14 Jan 2023 12:19:06 -0800 (PST) Received: (qmail 71784 invoked by uid 1000); 14 Jan 2023 15:19:06 -0500 Date: Sat, 14 Jan 2023 15:19:06 -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: <114ECED5-FED1-4361-94F7-8D9BC02449B7> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230114181537.GA493203@paulmck-ThinkPad-P17-Gen-1> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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.