Re: [PATCH v3 04/10] sched/fair: rework load_balance

From: Dietmar Eggemann
Date: Wed Oct 02 2019 - 05:21:42 EST


On 02/10/2019 08:44, Vincent Guittot wrote:
> On Tue, 1 Oct 2019 at 18:53, Dietmar Eggemann <dietmar.eggemann@xxxxxxx> wrote:
>>
>> On 01/10/2019 10:14, Vincent Guittot wrote:
>>> On Mon, 30 Sep 2019 at 18:24, Dietmar Eggemann <dietmar.eggemann@xxxxxxx> wrote:
>>>>
>>>> Hi Vincent,
>>>>
>>>> On 19/09/2019 09:33, Vincent Guittot wrote:
>>
>> [...]
>>
>>>>> @@ -7347,7 +7362,7 @@ static int detach_tasks(struct lb_env *env)
>>>>> {
>>>>> struct list_head *tasks = &env->src_rq->cfs_tasks;
>>>>> struct task_struct *p;
>>>>> - unsigned long load;
>>>>> + unsigned long util, load;
>>>>
>>>> Minor: Order by length or reduce scope to while loop ?
>>>
>>> I don't get your point here
>>
>> Nothing dramatic here! Just
>>
>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> index d0c3aa1dc290..a08f342ead89 100644
>> --- a/kernel/sched/fair.c
>> +++ b/kernel/sched/fair.c
>> @@ -7333,8 +7333,8 @@ static const unsigned int sched_nr_migrate_break = 32;
>> static int detach_tasks(struct lb_env *env)
>> {
>> struct list_head *tasks = &env->src_rq->cfs_tasks;
>> - struct task_struct *p;
>> unsigned long load, util;
>> + struct task_struct *p;
>
> hmm... I still don't get this.
> We usually gather pointers instead of interleaving them with other varaiables

I thought we should always order local variable declarations from
longest to shortest line but can't find this rule in coding-style.rst
either.

[...]