All of lore.kernel.org
 help / color / mirror / Atom feed
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] runner: Clean up quickly if the kernel OOPSed during a test
Date: Tue, 21 Jan 2020 14:28:11 +0200	[thread overview]
Message-ID: <20200121122811.GB25209@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20200121111738.127417-1-chris@chris-wilson.co.uk>

On Tue, Jan 21, 2020 at 11:17:38AM +0000, Chris Wilson wrote:
> If the kernel OOPSed during the test, it is unlikely to ever complete.
> Furthermore, we have the reason why it won't complete and so do not need
> to burden ourselves with the full stacktrace of every process -- or at
> least we have a more pressing bug to fix before worrying about the
> system deadlock.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Petri Latvala <petri.latvala@intel.com>
> ---
>  runner/executor.c | 33 ++++++++++++++++++++++++++-------
>  1 file changed, 26 insertions(+), 7 deletions(-)
> 
> diff --git a/runner/executor.c b/runner/executor.c
> index f36bfd3dd..00cd3b08a 100644
> --- a/runner/executor.c
> +++ b/runner/executor.c
> @@ -314,13 +314,28 @@ static const struct {
>    {(1 << 9), "TAINT_WARN: WARN_ON has happened."},
>    {0, 0}};
>  
> +static unsigned long bad_taints(void)
> +{
> +	static unsigned long __bad_taints;
> +
> +	if (!__bad_taints) {
> +		for (typeof(*abort_taints) *taint = abort_taints;
> +		     taint->bit;
> +		     taint++)
> +			__bad_taints |= taint->bit;
> +	}
> +
> +	return __bad_taints;
> +}
> +
> +static unsigned long is_tainted(unsigned long taints)
> +{
> +	return taints & bad_taints();
> +}
> +
>  static unsigned long tainted(unsigned long *taints)
>  {
>  	FILE *f;
> -	unsigned long bad_taints = 0;
> -
> -	for (typeof(*abort_taints) *taint = abort_taints; taint->bit; taint++)
> -		bad_taints |= taint->bit;
>  
>  	*taints = 0;
>  
> @@ -330,7 +345,7 @@ static unsigned long tainted(unsigned long *taints)
>  		fclose(f);
>  	}
>  
> -	return *taints & bad_taints;
> +	return is_tainted(*taints);
>  }
>  
>  static char *handle_taint(void)
> @@ -744,13 +759,17 @@ static int monitor_output(pid_t child,
>  			return -1;
>  		}
>  
> +		if (tainted(&taints)) /* cancel children after a kernel OOPS */
> +			n = 0, intervals_left = 1;
> +
>  		if (n == 0) {
>  			if (--intervals_left)
>  				continue;
>  
>  			switch (killed) {
>  			case 0:
> -				show_kernel_task_state();
> +				if (!is_tainted(taints))
> +					show_kernel_task_state();
>  
>  				if (settings->log_level >= LOG_LEVEL_NORMAL) {
>  					outf("Timeout. Killing the current test with SIGQUIT.\n");


We need a different message here if we're killing the test due to a
taint.

Something like


  if (!is_tainted(taints)) {
	show_kernel_task_state();
	if (settings->log_level >= LOG_LEVEL_NORMAL) {
	  outf("Timeout etc");
	  fflush(stdout);
	}
  } else {
    if (settings->log_level >= LOG_LEVEL_NORMAL) {
      outf("Killing the test because the kernel is tainted.\n");
      fflush(stdout);
    }
  }


Note to self: Is it time for logf(LOG_LEVEL_NORMAL, "Hello world")
yet?


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

  parent reply	other threads:[~2020-01-21 12:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-21 11:17 [igt-dev] [PATCH i-g-t] runner: Clean up quickly if the kernel OOPSed during a test Chris Wilson
2020-01-21 11:55 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-01-21 12:28 ` Petri Latvala [this message]
2020-01-21 12:59 ` [igt-dev] [PATCH i-g-t] " Chris Wilson
2020-01-21 13:45   ` Petri Latvala
2020-01-21 14:05 ` [igt-dev] ✓ Fi.CI.BAT: success for runner: Clean up quickly if the kernel OOPSed during a test (rev2) Patchwork
2020-01-22  8:50 ` [igt-dev] ✓ Fi.CI.IGT: success for runner: Clean up quickly if the kernel OOPSed during a test Patchwork
2020-01-22 13:39 ` [igt-dev] ✗ Fi.CI.IGT: failure for runner: Clean up quickly if the kernel OOPSed during a test (rev2) 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=20200121122811.GB25209@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 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.