Skip to content

Commit ec1da99

Browse files
committed
controllers/memcg: Remove force_empty with locked memory test
The testcase started to fail with newer kernels. The reason for this is that we only try to reclaim all the memory from the given memcg and retry MEM_CGROUP_RECLAIM_RETRIES (5) times. Mlocked memory is not reclaimable so we will simply eat all the retries and return back. We used to reparent the remaining charges to the parent. This is no longer true since f61c42a7d911 ("memcg: remove tasks/children test from mem_cgroup_force_empty()"). The behavior change is documented and considered complying with the previous documentation. The main use case for the knob as described by Documentation/cgroups/memory.txt is to: " The typical use case for this interface is before calling rmdir(). Because rmdir() moves all pages to parent, some out-of-use page caches can be moved to the parent. If you want to avoid that, force_empty will be useful. " So this change of behavior was deliberate and considering the testcase is quite artificial I do not consider this a bug. Signed-off-by: Michal Hocko <mhocko@suse.cz> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
1 parent 8b8fc3d commit ec1da99

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

testcases/kernel/controllers/memcg/functional/memcg_force_empty.sh

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
################################################################################
2727

2828
TCID="memcg_force_empty"
29-
TST_TOTAL=7
29+
TST_TOTAL=6
3030

3131
. memcg_lib.sh
3232

@@ -47,39 +47,26 @@ testcase_1()
4747
}
4848

4949
testcase_2()
50-
{
51-
memcg_process --mmap-lock2 -s $PAGESIZE &
52-
pid=$!
53-
TST_CHECKPOINT_WAIT 0
54-
echo $pid > tasks
55-
signal_memcg_process $pid $PAGESIZE
56-
57-
EXPECT_FAIL echo 1 \> memory.force_empty
58-
59-
stop_memcg_process $pid
60-
}
61-
62-
testcase_3()
6350
{
6451
EXPECT_PASS echo 0 \> memory.force_empty
6552
}
6653

67-
testcase_4()
54+
testcase_3()
6855
{
6956
EXPECT_PASS echo 1.0 \> memory.force_empty
7057
}
7158

72-
testcase_5()
59+
testcase_4()
7360
{
7461
EXPECT_PASS echo 1xx \> memory.force_empty
7562
}
7663

77-
testcase_6()
64+
testcase_5()
7865
{
7966
EXPECT_PASS echo xx \> memory.force_empty
8067
}
8168

82-
testcase_7()
69+
testcase_6()
8370
{
8471
# writing to non-empty top mem cgroup's force_empty
8572
# should return failure

0 commit comments

Comments
 (0)