On 4/16/25 5:25 AM, Michal Koutný wrote:
On Tue, Apr 15, 2025 at 05:04:14PM -0400, Waiman Long <[email protected]>
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.
I understand your point of view. What I want to do is to document the
expected behavior and I don't see any example of ignoring a metric for a
particular child in the test. In this particular test, I did see an elow
of 17 for child 2.
+ */
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]
I was referring to the suggestion that the setting of
memory_recursiveprot mount option has a material impact of the child 2
test result. Roman probably didn't have memory_recursiveprot set when
developing this selftest.
I can take out the Suggested-by tag.
Cheers,
Longman
Michal
[1]
https://lore.kernel.org/r/awgbdn6gwnj4kfaezsorvopgsdyoty3yahdeanqvoxstz2w2ke@xc3sv43elkz5