Re: [Patch v2 2/6] sched/topology: Record number of cores in sched group

From: Tim Chen
Date: Mon Jun 12 2023 - 16:17:05 EST


On Mon, 2023-06-12 at 13:29 +0200, Peter Zijlstra wrote:
> On Thu, Jun 08, 2023 at 03:32:28PM -0700, Tim Chen wrote:
> >
> > sg->group_weight = cpumask_weight(sched_group_span(sg));
> >
> > + cpumask_copy(mask, sched_group_span(sg));
> > + for_each_cpu(cpu, mask) {
> > + cores++;
> > + cpumask_andnot(mask, mask, cpu_smt_mask(cpu));
> > + }
> > + sg->cores = cores;
> > +
> > if (!(sd->flags & SD_ASYM_PACKING))
> > goto next;
>
> Just a note; not sure we want or can do anything about this, but
> consider someone doing partitions like:
>
> [0,1] [2,3] [3,6]
> [------] [------]
>
> That is, 3 SMT cores, and 2 partitions splitting an SMT core in two.
>
> Then the domain trees will see either 2 or 3 but not the fully core.
>
> I'm perfectly fine with saying: don't do that then.

I also can't see a reason to split SMT between two domains.

Tim