[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a8b4d514-f242-70ac-05c2-4ed31e2f66b8@arm.com>
Date: Fri, 13 Jul 2018 16:57:46 +0200
From: Dietmar Eggemann <dietmar.eggemann@....com>
To: Joel Fernandes <joel@...lfernandes.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Morten Rasmussen <morten.rasmussen@....com>,
Patrick Bellasi <patrick.bellasi@....com>,
Quentin Perret <quentin.perret@....com>,
kernel-team@...roid.com, Joel Fernandes <joelaf@...gle.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched/fair: Remove setting task's se->runnable_weight
during PELT update
On 07/12/2018 10:17 AM, Joel Fernandes wrote:
> On Wed, Jul 11, 2018 at 10:43:28AM +0200, Dietmar Eggemann wrote:
>> On 07/11/2018 01:09 AM, Joel Fernandes wrote:
>>> On Mon, Jul 09, 2018 at 05:47:53PM +0100, Dietmar Eggemann wrote:
>>>> A CFS (SCHED_OTHER, SCHED_BATCH or SCHED_IDLE policy) task's
>>>> se->runnable_weight must always be in sync with its se->load.weight.
>>>>
>>>> se->runnable_weight is set to se->load.weight when the task is
>>>> forked (init_entity_runnable_average()) or reniced (reweight_entity()).
>>>>
>>>> There are two cases in set_load_weight() which since they currently only
>>>> set se->load.weight could lead to a situation in which se->load.weight
>>>> is different to se->runnable_weight for a CFS task:
>>>>
>>>> (1) A task switches to SCHED_IDLE.
>>>>
>>>> (2) A SCHED_FIFO, SCHED_RR or SCHED_DEADLINE task which has been reniced
>>>> (during which only its static priority gets set) switches to
>>>> SCHED_OTHER or SCHED_BATCH.
>>>>
>>>> Set se->runnable_weight to se->load.weight in these two cases to prevent
>>>> this. This eliminates the need to explicitly set it to se->load.weight
>>>> during PELT updates in the CFS scheduler fastpath.
>>>
>>> Looks good to me. By the way just asking, is there a chance where
>>> se_weight(se) and se_runnable(se) can ever be different?
>>
>> Yes they can be different, not for a task though but for se's representing
>> task groups. It got introduced to be able to propagate load and runnable
>> load independently through the task groups hierarchies.
>
> I know that task-group se has different values. I was saying for task ses,
> the extra division can be skipped possibly improving performance (if at all).
Ah, OK, I didn't pay attention to the '... if the sa belongs to the
task:' part.
Since ___update_load_sum() is either called with !!se->on_rq or 0 for
both ('load' and 'runnable'), sa->load_sum and sa->runnable_load_sum
should be equal for a task.
And since se_weight(se) and se_runnable(se) for 'load' and 'runnable' of
___update_load_avg() are the same for a task, sa->load_avg and
sa->runnable_load_avg should be also equal for a task.
You would have to pass the information that sa belongs to a se and not
to a cfs_rq into ___update_load_avg() though to be able to use
entity_is_task().
[...]
Powered by blists - more mailing lists