From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: liming wu <wu860403-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
398776277 <398776277-9uewiaClKEY@public.gmane.org>
Subject: Re: [PATCH] tg: add cpu's wait_count of a task group
Date: Tue, 19 Jan 2021 10:32:25 -0500 [thread overview]
Message-ID: <YAb7icZqetp5c827@mtj.duckdns.org> (raw)
In-Reply-To: <CAPnMXWWmfzWh9J_G4OPT=eCFySaD2NAFE0_OiWFQKL-1R0uOkA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hello,
On Mon, Jan 18, 2021 at 11:07:47AM +0800, liming wu wrote:
> > > + if (schedstat_enabled() && tg != &root_task_group) {
> > > + u64 ws = 0;
> > > + u64 wc = 0;
> > > + int i;
> > > +
> > > + for_each_possible_cpu(i) {
> > > + ws += schedstat_val(tg->se[i]->statistics.wait_sum);
> > > + wc += schedstat_val(tg->se[i]->statistics.wait_count);
> > > + }
> > > +
> > > + seq_printf(sf, "wait_sum %llu\n"
> > > + "wait_count %llu\n", ws, wc);
> > > + }
> >
> > What does sum/count tell?
> It can tell the task group average latency of every context switch
> wait_sum is equivalent to sched_info->run_delay (the second parameter
> of /proc/$pid/schedstat)
> wait_count is equivalent to sched_info->pcount(the third parameter of
> /proc/$pid/schedstat)
Sounds good to me but can you please:
* Rename wait_sum to wait_usec and make sure the duration is in usecs.
* Rename wait_count to nr_waits.
* This should go through the scheduler tree. When you post the updated
version, please cc the scheduler folks from MAINAINERS.
Thanks.
--
tejun
prev parent reply other threads:[~2021-01-19 15:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-15 14:30 [PATCH] tg: add cpu's wait_count of a task group wu860403-Re5JQEeQqe8AvxtiuMwx3w
[not found] ` <20210115143005.7071-1-wu860403-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2021-01-15 20:19 ` Tejun Heo
[not found] ` <YAH4w5T3/oCTGJny-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
2021-01-18 3:07 ` liming wu
[not found] ` <CAPnMXWWmfzWh9J_G4OPT=eCFySaD2NAFE0_OiWFQKL-1R0uOkA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-01-19 15:32 ` Tejun Heo [this message]
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=YAb7icZqetp5c827@mtj.duckdns.org \
--to=tj-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=398776277-9uewiaClKEY@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=wu860403-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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