From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5812C27055D for ; Mon, 16 Feb 2026 11:41:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771242065; cv=none; b=Yjqd/Hy2EEKiXJCcaKRRj6pXUN+kwdCCPql84bYbWnhWRLJE9oCpKJwN93ddNRCo1v+ayhecgiVZRWfOGy9qDb4jCODsPZuzMLxlqzNYEHoHKBI5sBwLKFUm45d3TA2jrc1Tq4cU/nIBzQV3/o6wAMe6cgv5jmUQYjgdKMS/3HA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771242065; c=relaxed/simple; bh=+d5D52tN7kk27rfgCjL9UhrR9ffNZszFMXV+rVWOkFU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=a8ULq/d0Pt1yAIiJIQpOwBSz2BbTEwT0+Pl/FrtYYnzGc2MVKJIx9ropaxFAozNizH+/RVj9t7iLnbjfZZmmJSRKwJx2+A9AD3OTn8V3V8P20T0/JL4PrmG6eX0VIkTGJjkeKj2kRgK4ajWpq37OhoizShhGc11gYZNxIecFbVU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4EA23150C; Mon, 16 Feb 2026 03:40:56 -0800 (PST) Received: from [10.1.34.88] (e127648.arm.com [10.1.34.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B47253F632; Mon, 16 Feb 2026 03:40:59 -0800 (PST) Message-ID: <8834f9a7-7903-4a34-a0ea-c20f7f294c00@arm.com> Date: Mon, 16 Feb 2026 11:40:57 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v9] sched/fair: Filter false overloaded_group case for EAS To: Vincent Guittot , mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, linux-kernel@vger.kernel.org, pierre.gondois@arm.com, kprateek.nayak@amd.com Cc: qyousef@layalina.io, hongyan.xia2@arm.com, luis.machado@arm.com References: <20260206095454.1520619-1-vincent.guittot@linaro.org> Content-Language: en-US From: Christian Loehle In-Reply-To: <20260206095454.1520619-1-vincent.guittot@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 > Tested-by: Pierre Gondois Reviewed-by: Christian Loehle > --- > > 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;