Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2515169rwn; Fri, 16 Sep 2022 11:27:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5aLZ9uG9qNKWK7j6sHkTx5G0K8P5Sk1V0xvhwZ2N0aWWJ75jYbYuswdSM2or3+mGyeLGv0 X-Received: by 2002:a17:903:1cc:b0:178:44cd:e9e with SMTP id e12-20020a17090301cc00b0017844cd0e9emr1102714plh.158.1663352862204; Fri, 16 Sep 2022 11:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663352862; cv=none; d=google.com; s=arc-20160816; b=ab3wQZrVsyfDX37ISUKdoISmmurCmSFYQHngk3LMq+IDoulVC/H/78qvueyXHLQ18q fBRwxG4ZJ/BVBvwcVouSq+25HRhM/laWaTTbw6JJVihvqEEwm5TvKvkDNi6oT5jsOUjN B3GzLczWwAaCPgkG8xP/F0rT9NtPfbT8ZIk7VatemKL8pIzsvdyHmIsgoimY9XsfYo2D i+MF+ps4a6qbkCIBmVhdwBt6D8fqCvchFUZ8Uu5bEf9jfJzB1H88/zuydreuirmwibLr 56WMqrwOfxDTyO/ENHMDxrzHgHhdPdLzKaPw1q94C0tpIvgU9nxv5EXVHxXOHvwsIpkm lh+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=MqXEURyLnpmL3G43dGeg3N/8zDnGsAGL3mOe1kcuvho=; b=oGyO7GoE+irunl8/xDlVkcwAbgU4z6Ixajg6sIb2wE3aDqAPDIY44o9bqj6BUyUXw6 oDn27riQlN/fgvaOwq8/quT1UzYKpG+KlTQKy3UvVGxMRAwlXxxBbAyyCDm056pHp7/K jtEfhzKZdReqz8cZrA4g7q8Vbm9dE/MlTKEfyQ+YtK+qkJMssIuzpaSIcrBLxkgDzxOX 2Q3tDoafSOv6IDuvG2+zG/q4x+SVfvLMBNdnp34geKgRoyElIvporu9oBxe2i086pBgs /KPCGn7NnMFMOpbt3JqBvf/bHRhpg2mN3MpbVXQ65hfM7UEm+Eh+upIi1YJlTVJ0w3LX +GXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=CLz9mygk; 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 q25-20020aa79839000000b0052eb81ff734si20673863pfl.113.2022.09.16.11.27.31; Fri, 16 Sep 2022 11:27:42 -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=@joelfernandes.org header.s=google header.b=CLz9mygk; 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 S229510AbiIPSL0 (ORCPT + 99 others); Fri, 16 Sep 2022 14:11:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbiIPSLX (ORCPT ); Fri, 16 Sep 2022 14:11:23 -0400 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24641AB184 for ; Fri, 16 Sep 2022 11:11:23 -0700 (PDT) Received: by mail-io1-xd29.google.com with SMTP id h194so16316532iof.4 for ; Fri, 16 Sep 2022 11:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date; bh=MqXEURyLnpmL3G43dGeg3N/8zDnGsAGL3mOe1kcuvho=; b=CLz9mygkk22dS6Zysvq67YjGUob2U2cPE9UZq2PGUL07eySSV82cgbacNTFBHiKehc 03zux8CUm/9XDwT8g5lbrTOSt/uLOTn8VlBOvMWYOIpjrsl5CZF9LQiOoR2juWxYj8g6 c2CktvmHV6bzcNOl+ra684/vT0uWo5P+AI1A0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=MqXEURyLnpmL3G43dGeg3N/8zDnGsAGL3mOe1kcuvho=; b=Ff1OBmxNBa7Dz3JqZbky4ubjPiIQueO+ijl7hGB6+SyvXuE8oZS8pznq2F10OQbQPN M8N0fUkokX/Y2mX9bIbyD2vQBn27F6d13t4+iIK+HbkBn0Ja2Y8Zv+BZIHz02N/dWGiC 50B3K9apzvZFlv73lA4wYW2Flfk659rU/SMYdOcCZiPlWo4kYpKqZfcYtT2i/7Hto4Tv unVbEyulEbGAw9SfXHDwOHsiXzgs4kk+Z6tN3vMxv5WA3ApteVn0i0621gZ2BFIzd6zf HmGmh8Qxo/AxmA+MUjV0peQy0lAPwHFlWf2namheMvCdqJLk671aVqQmiS970FIPiDsD kQXg== X-Gm-Message-State: ACrzQf20Aao8nYuSgObax9LMI0l2uNS8oVcUeZEhBj6bJq31l3juxRcL dF8zbmnRLk+uCmcJE/Q5Q0HAF8V5umQEWtyw1QPEoA== X-Received: by 2002:a05:6638:2391:b0:35a:19da:f05f with SMTP id q17-20020a056638239100b0035a19daf05fmr3064144jat.232.1663351882449; Fri, 16 Sep 2022 11:11:22 -0700 (PDT) MIME-Version: 1.0 References: <20220915160600.GA246308@paulmck-ThinkPad-P17-Gen-1> <20220915191427.GC246308@paulmck-ThinkPad-P17-Gen-1> <20220916075817.GE246308@paulmck-ThinkPad-P17-Gen-1> In-Reply-To: From: Joel Fernandes Date: Fri, 16 Sep 2022 14:11:10 -0400 Message-ID: Subject: Re: RCU vs NOHZ To: Peter Zijlstra Cc: Boqun Feng , Frederic Weisbecker , "Paul E. McKenney" , "Rafael J. Wysocki" , Thomas Gleixner , LKML , Steven Rostedt Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLACK autolearn=no 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 Peter, On Fri, Sep 16, 2022 at 5:20 AM Peter Zijlstra wrote= : [...] > > It wasn't enabled for ChromeOS. > > > > When fully enabled, it gave them the energy-efficiency advantages Joel > > described. And then Joel described some additional call_rcu_lazy() > > changes that provided even better energy efficiency. Though I believe > > that the application should also be changed to avoid incessantly openin= g > > and closing that file while the device is idle, as this would remove > > -all- RCU work when nearly idle. But some of the other call_rcu_lazy() > > use cases would likely remain. > > So I'm thinking the scheme I outlined gets you most if not all of what > lazy would get you without having to add the lazy thing. A CPU is never > refused deep idle when it passes off the callbacks. > > The NOHZ thing is a nice hook for 'this-cpu-wants-to-go-idle-long-term' > and do our utmost bestest to move work away from it. You *want* to break > affinity at this point. > > If you hate on the global, push it to a per rcu_node offload list until > the whole node is idle and then push it up the next rcu_node level until > you reach the top. > > Then when the top rcu_node is full idle; you can insta progress the QS > state and run the callbacks and go idle. In my opinion the speed brakes have to be applied before the GP and other threads are even awakened. The issue Android and ChromeOS observe is that even a single CB queued every few jiffies can cause work that can be otherwise delayed / batched, to be scheduled in. I am not sure if your suggestions above address that. Does it? Try this experiment on your ADL system (for fun). Boot to the login screen on any distro, and before logging in, run turbostat over ssh and observe PC8 percent residencies. Now increase jiffies_till_first_fqs boot parameter value to 64 or so and try again. You may be surprised how much PC8 percent increases by delaying RCU and batching callbacks (via jiffies boot option) Admittedly this is more amplified on ADL because of package-C-states, firmware and what not, and isn=E2=80=99t as much a problem on Android; but still gives a nice power improvement there. thanks, - Joel