Re: [PATCH v1 2/2] Add selftests for pidfd polling

2019-04-26 Thread Joel Fernandes
On Fri, Apr 26, 2019 at 12:35:40PM -0700, Daniel Colascione wrote: > On Fri, Apr 26, 2019 at 10:26 AM Joel Fernandes > wrote: > > On Thu, Apr 25, 2019 at 03:07:48PM -0700, Daniel Colascione wrote: > > > On Thu, Apr 25, 2019 at 2:29 PM Christian Brauner > > > wrote: > > > > This timing-based tes

Re: [PATCH v1 2/2] Add selftests for pidfd polling

2019-04-26 Thread Daniel Colascione
On Fri, Apr 26, 2019 at 10:26 AM Joel Fernandes wrote: > On Thu, Apr 25, 2019 at 03:07:48PM -0700, Daniel Colascione wrote: > > On Thu, Apr 25, 2019 at 2:29 PM Christian Brauner > > wrote: > > > This timing-based testing seems kinda odd to be honest. Can't we do > > > something better than this?

Re: [PATCH v1 2/2] Add selftests for pidfd polling

2019-04-26 Thread Joel Fernandes
On Thu, Apr 25, 2019 at 03:07:48PM -0700, Daniel Colascione wrote: > On Thu, Apr 25, 2019 at 2:29 PM Christian Brauner > wrote: > > This timing-based testing seems kinda odd to be honest. Can't we do > > something better than this? > > Agreed. Timing-based tests have a substantial risk of becomi

Re: [PATCH v1 2/2] Add selftests for pidfd polling

2019-04-26 Thread Joel Fernandes
On Thu, Apr 25, 2019 at 02:00:35PM -0600, Tycho Andersen wrote: > On Thu, Apr 25, 2019 at 03:00:10PM -0400, Joel Fernandes (Google) wrote: > > > > +void *test_pidfd_poll_exec_thread(void *priv) > > I think everything in this file can be static, there's this one and > 3-4 below. > > > +int test_pi

Re: [PATCH v1 2/2] Add selftests for pidfd polling

2019-04-26 Thread Joel Fernandes
On Thu, Apr 25, 2019 at 11:29:18PM +0200, Christian Brauner wrote: > On Thu, Apr 25, 2019 at 03:00:10PM -0400, Joel Fernandes (Google) wrote: > > Other than verifying pidfd based polling, the tests make sure that > > wait semantics are preserved with the pidfd poll. Notably the 2 cases: > > 1. If a

Re: [PATCH v1 2/2] Add selftests for pidfd polling

2019-04-25 Thread Daniel Colascione
On Thu, Apr 25, 2019 at 2:29 PM Christian Brauner wrote: > This timing-based testing seems kinda odd to be honest. Can't we do > something better than this? Agreed. Timing-based tests have a substantial risk of becoming flaky. We ought to be able to make these tests fully deterministic and not su

Re: [PATCH v1 2/2] Add selftests for pidfd polling

2019-04-25 Thread Christian Brauner
On Thu, Apr 25, 2019 at 03:00:10PM -0400, Joel Fernandes (Google) wrote: > Other than verifying pidfd based polling, the tests make sure that > wait semantics are preserved with the pidfd poll. Notably the 2 cases: > 1. If a thread group leader exits while threads still there, then no >pidfd po

Re: [PATCH v1 2/2] Add selftests for pidfd polling

2019-04-25 Thread Tycho Andersen
On Thu, Apr 25, 2019 at 03:00:10PM -0400, Joel Fernandes (Google) wrote: > > +void *test_pidfd_poll_exec_thread(void *priv) I think everything in this file can be static, there's this one and 3-4 below. > +int test_pidfd_poll_exec(int use_waitpid) > +{ > + int pid, pidfd = 0; > + int stat

[PATCH v1 2/2] Add selftests for pidfd polling

2019-04-25 Thread Joel Fernandes (Google)
Other than verifying pidfd based polling, the tests make sure that wait semantics are preserved with the pidfd poll. Notably the 2 cases: 1. If a thread group leader exits while threads still there, then no pidfd poll notifcation should happen. 2. If a non-thread group leader does an execve, the