From nobody Mon Feb 9 02:15:29 2026 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E87D42D97A4 for ; Fri, 6 Feb 2026 09:55:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770371710; cv=none; b=FWdUaTirkxiq1nLXuU1B2Z+yZXWn4c/He7ahnWDA/6sxMo3riNOfJMcjDYWVHf5suknm2Ygnj4hML8KthiN4vYz3xZVs9Yeeo4UIf3VsXOKXxOoNixivVntf3GGfEJr887YpqkP2M49MdEjbdKyliVKok/3RTbhMnU2jQ+l7y/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770371710; c=relaxed/simple; bh=L4z+jlW5LI8remVO7+UAam1tVzXpmb2l7V6kfhHp6Dc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JM3KJmBo9mXWXvlOvONJiQtC8rut6AID12riJssiNd1sL2skuTI/7idIHZRuzvv+ZLUo5VAaa164hJHzX49LarM5oTFEG2wjm8rjl7NvodpXHU4GUKQV/b0IzgnTspeOaWIcNzAoiQkM045E/JcJlWufVBSnPl9UPXT/Prk+tNw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=gLpaM7ag; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gLpaM7ag" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-4362507f0feso782402f8f.0 for ; Fri, 06 Feb 2026 01:55:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770371708; x=1770976508; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sL/SezJ9qga4cnrAuFLIyVgAKvhY4qlIDOgWFNhUfLw=; b=gLpaM7ag+SNrhyhTfw05yrgPh1NBkj+Q5RG7+H7/4W57VgCfw2Z5nI4QSooLVWVnFP cy380E8AkERyasaQL5TdXzmYbq6l3r5I2b+7ixMMtw7+yjbwwclm8xVDsaL3E/gazSR2 gaAux9+GnaJmPHSx6iL5r8Nw+9kor5yl/243AWx3xx5tkNxXjZPwyyU6iynuiud4Vj5r 92NqejeZ8KcNH6k+biv3DTLt+81VzcAercoWst8PCntuofQrbhu351Hkar2g7w17kRQL NoKQiTz/2hYaRsFhonJZpRPb5K/PJHB2272RgqclU/GfEq2N+j9fcahrxDGNXsZQ5agS FYlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770371708; x=1770976508; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=sL/SezJ9qga4cnrAuFLIyVgAKvhY4qlIDOgWFNhUfLw=; b=JS4EusGEDDWwVTOb2YkVe1izi1/lo3xekwUa0fbHxzS6ByVC54BmIEaUg4INz5Epi7 VZYqUuOWrf5DxS+dogaLKniVHmYDkj2x205Xnm1FS6O0OIge/9Cmh0HcpbH2NlEwm1Tx D0RPCK6xODi+AGXaprdp20bmxbazoH5gPxcESwOEEv9nLAkTBI3kDH9ej8+ZkqPoeTCX x1kmGKdkaJjvpV9TH0dQCPFv1UAH+1ls6TVbNqpG3AqUpn66VZc3X4fcCOkA22ZqC/Ug 6TmHGc5lqR0u2ZatBbJn+fW69saOGKybIB/h1NZdU/8sggNi+WhaGW5X3cVnJ0L3tCyc TE4Q== X-Forwarded-Encrypted: i=1; AJvYcCUQV5yaq9mrBVD/bA3cS95w0db47V7LHeuzCtI/pwlqYXCEXOp4UbH/ypoVTw3W06uDN2J8GtowvYsLlKM=@vger.kernel.org X-Gm-Message-State: AOJu0YxOF1kZ00cmtfhrWM/8B/3FCAV1KDbvP+IHHiUkNJ9m6j+zmY+p CYrtqoWHxieYzKV7zzLZFob6pJAEM8uUsCy55XU9KcAb3e8XBBAp4YzEqfePY02/wFo= X-Gm-Gg: AZuq6aJNxicZsDj1xEbaIfYJVDvTpjM//lEKs55IIFoqDroHQzGkKRFQdHXKZBZdBQ1 z+cWL08XITIULoulBLdIlfEhaUJ6v1NEMZdHbZnQ4+0iALWeAJ/LIeXd5VbJr2S0sGXphgRmKfb +O9/kshbSYGA/4Z5cjFtutHsqpvIIUZFk23ZG7yo/hr/krxYEfG8ZJ61njuq2YblOWtZTgyKz7V PnsvbNdE4JFmquVZX4XIEOAtjmX+FVIO24nbQhaN6Ry5559jXC0V/mOjrzb8Acj8bTY9Cd406gp eC2WmxfGjr0wHbPf/0FJBDHLH+joJUkEmhlkqqQiPUjU3z8BjQM5qo1dZNfbuJrw1VLt3eNUPyj J+jb/VgmxWVt25Y6E2DH7Z9W4ash1r6KcEuPwAYmuzMJ/bLXkrHvZzRxcXkTJISVK7JOzmqQP4t N5fcVtvhzr8tXgjcVUWuE= X-Received: by 2002:a05:6000:40e1:b0:42f:9f18:8f40 with SMTP id ffacd0b85a97d-4362938d4e9mr3598384f8f.42.1770371708088; Fri, 06 Feb 2026 01:55:08 -0800 (PST) Received: from vingu-cube.. ([2a01:e0a:f:6020:306b:6f7e:eaa0:22d2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-436296bd1c9sm4406061f8f.15.2026.02.06.01.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 01:55:07 -0800 (PST) From: Vincent Guittot To: 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, christian.loehle@arm.com, luis.machado@arm.com, Vincent Guittot Subject: [PATCH v9] sched/fair: Filter false overloaded_group case for EAS Date: Fri, 6 Feb 2026 10:54:54 +0100 Message-ID: <20260206095454.1520619-1-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- 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@li= naro.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 CP= U */ 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 t= he 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, str= uct 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 <=3D sgs->group_weight) return false; =20 @@ -10384,14 +10392,12 @@ sched_reduced_capacity(struct rq *rq, struct sche= d_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 =3D env->sd->flags; bool balancing_at_rd =3D !env->sd->parent; @@ -10413,7 +10419,7 @@ static inline void update_sg_lb_stats(struct lb_env= *env, sgs->sum_nr_running +=3D nr_running; =20 if (cpu_overutilized(i)) - *sg_overutilized =3D 1; + sgs->group_overutilized =3D 1; =20 /* * 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_e= nv *env, struct sd_lb_stats *sd update_group_capacity(env->sd, env->dst_cpu); } =20 - update_sg_lb_stats(env, sds, sg, sgs, &sg_overloaded, &sg_overutilized); + update_sg_lb_stats(env, sds, sg, sgs, &sg_overloaded); =20 if (!local_group && update_sd_pick_busiest(env, sds, sg, sgs)) { sds->busiest =3D sg; sds->busiest_stat =3D *sgs; } =20 + sg_overutilized |=3D sgs->group_overutilized; + /* Now, start updating sd_lb_stats */ sds->total_load +=3D sgs->group_load; sds->total_capacity +=3D sgs->group_capacity; --=20 2.43.0