Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1242681rwn; Thu, 15 Sep 2022 12:34:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM45MWONHmNFutDyz59lregsGNLZEBNJhli3OUGrbsOK7N3OfffGzQr38rCOeiDUgkSIaLdk X-Received: by 2002:a17:907:25c7:b0:77b:c193:9230 with SMTP id ae7-20020a17090725c700b0077bc1939230mr1018584ejc.316.1663270479008; Thu, 15 Sep 2022 12:34:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663270479; cv=none; d=google.com; s=arc-20160816; b=YkDxpIgljNDAuvxRywnauV/RnofHT/1z5oyWUqj1HCGwdvTRz/UsgEiEc1kuh6BLpL xmPSREdnunpuuDgbRSU0ojmV5bCbUu+cQIyk5dKOjoUZ+BuIrhJmOnBNaVNUID1xEMgX 7iv/ENEnn7t2Cz1fAmhCudc+pfe0/m4KLGYrpfuqPJS8/52EI/qgXz5DWBB5wZ6Mj4m8 sp0ltNaCZtEZ77QIXMBo9F3WhXXOy8/fx1VVCdnm85fVsbAGPkJlNBqbl2Ue57cl7fw5 RwXaLT8hma6z90miEO/GNGzNaMDjahpBxYdUpworYNa9/CJJntCgtmDdg6AnkU2BG7eA 9AFg== 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=FvHKiovfF3UJGLuMaewnGnBn9WDZPNN/e22zBbZJ4wM=; b=cULjnA6UOAWQhwzC2iayq1G67SeYx3FTsLSoV0XTW7HbWo4p0VELxJ57GI5XoIG5N1 n/oEk+BNcikLoiIjsoa4RnvcFn5lMuk8Wuuyd0MccVfpmPuxOu7fDSi8zTltdUSeJ/9P p9XnG+efA8RUNMi9mfjaIQ0TRap97zbkmO0bJ027wa/ajH5j6V7uCzM+4vxSRoi1dYDn 0/fxNIQz+s9iuTP2OtOHzCjgVyXAa8gL2GNW1OY6G0ikCoz07J+TsQi8rvLCLjKkUEJO BP3Gn3ehEGdaD2BqR7sfiTYBD/EH44et2sdhAOikXnsO87QL6eul+KbyFutjqHzS01zt WPgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IRITagIr; 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 fj4-20020a1709069c8400b0074084f48b41si16511673ejc.998.2022.09.15.12.34.12; Thu, 15 Sep 2022 12:34:38 -0700 (PDT) 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=IRITagIr; 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 S229588AbiIOTOf (ORCPT + 99 others); Thu, 15 Sep 2022 15:14:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbiIOTOd (ORCPT ); Thu, 15 Sep 2022 15:14:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF5B338B7 for ; Thu, 15 Sep 2022 12:14:31 -0700 (PDT) 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 5B43162606 for ; Thu, 15 Sep 2022 19:14:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9928AC433C1; Thu, 15 Sep 2022 19:14:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663269270; bh=WBaqoHDdcpouRpoCaSc0AG1+mQ7IZwfb6q0ZwdI4vUs=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=IRITagIraYaUMxE8qCEcTmpgycz6kbftTksamGg+h6luZn2z62LAGTpuoCz617P8Z /ahkNdbjKI8+fhh7QtWcz9EolnkrHt3E0HT4baEn/EPeEWIu9JHM+COuysdr/t3n4i 8sJ6DscGc6CiywAtcMx+6Ujplc95CNoqx8iWbC2nQzbMfJhuyjGATT8BsRUngLWgfK P54mPrNVq+RqFOadhk6Pvt10F0nTi18rcmI1pzrlY80HPSezSQlXxH1sWmZgj9NMSJ gcSoxuX1vpCqvhHMUvVF4Jai0/NtPuW14qikO/qZkVquhpnrbZvJUtgoauLg5X5KIg 2Mzo6cwOh+lBA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id DCEFC5C0514; Thu, 15 Sep 2022 12:14:27 -0700 (PDT) Date: Thu, 15 Sep 2022 12:14:27 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Joel Fernandes , Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org, Boqun Feng , "Rafael J. Wysocki" Subject: Re: RCU vs NOHZ Message-ID: <20220915191427.GC246308@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20220915160600.GA246308@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 Thu, Sep 15, 2022 at 08:50:44PM +0200, Peter Zijlstra wrote: > On Thu, Sep 15, 2022 at 09:06:00AM -0700, Paul E. McKenney wrote: > > On Thu, Sep 15, 2022 at 10:39:12AM +0200, Peter Zijlstra wrote: > > > Hi, > > > > > > After watching Joel's talk about RCU and idle ticks I was wondering > > > about why RCU doesn't have NOHZ hooks -- that is regular NOHZ, not the > > > NOHZ_FULL stuff. > > > > It actually does, but they have recently moved into the context-tracking > > code, courtesy of Frederic's recent patch series. > > afair that's idle and that is not nohz. For nohz_full CPUs, it does both. > > > These deep idle states are only feasible during NOHZ idle, and the NOHZ > > > path is already relatively expensive (which is offset by then mostly > > > staying idle for a long while). > > > > > > Specifically my thinking was that when a CPU goes NOHZ it can splice > > > it's callback list onto a global list (cmpxchg), and then the > > > jiffy-updater CPU can look at and consume this global list (xchg). > > > > > > Before you say... but globals suck (they do), NOHZ already has a fair > > > amount of global state, and as said before, it's offset by the CPU then > > > staying idle for a fair while. If there is heavy contention on the NOHZ > > > data, the idle governor is doing a bad job by selecting deep idle states > > > whilst we're not actually idle for long. > > > > > > The above would remove the reason for RCU to inhibit NOHZ. > > > > > > > > > Additionally; when the very last CPU goes idle (I think we know this > > > somewhere, but I can't reaily remember where) we can insta-advance the > > > QS machinery and run the callbacks before going (NOHZ) idle. > > > > > > > > > Is there a reason this couldn't work? To me this seems like a much > > > simpler solution than the whole rcu-cb thing. > > > > To restate Joel's reply a bit... > > > > Maybe. > > > > Except that we need rcu_nocbs anyway for low latency and HPC applications. > > Given that we have it, and given that it totally eliminates RCU-induced > > idle ticks, how would it help to add cmpxchg-based global offloading? > > Because that nocb stuff isn't default enabled? Last I checked, both RHEL and Fedora were built with CONFIG_RCU_NOCB_CPU=y. And I checked Fedora just now. Or am I missing your point? Thanx, Paul