mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v9] sched/fair: Filter false overloaded_group case for EAS
@ 2026-02-06  9:54 Vincent Guittot
  2026-02-11  1:48 ` Qais Yousef
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Vincent Guittot @ 2026-02-06  9:54 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, dietmar.eggemann, rostedt, bsegall,
	mgorman, vschneid, linux-kernel, pierre.gondois, kprateek.nayak
  Cc: qyousef, hongyan.xia2, christian.loehle, luis.machado, Vincent Guittot

With EAS, a group should be set overloaded if at least 1 CPU in the group
is overutilized but it can happen that a CPU is fully utilized by tasks
because of clamping the compute capacity of the CPU. In such case, the CPU
is not overutilized and as a result should not be set overloaded as well.

group_overloaded being a higher priority than group_misfit, such group can
be selected as the busiest group instead of a group with a mistfit task
and prevents load_balance to select the CPU with the misfit task to pull
the latter on a fitting CPU.

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Tested-by: Pierre Gondois <pierre.gondois@arm.com>
---

This patch was part of a larger patchset [1] but makes sense on its own and has
not changed since v2

[1] https://lore.kernel.org/all/20251202181242.1536213-1-vincent.guittot@linaro.org/

 kernel/sched/fair.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c16b5fd71b2d..5d7ceaef7174 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9969,6 +9969,7 @@ struct sg_lb_stats {
 	unsigned int group_asym_packing;	/* Tasks should be moved to preferred CPU */
 	unsigned int group_smt_balance;		/* Task on busy SMT be moved */
 	unsigned long group_misfit_task_load;	/* A CPU has a task too big for its capacity */
+	unsigned int group_overutilized;	/* At least one CPU is overutilized in the group */
 #ifdef CONFIG_NUMA_BALANCING
 	unsigned int nr_numa_running;
 	unsigned int nr_preferred_running;
@@ -10201,6 +10202,13 @@ group_has_capacity(unsigned int imbalance_pct, struct sg_lb_stats *sgs)
 static inline bool
 group_is_overloaded(unsigned int imbalance_pct, struct sg_lb_stats *sgs)
 {
+	/*
+	 * With EAS and uclamp, 1 CPU in the group must be overutilized to
+	 * consider the group overloaded.
+	 */
+	if (sched_energy_enabled() && !sgs->group_overutilized)
+		return false;
+
 	if (sgs->sum_nr_running <= sgs->group_weight)
 		return false;
 
@@ -10384,14 +10392,12 @@ sched_reduced_capacity(struct rq *rq, struct sched_domain *sd)
  * @group: sched_group whose statistics are to be updated.
  * @sgs: variable to hold the statistics for this group.
  * @sg_overloaded: sched_group is overloaded
- * @sg_overutilized: sched_group is overutilized
  */
 static inline void update_sg_lb_stats(struct lb_env *env,
 				      struct sd_lb_stats *sds,
 				      struct sched_group *group,
 				      struct sg_lb_stats *sgs,
-				      bool *sg_overloaded,
-				      bool *sg_overutilized)
+				      bool *sg_overloaded)
 {
 	int i, nr_running, local_group, sd_flags = env->sd->flags;
 	bool balancing_at_rd = !env->sd->parent;
@@ -10413,7 +10419,7 @@ static inline void update_sg_lb_stats(struct lb_env *env,
 		sgs->sum_nr_running += nr_running;
 
 		if (cpu_overutilized(i))
-			*sg_overutilized = 1;
+			sgs->group_overutilized = 1;
 
 		/*
 		 * No need to call idle_cpu() if nr_running is not 0
@@ -11084,13 +11090,15 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd
 				update_group_capacity(env->sd, env->dst_cpu);
 		}
 
-		update_sg_lb_stats(env, sds, sg, sgs, &sg_overloaded, &sg_overutilized);
+		update_sg_lb_stats(env, sds, sg, sgs, &sg_overloaded);
 
 		if (!local_group && update_sd_pick_busiest(env, sds, sg, sgs)) {
 			sds->busiest = sg;
 			sds->busiest_stat = *sgs;
 		}
 
+		sg_overutilized |= sgs->group_overutilized;
+
 		/* Now, start updating sd_lb_stats */
 		sds->total_load += sgs->group_load;
 		sds->total_capacity += sgs->group_capacity;
-- 
2.43.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v9] sched/fair: Filter false overloaded_group case for EAS
  2026-02-06  9:54 [PATCH v9] sched/fair: Filter false overloaded_group case for EAS Vincent Guittot
@ 2026-02-11  1:48 ` Qais Yousef
  2026-02-12  7:16   ` Vincent Guittot
  2026-02-12  9:55   ` Christian Loehle
  2026-02-16 11:40 ` Christian Loehle
  2026-02-24  9:13 ` [tip: sched/core] " tip-bot2 for Vincent Guittot
  2 siblings, 2 replies; 8+ messages in thread
