Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3282375rwb; Fri, 20 Jan 2023 13:52:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXu0ng2r/A12aw+YG62lGhb6dWHrVl4bVvFw9HSV4q5wsRcKzZr9MseQldeqRbaa3xZn5mwB X-Received: by 2002:a05:6402:d63:b0:49e:9711:3178 with SMTP id ec35-20020a0564020d6300b0049e97113178mr5626864edb.32.1674251570538; Fri, 20 Jan 2023 13:52:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674251570; cv=none; d=google.com; s=arc-20160816; b=S1hfmoSPTIUWrSfyfg24IgAtEHIMRh5hMIuIY1AmyKRJBPiiFSZy23O4k5/BDrAs9s s3QTS1i2DY1KBLC56V6Njxxri3Hc8HxFJGWiOFaBFDvyTLdAVNSzvyytu809RFDtE8I8 gEvthoQvkFvMp/ravJqjldQMj76yEtamikXOMhIWnaHPhEqM7MgLKdJh8NEznaiM91iK 7hMcQ1/GFDVSgySKtbWSpLCw6mm4em1Cc0s8SHCC+OPReg5Y6QA76as+I9CJiszKEQeM xCYwDaePsfRymQboE1JT8Z0Go7/UPyuZJ1C0dvLE3bicGMX53r9gJgZCgT5wT/BDkRwS 6/0g== 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:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=9FBOcSsRTGAwa6HMC5UA6lMun9q5BA954I+FMgujEB4=; b=AHy/IWWtI6EUYRpdpH7wuyrb20uB6ShCN/nsBKscGt44B1MgDx451AzIc6FApiG6Nw KygxGX+dASDMaYs+eBTNNuaErJdUoMf8w5KIbYwg737Yv41NggKY9Z59CkQgskKZAnOT 14SK5JBSH8UKJpCLo8ojHuc73m2Izy3CslgqXm3XnSfuezCzn9IVlm0pNxvWB/9aF+tS aywXk+7tsm0jPT7LZ5tLuMolJiaIGdZHB2QX4TzghRQ/qXfq2LZE2wm2tJqBgcki/pmM AvbDnABQUSnZJ6vc2IMui5xkCI+xXbtZGGKtjF/koVSuFKST20gOgw+6jAwOvWf3AQpj wiuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bCzYcAib; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y8-20020a056402358800b0048ba605a150si24649623edc.240.2023.01.20.13.52.36; Fri, 20 Jan 2023 13:52: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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bCzYcAib; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229852AbjATVUm (ORCPT + 50 others); Fri, 20 Jan 2023 16:20:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229841AbjATVUj (ORCPT ); Fri, 20 Jan 2023 16:20:39 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 869DBEC55 for ; Fri, 20 Jan 2023 13:20:38 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0B1E06206E for ; Fri, 20 Jan 2023 21:20:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BFACC433D2; Fri, 20 Jan 2023 21:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674249637; bh=Yxu3NixxZ7KMRl7/GU6VsDiA6y9qJyUXAeTFwB6h9AE=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=bCzYcAibNMBXoH+zslduhUl95fBz2cz8XU3iesveBrq02b4Jv1hpsQvnxi9cL40Xo Seu/NbzhVOJdgAYRf1GBBgRimP7JeJIud6weJDaCsIJgKmQyy7S+Hj+S6KSlggYPF6 dD1bj2PwXpHEzgssZ9OTsQbOd0aesJ2RlOnKxIbfvi2BPDsfNzErtMi9ueCFcJh8Oa SY1QS2PUpOuEDWImDtHzdCX8aJ9eOqsCB+s4VJat97YaaKq0a2PBz8YdMRCm+kLCW3 hXpNpM7LDxe7x+W8I12QwxK1BFvDflyqC4Z5rYuWabZZ54EKV4gXzVBzrXUUPoPyeF Zzu9HbeobaBLA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 117755C17DC; Fri, 20 Jan 2023 13:20:37 -0800 (PST) Date: Fri, 20 Jan 2023 13:20:37 -0800 From: "Paul E. McKenney" To: Alan Stern 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 Subject: Re: Internal vs. external barriers (was: Re: Interesting LKMM litmus test) Message-ID: <20230120212037.GW2948950@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20230118035041.GQ2948950@paulmck-ThinkPad-P17-Gen-1> <20230118200601.GH2948950@paulmck-ThinkPad-P17-Gen-1> <20230119000214.GM2948950@paulmck-ThinkPad-P17-Gen-1> <20230120175804.GN2948950@paulmck-ThinkPad-P17-Gen-1> <20230120192032.GR2948950@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Fri, Jan 20, 2023 at 03:36:24PM -0500, Alan Stern wrote: > On Fri, Jan 20, 2023 at 11:20:32AM -0800, Paul E. McKenney wrote: > > On Fri, Jan 20, 2023 at 01:37:51PM -0500, Alan Stern wrote: > > > srcu_read_unlock() does not need a full smp_mb(). > > > > That is quite possible, and that is what we are looking into. And testing > > thus far agrees with you. But the grace-period ordering constraints > > are quite severe, so this requires careful checking and severe testing. > > If you're interested, I can provide a simple argument to show that the > Fundamental Law of RCU would continue to hold with only a release fence. > There is an added requirement: merely that synchronize_srcu() must have > an smp_mb() somewhere after its final read of the unlock counters -- > which your version of the algorithm already has. Please! For your amusement, here is a very informal argument that this is the case: https://docs.google.com/document/d/1xvwQzavmH474MBPAIBqVyvCrCcS5j2BpqhErPhRj7Is/edit?usp=sharing See the "Read-Side Optimizations" section at the end. Thanx, Paul