[PATCH v4 2/2] cgroup/rstat: Selftests for niced CPU statistics

2024-10-02 Thread Joshua Hahn
From: Joshua Hahn Creates a cgroup with a single nice CPU hog process running. fork() is called to generate the nice process because un-nicing is not possible (see man nice(3)). If fork() was not used to generate the CPU hog, we would run the rest of the cgroup selftest suite as a nice process

[PATCH v4 1/2] cgroup/rstat: Tracking cgroup-level niced CPU time

2024-10-02 Thread Joshua Hahn
From: Joshua Hahn Cgroup-level CPU statistics currently include time spent on user/system processes, but do not include niced CPU time (despite already being tracked). This patch exposes niced CPU time to the userspace, allowing users to get a better understanding of their hardware limits and

[PATCH v4 0/2] Exposing nice CPU usage to userspace

2024-10-02 Thread Joshua Hahn
ower non-nice CPU utilization. Signed-off-by Joshua Hahn 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/cgrou

Re: [PATCH v2 1/2] Tracking cgroup-level niced CPU time

2024-08-30 Thread Joshua Hahn
Hello, thank you for reviewing the v2. > Patch looks fine to me but can you please do the followings? > > - Add subsystem prefix to the patch titles. Look other commits for examples. > - Add Signed-off-by to both. > -- > tejun I will send out a v3 with the signed-off-by, and I will add cgroup/rst

[PATCH v2 2/2] Selftests for niced CPU statistics

2024-08-30 Thread Joshua Hahn
From: Joshua Hahn Creates a cgroup with a single nice CPU hog process running. fork() is called to generate the nice process because un-nicing is not possible (see man nice(3)). If fork() was not used to generate the CPU hog, we would run the rest of the cgroup selftest suite as a nice process

[PATCH v2 1/2] Tracking cgroup-level niced CPU time

2024-08-30 Thread Joshua Hahn
From: Joshua Hahn Cgroup-level CPU statistics currently include time spent on user/system processes, but do not include niced CPU time (despite already being tracked). This patch exposes niced CPU time to the userspace, allowing users to get a better understanding of their hardware limits and

[PATCH v2 0/2] Exposing nice CPU usage to userspace

2024-08-30 Thread Joshua Hahn
From: Joshua Hahn v1 -> v2: Edited commit messages for clarity. Niced CPU usage is a metric reported in host-level /prot/stat, but is not reported in cgroup-level statistics in cpu.stat. However, when a host contains multiple tasks across different workloads, it becomes difficult to gauge

Re: [PATCH 1/2] Tracking cgroup-level niced CPU time

2024-08-29 Thread Joshua Hahn
Hello, thank you for reviewing the patch. > > Cgroup-level CPU statistics currently include time spent on > > user/system processes, but do not include niced CPU time (despite > > already being tracked). This patch exposes niced CPU time to the > > userspace, allowing users to get a better underst

Re: [PATCH 0/2] Exposing nice CPU usage to userspace

2024-08-26 Thread Joshua Hahn
Hello, thank you for reviewing the patch. On Mon, Aug 26, 2024 at 10:43 AM Michal Koutný wrote: > The difference between the two metrics is in cputime.c: > index = (task_nice(p) > 0) ? CPUTIME_NICE : CPUTIME_USER; > > > Exposing this metric will allow load balancers to correctly probe the