Re: [PATCH] selftests/cgroup: Fix intermittent test_cgfreezer_ptrace test failures
From: Waiman Long
Date: Tue Jul 14 2026 - 21:25:32 EST
On 7/14/26 6:09 PM, Tejun Heo wrote:
Hello, Waiman.
+ usleep(1000);A fixed 1ms sleep only hides the race. On a loaded machine or a slow arch
if (cg_check_frozen(cgroup, true))
goto cleanup;
(you mention ppc64) the refreeze can take longer than 1ms, and the test
reads the unfrozen state and fails anyway.
The freezer test already has a way to wait for this properly.
cg_prepare_for_wait() sets up an inotify watch on cgroup.events and
cg_wait_for() blocks until it changes. cg_enter_and_wait_for_frozen() shows
the pattern: loop cg_wait_for() then cg_check_frozen(). The cgroup always
ends up frozen, so looping until cg_check_frozen() reports frozen is
reliable and doesn't depend on timing.
Can you respin using that instead of usleep()?
Also, temporaily -> temporarily, in both the changelog and the comment.
Thanks.
Thanks for the suggestion. Will revise the patch as suggested.
Cheers,
Longman