Re: [PATCH v2 23/23] bpf: selftests: PSI struct ops test
From: Michal Hocko
Date: Mon Nov 10 2025 - 04:50:48 EST
On Mon 27-10-25 16:22:06, Roman Gushchin wrote:
> Add a PSI struct ops test.
>
> The test creates a cgroup with two child sub-cgroups, sets up
> memory.high for one of those and puts there a memory hungry
> process (initially frozen).
>
> Then it creates 2 PSI triggers from within a init() BPF callback and
> attaches them to these cgroups. Then it deletes the first cgroup,
> creates another one and runs the memory hungry task. From the cgroup
> creation callback the test is creating another trigger.
>
> The memory hungry task is creating a high memory pressure in one
> memory cgroup, which triggers a PSI event. The PSI BPF handler
> declares a memcg oom in the corresponding cgroup. Finally the checks
> that both handle_cgroup_free() and handle_psi_event() handlers were
> executed, the correct process was killed and oom counters were
> updated.
I might be just dense but what is behind that deleted cgroup
(deleted_cgroup_id etc) dance?
--
Michal Hocko
SUSE Labs