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-10-01 Thread Michal Koutný
On Mon, Sep 30, 2024 at 02:07:22PM GMT, Joshua Hahn wrote: > The reason I used a fork in the testing is so that I could isolate the niced > portion of the test to only the CPU hog. If I were to nice(1) --> cg_hog() > in a single process without forking, this would mean that the cleanup portion >

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. > > + */ > > + user_usec =

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

2024-09-26 Thread Michal Koutný
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. > + */ > +static int test_cpucg_nice(const char *root) > +{ > + int ret = KSFT_FAIL; > +

[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.