Re: [PATCH v2] selftests/cgroup: Fix intermittent test_cgfreezer_ptrace test failures
Michal Koutný <[email protected]>
| Newsgroups | org.kernel.vger.cgroups,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest |
|---|---|
| Message-ID | <[email protected]> |
Hi. On Tue, Jul 14, 2026 at 11:54:46PM -0400, Waiman Long <[email protected]> wrote: > It is found that the test_cgfreezer_ptrace test of test_freezer can > intermittently fail on some architectures like arm64 and ppc64. > > After further tracing of the mechanics of the test_cgfreezer_ptrace test, > it is found that the ptrace(PTRACE_DETACH) call will spawn another process > to perform the detach I'm reading kernel/ptrace.c and cannot find a new task creation. I'm curious what is this "another process"? (Or is it referring to the child_fn() process from test_cgfreezer_ptrace()? Then I'm suspicous about the transitional unfreezing of it after PTRACE_DETACH. Wasn't it rightful expectation of the test that the cgroup remains contiguously frozen?) > by temporarily unfreezes the cgroup and then freezes > it again afterward during the detaching process. The reading of the > frozen flag from cgroup.events is done by the main test_freezer process > running probably on a different CPU. As a result, racing is possible and > the intermediate unfrozen state can be read leading to occasional test > failures especially on architectures with a weak memory model like arm64. What state would the task be in during this window? Thanks, Michal
signature.asc
(application/pgp-signature, 265 B)
-----BEGIN PGP SIGNATURE----- iJEEABYKADkWIQRCE24Fn/AcRjnLivR+PQLnlNv4CAUCaldUnRsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDIACgkQfj0C55Tb+AgBiAEAtibykYvZC+3Kxm/NzjT1 GszMpvkJPqiA7qKlwDnJvMMA/09aHmm6drkw1dia2aCU7YAPAnNa8o0FUlrsoBBC gs8E =tW7/ -----END PGP SIGNATURE-----