File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -7073,6 +7073,17 @@ group_is_overloaded(struct lb_env *env, struct sg_lb_stats *sgs)
70737073 return false;
70747074}
70757075
7076+ /*
7077+ * group_smaller_cpu_capacity: Returns true if sched_group sg has smaller
7078+ * per-CPU capacity than sched_group ref.
7079+ */
7080+ static inline bool
7081+ group_smaller_cpu_capacity (struct sched_group * sg , struct sched_group * ref )
7082+ {
7083+ return sg -> sgc -> min_capacity * capacity_margin <
7084+ ref -> sgc -> min_capacity * 1024 ;
7085+ }
7086+
70767087static inline enum
70777088group_type group_classify (struct sched_group * group ,
70787089 struct sg_lb_stats * sgs )
@@ -7176,6 +7187,20 @@ static bool update_sd_pick_busiest(struct lb_env *env,
71767187 if (sgs -> avg_load <= busiest -> avg_load )
71777188 return false;
71787189
7190+ if (!(env -> sd -> flags & SD_ASYM_CPUCAPACITY ))
7191+ goto asym_packing ;
7192+
7193+ /*
7194+ * Candidate sg has no more than one task per CPU and
7195+ * has higher per-CPU capacity. Migrating tasks to less
7196+ * capable CPUs may harm throughput. Maximize throughput,
7197+ * power/energy consequences are not considered.
7198+ */
7199+ if (sgs -> sum_nr_running <= sgs -> group_weight &&
7200+ group_smaller_cpu_capacity (sds -> local , sg ))
7201+ return false;
7202+
7203+ asym_packing :
71797204 /* This is the busiest node in its class. */
71807205 if (!(env -> sd -> flags & SD_ASYM_PACKING ))
71817206 return true;
You can’t perform that action at this time.
0 commit comments