Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3700544rwb; Mon, 16 Jan 2023 11:37:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXviyKci9IwFyQSg5tCXPclAPHLNXqUnfPgXRKFXgErNBZf0M/rGXVmtN8igge4xXhkPPE0V X-Received: by 2002:a17:90a:3886:b0:229:65e3:7877 with SMTP id x6-20020a17090a388600b0022965e37877mr483111pjb.2.1673897860369; Mon, 16 Jan 2023 11:37:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673897860; cv=none; d=google.com; s=arc-20160816; b=hPtDCkUnNmRrsZ73bPYHBKjUyLU22whhqjgYOF2N1F5eUAAnr49fymnzfnMH13/iHa 5KIwX/rKPtdteCXwbtKEwPuEplE0pUE0oEyalESeIy67fjiM6jGar36EBKqNBGtcE6px sV/+HeonTigw6zh3AAb1NPpFqFyr1YFms13a4H/9i0CRwLmtlHTLv/nQQWzJH8CGcVz+ xzlgdthKQMP9Kh2ImuSS5+zGuJV8rxsK5WssFuCYnYEEsYKWj9aycrQjK7QOsa1tAtn4 5LxfCzOXBK2juS/ulLZAmbfkroE0jkD1gJb5cxBzR9CFUMzZNRyld7lYnqLsLJsCxEse VBXg== 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=uS70rhU88HJFrPO52bhKttSHDAccLwCGpq/UJ6j1fA4=; b=GGpPZvs4q8osaN/siklWR5tPgCazUDfTxVUn8WSfR27GhA1n41YsAU2dzBN2jKKkdY WrZu8VbCPic1nlIFZRHvNfxFQIa33X0viWw6uufn4kwcf9/9impJC7PLn9f/Xa8nTS3N 2Ei1+kwQRAF2jdcu9GrHXBmjuSVP3xxM2dlPfl//exFs0yqMXKGQZMEeedMT3xbo17Tp QiZ4ZmYT3v4fvpS2mtQpSZHX/mdY30w2W4Jvy+mxXU5uZs0/zCVCwSEsr/WQ4zBOhK8I OIVQRbxacnXQF3d/HVwBy1D96CCMUrbxpwdSzbsbNan6ZT5bbx4xIRMR2Q5zKfAjzh4w 2Idg== 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 lk17-20020a17090b33d100b002293f258df4si6302713pjb.173.2023.01.16.11.37.34; Mon, 16 Jan 2023 11:37:40 -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 S232181AbjAPSZC (ORCPT + 50 others); Mon, 16 Jan 2023 13:25:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232411AbjAPSYX (ORCPT ); Mon, 16 Jan 2023 13:24:23 -0500 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 781EB13D72 for ; Mon, 16 Jan 2023 10:11:42 -0800 (PST) Received: (qmail 135386 invoked by uid 1000); 16 Jan 2023 13:11:41 -0500 Date: Mon, 16 Jan 2023 13:11:41 -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: <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> <20230115181052.GJ2948950@paulmck-ThinkPad-P17-Gen-1> <20230116042329.GN2948950@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230116042329.GN2948950@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 Sun, Jan 15, 2023 at 08:23:29PM -0800, Paul E. McKenney wrote: > On Sun, Jan 15, 2023 at 03:46:10PM -0500, Alan Stern wrote: > > On Sun, Jan 15, 2023 at 10:10:52AM -0800, Paul E. McKenney wrote: > > > On Sun, Jan 15, 2023 at 11:23:31AM -0500, Alan Stern wrote: > > > > On Sat, Jan 14, 2023 at 09:15:10PM -0800, Paul E. McKenney wrote: > > > > > 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. > > > > > > It looks like we need something that tracks (data | rf)* between > > > the return value of srcu_read_lock() and the second parameter of > > > srcu_read_unlock(). The reason for rf rather than rfi is the upcoming > > > srcu_down_read() and srcu_up_read(). > > > > Or just make herd treat srcu_read_lock(s) as an annotated equivalent of > > READ_ONCE(&s) and srcu_read_unlock(s, v) as an annotated equivalent of > > WRITE_ONCE(s, v). But with some special accomodation to avoid > > interaction with the new carry-dep relation. > > This is a modification to herd7 you are suggesting? Otherwise, I am > suffering a failure of imagination on how to properly sort it from the > other READ_ONCE() and WRITE_ONCE() instances. srcu_read_lock and srcu_read_unlock events would be distinguished from other marked loads and stores by belonging to the Srcu-lock and Srcu-unlock sets. But I don't know whether this result can be accomplished just by modifying the .def file -- it might require changes to herd7. (In fact, as far as I know there is no documentation at all for the double-underscore operations used in linux-kernel.def. Hint hint!) As mentioned earlier, we should ask Luc or Boqun. > > > Or is there some better intermediate position that could be taken? > > > > Do you mean go back to the current linux-kernel.bell? The code you > > wrote above is different, since it prohibits nesting. > > Not to the current linux-kernel.bell, but, as you say, making the change > to obtain a better approximation by prohibiting nesting. Why do you want to prohibit nesting? Why would that be a better approximation? Alan