sched/fair: Clear SMT siblings after determining the core is not idle

The clearing of SMT siblings from the SIS mask before checking for an idle
core is a small but unnecessary cost. Defer the clearing of the siblings
until the scan moves to the next potential target. The cost of this was
not measured as it is borderline noise but it should be self-evident.

Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lkml.kernel.org/r/20201130144020.GS3371@techsingularity.net
This commit is contained in:
Mel Gorman 2020-11-30 14:40:20 +00:00 committed by Ingo Molnar
parent 59a74b1544
commit 13d5a5e9f9
1 changed files with 2 additions and 1 deletions

View File

@ -6086,10 +6086,11 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int
break;
}
}
cpumask_andnot(cpus, cpus, cpu_smt_mask(core));
if (idle)
return core;
cpumask_andnot(cpus, cpus, cpu_smt_mask(core));
}
/*