The following commit has been merged into the sched/core branch of tip: Commit-ID: cb0e4ee938b1a08507ded179cec3a35b4a8d75b8 Gitweb: https://git.kernel.org/tip/cb0e4ee938b1a08507ded179cec3a35b4a8d75b8 Author: Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx> AuthorDate: Fri, 10 Sep 2021 18:18:16 -07:00 Committer: Peter Zijlstra <peterz@xxxxxxxxxxxxx> CommitterDate: Sat, 18 Sep 2021 12:18:39 +02:00 sched/fair: Optimize checking for group_asym_packing sched_asmy_prefer() always returns false when called on the local group. By checking local_group, we can avoid additional checks and invoking sched_asmy_prefer() when it is not needed. No functional changes are introduced. Signed-off-by: Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx> Reviewed-by: Joel Fernandes (Google) <joel@xxxxxxxxxxxxxxxxx> Reviewed-by: Len Brown <len.brown@xxxxxxxxx> Reviewed-by: Vincent Guittot <vincent.guittot@xxxxxxxxxx> Link: https://lkml.kernel.org/r/20210911011819.12184-4-ricardo.neri-calderon@xxxxxxxxxxxxxxx --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e26d622..d85c5a4 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8598,7 +8598,7 @@ static inline void update_sg_lb_stats(struct lb_env *env, } /* Check if dst CPU is idle and preferred to this group */ - if (env->sd->flags & SD_ASYM_PACKING && + if (!local_group && env->sd->flags & SD_ASYM_PACKING && env->idle != CPU_NOT_IDLE && sgs->sum_h_nr_running && sched_asym_prefer(env->dst_cpu, group->asym_prefer_cpu)) {