Skip to content

Commit

Permalink
sched/fair: Provide update_sg_lb_stats() with sched domain statistics
Browse files Browse the repository at this point in the history
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) <[email protected]>
Signed-off-by: Ricardo Neri <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Joel Fernandes (Google) <[email protected]>
Reviewed-by: Len Brown <[email protected]>
Reviewed-by: Vincent Guittot <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
  • Loading branch information
ricardon authored and Peter Zijlstra committed Oct 5, 2021
1 parent 6025643 commit c0d14b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -8579,6 +8579,7 @@ group_type group_classify(unsigned int imbalance_pct,
* @sg_status: Holds flag indicating the status of the sched_group
*/
static inline void update_sg_lb_stats(struct lb_env *env,
struct sd_lb_stats *sds,
struct sched_group *group,
struct sg_lb_stats *sgs,
int *sg_status)
Expand All @@ -8587,7 +8588,7 @@ static inline void update_sg_lb_stats(struct lb_env *env,

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

local_group = cpumask_test_cpu(env->dst_cpu, sched_group_span(group));
local_group = group == sds->local;

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

update_sg_lb_stats(env, sg, sgs, &sg_status);
update_sg_lb_stats(env, sds, sg, sgs, &sg_status);

if (local_group)
goto next_group;
Expand Down

0 comments on commit c0d14b5

Please sign in to comment.