Re: [PATCH] selftests/cgroup: Remove redundant cg_enter_current() call in test_core

Michal Koutný <[email protected]>
Newsgroups org.kernel.vger.cgroups,org.kernel.vger.linux-kselftest
Message-ID <[email protected]>
On Fri, Jul 17, 2026 at 07:06:06PM +0800, guojian <[email protected]> wrote:
> From: Jian Guo <[email protected]>
> 
> 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 <[email protected]>
> ---
>  tools/testing/selftests/cgroup/test_core.c | 1 -
>  1 file changed, 1 deletion(-)

Fixes: d863cb03fc5f9 ("Add cgroup core selftests")

Good catch.

Acked-by: Michal Koutný <[email protected]>
signature.asc (application/pgp-signature, 265 B)
-----BEGIN PGP SIGNATURE-----

iJEEABYKADkWIQRCE24Fn/AcRjnLivR+PQLnlNv4CAUCalo63xsUgAAAAAAEAA5t
YW51MiwyLjUrMS4xMiwyLDIACgkQfj0C55Tb+AitDgD/UbuUiXOGtFpCCTZfBsMC
M5HjWGFJWivmM+7NPaauMaEBAI0kzQ5rIjnNG/LYJ9VZ1lrYudYi8kS/+vZoHGVb
IJgG
=wOvu
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.