[PATCH] powerpc/selftests: Avoid backgroud process/threads

Michael Ellerman mpe at ellerman.id.au
Fri Aug 3 20:36:15 AEST 2018


Breno Leitao <leitao at debian.org> writes:

> Current tm-unavailable test runs for a long period (>120 seconds), and if it is
> interrupted, as pressing CRTL-C (SIGINT), the foreground process (harness) dies
> but the child process and threads continue to execute (with PPID = 1 now).
>
> In this case, you'd think the test is gone, but there are two threads being
> executed in background, one of the thread ('pong') consumes 100% of the CPU and
> the other one ('ping') dumps output message, from time to time, in the STDOUT,
> which is annoying.
>
> This patch simply gets the child process to be SIGTERMed when the parent dies.

Hmm, I think we should fix this in the harness if possible.

In run_test() it does:

	/* Kill anything else in the process group that is still running */
	kill(-pid, SIGTERM);


But that doesn't work if the harness has been killed with Ctrl-C.

I think the harness could have a SIGINT handler that basically does the
above and then exits?

cheers


More information about the Linuxppc-dev mailing list