All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Fernandes <joel@joelfernandes.org>
To: Suren Baghdasaryan <surenb@google.com>
Cc: christian@brauner.io, arnd@arndb.de, ebiederm@xmission.com,
	keescook@chromium.org, dancol@google.com, tglx@linutronix.de,
	jannh@google.com, dhowells@redhat.com, mtk.manpages@gmail.com,
	luto@kernel.org, akpm@linux-foundation.org, oleg@redhat.com,
	cyphar@cyphar.com, torvalds@linux-foundation.org,
	viro@zeniv.linux.org.uk, linux-api@vger.kernel.org,
	linux-kselftest@vger.kernel.org, kernel-team@android.com
Subject: Re: [PATCH v3 2/2] tests: add pidfd poll tests
Date: Fri, 26 Jul 2019 13:07:28 -0400	[thread overview]
Message-ID: <20190726170728.GA157922@google.com> (raw)
In-Reply-To: <20190726162226.252750-2-surenb@google.com>

On Fri, Jul 26, 2019 at 09:22:26AM -0700, Suren Baghdasaryan wrote:
> This adds testing for polling on pidfd of a process being killed. Test runs
> 10000 iterations by default to stress test pidfd polling functionality.
> It accepts an optional command-line parameter to override the number or
> iterations to run.
> Specifically, it tests for:
> - pidfd_open on a child process succeeds
> - pidfd_send_signal on a child process succeeds
> - polling on pidfd succeeds and returns exactly one event
> - returned event is POLLIN
> - event is received within 3 secs of the process being killed
> 
> 10000 iterations was chosen because of the race condition being tested
> which is not consistently reproducible but usually is revealed after less
> than 2000 iterations.
> Reveals race fixed by commit b191d6491be6 ("pidfd: fix a poll race when setting exit_state")
> 
> Signed-off-by: Suren Baghdasaryan <surenb@google.com>
> ---

> +		close(pidfd);
> +		// Wait for child to prevent zombies

Comment style should be /* */, but I think Christian would be kind enough to
fix that when he applies the patch so shouldn't need a resend.

Thanks Suren and Christian!

Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>


  reply	other threads:[~2019-07-26 17:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-26 16:22 [PATCH v3 1/2] tests: move common definitions and functions into pidfd.h Suren Baghdasaryan
2019-07-26 16:22 ` [PATCH v3 2/2] tests: add pidfd poll tests Suren Baghdasaryan
2019-07-26 17:07   ` Joel Fernandes [this message]
2019-07-26 17:24     ` Suren Baghdasaryan
2019-07-27  8:41     ` Christian Brauner
2019-07-27 18:24   ` Yann Droneaud
2019-08-06 18:03     ` Suren Baghdasaryan
2019-08-06 17:51   ` Christian Brauner
2019-08-06 17:50 ` [PATCH v3 1/2] tests: move common definitions and functions into pidfd.h Christian Brauner

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=20190726170728.GA157922@google.com \
    --to=joel@joelfernandes.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=christian@brauner.io \
    --cc=cyphar@cyphar.com \
    --cc=dancol@google.com \
    --cc=dhowells@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=jannh@google.com \
    --cc=keescook@chromium.org \
    --cc=kernel-team@android.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=oleg@redhat.com \
    --cc=surenb@google.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.