From: Qais Yousef @ 2026-02-11  1:48 UTC (permalink / raw)
  To: Vincent Guittot
  Cc: mingo, peterz, juri.lelli, dietmar.eggemann, rostedt, bsegall,
	mgorman, vschneid, linux-kernel, pierre.gondois, kprateek.nayak,
	hongyan.xia2, christian.loehle, luis.machado

On 02/06/26 10:54, Vincent Guittot wrote:
> With EAS, a group should be set overloaded if at least 1 CPU in the group
> is overutilized but it can happen that a CPU is fully utilized by tasks
> because of clamping the compute capacity of the CPU. In such case, the CPU
> is not overutilized and as a result should not be set overloaded as well.
> 
> group_overloaded being a higher priority than group_misfit, such group can
> be selected as the busiest group instead of a group with a mistfit task
> and prevents load_balance to select the CPU with the misfit task to pull
> the latter on a fitting CPU.
> 
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> Tested-by: Pierre Gondois <pierre.gondois@arm.com>
> ---
> 
> This patch was part of a larger patchset [1] but makes sense on its own and has
> not changed since v2
> 
> [1] https://lore.kernel.org/all/20251202181242.1536213-1-vincent.guittot@linaro.org/

I don't mind this. But I think with the original series misfit will be handled
better with push lb, and if it is made to handle overloaded case (which my
initial testing shows it is easily doable and I can't see clear bad impact
yet), I think we can retire overutilized altogether.

The current lb is slow, and doesn't do the right decision. Short circuiting to
wake up path via push is not only faster, but will also keep the decision tree
coherent whether it is EAS or something else.

Regardless of overloaded being handled in push lb or not, shouldn't your series
make misfit handling in pull lb obsolete anyway rendering this fix unnecessary?

