Skip to content

Commit

Permalink
selftests: memcg: remove protection from top level memcg
Browse files Browse the repository at this point in the history
The reclaim is triggered by memory limit in a subtree, therefore the
testcase does not need configured protection against external reclaim.

Also, correct respective comments.

Link: https://lkml.kernel.org/r/20220518161859.21565-5-mkoutny@suse.com
Signed-off-by: Michal Koutný <mkoutny@suse.com>
Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
Cc: David Vernet <void@manifault.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Richard Palethorpe <rpalethorpe@suse.de>
Cc: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Michal Koutný authored and akpm committed May 27, 2022
1 parent f10b6e9 commit 6a35919
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions tools/testing/selftests/cgroup/test_memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ static int cg_test_proc_killed(const char *cgroup)

/*
* First, this test creates the following hierarchy:
* A memory.min = 50M, memory.max = 200M
* A memory.min = 0, memory.max = 200M
* A/B memory.min = 50M
* A/B/C memory.min = 75M, memory.current = 50M
* A/B/D memory.min = 25M, memory.current = 50M
Expand All @@ -257,7 +257,7 @@ static int cg_test_proc_killed(const char *cgroup)
* Usages are pagecache, but the test keeps a running
* process in every leaf cgroup.
* Then it creates A/G and creates a significant
* memory pressure in it.
* memory pressure in A.
*
* Then it checks actual memory usages and expects that:
* A/B memory.current ~= 50M
Expand Down Expand Up @@ -338,8 +338,6 @@ static int test_memcg_min(const char *root)
(void *)(long)fd);
}

if (cg_write(parent[0], "memory.min", "50M"))
goto cleanup;
if (cg_write(parent[1], "memory.min", "50M"))
goto cleanup;
if (cg_write(children[0], "memory.min", "75M"))
Expand Down Expand Up @@ -407,7 +405,7 @@ static int test_memcg_min(const char *root)

/*
* First, this test creates the following hierarchy:
* A memory.low = 50M, memory.max = 200M
* A memory.low = 0, memory.max = 200M
* A/B memory.low = 50M
* A/B/C memory.low = 75M, memory.current = 50M
* A/B/D memory.low = 25M, memory.current = 50M
Expand Down Expand Up @@ -495,8 +493,6 @@ static int test_memcg_low(const char *root)
goto cleanup;
}

if (cg_write(parent[0], "memory.low", "50M"))
goto cleanup;
if (cg_write(parent[1], "memory.low", "50M"))
goto cleanup;
if (cg_write(children[0], "memory.low", "75M"))
Expand Down

0 comments on commit 6a35919

Please sign in to comment.