mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>,
	Tao Zhou <zhout@vivaldi.net>
Cc: Ben Segall <bsegall@google.com>, Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	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] sched/fair: fix runnable_avg for throttled cfs
Date: Thu, 27 Feb 2020 15:15:37 +0000	[thread overview]
Message-ID: <fe35049b-eef0-580f-aac6-b525a5e7f2a5@arm.com> (raw)
In-Reply-To: <CAKfTPtBXYTORWdx9fGOBgEMYk6noa7X-4RSdSM+gKgv47nmjXw@mail.gmail.com>

On 27.02.20 13:12, Vincent Guittot wrote:
> On Thu, 27 Feb 2020 at 14:10, Tao Zhou <zhout@vivaldi.net> wrote:
>>
>> Hi Dietmar,
>>
>> On Thu, Feb 27, 2020 at 11:20:05AM +0000, Dietmar Eggemann wrote:
>>> On 26.02.20 21:01, Vincent Guittot wrote:
>>>> On Wed, 26 Feb 2020 at 20:04, <bsegall@google.com> wrote:
>>>>>
>>>>> Vincent Guittot <vincent.guittot@linaro.org> writes:
>>>>>
>>>>>> When a cfs_rq is throttled, its group entity is dequeued and its running
>>>>>> tasks are removed. We must update runnable_avg with current h_nr_running
>>>>>> and update group_se->runnable_weight with new h_nr_running at each level
>>>
>>>                                               ^^^
>>>
>>> Shouldn't his be 'curren' rather 'new' h_nr_running for
>>> group_se->runnable_weight? IMHO, you want to cache the current value
>>> before you add/subtract task_delta.
>>
>> /me think Vincent is right. h_nr_running is updated in the previous
>> level or out. The next level will use current h_nr_running to update
>> runnable_avg and use the new group cfs_rq's h_nr_running which was
>> updated in the previous level or out to update se runnable_weight.

Ah OK, 'old' as in 'old' cached value se->runnable_weight and 'new' as
the 'new' se->runnable_weight which gets updated *after* update_load_avg
and before +/- task_delta.


So when we throttle e.g. /tg1/tg11

previous level is: /tg1/tg11

next level:        /tg1


loop for /tg1:

for_each_sched_entity(se)
  cfs_rq = cfs_rq_of(se);

  update_load_avg(cfs_rq, se ...) <-- uses 'old' se->runnable_weight

  se->runnable_weight = se->my_q->h_nr_running <-- 'new' value
                                                   (updated in previous
                                                    level, group cfs_rq)

[...]

  reply	other threads:[~2020-02-27 15:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 18:16 Vincent Guittot
2020-02-26 19:04 ` bsegall
2020-02-26 21:01   ` Vincent Guittot
2020-02-27 11:20     ` Dietmar Eggemann
2020-02-27 13:10       ` Vincent Guittot
2020-02-27 14:58         ` Vincent Guittot
2020-02-27 15:17           ` Dietmar Eggemann
2020-02-27 15:34           ` Phil Auld
2020-02-27 15:39             ` Vincent Guittot
     [not found]       ` <20200227131228.GA5872@geo.homenetwork>
2020-02-27 13:12         ` Vincent Guittot
2020-02-27 15:15           ` Dietmar Eggemann [this message]
2020-02-27 19:13     ` bsegall

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=fe35049b-eef0-580f-aac6-b525a5e7f2a5@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 \
    --cc=zhout@vivaldi.net \
    /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

all inboxes | Powered by JetHome®