Re: [PATCH v7 1/2] selftests: memcg: Allow low event with no memory.low and memory_recursiveprot on
From: Michal Koutný
Date: Wed Apr 16 2025 - 05:26:12 EST
On Tue, Apr 15, 2025 at 05:04:14PM -0400, Waiman Long <longman@xxxxxxxxxx> wrote:
> + /*
> + * Child 2 has memory.low=0, but some low protection is still being
> + * distributed down from its parent with memory.low=50M if cgroup2
> + * memory_recursiveprot mount option is enabled. So the low event
> + * count will be non-zero in this case.
I say: Child 2 should have zero effective low value in this test case.
Johannes says (IIUC): One cannot argue whether there is or isn't
effective low for Child 2, it depends on siblings.
(I also say that low events should only be counted for nominal low
breaches but that's not so important here.)
But together this means no value of memory.events:low is valid or
invalid in this testcase. Hence I suggested ignoring Child 2's value in
checks.
> + */
> for (i = 0; i < ARRAY_SIZE(children); i++) {
> - int no_low_events_index = 1;
> + int no_low_events_index = has_recursiveprot ? 2 : 1;
> long low, oom;
>
> oom = cg_read_key_long(children[i], "memory.events", "oom ");
But this is not what I Suggested-by: [1]
Michal
[1] https://lore.kernel.org/r/awgbdn6gwnj4kfaezsorvopgsdyoty3yahdeanqvoxstz2w2ke@xc3sv43elkz5
Attachment:
signature.asc
Description: PGP signature