Re: [PATCH 3/4] sched/fair: Consider SMT in ASYM_PACKING load balance

From: Ricardo Neri
Date: Tue Apr 06 2021 - 19:18:29 EST


On Tue, Apr 06, 2021 at 01:18:09PM +0200, Peter Zijlstra wrote:
> On Mon, Apr 05, 2021 at 09:11:07PM -0700, Ricardo Neri wrote:
> > +static bool cpu_group_is_smt(int cpu, struct sched_group *sg)
> > +{
> > +#ifdef CONFIG_SCHED_SMT
> > + if (!static_branch_likely(&sched_smt_present))
> > + return false;
> > +
> > + if (sg->group_weight == 1)
> > + return false;
> > +
> > + if (cpumask_weight(cpu_smt_mask(cpu)) == 1)
> > + return false;
>
> Please explain this condition. Why is it required?

Thank you for your quick review Peter!

Probably this is not required since the previous check verifies the
group weight, and the subsequent check makes sure that @sg matches the
SMT siblings of @cpu.

Thanks and BR,
Ricardo