Re: [PATCH] sched: Make ASYM_PACKING compile-time arch config

From: Michael Ellerman
Date: Tue Oct 22 2024 - 22:29:53 EST


Shrikanth Hegde <sshegde@xxxxxxxxxxxxx> writes:
> On 10/18/24 03:16, Christian Loehle wrote:
>> Only x86 and Power7 set SD_ASYM_PACKING at boot-time depending on the
>
> Power10 on Shared Processor LPAR also enables that.
>
>> system. All other platforms don't make use of asym-packing anyway,
>> so introduce auxiliary ARCH_HAS_SCHED_ASYM_PACKING and guard all the
>> related logic behind that so it isn't compiled when not needed.
>>
>> On arm64 this reduces
>> size kernel/sched/fair.o
>> text data bss dec hex filename
>> 74120 4097 88 78305 131e1 kernel/sched/fair.o
>> to
>> size kernel/sched/fair.o
>> text data bss dec hex filename
>> 72896 4065 88 77049 12cf9 kernel/sched/fair.o
>>
>> Most of that is on the load-balance hot-path, in particular
>> need_active_balance() reduces from 141 to 84 instructions.
>
> This patch sprinkes #ifdef across the code. IMHO it makes the code
> difficult to read.

Yes, strong agree on that.

It should be possible to clean that up for the most part with some
static inline helpers with stubs for the disabled case, in the usual
kernel style.

Also Christian please Cc linuxppc-dev@xxxxxxxxxxxxxxxx on v2.

cheers