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

From: Dietmar Eggemann
Date: Wed Mar 22 2017 - 12:30:57 EST


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);
+
+ /* 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 ...