diff options
author | Abel Wu <[email protected]> | 2022-09-07 19:19:57 +0800 |
---|---|---|
committer | Peter Zijlstra <[email protected]> | 2022-09-07 21:53:46 +0200 |
commit | b9bae70440d21e106fbc098803b5a190df65f2e0 (patch) | |
tree | c2b6a828a631d00a7adb80b24b19256396cc44b5 | |
parent | 3e6efe87cd5ccabf0f1d4e3ef25881ca0fd337e7 (diff) |
sched/fair: Avoid double search on same cpu
The prev cpu is checked at the beginning of SIS, and it's unlikely
to be idle before the second check in select_idle_smt(). So we'd
better focus on its SMT siblings.
Signed-off-by: Abel Wu <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Josh Don <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
-rw-r--r-- | kernel/sched/fair.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 9657c7de5f57..1ad79aaaaf93 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6355,6 +6355,8 @@ static int select_idle_smt(struct task_struct *p, int target) int cpu; for_each_cpu_and(cpu, cpu_smt_mask(target), p->cpus_ptr) { + if (cpu == target) + continue; if (available_idle_cpu(cpu) || sched_idle_cpu(cpu)) return cpu; } |