From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Juri Lelli <juri.lelli@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
linux-kernel <linux-kernel@vger.kernel.org>,
Phil Auld <pauld@redhat.com>, Parth Shah <parth@linux.ibm.com>,
Valentin Schneider <valentin.schneider@arm.com>,
Hillf Danton <hdanton@sina.com>
Subject: Re: [PATCH v2 1/5] sched/fair: Reorder enqueue/dequeue_task_fair path
Date: Thu, 20 Feb 2020 14:38:59 +0100 [thread overview]
Message-ID: <274ebb9a-9328-e312-f554-34da8b183932@arm.com> (raw)
In-Reply-To: <CAKfTPtCbHb2X30gNqNp5sukrg9U-hC6rvWC0dj8d1DawNL4D3Q@mail.gmail.com>
On 19/02/2020 17:26, Vincent Guittot wrote:
> On Wed, 19 Feb 2020 at 12:07, Dietmar Eggemann <dietmar.eggemann@arm.com> wrote:
>>
>> On 18/02/2020 15:15, Vincent Guittot wrote:
>>> On Tue, 18 Feb 2020 at 14:22, Peter Zijlstra <peterz@infradead.org> wrote:
>>>>
>>>> On Tue, Feb 18, 2020 at 01:37:37PM +0100, Dietmar Eggemann wrote:
>>>>> On 14/02/2020 16:27, Vincent Guittot wrote:
>>>>>> The walk through the cgroup hierarchy during the enqueue/dequeue of a task
>>>>>> is split in 2 distinct parts for throttled cfs_rq without any added value
>>>>>> but making code less readable.
>>>>>>
>>>>>> Change the code ordering such that everything related to a cfs_rq
>>>>>> (throttled or not) will be done in the same loop.
>>>>>>
>>>>>> In addition, the same steps ordering is used when updating a cfs_rq:
>>>>>> - update_load_avg
>>>>>> - update_cfs_group
>>>>>> - update *h_nr_running
>>>>>
>>>>> Is this code change really necessary? You pay with two extra goto's. We
>>>>> still have the two for_each_sched_entity(se)'s because of 'if
>>>>> (se->on_rq); break;'.
>>>>
>>>> IIRC he relies on the presented ordering in patch #5 -- adding the
>>>> running_avg metric.
>>>
>>> Yes, that's the main reason, updating load_avg before h_nr_running
>>
>> My hunch is you refer to the new function:
>>
>> static inline void se_update_runnable(struct sched_entity *se)
>> {
>> if (!entity_is_task(se))
>> se->runnable_weight = se->my_q->h_nr_running;
>> }
>>
>> I don't see the dependency to the 'update_load_avg -> h_nr_running'
>> order since it operates on se->my_q, not cfs_rq = cfs_rq_of(se), i.e.
>> se->cfs_rq.
>>
>> What do I miss here?
>
> update_load_avg() updates both se and cfs_rq so if you update
> cfs_rq->h_nr_running before calling update_load_avg() like in the 2nd
> for_each_sched_entity, you will update cfs_rq runnable_avg for the
> past time slot with the new h_nr_running value instead of the previous
> value.
Ah, now I see:
update_load_avg()
update_cfs_rq_load_avg()
__update_load_avg_cfs_rq()
___update_load_sum(..., cfs_rq->h_nr_running, ...)
^^^^^^^^^^^^^^^^^^^^
Not really obvious IMHO, since the code is introduced only in 4/5.
Could you add a comment to this patch header?
I see you mentioned this dependency already in v1 discussion
https://lore.kernel.org/r/CAKfTPtAM=kgF7Fz-JKFY+s_k5KFirs-8Bub3s1Eqtq7P0NMa0w@mail.gmail.com
"... But the following patches make PELT using h_nr_running ...".
IMHO it would be helpful to have this explanation in the 1/5 patch
header so people stop wondering why this is necessary.
next prev parent reply other threads:[~2020-02-20 13:39 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-14 15:27 [PATCH v2 0/5] remove runnable_load_avg and improve group_classify Vincent Guittot
2020-02-14 15:27 ` [PATCH v2 1/5] sched/fair: Reorder enqueue/dequeue_task_fair path Vincent Guittot
2020-02-18 12:37 ` Dietmar Eggemann
2020-02-18 13:22 ` Peter Zijlstra
2020-02-18 14:15 ` Vincent Guittot
2020-02-19 11:07 ` Dietmar Eggemann
2020-02-19 16:26 ` Vincent Guittot
2020-02-20 13:38 ` Dietmar Eggemann [this message]
[not found] ` <20200222152541.GA11669@geo.homenetwork>
2020-02-26 16:30 ` Vincent Guittot
2020-02-14 15:27 ` [PATCH v2 2/5] sched/numa: Replace runnable_load_avg by load_avg Vincent Guittot
2020-02-18 12:37 ` Dietmar Eggemann
2020-02-18 13:50 ` Mel Gorman
2020-02-18 14:17 ` Vincent Guittot
2020-02-18 14:42 ` Dietmar Eggemann
2020-02-18 14:54 ` Valentin Schneider
2020-02-18 15:33 ` Vincent Guittot
2020-02-18 15:38 ` Mel Gorman
2020-02-18 16:50 ` Valentin Schneider
2020-02-18 17:41 ` Mel Gorman
2020-02-18 17:54 ` Valentin Schneider
2020-02-18 16:51 ` Vincent Guittot
2020-02-14 15:27 ` [PATCH v2 3/5] sched/pelt: Remove unused runnable load average Vincent Guittot
2020-02-21 9:57 ` Dietmar Eggemann
2020-02-21 11:56 ` Vincent Guittot
2020-02-14 15:27 ` [PATCH v2 4/5] sched/pelt: Add a new runnable average signal Vincent Guittot
2020-02-18 14:54 ` Valentin Schneider
2020-02-18 15:12 ` Peter Zijlstra
2020-02-18 15:28 ` Vincent Guittot
2020-02-18 16:30 ` Valentin Schneider
2020-02-18 21:19 ` Valentin Schneider
2020-02-19 9:02 ` Vincent Guittot
2020-02-19 9:08 ` Mel Gorman
2020-02-19 12:55 ` [PATCH v3 " Vincent Guittot
2020-02-19 14:02 ` Mel Gorman
2020-02-19 20:10 ` Valentin Schneider
2020-02-20 14:36 ` Vincent Guittot
2020-02-20 16:11 ` Valentin Schneider
2020-02-21 8:56 ` Vincent Guittot
2020-02-24 15:57 ` Valentin Schneider
2020-02-21 9:04 ` Mel Gorman
2020-02-21 9:25 ` Vincent Guittot
2020-02-21 10:40 ` Mel Gorman
2020-02-21 13:28 ` Vincent Guittot
2020-02-20 15:04 ` Dietmar Eggemann
2020-02-21 9:44 ` Dietmar Eggemann
2020-02-21 11:47 ` Vincent Guittot
2020-02-14 15:27 ` [PATCH v2 5/5] sched/fair: Take into account runnable_avg to classify group Vincent Guittot
2020-02-15 21:58 ` [PATCH v2 0/5] remove runnable_load_avg and improve group_classify Mel Gorman
2020-02-21 9:58 ` Dietmar Eggemann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=274ebb9a-9328-e312-f554-34da8b183932@arm.com \
--to=dietmar.eggemann@arm.com \
--cc=bsegall@google.com \
--cc=hdanton@sina.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=parth@linux.ibm.com \
--cc=pauld@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=valentin.schneider@arm.com \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome