From: Peter Zijlstra <peterz@infradead.org>
To: ufo19890607@gmail.com
Cc: mingo@redhat.com, yun.wang@linux.alibaba.com,
yuzhoujian@didichuxing.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/debug: Show intergroup and hierarchy sum wait time of a task group
Date: Wed, 6 Feb 2019 18:19:15 +0100 [thread overview]
Message-ID: <20190206171915.GJ17564@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <1548236816-18712-1-git-send-email-ufo19890607@gmail.com>
On Wed, Jan 23, 2019 at 05:46:56PM +0800, ufo19890607@gmail.com wrote:
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index e2ff4b6..35e89ca 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -858,6 +858,19 @@ static void update_curr_fair(struct rq *rq)
> }
>
> static inline void
> +update_hierarchy_wait_sum(struct sched_entity *se,
> + u64 delta_wait)
> +{
> + for_each_sched_entity(se) {
> + struct cfs_rq *cfs_rq = cfs_rq_of(se);
> +
> + if (cfs_rq->tg != &root_task_group)
> + __schedstat_add(cfs_rq->hierarchy_wait_sum,
> + delta_wait);
> + }
> +}
> +
> +static inline void
> update_stats_wait_end(struct cfs_rq *cfs_rq, struct sched_entity *se)
> {
> struct task_struct *p;
> @@ -880,6 +893,7 @@ static void update_curr_fair(struct rq *rq)
> return;
> }
> trace_sched_stat_wait(p, delta);
> + update_hierarchy_wait_sum(se, delta);
> }
>
> __schedstat_set(se->statistics.wait_max,
The problem I have with this is that it will make schedstats even more
expensive :/
next prev parent reply other threads:[~2019-02-06 17:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-23 9:46 ufo19890607
2019-01-25 3:11 ` 王贇
[not found] ` <CAHCio2iYoKOSgxJWFX6KcRcn7GK=aEJP7Sz0vU6SwXK2C56mew@mail.gmail.com>
2019-01-28 2:53 ` 王贇
2019-01-28 7:21 ` 禹舟键
2019-01-30 1:53 ` 王贇
2019-02-06 17:19 ` Peter Zijlstra [this message]
2019-02-11 2:43 ` 禹舟键
2019-02-12 3:14 ` 禹舟键
2019-02-19 2:15 ` 禹舟键
2019-02-25 3:29 ` 禹舟键
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=20190206171915.GJ17564@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=ufo19890607@gmail.com \
--cc=yun.wang@linux.alibaba.com \
--cc=yuzhoujian@didichuxing.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
Powered by JetHome