diff mbox series

[-next] selftests: memcg: remove useless code in test_memcg_oom_group_leaf_events

Message ID 20241012021057.993520-1-tujinjiang@huawei.com (mailing list archive)
State New
Headers show
Series [-next] selftests: memcg: remove useless code in test_memcg_oom_group_leaf_events | expand

Commit Message

Jinjiang Tu Oct. 12, 2024, 2:10 a.m. UTC
Due to No Internal Process Constraint, parent cgroup couldn't contain any
process, the code `cg_run_nowait(parent, ...)` fails to execute and
return -1 in fact. So remove the useless code to avoid misunderstanding.

Fixes: a987785dcd6c ("Add tests for memory.oom.group")
Signed-off-by: Jinjiang Tu <tujinjiang@huawei.com>
---
 tools/testing/selftests/cgroup/test_memcontrol.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Shuah Khan Oct. 14, 2024, 10:30 p.m. UTC | #1
On 10/11/24 20:10, Jinjiang Tu wrote:
> Due to No Internal Process Constraint, parent cgroup couldn't contain any
> process, the code `cg_run_nowait(parent, ...)` fails to execute and
> return -1 in fact. So remove the useless code to avoid misunderstanding.
> 

Hmm. wouldn't this make a good regression test for "No Internal
Process Constraint"

Why would you want to delete it?

> Fixes: a987785dcd6c ("Add tests for memory.oom.group")
> Signed-off-by: Jinjiang Tu <tujinjiang@huawei.com>
> ---
>   tools/testing/selftests/cgroup/test_memcontrol.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/cgroup/test_memcontrol.c b/tools/testing/selftests/cgroup/test_memcontrol.c
> index 16f5d74ae762..1be36cff72a0 100644
> --- a/tools/testing/selftests/cgroup/test_memcontrol.c
> +++ b/tools/testing/selftests/cgroup/test_memcontrol.c
> @@ -1392,7 +1392,6 @@ static int test_memcg_oom_group_leaf_events(const char *root)
>   	if (cg_write(child, "memory.oom.group", "1"))
>   		goto cleanup;
>   
> -	cg_run_nowait(parent, alloc_anon_noexit, (void *) MB(60));
>   	cg_run_nowait(child, alloc_anon_noexit, (void *) MB(1));
>   	cg_run_nowait(child, alloc_anon_noexit, (void *) MB(1));
>   	if (!cg_run(child, alloc_anon, (void *)MB(100)))

thanks,
-- Shuah
diff mbox series

Patch

diff --git a/tools/testing/selftests/cgroup/test_memcontrol.c b/tools/testing/selftests/cgroup/test_memcontrol.c
index 16f5d74ae762..1be36cff72a0 100644
--- a/tools/testing/selftests/cgroup/test_memcontrol.c
+++ b/tools/testing/selftests/cgroup/test_memcontrol.c
@@ -1392,7 +1392,6 @@  static int test_memcg_oom_group_leaf_events(const char *root)
 	if (cg_write(child, "memory.oom.group", "1"))
 		goto cleanup;
 
-	cg_run_nowait(parent, alloc_anon_noexit, (void *) MB(60));
 	cg_run_nowait(child, alloc_anon_noexit, (void *) MB(1));
 	cg_run_nowait(child, alloc_anon_noexit, (void *) MB(1));
 	if (!cg_run(child, alloc_anon, (void *)MB(100)))