sched/fair: Optimize checking for group_asym_packing
authorRicardo Neri <ricardo.neri-calderon@linux.intel.com>
Sat, 11 Sep 2021 01:18:16 +0000 (18:18 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 5 Oct 2021 13:52:02 +0000 (15:52 +0200)
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@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Reviewed-by: Len Brown <len.brown@intel.com>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lkml.kernel.org/r/20210911011819.12184-4-ricardo.neri-calderon@linux.intel.com
kernel/sched/fair.c

index 71b30ef31110fcd9877d7296aebcc1496bff0f2c..e050b1d92efe68f99f60349c923fe06ceeef1f0b 100644 (file)
@@ -8631,7 +8631,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)) {