Re: [PATCH] sched/fair: optimize should_we_balance for higher SMT systems

From: Tim Chen
Date: Wed Sep 06 2023 - 11:57:05 EST


On Wed, 2023-09-06 at 07:36 +0530, Shrikanth Hegde wrote:
>
> Hi Tim,
>
> Thanks for taking a look at this patch.
>
> > Wonder if we can avoid allocating the
> > should_we_balance_tmpmask for SMT2 case to save memory
> > for system with large number of cores.
> >
> > The new mask and logic I think is only needed for more than 2 threads in a core.
>
> Code would have to be refactored quite a bit if one needs to take
> different approach for specific SMT setting.
>
> I think there would some cases in SMT2 that will benefit as well.
> Lets say 1 cpu in each core is busy. the busy CPU happens to be second
> CPU in the core. In that case, this approach would skip that instead of
> checking if that is idle or not.
>
>
That's true. This change could skip the sibling for SMT2.

Tim