From: Tejun Heo <tj@kernel.org>
To: Hao Jia <jiahao.os@bytedance.com>
Cc: lizefan.x@bytedance.com, hannes@cmpxchg.org, mkoutny@suse.com,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [External] Re: [PATCH] cgroup/rstat: record the cumulative per-cpu time of cgroup and its descendants
Date: Tue, 18 Jul 2023 11:53:26 -1000 [thread overview]
Message-ID: <ZLcJ1nH8KzWzoQWj@slm.duckdns.org> (raw)
In-Reply-To: <2655026d-6ae4-c14c-95b0-4177eefa434f@bytedance.com>
On Tue, Jul 18, 2023 at 06:08:50PM +0800, Hao Jia wrote:
> https://github.com/jiaozhouxiaojia/cgv2-stat-percpu_test/tree/main
Isn't that just adding the same numbers twice and verifying that? Maybe I'm
misunderstanding you. Here's a simpler case:
# cd /sys/fs/cgroup
# mkdir -p asdf/test0
# grep usage_usec asdf/test0/cpu.stat
usage_usec 0
# echo $$ > asdf/test0/cgroup.procs
# stress -c 1 & sleep 1; kill %%
[1] 122329
stress: info: [122329] dispatching hogs: 1 cpu, 0 io, 0 vm, 0 hdd
# grep usage_usec asdf/test0/cpu.stat
usage_usec 1000956
[1]+ Terminated stress -c 1
# grep usage_usec asdf/cpu.stat
usage_usec 1002548
# echo $$ > /sys/fs/cgroup/cgroup.procs
# rmdir asdf/test0
# grep usage_usec asdf/cpu.stat
usage_usec 1006338
So, we run `stress -c 1` for 1 second in the asdf/test0 cgroup and
asdf/cpu.stat correctly reports the cumulative usage. After removing
asdf/test0 cgroup, asdf's usage_usec is still there. What's missing here?
What are you adding?
Thanks.
--
tejun
next prev parent reply other threads:[~2023-07-18 21:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 9:36 Hao Jia
2023-07-17 19:52 ` Tejun Heo
2023-07-18 10:08 ` [External] " Hao Jia
2023-07-18 21:53 ` Tejun Heo [this message]
2023-07-19 3:01 ` Hao Jia
2023-07-27 12:05 ` Hao Jia
2023-07-27 17:44 ` Tejun Heo
2023-08-02 21:39 ` Tejun Heo
2023-08-07 3:36 ` Hao Jia
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=ZLcJ1nH8KzWzoQWj@slm.duckdns.org \
--to=tj@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=jiahao.os@bytedance.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan.x@bytedance.com \
--cc=mkoutny@suse.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®