[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <176820500726.510.7772385026461136688.tip-bot2@tip-bot2>
Date: Mon, 12 Jan 2026 08:03:27 -0000
From: "tip-bot2 for Yury Norov (NVIDIA)" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: "Yury Norov (NVIDIA)" <yury.norov@...il.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
K Prateek Nayak <kprateek.nayak@....com>, Phil Auld <pauld@...hat.com>,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip: sched/core] sched/fair: Simplify task_numa_find_cpu()
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 0ab25ea2a3b3a973fb914d0e47dc9c3c26049e8b
Gitweb: https://git.kernel.org/tip/0ab25ea2a3b3a973fb914d0e47dc9c3c26049e8b
Author: Yury Norov (NVIDIA) <yury.norov@...il.com>
AuthorDate: Sat, 06 Dec 2025 22:30:36 -05:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Thu, 08 Jan 2026 12:43:56 +01:00
sched/fair: Simplify task_numa_find_cpu()
Use for_each_cpu_and() and drop some housekeeping code.
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@...il.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: K Prateek Nayak <kprateek.nayak@....com>
Reviewed-by: Phil Auld <pauld@...hat.com>
Link: https://patch.msgid.link/20251207033037.399608-1-yury.norov@gmail.com
---
kernel/sched/fair.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 64275d7..842a0f2 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2494,11 +2494,8 @@ static void task_numa_find_cpu(struct task_numa_env *env,
maymove = !load_too_imbalanced(src_load, dst_load, env);
}
- for_each_cpu(cpu, cpumask_of_node(env->dst_nid)) {
- /* Skip this CPU if the source task cannot migrate */
- if (!cpumask_test_cpu(cpu, env->p->cpus_ptr))
- continue;
-
+ /* Skip CPUs if the source task cannot migrate */
+ for_each_cpu_and(cpu, cpumask_of_node(env->dst_nid), env->p->cpus_ptr) {
env->dst_cpu = cpu;
if (task_numa_compare(env, taskimp, groupimp, maymove))
break;
Powered by blists - more mailing lists