Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1593559rwb; Thu, 19 Jan 2023 12:45:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXsoC+gqaKJAWZlYnTNlm4XMFi4I02E7R5gW8eLRqtS7Rhpq5oEGpYUvbehB5vlqXg59/hdt X-Received: by 2002:a05:6a21:3a96:b0:b8:60b3:82e3 with SMTP id zv22-20020a056a213a9600b000b860b382e3mr14057308pzb.46.1674161153457; Thu, 19 Jan 2023 12:45:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674161153; cv=none; d=google.com; s=arc-20160816; b=tZHOZ91r99WzrlMkMHCI7Xksc2HgCb6yjFGgJGiO8eloZEaF6vFpDUxoVARuytEFSw PPQ5SQVe91eig1E+5bVmOC3gG1XkSgORDUYU9xhmvhYG0HtnQkadRDGGf3Tew2enrv/D xAhI1SK1WC5DLih9P3SKFph9KnYyNvM3ocIiKfMW08vG1CO9hKRuJwaPh59fTvV3Osmk a2VSNqyWhWe36mZmKKAbPkMAG538x4M2tJyItIvxI1w/bhy0lxvqFN9plMv0p4/a6Nr9 sN3ZgWB0/FbqBPLnmgEZqUdWg1HbZ6Nclw+WjOh4MxtR08YVHNjmm9BT4DVUL3SAMJRo dFhQ== 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=zhF+WZx++/mK1TmdqArqDMJ89ayO5ftoWrWKnJUTqws=; b=th4gWTA/04Ujyc3fTVMix2mQL5qPGHlvXCnk0ZyBpmP69njscpMCAbbpPPlOl2QFoN ahmfd/jmtu9V89Rh33i/GrH86xzjqjfrYeIY66s4fLJMtbGU478Qwni56X01azV8c7IQ pG90TgKCMqLmI2JhudAo5+gIP66hHZ5fccjSKW0aYP4kFBuPqBs6reQGWvBerWEgR11u UbF67zTdo/pEYhNS4+ETI8HYpzQ6DOnyA+3tDYxBoT6qPihkZCGYAXB7j4QhAiLbRzuK +EuXMVfaVNzrXPyoby2saMhutOxsy43t2AGcw02cpj3SOPu5yAoM7FeGwskRg0WwrOhY WP0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oH8xbdsz; 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 c5-20020a6566c5000000b004c494c3e40dsi18869615pgw.202.2023.01.19.12.45.48; Thu, 19 Jan 2023 12:45:53 -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=oH8xbdsz; 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 S230095AbjASTKN (ORCPT + 46 others); Thu, 19 Jan 2023 14:10:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231290AbjASTJx (ORCPT ); Thu, 19 Jan 2023 14:09:53 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24C059CB98 for ; Thu, 19 Jan 2023 11:08:47 -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 CE09B61D59 for ; Thu, 19 Jan 2023 19:07:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37856C433D2; Thu, 19 Jan 2023 19:07:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674155273; bh=4K8ATPiykEqbx0orM4yhOUMVCu1RqqdR/qxce393rac=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=oH8xbdszEZsfZwd0jR2XApauY4+/igyhmFqzxEpbWUskxvttGb/bxgrcksG7SGR28 JSY1YtEap1IwEdKJ4Ud/5WmTsfWRlSD/uEunKD4mQPXwAT5A1be97Ls8G9WFKkWj3g nE6r4/JRWM3bx4gLPknKaqMi0PigdsQeKUhvdJLgi4cQqkXXhoeellZjJoKNSMGwyw 9e1K9c68QY7/FWYow4jmFkx3Db3oWbfGdHt/kmRRT9KRBFyp9uKm4YVRpWrC/H0K6D 8J4BUYXRoCXq8WofqaYDGTVMN3YCzPQ44n/50RedU5/qOcLW/b/M/1dRVy9PouIPpD qFDMlTeo94LsQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id D45C25C1A49; Thu, 19 Jan 2023 11:07:52 -0800 (PST) Date: Thu, 19 Jan 2023 11:07:52 -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: <20230119190752.GA932071@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20230116221357.GA2948950@paulmck-ThinkPad-P17-Gen-1> <20230117151416.GI2948950@paulmck-ThinkPad-P17-Gen-1> <20230117174308.GK2948950@paulmck-ThinkPad-P17-Gen-1> <20230118051704.GX2948950@paulmck-ThinkPad-P17-Gen-1> <20230118174138.GB2948950@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230118174138.GB2948950@paulmck-ThinkPad-P17-Gen-1> 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 Wed, Jan 18, 2023 at 09:41:38AM -0800, Paul E. McKenney wrote: > On Wed, Jan 18, 2023 at 11:03:35AM -0500, Alan Stern wrote: > > On Tue, Jan 17, 2023 at 09:17:04PM -0800, Paul E. McKenney wrote: > > > On Tue, Jan 17, 2023 at 09:15:15PM -0500, Alan Stern wrote: > > > > Maybe we don't. Please test the patch below; I think it will do what > > > > you want -- and it doesn't rule out nesting. > > > > > > It works like a champ on manual/kernel/C-srcu*.litmus in the litmus > > > repository on github, good show and thank you!!! > > > > > > I will make more tests, and am checking this against the rest of the > > > litmus tests in the repo, but in the meantime would you be willing to > > > have me add your Signed-off-by? > > > > I'll email a real patch submission in the not-too-distant future, > > assuming you don't find any problems with the new code. > > Sounds good! > > The current state is that last night's testing found a difference only > for C-srcu-nest-5.litmus, in which case your version gives the correct > answer and mainline is wrong. There were a couple of broken tests, which > I fixed and a test involving spin_unlock_wait(), which is at this point > perma-broken due to the Linux kernel no longer having such a thing. > (Other than its re-introduction into i915, but they define it as a > spin_lock_irq() followed by a spin_unlock_irq(), so why worry?) > There were also a few timeouts. > > I intend to run the longer tests overnight. Except that I had an episode of pilot error. :-/ But here are a couple of litmus tests illustrating how SRCU read-side critical sections do not flatten/fuse the way that RCU read-side critical sections do. Why the difference? Because such a Linux-kernel SRCU implementation would require additional storage of the order (T * S), where T is the number of tasks and S is the number of srcu_struct structures. That just won't be happening. Here they are, and both behave the way that I would expect given your unofficial patch: https://github.com/paulmckrcu/litmus/blob/master/manual/kernel/C-srcu-nest-7.litmus https://github.com/paulmckrcu/litmus/blob/master/manual/kernel/C-srcu-nest-8.litmus Whew! ;-) Thanx, Paul