Message ID | 4511619.LvFx2qVVIh@kreacher |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp2912945vqg; Tue, 1 Aug 2023 13:21:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlGYWQD3Zhc3ZUWqPsKUrNXnYOIS3aGTQ5Y8ERa12+Q8ooSYedFoqTWj53Y784SLT4Y6d6CF X-Received: by 2002:a05:6808:150d:b0:3a7:3988:87ee with SMTP id u13-20020a056808150d00b003a7398887eemr7419736oiw.58.1690921271730; Tue, 01 Aug 2023 13:21:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690921271; cv=none; d=google.com; s=arc-20160816; b=mrE0/FIC/q85ev2UekuS8kJv1GKz5qRzCyjC95Z1iUra0X0m2UX+LBKQ6xllVm92HS Pmn3vnMxz1Hpnv606Z/ZoRBiMUyNdqbOCbiWsEs2x3MX1H1+fvn6j0KCJ/yJSKmq4XPu FBXOtWh2KS86q2iBqFEBLgCzIADBqNpZ+CBbS4dEOUpnHtK5KR2MQf9zH27fBtoo6kmH OtjY91U4hKOn9ft4IkCDkvIBGM8VwWauc2g8opzSKynC8y9Znx+0P48ERZN+UuBEp6nk JZl5f2d/scPIu7+DnJfUcoAwMH76RgLyil5ISNvuAehREvlk5ZhC/OvV1lPwinnQFFn+ J4aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Qw60mH27Vw82wQWnmWQuEGPBWj63KnGH7uHbL6UntqE=; fh=Af0TSsBJ/1V9PzWEqlGZQbe4W93rH3tFDb8nZ2DwyAk=; b=VZkdOaKk3enoAr2n21iShT45PGF/L8Y6mMI00A265mTfBiK3h6+fLfaF1b4cl4Y3vi NQx2x0GMEMXXLSkf+iSVksavKCQQtkY2g4XZqQcNLyYNzdDXmdrW9hlVmbgayo6tVkgE u+f8eHVz30Z+L1BNi20f40Ca5vp3CAEoA+8iqTw+BVGQNJUC/SIdPA2zwH0uITLkqrS7 y8aIRnq8VgHcAceO/AbTCP4BxWW0p6wPGRbQFpM3h/xexrrbUz0Ia/uVb6xb5UQh0+oy ueLRw+Ltj8pfAkwjkB+SlBipDwCnoyL3opGtthkDKkiByvyYxl29yb1yHdQK9CpJodOB iU7g== ARC-Authentication-Results: i=1; mx.google.com; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t33-20020a634461000000b00563b0cbe802si2067071pgk.109.2023.08.01.13.20.55; Tue, 01 Aug 2023 13:21:11 -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; 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 S232569AbjHATlT (ORCPT <rfc822;dengxinlin2429@gmail.com> + 99 others); Tue, 1 Aug 2023 15:41:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229880AbjHATlQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 1 Aug 2023 15:41:16 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C4F61FF3; Tue, 1 Aug 2023 12:41:14 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.2.0) id 9a48f1ec80921127; Tue, 1 Aug 2023 21:41:12 +0200 Authentication-Results: v370.home.net.pl; spf=softfail (domain owner discourages use of this host) smtp.mailfrom=rjwysocki.net (client-ip=195.136.19.94; helo=[195.136.19.94]; envelope-from=rjw@rjwysocki.net; receiver=<UNKNOWN>) Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 365E16621DD; Tue, 1 Aug 2023 21:41:12 +0200 (CEST) From: "Rafael J. Wysocki" <rjw@rjwysocki.net> To: Linux PM <linux-pm@vger.kernel.org>, Peter Zijlstra <peterz@infradead.org>, Anna-Maria Behnsen <anna-maria@linutronix.de> Cc: LKML <linux-kernel@vger.kernel.org>, Frederic Weisbecker <frederic@kernel.org>, Kajetan Puchalski <kajetan.puchalski@arm.com> Subject: [RFC/RFT][PATCH v1 0/2] cpuidle: teo: Do not check timers unconditionally every time Date: Tue, 01 Aug 2023 21:35:15 +0200 Message-ID: <4511619.LvFx2qVVIh@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedviedrjeeigddufeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepgeffhfdujeelhfdtgeffkeetudfhtefhhfeiteethfekvefgvdfgfeeikeeigfehnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeeipdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepphgvthgvrhiisehinhhfrhgruggvrggurdhorhhgpdhrtghpthhtoheprghnnhgrqdhmrghrihgrsehlihhnuhhtrhhonhhigidruggvpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhn vghlrdhorhhgpdhrtghpthhtohepfhhrvgguvghrihgtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkrghjvghtrghnrdhpuhgthhgrlhhskhhisegrrhhmrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773059463303924936 X-GMAIL-MSGID: 1773059463303924936 |
Series |
cpuidle: teo: Do not check timers unconditionally every time
|
|
Message
Rafael J. Wysocki
Aug. 1, 2023, 7:35 p.m. UTC
Hi Folks, This is on top of the fixes series posted previously: https://lore.kernel.org/linux-pm/4515817.LvFx2qVVIh@kreacher/ (I'll put it all into one git branch tomorrow). I started to play with the idea described here https://lore.kernel.org/linux-pm/CAJZ5v0hQh2Pg_uXxj8KBRw3oLS1WdsU+rUafBAAq7dRdbRwYSA@mail.gmail.com/ and this is the result. Note that this is completely experimental, even though it doesn't kill any of the test boxes I've run it on. Patch [1/2] moves the tick_nohz_get_sleep_length() call in teo_select() after a preliminary idle state selection based on statistics and patch [2/2] adds checks to avoid it completely if the idle state selected so far is shallow enough. I would appreciate checking if this actually makes any difference. Thanks!
Comments
Hi Rafael, On Tue, Aug 01, 2023 at 09:35:15PM +0200, Rafael J. Wysocki wrote: > Hi Folks, > > This is on top of the fixes series posted previously: > > https://lore.kernel.org/linux-pm/4515817.LvFx2qVVIh@kreacher/ > > (I'll put it all into one git branch tomorrow). > > I started to play with the idea described here > > https://lore.kernel.org/linux-pm/CAJZ5v0hQh2Pg_uXxj8KBRw3oLS1WdsU+rUafBAAq7dRdbRwYSA@mail.gmail.com/ > > and this is the result. > > Note that this is completely experimental, even though it doesn't kill any of > the test boxes I've run it on. > > Patch [1/2] moves the tick_nohz_get_sleep_length() call in teo_select() after > a preliminary idle state selection based on statistics and patch [2/2] adds > checks to avoid it completely if the idle state selected so far is shallow > enough. > > I would appreciate checking if this actually makes any difference. > > Thanks! As mentioned in the other thread I did some testing with these two patches on top as well, here are the results: 1. Geekbench 6 +---------------------------+---------------+-----------------+-------------------+ | metric | teo | teo_tick | teo_tick_rfc | +---------------------------+---------------+-----------------+-------------------+ | multicore_score | 3320.9 (0.0%) | 3303.3 (-0.53%) | 3293.6 (-0.82%) | | score | 1415.7 (0.0%) | 1417.7 (0.14%) | 1423.4 (0.54%) | | CPU_total_power | 2421.3 (0.0%) | 2429.3 (0.33%) | 2442.2 (0.86%) | | latency (AsyncTask #1) | 49.41μ (0.0%) | 51.07μ (3.36%) | 50.1μ (1.4%) | | latency (labs.geekbench6) | 65.63μ (0.0%) | 77.47μ (18.03%) | 55.82μ (-14.95%) | | latency (surfaceflinger) | 39.46μ (0.0%) | 36.94μ (-6.39%) | 35.79μ (-9.28%) | +---------------------------+---------------+-----------------+-------------------+ Ie the big picture is all right, the latency either improves with these patches or the spike in the previous patchset was an anomaly, either way seems fine. Not sure where the change in the score is coming from but for the record the line plots of the 3 iterations for both the tick variants look the same while they're slightly distinct from the pure 'teo' variant. It's still a below 1% gap so not the end of the world if there's benefits elsewhere. +-------------------+---------+------------+--------+ | kernel | cluster | idle_state | time | +-------------------+---------+------------+--------+ | teo | little | 0.0 | 146.75 | | teo_tick | little | 0.0 | 63.5 | | teo_tick_rfc | little | 0.0 | 62.48 | | teo | little | 1.0 | 53.75 | | teo_tick | little | 1.0 | 146.78 | | teo_tick_rfc | little | 1.0 | 147.14 | +-------------------+---------+------------+--------+ The idle numbers look pretty much the same as the previous variant which confirms that the change for the little cluster residency is caused by the previous changes but also that these two patches don't affect it. 2. JetNews +-----------------+---------------+----------------+-------------------+ | metric | teo | teo_tick | teo_tick_rfc | +-----------------+---------------+----------------+-------------------+ | fps | 86.2 (0.0%) | 86.4 (0.16%) | 86.0 (-0.28%) | | janks_pc | 0.8 (0.0%) | 0.8 (-0.66%) | 0.8 (-1.37%) | | CPU_total_power | 185.2 (0.0%) | 178.2 (-3.76%) | 182.2 (-1.6%) | +-----------------+---------------+----------------+-------------------+ Pretty much no change here, the power is still better than in base teo. +-------------------+---------+------------+-------+ | kernel | cluster | idle_state | time | +-------------------+---------+------------+-------+ | teo | mid | -1.0 | 21.63 | | teo_tick | mid | -1.0 | 21.57 | | teo_tick_rfc | mid | -1.0 | 17.66 | | teo | big | -1.0 | 8.81 | | teo_tick | big | -1.0 | 8.55 | | teo_tick_rfc | big | -1.0 | 12.04 | +-------------------+---------+------------+-------+ This part slightly stands out so could be worth noting. For some reason the trace registers a few seconds less running time (-1 means 'not idle') on the mid cores but a few seconds more on the big cores. This wasn't the case for the 'teo_tick' variant before so looks like it's caused by these two patches. Doesn't seem to be an issue though, just interesting. TLDR: Does not blow up, looks okay :)
Hi Kajetan, On Thu, Aug 3, 2023 at 3:18 PM Kajetan Puchalski <kajetan.puchalski@arm.com> wrote: > > Hi Rafael, > > On Tue, Aug 01, 2023 at 09:35:15PM +0200, Rafael J. Wysocki wrote: > > Hi Folks, > > > > This is on top of the fixes series posted previously: > > > > https://lore.kernel.org/linux-pm/4515817.LvFx2qVVIh@kreacher/ > > > > (I'll put it all into one git branch tomorrow). > > > > I started to play with the idea described here > > > > https://lore.kernel.org/linux-pm/CAJZ5v0hQh2Pg_uXxj8KBRw3oLS1WdsU+rUafBAAq7dRdbRwYSA@mail.gmail.com/ > > > > and this is the result. > > > > Note that this is completely experimental, even though it doesn't kill any of > > the test boxes I've run it on. > > > > Patch [1/2] moves the tick_nohz_get_sleep_length() call in teo_select() after > > a preliminary idle state selection based on statistics and patch [2/2] adds > > checks to avoid it completely if the idle state selected so far is shallow > > enough. > > > > I would appreciate checking if this actually makes any difference. > > > > Thanks! > > As mentioned in the other thread I did some testing with these two > patches on top as well, here are the results: > > 1. Geekbench 6 > > +---------------------------+---------------+-----------------+-------------------+ > | metric | teo | teo_tick | teo_tick_rfc | > +---------------------------+---------------+-----------------+-------------------+ > | multicore_score | 3320.9 (0.0%) | 3303.3 (-0.53%) | 3293.6 (-0.82%) | > | score | 1415.7 (0.0%) | 1417.7 (0.14%) | 1423.4 (0.54%) | > | CPU_total_power | 2421.3 (0.0%) | 2429.3 (0.33%) | 2442.2 (0.86%) | > | latency (AsyncTask #1) | 49.41μ (0.0%) | 51.07μ (3.36%) | 50.1μ (1.4%) | > | latency (labs.geekbench6) | 65.63μ (0.0%) | 77.47μ (18.03%) | 55.82μ (-14.95%) | > | latency (surfaceflinger) | 39.46μ (0.0%) | 36.94μ (-6.39%) | 35.79μ (-9.28%) | > +---------------------------+---------------+-----------------+-------------------+ > > Ie the big picture is all right, the latency either improves with these > patches or the spike in the previous patchset was an anomaly, either way > seems fine. Not sure where the change in the score is coming from but > for the record the line plots of the 3 iterations for both the tick > variants look the same while they're slightly distinct from the pure 'teo' > variant. It's still a below 1% gap so not the end of the world if > there's benefits elsewhere. > > +-------------------+---------+------------+--------+ > | kernel | cluster | idle_state | time | > +-------------------+---------+------------+--------+ > | teo | little | 0.0 | 146.75 | > | teo_tick | little | 0.0 | 63.5 | > | teo_tick_rfc | little | 0.0 | 62.48 | > | teo | little | 1.0 | 53.75 | > | teo_tick | little | 1.0 | 146.78 | > | teo_tick_rfc | little | 1.0 | 147.14 | > +-------------------+---------+------------+--------+ > > The idle numbers look pretty much the same as the previous variant which > confirms that the change for the little cluster residency is caused by > the previous changes but also that these two patches don't affect it. > > 2. JetNews > > +-----------------+---------------+----------------+-------------------+ > | metric | teo | teo_tick | teo_tick_rfc | > +-----------------+---------------+----------------+-------------------+ > | fps | 86.2 (0.0%) | 86.4 (0.16%) | 86.0 (-0.28%) | > | janks_pc | 0.8 (0.0%) | 0.8 (-0.66%) | 0.8 (-1.37%) | > | CPU_total_power | 185.2 (0.0%) | 178.2 (-3.76%) | 182.2 (-1.6%) | > +-----------------+---------------+----------------+-------------------+ > > Pretty much no change here, the power is still better than in base teo. > > +-------------------+---------+------------+-------+ > | kernel | cluster | idle_state | time | > +-------------------+---------+------------+-------+ > | teo | mid | -1.0 | 21.63 | > | teo_tick | mid | -1.0 | 21.57 | > | teo_tick_rfc | mid | -1.0 | 17.66 | > | teo | big | -1.0 | 8.81 | > | teo_tick | big | -1.0 | 8.55 | > | teo_tick_rfc | big | -1.0 | 12.04 | > +-------------------+---------+------------+-------+ > > This part slightly stands out so could be worth noting. For some reason > the trace registers a few seconds less running time (-1 means 'not > idle') on the mid cores but a few seconds more on the big cores. This > wasn't the case for the 'teo_tick' variant before so looks like it's > caused by these two patches. Doesn't seem to be an issue though, just > interesting. > > TLDR: > Does not blow up, looks okay :) Thank you for the feedback, much appreciated! I'll likely send a new version of this series later today including one more patch and I will set up a git branch with it later. Thanks!