Re: [PATCH] sched/fair: Fix ftq noise bench regression

From: Vincent Guittot
Date: Wed Mar 22 2017 - 12:56:07 EST


On 22 March 2017 at 17:22, Dietmar Eggemann <dietmar.eggemann@xxxxxxx> wrote:
> On 22/03/17 09:22, Vincent Guittot wrote:
>> On 21 March 2017 at 18:46, Dietmar Eggemann <dietmar.eggemann@xxxxxxx> wrote:
>>> Hi Vincent,
>>>
>>> On 17/03/17 13:47, Vincent Guittot wrote:
>>>
>>> [...]
>>>
>>>> Reported-by: ying.huang@xxxxxxxxxxxxxxx
>>>> Signed-off-by: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
>>>> Fixes: 4e5160766fcc ("sched/fair: Propagate asynchrous detach")
>
> [...]
>
>>> Why not turn skip_blocked_update(se) into blocked_update_needed(cpu, cfs_rq)?
>>> Saves a couple of patch lines:
>>
>> Are you sure that we are saving some patch lines ?
>
> Sorry, it's actually the same :-)
>
>>
>> I tend to agree on the name and but not on parameters.
>> IMO, it's easier to understand the purpose of
>> blocked_update_needed(se) compared to blocked_update_needed(cpu,
>> cfs_rq)
>
> OK, so:
>
> - /* Propagate pending load changes to the parent */
> - if (cfs_rq->tg->se[cpu])
> + /* Propagate pending load changes to the parent if any */
> + if (blocked_update_needed(cfs_rq->tg->se[cpu]))
>
> and
>
> +static inline bool blocked_update_needed(struct sched_entity *se)
> +{
> + struct cfs_rq *gcfs_rq = group_cfs_rq(se);

gcfs_rq can't be set before testing that se is not null

> +
> + /* cfs_rq of a root task_group has no sched_entity counterpart */
> + if (!se)
> + return false;
> +
> + /*
> + * If sched_entity still have not null load or utilization, we
> have to
> + * decay it.
> + */
> ....
>
> Would make sense to me ...