mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: "Michal Koutný" <mkoutny@suse.com>
Cc: Tejun Heo <tj@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
	Shuah Khan <shuah@kernel.org>,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v2] selftests/cgroup: Fix intermittent test_cgfreezer_ptrace test failures
Date: Wed, 15 Jul 2026 11:47:10 -0400	[thread overview]
Message-ID: <47ae1970-b7a7-478d-b0d0-2110428c2ee3@redhat.com> (raw)
In-Reply-To: <aldSsQAboD6g2Sso@localhost.localdomain>


On 7/15/26 5:36 AM, Michal Koutný wrote:
> Hi.
>
> On Tue, Jul 14, 2026 at 11:54:46PM -0400, Waiman Long <longman@redhat.com> 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"?
I should be more clear about that. It is not exec'ing a new binary. It 
is just spawning a child process/thread which still has the same name 
but different pid as well as running on a different CPU which are what I 
am tracking.
>
> (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?)

As said in my reply to the v1 thread, the detaching process includes a 
call to ptrace_stop() which will unfreeze the cgroup temporarily and 
then go back to frozen afterward. It is this transitional 
unfreeze/freeze that may cause the test to fail if it detects the 
transitional non-frozen state. My patch is to make sure that it can see 
the final the frozen state and avoid reporting failure.

Cheers,
Longman

>
>> 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


      reply	other threads:[~2026-07-15 15:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15  3:54 Waiman Long
2026-07-15  9:36 ` Michal Koutný
2026-07-15 15:47   ` Waiman Long [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47ae1970-b7a7-478d-b0d0-2110428c2ee3@redhat.com \
    --to=longman@redhat.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mkoutny@suse.com \
    --cc=shuah@kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®