mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Loehle <christian.loehle@arm.com>
To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com
Cc: rafael@kernel.org, qyousef@layalina.io, peterz@infradead.org,
	pierre.gondois@arm.com, qperret@google.com, sven@svenpeter.dev,
	Christian Loehle <christian.loehle@arm.com>
Subject: [PATCH 1/1] sched/fair: Ignore OU for lone task on max-cap CPU
Date: Tue, 30 Dec 2025 09:30:37 +0000	[thread overview]
Message-ID: <20251230093037.427141-2-christian.loehle@arm.com> (raw)
In-Reply-To: <20251230093037.427141-1-christian.loehle@arm.com>

Tasks that have an utilization high enough to trigger misfit or
overutilized on a max-cap CPU don't have any better CPU to be placed
on, as long as this CPU isn't under significant thermal or system
pressure. There's no reason to let it trigger the global
overutilized state then.
Treat maximum capacity CPUs with just a single task as !overutilized
to let EAS decide placements on the remaining tasks and CPUs, it will
already avoid placing additional tasks on these CPUs as they don't have
any spare capacity.

Overutilized state is global to 1) ensure maximum throughput and 2)
prevent running find_energy_efficient_cpu() with unreliable PELT values
when compute capacity isn't provided to tasks.
1) remains trivially true as for CAS the same 1024-capacity CPU would
have been a correct choice for a lone task, too.
2) is guaranteed by limiting it to nr_running <= 1, the task itself
then has accurate PELT values as maximum compute capacity can be provided
(also ensured by subtracting system and thermal pressure from the CPU).
EAS will naturally not place additional tasks on the CPU as
find_energy_efficient_cpu() requires the task's utilization to fit onto
the spare-cap (util_fits_cpu()), of which there is none in the scenario
we are concerned with.

Signed-off-by: Christian Loehle <christian.loehle@arm.com>
---
 kernel/sched/fair.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index da46c3164537..d885b2a0fcd3 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6790,6 +6790,12 @@ static inline bool cpu_overutilized(int cpu)
 	if (!sched_energy_enabled())
 		return false;
 
+	/* Single task on max-cap CPU isn't misfit so no reason to trigger OU */
+	if (arch_scale_cpu_capacity(cpu) == SCHED_CAPACITY_SCALE &&
+	    cpu_rq(cpu)->nr_running <= 1 &&
+	    !capacity_greater(SCHED_CAPACITY_SCALE, capacity_of(cpu)))
+		return false;
+
 	rq_util_min = uclamp_rq_get(cpu_rq(cpu), UCLAMP_MIN);
 	rq_util_max = uclamp_rq_get(cpu_rq(cpu), UCLAMP_MAX);
 
-- 
2.34.1


  reply	other threads:[~2025-12-30  9:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-30  9:30 [PATCH 0/1] sched: Ignore overutilized by " Christian Loehle
2025-12-30  9:30 ` Christian Loehle [this message]
2026-01-09 17:12   ` [PATCH 1/1] sched/fair: Ignore OU for " Pierre Gondois
2026-01-09 17:12 ` [PATCH 0/1] sched: Ignore overutilized by " Pierre Gondois
2026-01-15 14:13   ` Christian Loehle
2026-01-13 13:11 ` Qais Yousef
2026-01-15 11:17   ` Christian Loehle
2026-02-06 17:23     ` Qais Yousef

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=20251230093037.427141-2-christian.loehle@arm.com \
    --to=christian.loehle@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=pierre.gondois@arm.com \
    --cc=qperret@google.com \
    --cc=qyousef@layalina.io \
    --cc=rafael@kernel.org \
    --cc=sven@svenpeter.dev \
    --cc=vincent.guittot@linaro.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

all inboxes | Powered by JetHome®