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 7E484C25B4E for ; Fri, 20 Jan 2023 16:18:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229668AbjATQSb (ORCPT ); Fri, 20 Jan 2023 11:18:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbjATQS3 (ORCPT ); Fri, 20 Jan 2023 11:18:29 -0500 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 2F1FE7CCF6 for ; Fri, 20 Jan 2023 08:18:06 -0800 (PST) Received: (qmail 38184 invoked by uid 1000); 20 Jan 2023 11:18:03 -0500 Date: Fri, 20 Jan 2023 11:18:03 -0500 From: Alan Stern To: Jonas Oberhauser Cc: paulmck@kernel.org, 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: <3dabbcfb-858c-6aa0-6824-05b8cc8e9cdb@gmail.com> <20230118201918.GI2948950@paulmck-ThinkPad-P17-Gen-1> <20230118211201.GL2948950@paulmck-ThinkPad-P17-Gen-1> <09f084d2-6128-7f83-b2a5-cbe236b1678d@huaweicloud.com> <20230119001147.GN2948950@paulmck-ThinkPad-P17-Gen-1> <0fae983b-2a7c-d44e-8881-53d5cc053f09@huaweicloud.com> <20230119184107.GT2948950@paulmck-ThinkPad-P17-Gen-1> <64b48a7b-624c-26bd-be9b-0522fc490b28@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <64b48a7b-624c-26bd-be9b-0522fc490b28@huaweicloud.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 20, 2023 at 11:13:00AM +0100, Jonas Oberhauser wrote: > Perhaps we could say that reading an index without using it later is > forbidden? > > flag ~empty [Srcu-lock];data;rf;[~ domain(data;[Srcu-unlock])] as > thrown-srcu-cookie-on-floor We already flag locks that don't have a matching unlock. I don't see any point in worrying about whatever else happens to the index. > So if there is an srcu_down() that produces a cookie that is read by some > read R, and R doesn't then pass that value into an srcu_up(), the > srcu-warranty is voided. No, it isn't. As long as the value is passed to exactly one srcu_up_read(), it doesn't much matter what else you do with it. Alan