linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "tip-bot2 for Lukasz Luba" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Lukasz Luba <lukasz.luba@arm.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/core] thermal/cpufreq_cooling: Update offline CPUs per-cpu thermal_pressure
Date: Fri, 18 Jun 2021 08:46:06 -0000	[thread overview]
Message-ID: <162400596666.19906.7832650619393639498.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20210614191030.22241-1-lukasz.luba@arm.com>

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     2ad8ccc17d1e4270cf65a3f2a07a7534aa23e3fb
Gitweb:        https://git.kernel.org/tip/2ad8ccc17d1e4270cf65a3f2a07a7534aa23e3fb
Author:        Lukasz Luba <lukasz.luba@arm.com>
AuthorDate:    Mon, 14 Jun 2021 20:10:30 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Thu, 17 Jun 2021 14:11:43 +02:00

thermal/cpufreq_cooling: Update offline CPUs per-cpu thermal_pressure

The thermal pressure signal gives information to the scheduler about
reduced CPU capacity due to thermal. It is based on a value stored in
a per-cpu 'thermal_pressure' variable. The online CPUs will get the
new value there, while the offline won't. Unfortunately, when the CPU
is back online, the value read from per-cpu variable might be wrong
(stale data).  This might affect the scheduler decisions, since it
sees the CPU capacity differently than what is actually available.

Fix it by making sure that all online+offline CPUs would get the
proper value in their per-cpu variable when thermal framework sets
capping.

Fixes: f12e4f66ab6a3 ("thermal/cpu-cooling: Update thermal pressure in case of a maximum frequency capping")
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/20210614191030.22241-1-lukasz.luba@arm.com
---
 drivers/thermal/cpufreq_cooling.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c
index eeb4e4b..43b1ae8 100644
--- a/drivers/thermal/cpufreq_cooling.c
+++ b/drivers/thermal/cpufreq_cooling.c
@@ -478,7 +478,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
 	ret = freq_qos_update_request(&cpufreq_cdev->qos_req, frequency);
 	if (ret >= 0) {
 		cpufreq_cdev->cpufreq_state = state;
-		cpus = cpufreq_cdev->policy->cpus;
+		cpus = cpufreq_cdev->policy->related_cpus;
 		max_capacity = arch_scale_cpu_capacity(cpumask_first(cpus));
 		capacity = frequency * max_capacity;
 		capacity /= cpufreq_cdev->policy->cpuinfo.max_freq;

  reply	other threads:[~2021-06-18  8:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-14 18:58 [PATCH v4 0/3] Add allowed CPU capacity knowledge to EAS Lukasz Luba
2021-06-14 19:10 ` [PATCH 1/3] thermal: cpufreq_cooling: Update also offline CPUs per-cpu thermal_pressure Lukasz Luba
2021-06-18  8:46   ` tip-bot2 for Lukasz Luba [this message]
2021-06-14 19:11 ` [PATCH v4 2/3] sched/fair: Take thermal pressure into account while estimating energy Lukasz Luba
2021-06-15 15:31   ` Dietmar Eggemann
2021-06-15 16:09     ` Lukasz Luba
2021-06-16 17:24       ` Dietmar Eggemann
2021-06-16 18:31         ` Lukasz Luba
2021-06-16 19:25         ` Vincent Guittot
2021-06-16 20:22           ` Lukasz Luba
2021-06-18  8:46   ` [tip: sched/core] " tip-bot2 for Lukasz Luba
2021-06-14 19:12 ` [PATCH v4 3/3] sched/cpufreq: Consider reduced CPU capacity in energy calculation Lukasz Luba
2021-06-18  8:46   ` [tip: sched/core] " tip-bot2 for Lukasz Luba
2021-06-16 13:33 ` [PATCH v4 0/3] Add allowed CPU capacity knowledge to EAS Lukasz Luba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=162400596666.19906.7832650619393639498.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=peterz@infradead.org \
    --cc=viresh.kumar@linaro.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).