From: Benjamin Segall <bsegall@google.com>
To: Chengming Zhou <zhouchengming@bytedance.com>
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, mgorman@suse.de, bristot@redhat.com,
linux-kernel@vger.kernel.org, duanxiongchun@bytedance.com,
songmuchun@bytedance.com
Subject: Re: [PATCH 1/2] sched/fair: Fix cfs_rq_clock_pelt() for throttled cfs_rq
Date: Thu, 07 Apr 2022 13:57:26 -0700 [thread overview]
Message-ID: <xm26tub4vcg9.fsf@bsegall-linux.svl.corp.google.com> (raw)
In-Reply-To: <20220407021729.16655-1-zhouchengming@bytedance.com> (Chengming Zhou's message of "Thu, 7 Apr 2022 10:17:28 +0800")
Chengming Zhou <zhouchengming@bytedance.com> writes:
> Since commit 23127296889f ("sched/fair: Update scale invariance of PELT")
> change to use rq_clock_pelt() instead of rq_clock_task(), we should also
> use rq_clock_pelt() for throttled_clock_task_time and throttled_clock_task
> accounting.
I think this patch is indeed what we want, despite the confusing
interactions between pelt slowdown+skipping and throttle_clock_task
trying to freeze time.
I think it would be slightly better to rename
throttled_clock_task(_time) to be clock_pelt rather than clock_task, but
that's minor.
Reviewed-by: Ben Segall <bsegall@google.com>
>
> Fixes: 23127296889f ("sched/fair: Update scale invariance of PELT")
> Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
> ---
> kernel/sched/fair.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index d4bd299d67ab..e6fa5d1141b4 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4846,7 +4846,7 @@ static int tg_unthrottle_up(struct task_group *tg, void *data)
>
> cfs_rq->throttle_count--;
> if (!cfs_rq->throttle_count) {
> - cfs_rq->throttled_clock_task_time += rq_clock_task(rq) -
> + cfs_rq->throttled_clock_task_time += rq_clock_pelt(rq) -
> cfs_rq->throttled_clock_task;
>
> /* Add cfs_rq with load or one or more already running entities to the list */
> @@ -4864,7 +4864,7 @@ static int tg_throttle_down(struct task_group *tg, void *data)
>
> /* group is entering throttled state, stop time */
> if (!cfs_rq->throttle_count) {
> - cfs_rq->throttled_clock_task = rq_clock_task(rq);
> + cfs_rq->throttled_clock_task = rq_clock_pelt(rq);
> list_del_leaf_cfs_rq(cfs_rq);
> }
> cfs_rq->throttle_count++;
> @@ -5308,7 +5308,7 @@ static void sync_throttle(struct task_group *tg, int cpu)
> pcfs_rq = tg->parent->cfs_rq[cpu];
>
> cfs_rq->throttle_count = pcfs_rq->throttle_count;
> - cfs_rq->throttled_clock_task = rq_clock_task(cpu_rq(cpu));
> + cfs_rq->throttled_clock_task = rq_clock_pelt(cpu_rq(cpu));
> }
>
> /* conditionally throttle active cfs_rq's from put_prev_entity() */
next prev parent reply other threads:[~2022-04-07 20:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-07 2:17 Chengming Zhou
2022-04-07 2:17 ` [PATCH 2/2] sched/fair: Delete useless condition in tg_unthrottle_up() Chengming Zhou
2022-04-07 21:00 ` Benjamin Segall
2022-04-08 7:16 ` Vincent Guittot
2022-04-07 20:57 ` Benjamin Segall [this message]
2022-04-08 6:23 ` [External] Re: [PATCH 1/2] sched/fair: Fix cfs_rq_clock_pelt() for throttled cfs_rq Chengming Zhou
2022-04-08 7:17 ` Vincent Guittot
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=xm26tub4vcg9.fsf@bsegall-linux.svl.corp.google.com \
--to=bsegall@google.com \
--cc=bristot@redhat.com \
--cc=dietmar.eggemann@arm.com \
--cc=duanxiongchun@bytedance.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=songmuchun@bytedance.com \
--cc=vincent.guittot@linaro.org \
--cc=zhouchengming@bytedance.com \
/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®