sched/fair: simplify task_numa_find_cpu()
PATCH RESEND 1/1 sched/fair: simplify task_numa_find_cpu()
Use for_each_cpu_and() and drop some housekeeping code.
Reviewed-by K Prateek Nayak <[email protected]>
Reviewed-by Phil Auld <[email protected]>
Signed-off-by Yury Norov (NVIDIA) <[email protected]>
---
Rebased and re-tested on top of master. Original patch:
https://lore.kernel.org/all/[email protected]/
kernel/sched/fair.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
kernel/sched/fair.c +2 -5
@@ -2458,11 +2458,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 ;
Signature · 1 line
2.43.0
[tip: sched/core] sched/fair: Simplify task_numa_find_cpu()
The following commit has been merged into the sched/core branch of tip:
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) <[email protected]> AuthorDate: Sat, 06 Dec 2025 22:30:36 -05:00 Committer: Peter Zijlstra <[email protected]> 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) <[email protected]>
Signed-off-by Peter Zijlstra (Intel) <[email protected]>
Reviewed-by K Prateek Nayak <[email protected]>
Reviewed-by Phil Auld <[email protected]>
--- kernel/sched/fair.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
kernel/sched/fair.c +2 -5
@@ -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 ;