From: Joshua Hahn <joshua.hahnjy@gmail.com>
To: tj@kernel.org, mkoutny@suse.com
Cc: cgroups@vger.kernel.org, hannes@cmpxchg.org,
linux-kernel@vger.org, linux-kselftest@vger.kernel.org,
lizefan.x@bytedance.com, shuah@kernel.org
Subject: [PATCH v4 0/2] Exposing nice CPU usage to userspace
Date: Wed, 2 Oct 2024 11:47:15 -0700 [thread overview]
Message-ID: <20241002184717.153302-1-joshua.hahnjy@gmail.com> (raw)
Changes in v4
- Removed unnecessary forking from selftest.
- Style changes in rstat.c (fallthrough & indents)
- Fixed a selftest bug that raised false negatives, caused by
cputime_adjust sometimes adjusting utime below ntime.
- Reworded cover letter for clarity & motivation
Changes in v3
- Signed-off-by & renamed subject for clarity.
Changes in v2
- Edited commit messages for clarity.
Niced CPU usage is a metric reported in host-level /proc/stat, but is
not currently reported in cgroup-level statistics. Thus, even if one
can observe that a fracion of the host's CPU time is spent on (non-)nice
tasks, the distribution of the CPU usage across cgroups is not readily
available to the user.
This patch introduces cgroup-level niced CPU utilization to cpu.stat.
Exposing this metric will allow users to accurately probe the niced CPU
metric for each workload, and make more informed decisions when
directing higher priority tasks. For instance, service routers will be
able to probe cgroups in the host to determine CPU time spent on niced
processes in each cgroup, and direct more traffic to cgroups with lower
non-nice CPU utilization.
Signed-off-by Joshua Hahn <joshua.hahnjy@gmail.com>
Joshua Hahn (2):
Tracking cgroup-level niced CPU time
Selftests for niced CPU statistics
include/linux/cgroup-defs.h | 1 +
kernel/cgroup/rstat.c | 19 ++++--
tools/testing/selftests/cgroup/test_cpu.c | 75 +++++++++++++++++++++++
3 files changed, 90 insertions(+), 5 deletions(-)
--
2.43.5
next reply other threads:[~2024-10-02 18:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 18:47 Joshua Hahn [this message]
2024-10-02 18:47 ` [PATCH v4 1/2] cgroup/rstat: Tracking cgroup-level niced CPU time Joshua Hahn
2024-10-02 18:47 ` [PATCH v4 2/2] cgroup/rstat: Selftests for niced CPU statistics Joshua Hahn
2024-10-08 18:51 ` [PATCH v4 0/2] Exposing nice CPU usage to userspace Tejun Heo
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=20241002184717.153302-1-joshua.hahnjy@gmail.com \
--to=joshua.hahnjy@gmail.com \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=lizefan.x@bytedance.com \
--cc=mkoutny@suse.com \
--cc=shuah@kernel.org \
--cc=tj@kernel.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