From: Adam Li <adamli@os.amperecomputing.com>
To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org
Cc: dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
cl@linux.com, linux-kernel@vger.kernel.org,
patches@amperecomputing.com, shkaushik@amperecomputing.com,
Adam Li <adamli@os.amperecomputing.com>
Subject: [PATCH v2 3/6] sched/fair: Only count group weight for CPUs doing load balance when looking for src group
Date: Thu, 17 Jul 2025 06:20:33 +0000 [thread overview]
Message-ID: <20250717062036.432243-4-adamli@os.amperecomputing.com> (raw)
In-Reply-To: <20250717062036.432243-1-adamli@os.amperecomputing.com>
Load balancing is limitted to a set of CPUs, such as active CPUs.
Group classification may be incorrect if group weight counts inactive CPUs.
Signed-off-by: Adam Li <adamli@os.amperecomputing.com>
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 452e2df961b9..db9ec6a6acdf 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -10427,7 +10427,7 @@ static inline void update_sg_lb_stats(struct lb_env *env,
sgs->group_capacity = group->sgc->capacity;
- sgs->group_weight = group->group_weight;
+ sgs->group_weight = cpumask_weight_and(sched_group_span(group), env->cpus);
/* Check if dst CPU is idle and preferred to this group */
if (!local_group && env->idle && sgs->sum_h_nr_running &&
--
2.34.1
next prev parent reply other threads:[~2025-07-17 6:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-17 6:20 [PATCH v2 0/6] sched/fair: Fix imbalance issue when balancing fork Adam Li
2025-07-17 6:20 ` [PATCH v2 1/6] sched/fair: Only update stats for allowed CPUs when looking for dst group Adam Li
2025-07-17 6:20 ` [PATCH v2 2/6] sched/fair: Only count group weight " Adam Li
2025-07-17 6:20 ` Adam Li [this message]
2025-07-17 6:20 ` [RFC PATCH v2 4/6] sched/fair: Make update_sg_wakeup_stats() helper functions handle NULL pointers Adam Li
2025-07-17 6:20 ` [RFC PATCH v2 5/6] sched/fair: Introduce update_sg_stats() Adam Li
2025-07-17 6:20 ` [RFC PATCH v2 6/6] sched/fair: Unify update_sg_lb_stats() and update_sg_wakeup_stats() Adam Li
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=20250717062036.432243-4-adamli@os.amperecomputing.com \
--to=adamli@os.amperecomputing.com \
--cc=bsegall@google.com \
--cc=cl@linux.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=patches@amperecomputing.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=shkaushik@amperecomputing.com \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/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®