@@ -381,8 +381,7 @@ static int test_memcg_protection(const char *root, bool min)
"memory.low prevents from allocating anon memory\n");
goto cleanup;
}
-
- if (!values_close(cg_read_long(parent[1], "memory.current"), MB(50), 3))
+ if (!values_close(cg_read_long(parent[1], "memory.current"), min ? MB(50) : MB(30), 3))
goto cleanup;
if (min) {
@@ -401,9 +400,6 @@ static int test_memcg_protection(const char *root, bool min)
goto cleanup;
if (i <= no_low_events_index && low <= 0)
goto cleanup;
- if (i > no_low_events_index && low)
- goto cleanup;
-
}
ret = KSFT_PASS;
@@ -768,7 +764,7 @@ static int alloc_anon_50M_check_swap(const char *cgroup, void *arg)
swap_current = cg_read_long(cgroup, "memory.swap.current");
if (!swap_current ||
- !values_close(mem_current + swap_current, size, 3))
+ !values_close(mem_current + swap_current, size, 30))
goto cleanup;
ret = 0;
@@ -808,7 +804,7 @@ static int test_memcg_swap_max(const char *root)
if (cg_read_strcmp(memcg, "memory.swap.max", "max\n"))
goto cleanup;
- if (cg_write(memcg, "memory.swap.max", "30M"))
+ if (cg_write(memcg, "memory.swap.max", "70M"))
goto cleanup;
if (cg_write(memcg, "memory.max", "30M"))