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 6304BC54E94 for ; Wed, 25 Jan 2023 20:36:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236486AbjAYUgh (ORCPT ); Wed, 25 Jan 2023 15:36:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230329AbjAYUgc (ORCPT ); Wed, 25 Jan 2023 15:36:32 -0500 Received: from frasgout13.his.huawei.com (frasgout13.his.huawei.com [14.137.139.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 058145528E for ; Wed, 25 Jan 2023 12:36:22 -0800 (PST) Received: from mail02.huawei.com (unknown [172.18.147.229]) by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4P2Fln3lX1z9xtmt for ; Thu, 26 Jan 2023 04:28:21 +0800 (CST) Received: from [10.81.213.36] (unknown [10.81.213.36]) by APP2 (Coremail) with SMTP id GxC2BwDnuF+jktFjVXHGAA--.15159S2; Wed, 25 Jan 2023 21:35:59 +0100 (CET) Message-ID: <16ca40c7-ba9d-6741-e7fc-fd553c80a757@huaweicloud.com> Date: Wed, 25 Jan 2023 21:35:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [Patch 1/2] tools/memory-model: Update some warning labels To: Alan Stern , "Paul E. McKenney" Cc: Andrea Parri , Jonas Oberhauser , Peter Zijlstra , will , "boqun.feng" , npiggin , dhowells , "j.alglave" , "luc.maranget" , akiyks , dlustig , joel , urezki , quic_neeraju , frederic , Kernel development list References: From: Jonas Oberhauser In-Reply-To: Content-Type: text/plain; charset=UT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F0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf 9x07UZ18PUUUUU= X-CM-SenderInfo: 5mrqt2oorev25kdx2v3u6k3tpzhluzxrxghudrp/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/25/2023 9:20 PM, Alan Stern wrote: > Some of the warning labels used in the LKMM are unfortunately > ambiguous. In particular, the same warning is used for both an > unmatched rcu_read_lock() call and for an unmatched rcu_read_unlock() > call. Likewise for the srcu_* equivalents. Also, the warning about > passing a wrong value to srcu_read_unlock() -- i.e., a value different > from the one returned by the matching srcu_read_lock() -- talks about > bad nesting rather than non-matching values. > > Let's update the warning labels to make their meanings more clear. > > Signed-off-by: Alan Stern Reviewed-by: Jonas Oberhauser > > --- > > tools/memory-model/linux-kernel.bell | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > Index: usb-devel/tools/memory-model/linux-kernel.bell > =================================================================== > --- usb-devel.orig/tools/memory-model/linux-kernel.bell > +++ usb-devel/tools/memory-model/linux-kernel.bell > @@ -53,8 +53,8 @@ let rcu-rscs = let rec > in matched > > (* Validate nesting *) > -flag ~empty Rcu-lock \ domain(rcu-rscs) as unbalanced-rcu-locking > -flag ~empty Rcu-unlock \ range(rcu-rscs) as unbalanced-rcu-locking > +flag ~empty Rcu-lock \ domain(rcu-rscs) as unmatched-rcu-lock > +flag ~empty Rcu-unlock \ range(rcu-rscs) as unmatched-rcu-unlock > > (* Compute matching pairs of nested Srcu-lock and Srcu-unlock *) > let srcu-rscs = let rec > @@ -69,14 +69,14 @@ let srcu-rscs = let rec > in matched > > (* Validate nesting *) > -flag ~empty Srcu-lock \ domain(srcu-rscs) as unbalanced-srcu-locking > -flag ~empty Srcu-unlock \ range(srcu-rscs) as unbalanced-srcu-locking > +flag ~empty Srcu-lock \ domain(srcu-rscs) as unmatched-srcu-lock > +flag ~empty Srcu-unlock \ range(srcu-rscs) as unmatched-srcu-unlock > > (* 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 > +flag ~empty different-values(srcu-rscs) as srcu-bad-value-match > > (* Compute marked and plain memory accesses *) > let Marked = (~M) | IW | Once | Release | Acquire | domain(rmw) | range(rmw) |