Re: [PATCH] psi: Inherit parent cgroup psi enable state

From: Michal Koutný
Date: Mon Jul 29 2024 - 07:37:55 EST


Hello Chuyi.

On Mon, Jul 29, 2024 at 11:41:00AM GMT, Chuyi Zhou <zhouchuyi@xxxxxxxxxxxxx> wrote:
> This patch tries to solve this issue. When a child cgroup is created, it
> would inherit the psi enabled state of the parent in group_init().
> Once the enable state is found to be false in the css_populate_dir(), the
> {cpu, io, memory}.pressure files will be hidden using cgroup_file_show().

I'd consider such an inheritance cgroupv1-ism. Notably,
mmemory.swappiness also had inheritance and it caused some headaches
because of its susceptibility to races (cgroup creation vs parent
configuration).

What about adding an option (mount option?) to determine the default of
per-cgroup pressure accounting?
(Based on reading about your use case in other mail.) With that you
could only enable it for the "online" groups of interest.

(I admit I only assume it'd be possible thanks to existence of
psi_cgroup_restart(), I didn't look at how easy it'd be.)

Thanks,
Michal

Attachment: signature.asc
Description: PGP signature