[PATCH v5 3/6] sched/fair: Optimize checking for group_asym_packing
Ricardo Neri
ricardo.neri-calderon at linux.intel.com
Sat Sep 11 11:18:16 AEST 2021
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.
Cc: Aubrey Li <aubrey.li at intel.com>
Cc: Ben Segall <bsegall at google.com>
Cc: Daniel Bristot de Oliveira <bristot at redhat.com>
Cc: Dietmar Eggemann <dietmar.eggemann at arm.com>
Cc: Mel Gorman <mgorman at suse.de>
Cc: Quentin Perret <qperret at google.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki at intel.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada at linux.intel.com>
Cc: Steven Rostedt <rostedt at goodmis.org>
Cc: Tim Chen <tim.c.chen at linux.intel.com>
Reviewed-by: Joel Fernandes (Google) <joel at joelfernandes.org>
Reviewed-by: Len Brown <len.brown at intel.com>
Signed-off-by: Ricardo Neri <ricardo.neri-calderon at linux.intel.com>
---
Changes since v4:
* None
Changes since v3:
* Further rewording of the commit message. (Len)
Changes since v2:
* Reworded the commit message for clarity. (Peter Z)
Changes since v1:
* None
---
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 ff69f245b939..7a054f528bcc 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -8657,7 +8657,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)) {
--
2.17.1
More information about the Linuxppc-dev
mailing list