Skip to content

Commit

Permalink
sched/topology: Propagate SMT flags when removing degenerate domain
Browse files Browse the repository at this point in the history
When a degenerate cluster domain for core with SMT CPUs is removed,
the SD_SHARE_CPUCAPACITY flag in the local child sched group was not
propagated to the new parent.  We need this flag to properly determine
whether the local sched group is SMT.  Set the flag in the local
child sched group of the new parent sched domain.

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Link: https://lkml.kernel.org/r/73cf0959eafa53c02e7ef6bf805d751d9190e55d.1683156492.git.tim.c.chen@linux.intel.com
  • Loading branch information
Tim C Chen authored and Peter Zijlstra committed May 8, 2023
1 parent 519fabc commit bf2dc42
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kernel/sched/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,13 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)

if (sd_parent_degenerate(tmp, parent)) {
tmp->parent = parent->parent;
if (parent->parent)

if (parent->parent) {
parent->parent->child = tmp;
if (tmp->flags & SD_SHARE_CPUCAPACITY)
parent->parent->groups->flags |= SD_SHARE_CPUCAPACITY;
}

/*
* Transfer SD_PREFER_SIBLING down in case of a
* degenerate parent; the spans match for this
Expand Down

0 comments on commit bf2dc42

Please sign in to comment.