Skip to content

Commit

Permalink
sched/fair: Clear SMT siblings after determining the core is not idle
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Mel Gorman authored and Ingo Molnar committed Dec 11, 2020
1 parent 59a74b1 commit 13d5a5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/*
Expand Down

0 comments on commit 13d5a5e

Please sign in to comment.