Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2095371rwb; Sun, 15 Jan 2023 09:07:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXuVYc2gBQpqVLAX4xm8/blRABwrsRdTavDofDodbzauZCSSxwIOzrrVg0QsMisyT/XonVS/ X-Received: by 2002:a05:6402:528f:b0:47e:eaae:9a69 with SMTP id en15-20020a056402528f00b0047eeaae9a69mr79095461edb.41.1673802432091; Sun, 15 Jan 2023 09:07:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673802432; cv=none; d=google.com; s=arc-20160816; b=nv0p8xywq5hfnYiz/uBJBdOF6jUTiks57Sv/kvTrkbFN/cWgOKyGOPcSC4xvSkHZws S4eE8elOlAdpsACd0RV40LaZXIVabZEo1tya/B1hDVw0UjXlSO5zcdyl4b+sfGu1J8Dd QdoneJd04wGX6vIoYvt0GNVlxIGtbTtQQuDpglZx9TkoifctutYa5jlEVkchlmol6NrH 7xX0xaIcoTSzdZKWxvO1piSwDgW0GQoHdla8HCTJvcfo+J+tZ7n2vEKE36bD36ra8qG7 2aLV8CB5FT++b5gU+SYzvQ+rVO9aaoXQGcBpFBnak0Rm0oU6tgip5b5DnxgKlgPusFV+ QArw== 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=bVVyyb8V9a9gFC/5ThfT0T/DuAaHXp7GBpHKSiF+0eY=; b=nJt/7SZ04ouqed8bjOpbf9ZTjQS+a6OxkOJroO07rnMdS9u7sLgNwZmWvstDmD5onY ZwqFBQ9R8z66Y05fFnnoLaJAgx+Yzs9N6J0pFkw9nyEn2kxkyR/r4Z76+eflrOBfHWDt 1+t8Tm85X+EIC24GISEDN8d6+EMbR5qQRjPWlbcDTL9zmkC08g54Was+j1hqwwvjBp3a w9tIaNbL5i7HqgSmVag3KxX6O9+VHm2xrbGEdqWWRvQifwMzn5CD48VfvLovgbR4BQ6G K8NWgyOHXC89aM/m1UF98AtsZQhPxxfrN254mgRyl5Eet5R7owYIDeGiHGHp8Pnj9Hmf 0IdA== 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 t32-20020a056402242000b0048b8e656038si28232021eda.383.2023.01.15.09.06.57; Sun, 15 Jan 2023 09:07:12 -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 S231497AbjAOQXg (ORCPT + 54 others); 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> 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 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