Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp496500rwn; Thu, 15 Sep 2022 01:52:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Ncd0Am8qDoxrqd1IY8CtZqh7oUP6EsiquinDgqcv9/RFU14tPDhoCuUMcfUhJ/E0PJHND X-Received: by 2002:a05:6a00:1346:b0:546:ff1e:26ae with SMTP id k6-20020a056a00134600b00546ff1e26aemr9494691pfu.45.1663231926346; Thu, 15 Sep 2022 01:52:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663231926; cv=none; d=google.com; s=arc-20160816; b=bdLC5sjuDXWV6EMu2ufPqlYdE3C95PhHV1MuAPf5REVuCsZTDcwRDuLOCMDhYr/FZC wPdnmu/6CdDYJSpzdeWaG4GclWsF0NZvResmKNpNvWFsP71+tGOSGNC0uNLEHW1yRrS/ VlafcYdsQLz9tiAKfoXadFTWMkUuXBBYjUsOwteUrodz+Rvziv1+ltRjB96BF0JzbIhC gl1qkcnVqXT0QmGOHDNJpk2ZSCI3eA+ORS1/Useg3r+PLpT6Uhw8cS/HDYEZPTnTY/ZT CckpwpEaNmzW6BmlLgrsKPhi0k7Z5/fgnK/AbijauRhytH3SKIjsJk5dnoclkUR79ayD F23A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=byClg82A0KaCb5Ew/JsomAusUt5TBcsIZQADQgPYL0Q=; b=ro54g6YoAuyev85r/6R/ispFYHwXIYoG1iNnoHz8YuR5ec5QAooEbBUJO+VgC5WOLT hcWPzxi8LMKkHXD4Va44KNPlJR4IrUl1VIeGuROTe0u3q64D8DK/+e1XzFWP0WHSWl0D l4S8q9hVtwg6HkkITso00N+f1Bi09a6MzkNJDcjU4RX+zZbwkX098yNdART009SFCHRK 6G2qk3WyAGyoSQOJamLi2n77Ryc2nFNM6RSlhsnHkf3/W5mtC/XcT6lKPGTsa79ww78o srP92tecO+w/rhFbPrZY1gPWeGYcvJoO7OxVo+t3+26xr2jDfk5Iu3GEpMkgZWyxeWhy /l6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=PW6ug7e0; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w185-20020a6382c2000000b0040d287c145fsi17812486pgd.460.2022.09.15.01.51.53; Thu, 15 Sep 2022 01:52:06 -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=@infradead.org header.s=desiato.20200630 header.b=PW6ug7e0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229458AbiIOIjk (ORCPT + 99 others); Thu, 15 Sep 2022 04:39:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229639AbiIOIjf (ORCPT ); Thu, 15 Sep 2022 04:39:35 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8BB821B6 for ; Thu, 15 Sep 2022 01:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=byClg82A0KaCb5Ew/JsomAusUt5TBcsIZQADQgPYL0Q=; b=PW6ug7e0p9Li8Aoa1U9oMu+tXC bAgLZpNd0rIFUSxBW1VpH9diaOymd8heNgfKLLXQ/JIjRVJajMi4j8IOYqqmTTnQj7L157qGFbCzQ P3pzrUg8ZeztogVWTaih9LiAxnP9b1nfGp3xU9E3MRlxthWS/AD6CkHq0zBba/NNGvCE2EwMqSpsq QygQzlk0+LZkQjlIUN1nwI0v9fGhUO3wWq6iL2diz0KyyqW1Gb5/JmTZG6rdCaTV9Yx0yByECUEkI ggUpnqVV0LZ+ghDUC2kZb7GJ0yh8U4p/bpdKUrOPymdzQU/2DUFxV1s14cGWEE8xGoLadaF6SWr60 K4TYGtsw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYkOv-00CYPd-JJ; Thu, 15 Sep 2022 08:39:14 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 4F68F30010B; Thu, 15 Sep 2022 10:39:12 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 2EECF2BA39EB3; Thu, 15 Sep 2022 10:39:12 +0200 (CEST) Date: Thu, 15 Sep 2022 10:39:12 +0200 From: Peter Zijlstra To: Joel Fernandes , Paul McKenney , Frederic Weisbecker , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Boqun Feng , "Rafael J. Wysocki" Subject: RCU vs NOHZ Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 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. 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.