It might be a good candidate for LTS though if there are reports.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v9] sched/fair: Filter false overloaded_group case for EAS
  2026-02-11  1:48 ` Qais Yousef
@ 2026-02-12  7:16   ` Vincent Guittot
  2026-02-12  9:55   ` Christian Loehle
  1 sibling, 0 replies; 8+ messages in thread
From: Vincent Guittot @ 2026-02-12  7:16 UTC (permalink / raw)
  To: Qais Yousef
  Cc: mingo, peterz, juri.lelli, dietmar.eggemann, rostedt, bsegall,
	mgorman, vschneid, linux-kernel, pierre.gondois, kprateek.nayak,
	hongyan.xia2, christian.loehle, luis.machado

On Wed, 11 Feb 2026 at 02:48, Qais Yousef <qyousef@layalina.io> wrote:
>
> On 02/06/26 10:54, Vincent Guittot wrote:
> > With EAS, a group should be set overloaded if at least 1 CPU in the group
> > is overutilized but it can happen that a CPU is fully utilized by tasks
> > because of clamping the compute capacity of the CPU. In such case, the CPU
> > is not overutilized and as a result should not be set overloaded as well.
> >
> > group_overloaded being a higher priority than group_misfit, such group can
> > be selected as the busiest group instead of a group with a mistfit task
> > and prevents load_balance to select the CPU with the misfit task to pull
> > the latter on a fitting CPU.
> >
> > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> > Tested-by: Pierre Gondois <pierre.gondois@arm.com>
> > ---
> >
> > This patch was part of a larger patchset [1] but makes sense on its own and has
> > not changed since v2
> >
> > [1] https://lore.kernel.org/all/20251202181242.1536213-1-vincent.guittot@linaro.org/
>
> I don't mind this. But I think with the original series misfit will be handled
> better with push lb, and if it is made to handle overloaded case (which my
> initial testing shows it is easily doable and I can't see clear bad impact
> yet), I think we can retire overutilized altogether.
>
> The current lb is slow, and doesn't do the right decision. Short circuiting to
> wake up path via push is not only faster, but will also keep the decision tree
> coherent whether it is EAS or something else.
>
> Regardless of overloaded being handled in push lb or not, shouldn't your series
> make misfit handling in pull lb obsolete anyway rendering this fix unnecessary?
>
> It might be a good candidate for LTS though if there are reports.

Even if the end goal is to use push to cover all cases, this seems to
be a good fix for the cases that could not be covered otherwise.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v9] sched/fair: Filter false overloaded_group case for EAS
  2026-02-11  1:48 ` Qais Yousef
  2026-02-12  7:16   ` Vincent Guittot
@ 2026-02-12  9:55   ` Christian Loehle
  2026-02-17  1:03     ` Qais Yousef
  1 sibling, 1 reply; 8+ messages in thread
From: Christian Loehle @ 2026-02-12  9:55 UTC (permalink / raw)
  To: Qais Yousef, Vincent Guittot
  Cc: mingo, peterz, juri.lelli, dietmar.eggemann, rostedt, bsegall,
	mgorman, vschneid, linux-kernel, pierre.gondois, kprateek.nayak,
	hongyan.xia2, luis.machado

On 2/11/26 01:48, Qais Yousef wrote:
> On 02/06/26 10:54, Vincent Guittot wrote:
>> With EAS, a group should be set overloaded if at least 1 CPU in the group
>> is overutilized but it can happen that a CPU is fully utilized by tasks
>> because of clamping the compute capacity of the CPU. In such case, the CPU
>> is not overutilized and as a result should not be set overloaded as well.
>>
>> group_overloaded being a higher priority than group_misfit, such group can
>> be selected as the busiest group instead of a group with a mistfit task
>> and prevents load_balance to select the CPU with the misfit task to pull
>> the latter on a fitting CPU.
>>
>> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
>> Tested-by: Pierre Gondois <pierre.gondois@arm.com>
>> ---
>>
>> This patch was part of a larger patchset [1] but makes sense on its own and has
>> not changed since v2
>>
>> [1] https://lore.kernel.org/all/20251202181242.1536213-1-vincent.guittot@linaro.org/
> 
> I don't mind this. But I think with the original series misfit will be handled
> better with push lb, and if it is made to handle overloaded case (which my
> initial testing shows it is easily doable and I can't see clear bad impact
> yet), I think we can retire overutilized altogether.
> 

The EAS wakeup path (and therefore the push lb for that matter) is costly and workloads
are sensitive to it, it's trivial to see with hackbench. Overutilized prevents that.
Arguments about PELT inaccuracies during periods of unmet compute demand (and therefore
entirely bogus EAS computation results) aside, I don't see how we a push lb could retire
OU? If anything you're paying twice the price then for these scenarios?

> [snip]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v9] sched/fair: Filter false overloaded_group case for EAS
  2026-02-06  9:54 [PATCH v9] sched/fair: Filter false overloaded_group case for EAS Vincent Guittot
  2026-02-11  1:48 ` Qais Yousef
@ 2026-02-16 11:40 ` Christian Loehle
  2026-02-24  9:13 ` [tip: sched/core] " tip-bot2 for Vincent Guittot
  2 siblings, 0 replies; 8+ messages in thread
From: Christian Loehle @ 2026-02-16 11:40 UTC (permalink / raw)
  To: Vincent Guittot, mingo, peterz, juri.lelli, dietmar.eggemann,
	rostedt, bsegall, mgorman, vschneid, linux-kernel,
	pierre.gondois, kprateek.nayak
  Cc: qyousef, hongyan.xia2, luis.machado

On 2/6/26 09:54, Vincent Guittot wrote:
> With EAS, a group should be set overloaded if at least 1 CPU in the group
> is overutilized but it can happen that a CPU is fully utilized by tasks
> because of clamping the compute capacity of the CPU. In such case, the CPU
> is not overutilized and as a result should not be set overloaded as well.
> 
> group_overloaded being a higher priority than group_misfit, such group can
> be selected as the busiest group instead of a group with a mistfit task
> and prevents load_balance to select the CPU with the misfit task to pull
> the latter on a fitting CPU.
> 
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> Tested-by: Pierre Gondois <pierre.gondois@arm.com>

