[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1635578759-32343-1-git-send-email-yuanzhaoxiong@baidu.com>
Date: Sat, 30 Oct 2021 15:25:59 +0800
From: Yuan ZhaoXiong <yuanzhaoxiong@...du.com>
To: mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
bristot@...hat.com
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] sched/fair: Simplify task_numa_find_cpu()
Combine the 'cpumask_of_node()' with 'env->p->cpus_ptr' and drop the
cpumask_test_cpu().
Signed-off-by: Yuan ZhaoXiong <yuanzhaoxiong@...du.com>
---
kernel/sched/fair.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f6a05d9..dc064d7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1950,11 +1950,7 @@ 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;
-
+ 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;
--
1.8.3.1
Powered by blists - more mailing lists