Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Li Zhijian <lizhijian@fujitsu.com>,
	brauner@kernel.org, shuah@kernel.org,
	linux-kselftest@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Philip Li <philip.li@intel.com>,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v3] ksefltests: pidfd: Fix wait_states: Test terminated by timeout
Date: Sun, 30 Oct 2022 02:29:41 -0600	[thread overview]
Message-ID: <2dc3fbd9-217b-1e7e-1b77-dad14bce91e0@linuxfoundation.org> (raw)
In-Reply-To: <1662001807-7-1-git-send-email-lizhijian@fujitsu.com>

On 8/31/22 21:10, Li Zhijian wrote:
> 0Day/LKP observed that the kselftest blocks forever since one of the
> pidfd_wait doesn't terminate in 1 of 30 runs. After digging into
> the source, we found that it blocks at:
> ASSERT_EQ(sys_waitid(P_PIDFD, pidfd, &info, WCONTINUED, NULL), 0);
> 
> wait_states has below testing flow:
>    CHILD                 PARENT
>    ---------------+--------------
> 1 STOP itself
> 2                   WAIT for CHILD STOPPED
> 3                   SIGNAL CHILD to CONT
> 4 CONT
> 5 STOP itself
> 5'                  WAIT for CHILD CONT
> 6                   WAIT for CHILD STOPPED
> 
> The problem is that the kernel cannot ensure the order of 5 and 5', once
> 5 goes first, the test will fail.
> 
> we can reproduce it by:
> $ while true; do make run_tests -C pidfd; done
> 
> Introduce a blocking read in child process to make sure the parent can
> check its WCONTINUED.
> 
> CC: Philip Li <philip.li@intel.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
> Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>
> ---

Sorry for the delay. Now applied to linux-kselftest fixes for rc4

thanks,
-- Shuah

      parent reply	other threads:[~2022-10-30  8:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-01  3:10 [PATCH v3] ksefltests: pidfd: Fix wait_states: Test terminated by timeout Li Zhijian
2022-09-29  0:56 ` Li Zhijian
2022-10-30  8:09   ` Li Zhijian
2022-10-30  8:29 ` Shuah Khan [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=2dc3fbd9-217b-1e7e-1b77-dad14bce91e0@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=brauner@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=lizhijian@fujitsu.com \
    --cc=philip.li@intel.com \
    --cc=shuah@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