Messages in this thread Patch in this message | | | From | Yicong Yang <> | Subject | [PATCH] sched/fair: Clear target from cpus to scan in select_idle_cpu | Date | Wed, 24 Nov 2021 16:54:01 +0800 |
| |
Commit 56498cfb045d noticed that "When select_idle_cpu starts scanning for an idle CPU, it starts with a target CPU that has already been checked by select_idle_sibling. This patch starts with the next CPU instead." It only changed the scanning start cpu to target + 1 but still leave the target in the scanning cpumask. The target still have a chance to be checked in the last turn. Fix this by clear the target from the cpus to scan.
Fixes: 56498cfb045d ("sched/fair: Avoid a second scan of target in select_idle_cpu") Signed-off-by: Yicong Yang <yangyicong@hisilicon.com> --- kernel/sched/fair.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6e476f6d9435..e1031e0da231 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6249,6 +6249,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool return -1; cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); + cpumask_clear_cpu(target, cpus); if (sched_feat(SIS_PROP) && !has_idle_core) { u64 avg_cost, avg_idle, span_avg; -- 2.33.0
| |