All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] runner: Make sure output is still collected when killing test due to taint
@ 2020-01-28 11:48 Petri Latvala
  2020-01-28 12:01 ` Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Petri Latvala @ 2020-01-28 11:48 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

If the kernel is tainted, it stays tainted, so make sure the execution
monitoring still reaches the output collectors and other fd change
handlers.

Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 runner/executor.c | 45 +++++++++++++++++++++++++++++----------------
 1 file changed, 29 insertions(+), 16 deletions(-)

diff --git a/runner/executor.c b/runner/executor.c
index 0927d1fd..ca9a12e3 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -759,28 +759,41 @@ static int monitor_output(pid_t child,
 			return -1;
 		}
 
-		if (settings->abort_mask & ABORT_TAINT && tainted(&taints)) /* cancel children after a kernel OOPS */
-			n = 0, intervals_left = 1;
+		/*
+		 * If we're configured to care about taints, kill the
+		 * test if there's a taint. But only if we didn't
+		 * already kill it, and make sure we still process the
+		 * fds select() marked for us.
+		 */
+		if (settings->abort_mask & ABORT_TAINT &&
+		    tainted(&taints) &&
+		    killed == 0) {
+			if (settings->log_level >= LOG_LEVEL_NORMAL) {
+				outf("Killing the test because the kernel is tainted.\n");
+				fflush(stdout);
+			}
 
-		if (n == 0) {
+			killed = SIGQUIT;
+			if (!kill_child(killed, child))
+				return -1;
+
+			/*
+			 * Now continue the loop and let the
+			 * dying child be handled normally.
+			 */
+			timeout = 20;
+			watchdogs_set_timeout(120);
+			intervals_left = timeout_intervals = 1;
+		} else if (n == 0) {
 			if (--intervals_left)
 				continue;
 
 			switch (killed) {
 			case 0:
-				/* If abort_mask doesn't have taint set, taints is still 0 here */
-				if (!is_tainted(taints)) {
-					show_kernel_task_state();
-					if (settings->log_level >= LOG_LEVEL_NORMAL) {
-						outf("Timeout. Killing the current test with SIGQUIT.\n");
-
-						fflush(stdout);
-					}
-				} else {
-					if (settings->log_level >= LOG_LEVEL_NORMAL) {
-						outf("Killing the test because the kernel is tainted.\n");
-						fflush(stdout);
-					}
+				show_kernel_task_state();
+				if (settings->log_level >= LOG_LEVEL_NORMAL) {
+					outf("Timeout. Killing the current test with SIGQUIT.\n");
+					fflush(stdout);
 				}
 
 				killed = SIGQUIT;
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-01-29 22:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-28 11:48 [igt-dev] [PATCH i-g-t] runner: Make sure output is still collected when killing test due to taint Petri Latvala
2020-01-28 12:01 ` Chris Wilson
2020-01-28 15:30 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-01-28 15:56   ` Chris Wilson
2020-01-29 13:24     ` Petri Latvala
2020-01-29 13:28       ` Chris Wilson
2020-01-29 13:39         ` Petri Latvala
2020-01-29 22:06 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

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.