Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH v4 0/2] Exposing nice CPU usage to userspace
@ 2024-10-02 18:47 Joshua Hahn
  2024-10-02 18:47 ` [PATCH v4 1/2] cgroup/rstat: Tracking cgroup-level niced CPU time Joshua Hahn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Joshua Hahn @ 2024-10-02 18:47 UTC (permalink / raw)
  To: tj, mkoutny
  Cc: cgroups, hannes, linux-kernel, linux-kselftest, lizefan.x, shuah

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-10-08 18:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-02 18:47 [PATCH v4 0/2] Exposing nice CPU usage to userspace Joshua Hahn
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox