From: Petri Latvala <petri.latvala@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib: Kill residual children at the end of a subtest
Date: Mon, 3 Feb 2020 14:01:03 +0200 [thread overview]
Message-ID: <20200203120103.GD25209@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <158073086877.20090.4222798174748260088@skylake-alporthouse-com>
On Mon, Feb 03, 2020 at 11:54:28AM +0000, Chris Wilson wrote:
> Quoting Petri Latvala (2020-02-03 11:50:07)
> > On Mon, Feb 03, 2020 at 11:21:56AM +0000, Chris Wilson wrote:
> > > Quoting Petri Latvala (2020-02-03 11:13:44)
> > > > On Sun, Feb 02, 2020 at 06:56:49PM +0000, Chris Wilson wrote:
> > > > > Ensure that we tidy up all the excess children left behind by a failing
> > > > > subtest, we do not want them loitering into the next!
> > > > >
> > > > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > > > ---
> > > > > lib/igt_core.c | 4 ++++
> > > > > 1 file changed, 4 insertions(+)
> > > > >
> > > > > diff --git a/lib/igt_core.c b/lib/igt_core.c
> > > > > index a0bf29408..65c80fbba 100644
> > > > > --- a/lib/igt_core.c
> > > > > +++ b/lib/igt_core.c
> > > > > @@ -1362,6 +1362,10 @@ static void exit_subtest(const char *result)
> > > > >
> > > > > igt_terminate_spins();
> > > > >
> > > > > + for (int c = 0; c < num_test_children; c++)
> > > > > + kill(test_children[c], SIGKILL);
> > > > > + num_test_children = 0;
> > > >
> > > > Are the children wait()ed for somewhere?
> > >
> > > Would be very hard to do from inside the dead subtest. We can leave them
> > > as zombies, otherwise how long do you want to wait? As far as the CPU
> > > side of things go, they will not make any further progress.
> >
> > igt_exit() does an assert that waitpid(-1, ...) errors with
> > ECHILD. The exit handler that does call wait() only does it if
> > num_test_children is nonzero.
>
> Hah. That doesn't work :) Since it doesn't wait, the children aren't
> dead by that point.
>
> > All tests that fork stuff are already supposed to call
> > igt_waitchildren(), right? Should we call igt_waitchildren_timeout()
> > here instead, with a 1s timeout? Or __igt_waitchildren() after firing
> > off some SIGKILLs.
>
> The test does call wait, but it has failed before it can do so. If only
> we had some subtest closures :)
Which test is that? All the tests I checked (a whopping two of them)
follow the pattern of
igt_fork(..) {
..
}
igt_waitchildren()
--
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-02-03 12:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-02 18:56 [igt-dev] [PATCH i-g-t] lib: Kill residual children at the end of a subtest Chris Wilson
2020-02-02 19:28 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2020-02-03 11:13 ` [igt-dev] [PATCH i-g-t] " Petri Latvala
2020-02-03 11:21 ` Chris Wilson
2020-02-03 11:50 ` Petri Latvala
2020-02-03 11:54 ` Chris Wilson
2020-02-03 12:01 ` Petri Latvala [this message]
2020-02-03 12:03 ` Chris Wilson
2020-02-03 12:00 ` Chris Wilson
2020-02-03 12:23 ` Petri Latvala
2020-02-03 12:25 ` Chris Wilson
2020-02-03 13:03 ` [igt-dev] [PATCH i-g-t v2] " Chris Wilson
2020-02-03 13:11 ` [igt-dev] [PATCH i-g-t v3] " Chris Wilson
2020-02-03 14:36 ` [igt-dev] ✓ Fi.CI.BAT: success for lib: Kill residual children at the end of a subtest (rev3) Patchwork
2020-02-05 22:58 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
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=20200203120103.GD25209@platvala-desk.ger.corp.intel.com \
--to=petri.latvala@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=igt-dev@lists.freedesktop.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