[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20251230093037.427141-2-christian.loehle@arm.com>
Date: Tue, 30 Dec 2025 09:30:37 +0000
From: Christian Loehle <christian.loehle@....com>
To: linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org,
vincent.guittot@...aro.org,
dietmar.eggemann@....com
Cc: rafael@...nel.org,
qyousef@...alina.io,
peterz@...radead.org,
pierre.gondois@....com,
qperret@...gle.com,
sven@...npeter.dev,
Christian Loehle <christian.loehle@....com>
Subject: [PATCH 1/1] sched/fair: Ignore OU for lone task on max-cap CPU
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@....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
Powered by blists - more mailing lists