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@xxxxxxxxx> 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