All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [Intel-gfx] [PATCH i-g-t] igt/gem_ctx_exec: Exercise I915_CONTEXT_PARAM_RECOVERABLE
Date: Thu, 04 Oct 2018 16:26:16 +0300	[thread overview]
Message-ID: <874le1lu6f.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20181002194554.21423-1-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> When RECOVERABLE is set, the kernel will attempt to automatically recover
> a context after a hang. But if it is unset, the kernel will ban the
> guilty context on a hang, preventing subsequent execution.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  tests/gem_ctx_exec.c | 38 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
>
> diff --git a/tests/gem_ctx_exec.c b/tests/gem_ctx_exec.c
> index 908b59af..1cd3b20e 100644
> --- a/tests/gem_ctx_exec.c
> +++ b/tests/gem_ctx_exec.c
> @@ -147,6 +147,41 @@ static void invalid_context(int fd, unsigned ring, uint32_t handle)
>  	igt_assert_eq(__gem_execbuf(fd, &execbuf), -ENOENT);
>  }
>  
> +static void norecovery(int i915)
> +{
> +	for (int pass = 1; pass >= 0; pass--) {
> +		struct drm_i915_gem_context_param param = {
> +			.ctx_id = gem_context_create(i915),
> +			.param = 0x7,
> +			.value = pass,
> +		};
> +		int expect = pass == 0 ? -EIO : 0;
> +		igt_spin_t *spin;
> +
> +		if (pass)
> +			igt_require(__gem_context_set_param(i915, &param) == 0);
> +		else
> +			gem_context_set_param(i915, &param);

You are trying in here to make the asserts unique?

> +		gem_context_get_param(i915, &param);
> +		igt_assert_eq(param.value, pass);
> +
> +		spin = __igt_spin_batch_new(i915,
> +					    .ctx = param.ctx_id,
> +					    .flags = IGT_SPIN_POLL_RUN);
> +		igt_assert(spin->running);
> +
> +		while (!READ_ONCE(*spin->running))
> +			;

wait that it is running...

> +		igt_force_gpu_reset(i915);
> +

then reset.

> +		igt_spin_batch_end(spin);

> +		igt_assert_eq(__gem_execbuf(i915, &spin->execbuf), expect);

Hmm where do we sync with hang resolution. Is it the handoff in
the wedged debugfs entry?

-Mika

> +		igt_spin_batch_free(i915, spin);
> +
> +		gem_context_destroy(i915, param.ctx_id);
> +	}
> +}
> +
>  igt_main
>  {
>  	const uint32_t batch[2] = { 0, MI_BATCH_BUFFER_END };
> @@ -190,6 +225,9 @@ igt_main
>  	igt_subtest("eviction")
>  		big_exec(fd, handle, 0);
>  
> +	igt_subtest("norecovery")
> +		norecovery(fd);
> +
>  	igt_subtest("reset-pin-leak") {
>  		int i;
>  
> -- 
> 2.19.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

WARNING: multiple messages have this Message-ID (diff)
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t] igt/gem_ctx_exec: Exercise I915_CONTEXT_PARAM_RECOVERABLE
Date: Thu, 04 Oct 2018 16:26:16 +0300	[thread overview]
Message-ID: <874le1lu6f.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20181002194554.21423-1-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> When RECOVERABLE is set, the kernel will attempt to automatically recover
> a context after a hang. But if it is unset, the kernel will ban the
> guilty context on a hang, preventing subsequent execution.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  tests/gem_ctx_exec.c | 38 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
>
> diff --git a/tests/gem_ctx_exec.c b/tests/gem_ctx_exec.c
> index 908b59af..1cd3b20e 100644
> --- a/tests/gem_ctx_exec.c
> +++ b/tests/gem_ctx_exec.c
> @@ -147,6 +147,41 @@ static void invalid_context(int fd, unsigned ring, uint32_t handle)
>  	igt_assert_eq(__gem_execbuf(fd, &execbuf), -ENOENT);
>  }
>  
> +static void norecovery(int i915)
> +{
> +	for (int pass = 1; pass >= 0; pass--) {
> +		struct drm_i915_gem_context_param param = {
> +			.ctx_id = gem_context_create(i915),
> +			.param = 0x7,
> +			.value = pass,
> +		};
> +		int expect = pass == 0 ? -EIO : 0;
> +		igt_spin_t *spin;
> +
> +		if (pass)
> +			igt_require(__gem_context_set_param(i915, &param) == 0);
> +		else
> +			gem_context_set_param(i915, &param);

You are trying in here to make the asserts unique?

> +		gem_context_get_param(i915, &param);
> +		igt_assert_eq(param.value, pass);
> +
> +		spin = __igt_spin_batch_new(i915,
> +					    .ctx = param.ctx_id,
> +					    .flags = IGT_SPIN_POLL_RUN);
> +		igt_assert(spin->running);
> +
> +		while (!READ_ONCE(*spin->running))
> +			;

wait that it is running...

> +		igt_force_gpu_reset(i915);
> +

then reset.

> +		igt_spin_batch_end(spin);

> +		igt_assert_eq(__gem_execbuf(i915, &spin->execbuf), expect);

Hmm where do we sync with hang resolution. Is it the handoff in
the wedged debugfs entry?

-Mika

> +		igt_spin_batch_free(i915, spin);
> +
> +		gem_context_destroy(i915, param.ctx_id);
> +	}
> +}
> +
>  igt_main
>  {
>  	const uint32_t batch[2] = { 0, MI_BATCH_BUFFER_END };
> @@ -190,6 +225,9 @@ igt_main
>  	igt_subtest("eviction")
>  		big_exec(fd, handle, 0);
>  
> +	igt_subtest("norecovery")
> +		norecovery(fd);
> +
>  	igt_subtest("reset-pin-leak") {
>  		int i;
>  
> -- 
> 2.19.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-10-04 13:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-02 19:45 [igt-dev] [PATCH i-g-t] igt/gem_ctx_exec: Exercise I915_CONTEXT_PARAM_RECOVERABLE Chris Wilson
2018-10-02 19:45 ` Chris Wilson
2018-10-02 20:06 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-10-03  8:35 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-10-04 13:26 ` Mika Kuoppala [this message]
2018-10-04 13:26   ` [PATCH i-g-t] " Mika Kuoppala
2018-10-04 15:19   ` [igt-dev] [Intel-gfx] " Chris Wilson
2018-10-04 15:19     ` Chris Wilson
2018-10-04 15:30 ` [PATCH i-g-t v2] " Chris Wilson
2018-10-05 13:18   ` Mika Kuoppala
2018-10-04 16:17 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-10-04 23:54 ` ✓ Fi.CI.IGT: " 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=874le1lu6f.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@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.