From mboxrd@z Thu Jan 1 00:00:00 1970 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 60B22C25B50 for ; Fri, 20 Jan 2023 20:36:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229649AbjATUg2 (ORCPT ); Fri, 20 Jan 2023 15:36:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbjATUg0 (ORCPT ); Fri, 20 Jan 2023 15:36:26 -0500 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id DC600891F7 for ; Fri, 20 Jan 2023 12:36:24 -0800 (PST) Received: (qmail 47262 invoked by uid 1000); 20 Jan 2023 15:36:24 -0500 Date: Fri, 20 Jan 2023 15:36:24 -0500 From: Alan Stern To: "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 Subject: Re: Internal vs. external barriers (was: Re: Interesting LKMM litmus test) Message-ID: 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: <20230120192032.GR2948950@paulmck-ThinkPad-P17-Gen-1> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Alan