Re: [PATCH v2 2/5] cgroup: Account for memory_recursiveprot in test_memcg_low()

Michal Koutný
2022-04-29T09:26:20Z

On Thu, Apr 28, 2022 at 06:03:33PM -0700, David Vernet <void-gq6j2QGBifHby3iVrkZq2A@public.gmane.org> wrote:
> but my interpretation of the rest of that discussion with Roman is
> that we haven't yet decided whether we don't want to propagate
> memory.low events from children cgroups with memory.low == 0. Or at
> the very least, some more justification was requested on why not
> counting such events was prudent.

I'm not a fan of that original proposal of mine anymore (to be more
precise, of _only_ that patch, there's still the RFCness reason 1) to
consider).
As I shared with the last reply there, there's a problem in the behavior
which shouldn't be masked by filtering some events.

> Would you be ok with merging this patch so that the cgroup selftests can
> pass again based on the current behavior of the kernel, and we can then
> revert the changes to test_memcg_low() later on if and when we decide that
> we don't want to propagate memory.low events for memory.low == 0 children?

I still think that the behavior when there's no protection left for the
memory.low == 0 child, there should be no memory.low events (not just
uncounted but not happening) and test should not accept this (even
though it's the current behavior).

What might improve the test space would be to have two configs like

Original one (simplified here)
parent memory.low=50M memory.current=100M
` child1 memory.low=50M memory.current=50M
` child2 memory.low=0M memory.current=50M

New one (checks events due to recursive protection)
parent memory.low=50M memory.current=100M
` child1 memory.low=40M memory.current=50M
` child2 memory.low=0M memory.current=50M

The second config assigns recursive protection to child2 and should
therefore cause memory.low events in child2 (with memory_recursiveprot
enabled of course).

Or alternative new one (checks events due to recursive protection)
parent memory.low=50M memory.current=100M
` child1 memory.low=0M memory.current=50M
` child2 memory.low=0M memory.current=50M

HTH,
Michal