Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1032494rwb; Sat, 14 Jan 2023 12:49:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXtEV4dCMI2Mrn+2OS2v3N3mLYmwnACZJ78YOhspD8q9WS5HcXq/4cRRv3wijpyr1Ad7ctQW X-Received: by 2002:aa7:cd69:0:b0:499:bffb:7e58 with SMTP id ca9-20020aa7cd69000000b00499bffb7e58mr4340014edb.20.1673729390882; Sat, 14 Jan 2023 12:49:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673729390; cv=none; d=google.com; s=arc-20160816; b=lzkh1hI9/s0pEyPoUyGBdoF0mkNDJD5dxH/p1SJozYNbZnuehPWs1uv/SF3fiB4nxu xHzOOUgf2yijD9MWzjoFudFmNn33h2fpQ1sEkqaYtAwqDGMIJfVTV85L1nYGKabmYA1M IBZ5Yv55o0c1xR4XYBINyNNWqKkX3IAAfr03ZrzHs1Ov5WiP5o93R1RGhKfb1BGoeucT TMOYb6MmThHvwFMj6ustEEvdAa30CNqvOY5GdRWWsR6oWs8U96Pth6mTzigV33xC36xv RWmifcvnkpkHfUAvcCnQQOr2cz93AlNK7dO3gNruyHhHEt2CMu9OCPkJbuRxMlVJKG2b yrBw== 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=omQ/Dt+O8vKH62QOR+p6ZgwG7BPI2YmoS/qRBxjRvak=; b=r6Gx93oJLWgyY3Nb47BbVGgjdEgt1gs/DykftoYb7BMQNh39SkTF+7im4bgzDGEMAa OzeoDHvyYKrqhlqyCjW3whh/X1hDrs66rwJ7Ev4mF2etQGz2zxCkVp91hD0/Tab0WV58 ZlzxqVy6J6Ch3iX62M2UrBCqXM5eN53csySCb+ahCT6Ve0W/Yz007/OZPLCW8RpR/B2t OgTOLt8X3ZKIAAZMPylPIA3k1mXkRhbjK5lov9gdHRDNe3Q9nloGq09crNkSfvPQddkC qo0nnKbaSF62Vms2bBJ0dNHxjKXqMUj1s8zrYemu9XBdH8tNpnpG2qDB3sSHuVLeBiGg sK4A== 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 s11-20020aa7c54b000000b00480e42f3032si23104717edr.305.2023.01.14.12.49.36; Sat, 14 Jan 2023 12:49:50 -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 S229553AbjANUTJ (ORCPT + 54 others); Sat, 14 Jan 2023 15:19:09 -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> 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 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.