Skip to content

Commit c0d14b5

Browse files
ricardonPeter Zijlstra
authored and
Peter Zijlstra
committed
sched/fair: Provide update_sg_lb_stats() with sched domain statistics
Before deciding to pull tasks when using asymmetric packing of tasks, on some architectures (e.g., x86) it is necessary to know not only the state of dst_cpu but also of its SMT siblings. The decision to classify a candidate busiest group as group_asym_packing is done in update_sg_lb_stats(). Give this function access to the scheduling domain statistics, which contains the statistics of the local group. Originally-by: Peter Zijlstra (Intel) <peterz@infradead.org> 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-5-ricardo.neri-calderon@linux.intel.com
1 parent 6025643 commit c0d14b5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kernel/sched/fair.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -8579,6 +8579,7 @@ group_type group_classify(unsigned int imbalance_pct,
85798579
* @sg_status: Holds flag indicating the status of the sched_group
85808580
*/
85818581
static inline void update_sg_lb_stats(struct lb_env *env,
8582+
struct sd_lb_stats *sds,
85828583
struct sched_group *group,
85838584
struct sg_lb_stats *sgs,
85848585
int *sg_status)
@@ -8587,7 +8588,7 @@ static inline void update_sg_lb_stats(struct lb_env *env,
85878588

85888589
memset(sgs, 0, sizeof(*sgs));
85898590

8590-
local_group = cpumask_test_cpu(env->dst_cpu, sched_group_span(group));
8591+
local_group = group == sds->local;
85918592

85928593
for_each_cpu_and(i, sched_group_span(group), env->cpus) {
85938594
struct rq *rq = cpu_rq(i);
@@ -9150,7 +9151,7 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd
91509151
update_group_capacity(env->sd, env->dst_cpu);
91519152
}
91529153

9153-
update_sg_lb_stats(env, sg, sgs, &sg_status);
9154+
update_sg_lb_stats(env, sds, sg, sgs, &sg_status);
91549155

91559156
if (local_group)
91569157
goto next_group;

0 commit comments

Comments
 (0)