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

2024-10-01 Thread Joshua Hahn
> My motivation comes from debugging cgroup selftests when strace is quite > useful and your implementation adds the unnecessary fork which makes the > strace (slightly) less readable. This makes sense, thank you for the context. I hadn't considered debugging considerations much, but I can imagine

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

2024-09-30 Thread Joshua Hahn
On Thu, Sep 26, 2024 at 2:10 PM Michal Koutný wrote: > > On Mon, Sep 23, 2024 at 07:20:06AM GMT, Joshua Hahn > wrote: > > +/* > > + * Creates a nice process that consumes CPU and checks that the elapsed > > + * usertime in the cgroup is close to the expected time. &

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

2024-09-23 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 v3 1/2] cgroup/rstat: Tracking cgroup-level niced CPU time

2024-09-23 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 v3 0/2] Exposing nice CPU usage to userspace

2024-09-23 Thread Joshua Hahn
From: Joshua Hahn v2 -> v3: Signed-off-by & renamed subject for clarity. 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 ta