mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Josh Don <joshdon@google.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Valentin Schneider <vschneid@redhat.com>,
	linux-kernel@vger.kernel.org,
	Xiangling Kong <xiangling@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH 2/2] sched: add throttled time stat for throttled children
Date: Tue, 23 May 2023 11:44:53 -1000	[thread overview]
Message-ID: <ZG0z1enh3TNbsxQh@slm.duckdns.org> (raw)
In-Reply-To: <20230518013414.3053254-2-joshdon@google.com>

Hello,

(cc'ing Johannes)

On Wed, May 17, 2023 at 06:34:14PM -0700, Josh Don wrote:
> We currently export the total throttled time for cgroups that are given
> a bandwidth limit. This patch extends this accounting to also account
> the total time that each children cgroup has been throttled.
> 
> This is useful to understand the degree to which children have been
> affected by the throttling control. Children which are not runnable
> during the entire throttled period, for example, will not show any
> self-throttling time during this period.
...
> @@ -11204,20 +11217,24 @@ static int cpu_extra_stat_show(struct seq_file *sf,
>  	{
>  		struct task_group *tg = css_tg(css);
>  		struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth;
> -		u64 throttled_usec, burst_usec;
> +		u64 throttled_usec, burst_usec, throttled_self_usec;
>  
>  		throttled_usec = cfs_b->throttled_time;
>  		do_div(throttled_usec, NSEC_PER_USEC);
> +		throttled_self_usec = throttled_time_self(tg);
> +		do_div(throttled_self_usec, NSEC_PER_USEC);
>  		burst_usec = cfs_b->burst_time;
>  		do_div(burst_usec, NSEC_PER_USEC);
>  
>  		seq_printf(sf, "nr_periods %d\n"
>  			   "nr_throttled %d\n"
>  			   "throttled_usec %llu\n"
> +			   "throttled_self_usec %llu\n"

This is fine in principle but I think it'd be better to keep it consistent
with how non-hierarchical events are in memory.events.local. ie. Can we
please add cpu.stat.local instead of adding the _self key to cpu.stat?

Thanks.

-- 
tejun

  parent reply	other threads:[~2023-05-23 21:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18  1:34 [PATCH 1/2] sched: don't account throttle time for empty groups Josh Don
2023-05-18  1:34 ` [PATCH 2/2] sched: add throttled time stat for throttled children Josh Don
2023-05-18 12:04   ` kernel test robot
2023-05-23 21:44   ` Tejun Heo [this message]
2023-05-25  0:06     ` Josh Don
2023-05-18  8:20 ` [PATCH 1/2] sched: don't account throttle time for empty groups kernel test robot

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=ZG0z1enh3TNbsxQh@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=hannes@cmpxchg.org \
    --cc=joshdon@google.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=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=xiangling@google.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®