Re: [PATCH v2 4/9] sched/topology: Kill SD_LOAD_BALANCE
From: Valentin Schneider
Date: Thu Mar 19 2020 - 08:06:33 EST
On Thu, Mar 19 2020, Dietmar Eggemann wrote:
> On 11.03.20 19:15, Valentin Schneider wrote:
>> That flag is set unconditionally in sd_init(), and no one checks for it
>> anymore. Remove it.
>
> Why not merge 3/9 and 4/9 ?
>
> [...]
>
>> diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
>> index f341163fedc9..8de2f9744569 100644
>> --- a/include/linux/sched/topology.h
>> +++ b/include/linux/sched/topology.h
>> @@ -11,21 +11,20 @@
>> */
>> #ifdef CONFIG_SMP
>>
>> -#define SD_LOAD_BALANCE 0x0001 /* Do load balancing on this domain. */
>> -#define SD_BALANCE_NEWIDLE 0x0002 /* Balance when about to become idle */
>
> [...]
>
>> -#define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */
>> -#define SD_NUMA 0x4000 /* cross-node balancing */
>> +#define SD_BALANCE_NEWIDLE 0x0001 /* Balance when about to become idle */
>
> IMHO, changing the values of the remaining SD flags will break lots of
> userspace scripts.
>
True, and that includes some of my own scripts. That's also part of why
I have this 3/9 and 4/9 split: 4/9 is the externally visible part. If
deemed necessary, we could keep the definition of SD_LOAD_BALANCE but
kill all of its uses.
Alternatively, I was thinking that we could leverage [1] to make
/proc/sys/kernel/sched_domain/cpu*/domain*/flags print
e.g. comma-separated flag names rather than flag values. That way the
userland scripts would no longer have to contain some
{flag_value : flag_name} translation.
[1]: https://lkml.kernel.org/r/20200311183320.19186-1-valentin.schneider@xxxxxxx
> [...]