Reviewed-by: Christian Loehle <christian.loehle@arm.com>

> ---
> 
> This patch was part of a larger patchset [1] but makes sense on its own and has
> not changed since v2
> 
> [1] https://lore.kernel.org/all/20251202181242.1536213-1-vincent.guittot@linaro.org/
> 
>  kernel/sched/fair.c | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index c16b5fd71b2d..5d7ceaef7174 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -9969,6 +9969,7 @@ struct sg_lb_stats {
>  	unsigned int group_asym_packing;	/* Tasks should be moved to preferred CPU */
>  	unsigned int group_smt_balance;		/* Task on busy SMT be moved */
>  	unsigned long group_misfit_task_load;	/* A CPU has a task too big for its capacity */
> +	unsigned int group_overutilized;	/* At least one CPU is overutilized in the group */
>  #ifdef CONFIG_NUMA_BALANCING
>  	unsigned int nr_numa_running;
>  	unsigned int nr_preferred_running;
> @@ -10201,6 +10202,13 @@ group_has_capacity(unsigned int imbalance_pct, struct sg_lb_stats *sgs)
>  static inline bool
>  group_is_overloaded(unsigned int imbalance_pct, struct sg_lb_stats *sgs)
>  {
> +	/*
> +	 * With EAS and uclamp, 1 CPU in the group must be overutilized to
> +	 * consider the group overloaded.
> +	 */
> +	if (sched_energy_enabled() && !sgs->group_overutilized)
> +		return false;
> +
>  	if (sgs->sum_nr_running <= sgs->group_weight)
>  		return false;
>  
> @@ -10384,14 +10392,12 @@ sched_reduced_capacity(struct rq *rq, struct sched_domain *sd)
>   * @group: sched_group whose statistics are to be updated.
>   * @sgs: variable to hold the statistics for this group.
>   * @sg_overloaded: sched_group is overloaded
> - * @sg_overutilized: sched_group is overutilized
>   */
>  static inline void update_sg_lb_stats(struct lb_env *env,
>  				      struct sd_lb_stats *sds,
>  				      struct sched_group *group,
>  				      struct sg_lb_stats *sgs,
> -				      bool *sg_overloaded,
> -				      bool *sg_overutilized)
> +				      bool *sg_overloaded)
>  {
>  	int i, nr_running, local_group, sd_flags = env->sd->flags;
>  	bool balancing_at_rd = !env->sd->parent;
> @@ -10413,7 +10419,7 @@ static inline void update_sg_lb_stats(struct lb_env *env,
>  		sgs->sum_nr_running += nr_running;
>  
>  		if (cpu_overutilized(i))
> -			*sg_overutilized = 1;
> +			sgs->group_overutilized = 1;
>  
>  		/*
>  		 * No need to call idle_cpu() if nr_running is not 0
> @@ -11084,13 +11090,15 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd
>  				update_group_capacity(env->sd, env->dst_cpu);
>  		}
>  
> -		update_sg_lb_stats(env, sds, sg, sgs, &sg_overloaded, &sg_overutilized);
> +		update_sg_lb_stats(env, sds, sg, sgs, &sg_overloaded);
>  
>  		if (!local_group && update_sd_pick_busiest(env, sds, sg, sgs)) {
>  			sds->busiest = sg;
>  			sds->busiest_stat = *sgs;
>  		}
>  
> +		sg_overutilized |= sgs->group_overutilized;
> +
>  		/* Now, start updating sd_lb_stats */
>  		sds->total_load += sgs->group_load;
>  		sds->total_capacity += sgs->group_capacity;


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v9] sched/fair: Filter false overloaded_group case for EAS
  2026-02-12  9:55   ` Christian Loehle
@ 2026-02-17  1:03     ` Qais Yousef
  2026-02-18 16:12       ` Christian Loehle
  0 siblings, 1 reply; 8+ messages in thread
From: Qais Yousef @ 2026-02-17  1:03 UTC (permalink / raw)
  To: Christian Loehle
  Cc: Vincent Guittot, mingo, peterz, juri.lelli, dietmar.eggemann,
	rostedt, bsegall, mgorman, vschneid, linux-kernel,
	pierre.gondois, kprateek.nayak, hongyan.xia2, luis.machado

On 02/12/26 09:55, Christian Loehle wrote:
> On 2/11/26 01:48, Qais Yousef wrote:
> > On 02/06/26 10:54, Vincent Guittot wrote:
> >> With EAS, a group should be set overloaded if at least 1 CPU in the group
> >> is overutilized but it can happen that a CPU is fully utilized by tasks
> >> because of clamping the compute capacity of the CPU. In such case, the CPU
> >> is not overutilized and as a result should not be set overloaded as well.
> >>
> >> group_overloaded being a higher priority than group_misfit, such group can
> >> be selected as the busiest group instead of a group with a mistfit task
> >> and prevents load_balance to select the CPU with the misfit task to pull
> >> the latter on a fitting CPU.
> >>
> >> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> >> Tested-by: Pierre Gondois <pierre.gondois@arm.com>
> >> ---
> >>
> >> This patch was part of a larger patchset [1] but makes sense on its own and has
> >> not changed since v2
> >>
> >> [1] https://lore.kernel.org/all/20251202181242.1536213-1-vincent.guittot@linaro.org/
> > 
> > I don't mind this. But I think with the original series misfit will be handled
> > better with push lb, and if it is made to handle overloaded case (which my
> > initial testing shows it is easily doable and I can't see clear bad impact
> > yet), I think we can retire overutilized altogether.
> > 
> 
> The EAS wakeup path (and therefore the push lb for that matter) is costly and workloads
> are sensitive to it, it's trivial to see with hackbench. Overutilized prevents that.

What workloads? I have been testing this and all I am seeing are great results
so far.

Hackbench is a super synthetic test that doesn't represent any real workload.
It purely measures context switch overhead. I think I said this before, but
I'll repeat it again. For most modern systems and workloads we really need to
spend more time to make sure we do the correct task placement decision as the
cost of a wrong fast decision is worse than a slow correct one. And this is not
something special about mobile systems. Servers and others do care. For those
who really don't want any additional overhead they can just disable the static
key.

FWIW I tried schbench, which is more realistic since it does something that
represents a web server, and it measures throughput and latencies and I got 10%
better throughput, 27% better P99 and 49% better max latencies. And yes, OU is
completely disabled when I ran this test.

But disclaimer again, I backported earlier (modified) version of the patch and
running on non-mainline kernel with OOT changes applied that I think helps to
demonstrate the benefit even better.

Vincent, I am trying to stress the importance of the work and its great
potential. I am not expecting the initial merge to handle everything yet ;-)

> Arguments about PELT inaccuracies during periods of unmet compute demand (and therefore
> entirely bogus EAS computation results) aside, I don't see how we a push lb could retire
> OU? If anything you're paying twice the price then for these scenarios?

I am not seeing any price to be paid. Geekbench scores are within run-to-run
variation.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v9] sched/fair: Filter false overloaded_group case for EAS
  2026-02-17  1:03     ` Qais Yousef
@ 2026-02-18 16:12       ` Christian Loehle
  0 siblings, 0 replies; 8+ messages in thread
From: Christian Loehle @ 2026-02-18 16:12 UTC (permalink / raw)
  To: Qais Yousef
  Cc: Vincent Guittot, mingo, peterz, juri.lelli, dietmar.eggemann,
	rostedt, bsegall, mgorman, vschneid, linux-kernel,
	pierre.gondois, kprateek.nayak, hongyan.xia2, luis.machado

On 2/17/26 01:03, Qais Yousef wrote:
> On 02/12/26 09:55, Christian Loehle wrote:
>> On 2/11/26 01:48, Qais Yousef wrote:
>>> On 02/06/26 10:54, Vincent Guittot wrote:
>>>> With EAS, a group should be set overloaded if at least 1 CPU in the group
>>>> is overutilized but it can happen that a CPU is fully utilized by tasks
>>>> because of clamping the compute capacity of the CPU. In such case, the CPU
>>>> is not overutilized and as a result should not be set overloaded as well.
>>>>
>>>> group_overloaded being a higher priority than group_misfit, such group can
>>>> be selected as the busiest group instead of a group with a mistfit task
>>>> and prevents load_balance to select the CPU with the misfit task to pull
>>>> the latter on a fitting CPU.
>>>>
>>>> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
>>>> Tested-by: Pierre Gondois <pierre.gondois@arm.com>
>>>> ---
>>>>
>>>> This patch was part of a larger patchset [1] but makes sense on its own and has
>>>> not changed since v2
>>>>
>>>> [1] https://lore.kernel.org/all/20251202181242.1536213-1-vincent.guittot@linaro.org/
>>>
>>> I don't mind this. But I think with the original series misfit will be handled
>>> better with push lb, and if it is made to handle overloaded case (which my
>>> initial testing shows it is easily doable and I can't see clear bad impact
>>> yet), I think we can retire overutilized altogether.
>>>
>>
>> The EAS wakeup path (and therefore the push lb for that matter) is costly and workloads
>> are sensitive to it, it's trivial to see with hackbench. Overutilized prevents that.
> 
> What workloads? I have been testing this and all I am seeing are great results
> so far.
> 
> Hackbench is a super synthetic test that doesn't represent any real workload.
> It purely measures context switch overhead. I think I said this before, but
> I'll repeat it again. For most modern systems and workloads we really need to
> spend more time to make sure we do the correct task placement decision as the
> cost of a wrong fast decision is worse than a slow correct one. And this is not
> something special about mobile systems. Servers and others do care. For those
> who really don't want any additional overhead they can just disable the static
> key.

There's quite a few systems and workloads, especially in servers / datacenters
where the "fast cheap" placement is better...
But I guess that's going a bit off-topic now.

> 
> FWIW I tried schbench, which is more realistic since it does something that
> represents a web server, and it measures throughput and latencies and I got 10%
> better throughput, 27% better P99 and 49% better max latencies. And yes, OU is
> completely disabled when I ran this test.
> 
> But disclaimer again, I backported earlier (modified) version of the patch and
> running on non-mainline kernel with OOT changes applied that I think helps to
> demonstrate the benefit even better.

So I'm assuming this was with the old series that still changed feec() placement
trying a 'latency-aware' placement, otherwise the improvements you state don't
make sense to me.

> 
> Vincent, I am trying to stress the importance of the work and its great
> potential. I am not expecting the initial merge to handle everything yet ;-)
> 
>> Arguments about PELT inaccuracies during periods of unmet compute demand (and therefore
>> entirely bogus EAS computation results) aside, I don't see how we a push lb could retire
>> OU? If anything you're paying twice the price then for these scenarios?
> 
> I am not seeing any price to be paid. Geekbench scores are within run-to-run
> variation.

Hackbench isn't the only one here, I can make an overview too.
There's definitely a measurable speedometer3.1 score regression with "never-OU", too.
Again though, if you tested this extensively and think the improvements outweigh,
please do share the setup and results.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [tip: sched/core] sched/fair: Filter false overloaded_group case for EAS
  2026-02-06  9:54 [PATCH v9] sched/fair: Filter false overloaded_group case for EAS Vincent Guittot
  2026-02-11  1:48 ` Qais Yousef
  2026-02-16 11:40 ` Christian Loehle
@ 2026-02-24  9:13 ` tip-bot2 for Vincent Guittot
  2 siblings, 0 replies; 8+ messages in thread
From: tip-bot2 for Vincent Guittot @ 2026-02-24  9:13 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Vincent Guittot, Peter Zijlstra (Intel),
	Pierre Gondois, x86, linux-kernel

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

Commit-ID:     d3d663faa1d4e86491b77ab72eabc3ea2f58b197
Gitweb:        https://git.kernel.org/tip/d3d663faa1d4e86491b77ab72eabc3ea2f58b197
Author:        Vincent Guittot <vincent.guittot@linaro.org>
AuthorDate:    Fri, 06 Feb 2026 10:54:54 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Mon, 23 Feb 2026 18:04:11 +01:00

sched/fair: Filter false overloaded_group case for EAS

With EAS, a group should be set overloaded if at least 1 CPU in the group
is overutilized but it can happen that a CPU is fully utilized by tasks
because of clamping the compute capacity of the CPU. In such case, the CPU
is not overutilized and as a result should not be set overloaded as well.

group_overloaded being a higher priority than group_misfit, such group can
be selected as the busiest group instead of a group with a mistfit task
and prevents load_balance to select the CPU with the misfit task to pull
the latter on a fitting CPU.

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Pierre Gondois <pierre.gondois@arm.com>
Link: https://patch.msgid.link/20260206095454.1520619-1-vincent.guittot@linaro.org
---
 kernel/sched/fair.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index b8b052b..966e252 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -10211,6 +10211,7 @@ struct sg_lb_stats {
 	unsigned int group_asym_packing;	/* Tasks should be moved to preferred CPU */
 	unsigned int group_smt_balance;		/* Task on busy SMT be moved */
 	unsigned long group_misfit_task_load;	/* A CPU has a task too big for its capacity */
+	unsigned int group_overutilized;	/* At least one CPU is overutilized in the group */
 #ifdef CONFIG_NUMA_BALANCING
 	unsigned int nr_numa_running;
 	unsigned int nr_preferred_running;
@@ -10443,6 +10444,13 @@ group_has_capacity(unsigned int imbalance_pct, struct sg_lb_stats *sgs)
 static inline bool
 group_is_overloaded(unsigned int imbalance_pct, struct sg_lb_stats *sgs)
 {
+	/*
+	 * With EAS and uclamp, 1 CPU in the group must be overutilized to
+	 * consider the group overloaded.
+	 */
+	if (sched_energy_enabled() && !sgs->group_overutilized)
+		return false;
+
 	if (sgs->sum_nr_running <= sgs->group_weight)
 		return false;
 
@@ -10626,14 +10634,12 @@ sched_reduced_capacity(struct rq *rq, struct sched_domain *sd)
  * @group: sched_group whose statistics are to be updated.
  * @sgs: variable to hold the statistics for this group.
  * @sg_overloaded: sched_group is overloaded
- * @sg_overutilized: sched_group is overutilized
  */
 static inline void update_sg_lb_stats(struct lb_env *env,
 				      struct sd_lb_stats *sds,
 				      struct sched_group *group,
 				      struct sg_lb_stats *sgs,
-				      bool *sg_overloaded,
-				      bool *sg_overutilized)
+				      bool *sg_overloaded)
 {
 	int i, nr_running, local_group, sd_flags = env->sd->flags;
 	bool balancing_at_rd = !env->sd->parent;
@@ -10655,7 +10661,7 @@ static inline void update_sg_lb_stats(struct lb_env *env,
 		sgs->sum_nr_running += nr_running;
 
 		if (cpu_overutilized(i))
-			*sg_overutilized = 1;
+			sgs->group_overutilized = 1;
 
 		/*
 		 * No need to call idle_cpu() if nr_running is not 0
@@ -11326,13 +11332,15 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd
 				update_group_capacity(env->sd, env->dst_cpu);
 		}
 
-		update_sg_lb_stats(env, sds, sg, sgs, &sg_overloaded, &sg_overutilized);
+		update_sg_lb_stats(env, sds, sg, sgs, &sg_overloaded);
 
 		if (!local_group && update_sd_pick_busiest(env, sds, sg, sgs)) {
 			sds->busiest = sg;
 			sds->busiest_stat = *sgs;
 		}
 
+		sg_overutilized |= sgs->group_overutilized;
+
 		/* Now, start updating sd_lb_stats */
 		sds->total_load += sgs->group_load;
 		sds->total_capacity += sgs->group_capacity;

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-02-24  9:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-06  9:54 [PATCH v9] sched/fair: Filter false overloaded_group case for EAS Vincent Guittot
2026-02-11  1:48 ` Qais Yousef
2026-02-12  7:16   ` Vincent Guittot
2026-02-12  9:55   ` Christian Loehle
2026-02-17  1:03     ` Qais Yousef
2026-02-18 16:12       ` Christian Loehle
2026-02-16 11:40 ` Christian Loehle
2026-02-24  9:13 ` [tip: sched/core] " tip-bot2 for Vincent Guittot

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®