[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6d81d576-7e94-4523-af9a-d43298ea64ba@redhat.com>
Date: Fri, 11 Apr 2025 17:08:33 -0400
From: Waiman Long <llong@...hat.com>
To: Michal Koutný <mkoutny@...e.com>
Cc: Johannes Weiner <hannes@...xchg.org>, Michal Hocko <mhocko@...nel.org>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Shakeel Butt <shakeel.butt@...ux.dev>, Muchun Song <muchun.song@...ux.dev>,
Andrew Morton <akpm@...ux-foundation.org>, Tejun Heo <tj@...nel.org>,
Shuah Khan <shuah@...nel.org>, linux-kernel@...r.kernel.org,
cgroups@...r.kernel.org, linux-mm@...ck.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v4 1/2] mm/vmscan: Skip memcg with !usage in
shrink_node_memcgs()
On 4/7/25 11:25 AM, Michal Koutný wrote:
> Hi Waiman.
>
> On Sun, Apr 06, 2025 at 09:41:58PM -0400, Waiman Long <longman@...hat.com> wrote:
> ...
>> diff --git a/tools/testing/selftests/cgroup/test_memcontrol.c b/tools/testing/selftests/cgroup/test_memcontrol.c
>> index 16f5d74ae762..bab826b6b7b0 100644
>> --- a/tools/testing/selftests/cgroup/test_memcontrol.c
>> +++ b/tools/testing/selftests/cgroup/test_memcontrol.c
> I'd suggest updating also the header of the test for clarity and then
> exempt the Child 2 ('E') conditionally from comparisons, something like:
>
> @@ -380,10 +380,10 @@ static bool reclaim_until(const char *memcg, long goal);
> *
> * Then it checks actual memory usages and expects that:
> * A/B memory.current ~= 50M
> - * A/B/C memory.current ~= 29M
> - * A/B/D memory.current ~= 21M
> - * A/B/E memory.current ~= 0
> - * A/B/F memory.current = 0
> + * A/B/C memory.current ~= 29M, memory.events:low > 0
> + * A/B/D memory.current ~= 21M, memory.events:low > 0
> + * A/B/E memory.current ~= 0, memory.events:low not specified (==0 w/out memory_recursiveprot)
> + * A/B/F memory.current = 0, memory.events:low == 0
> * (for origin of the numbers, see model in memcg_protection.m.)
Sorry for the late reply. I think it is a good idea to update the header
as well. This function is actually used by both test_memcg_low and
test_memcg.min. So I will use low/min instead.
Cheers,
Longman
> *
> * After that it tries to allocate more than there is
> @@ -527,6 +527,7 @@ static int test_memcg_protection(const char *root, bool min)
>
> for (i = 0; i < ARRAY_SIZE(children); i++) {
> int no_low_events_index = 1;
> + int ignore_low_events_index = has_recursiveprot ? 2 : -1;
> long low, oom;
>
> oom = cg_read_key_long(children[i], "memory.events", "oom ");
> @@ -534,6 +535,8 @@ static int test_memcg_protection(const char *root, bool min)
>
> if (oom)
> goto cleanup;
> + if (i == ignore_low_events_index)
> + continue;
> if (i <= no_low_events_index && low <= 0)
> goto cleanup;
> if (i > no_low_events_index && low)
Powered by blists - more mailing lists