Linux cgroups development
 help / color / mirror / Atom feed
* [PATCH] selftests/cgroup: Remove redundant cg_enter_current() call in test_core
@ 2026-07-17 11:06 guojian
  2026-07-17 12:51 ` Tao Cui
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: guojian @ 2026-07-17 11:06 UTC (permalink / raw)
  To: tj, hannes, mkoutny, shuah; +Cc: cgroups, linux-kselftest, Jian Guo

From: Jian Guo <guojian@kylinos.cn>

The test_cgcore_no_internal_process_constraint_on_threads test has two
back-to-back cg_enter_current(root) calls in its cleanup path.

A single cg_enter_current() call atomically migrates the entire thread
group to the target cgroup even for multi-threaded processes, and this
test creates no extra threads or child processes that would require a
second migration attempt. The second call is a harmless no-op once the
process is already in the root cgroup, but it is redundant and
inconsistent with the cleanup logic used in all other cgroup core
selftest cases.

Remove the duplicate call to clean up the code. No functional change is
intended.

Signed-off-by: Jian Guo <guojian@kylinos.cn>
---
 tools/testing/selftests/cgroup/test_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/testing/selftests/cgroup/test_core.c b/tools/testing/selftests/cgroup/test_core.c
index 88ca832d4fc1..8e3f9b391e44 100644
--- a/tools/testing/selftests/cgroup/test_core.c
+++ b/tools/testing/selftests/cgroup/test_core.c
@@ -426,7 +426,6 @@ static int test_cgcore_no_internal_process_constraint_on_threads(const char *roo
 	ret = KSFT_PASS;
 
 cleanup:
-	cg_enter_current(root);
 	cg_enter_current(root);
 	if (child)
 		cg_destroy(child);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-17 17:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17 11:06 [PATCH] selftests/cgroup: Remove redundant cg_enter_current() call in test_core guojian
2026-07-17 12:51 ` Tao Cui
2026-07-17 15:30   ` Tao Cui
2026-07-17 14:23 ` Michal Koutný
2026-07-17 17:23 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox