Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH i-g-t 4/6] igt/gem_eio: Exercise banning
Date: Mon, 14 May 2018 12:01:23 +0100	[thread overview]
Message-ID: <167ca7cc-6c02-5e6c-a2a9-ccbcbc423e12@linux.intel.com> (raw)
In-Reply-To: <20180514080251.11224-4-chris@chris-wilson.co.uk>


On 14/05/2018 09:02, Chris Wilson wrote:
> If we trigger "too many" resets, the context and even the file, will be
> banend and subsequent execbufs should fail with -EIO.

banned

> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   tests/gem_eio.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 49 insertions(+)
> 
> diff --git a/tests/gem_eio.c b/tests/gem_eio.c
> index 6455c6acd..4720b47b5 100644
> --- a/tests/gem_eio.c
> +++ b/tests/gem_eio.c
> @@ -250,6 +250,52 @@ static int __check_wait(int fd, uint32_t bo, unsigned int wait)
>   	return ret;
>   }
>   
> +static void __test_banned(int fd)
> +{
> +	struct drm_i915_gem_exec_object2 obj = {
> +		.handle = gem_create(fd, 4096),
> +	};
> +	struct drm_i915_gem_execbuffer2 execbuf = {
> +		.buffers_ptr = to_user_pointer(&obj),
> +		.buffer_count = 1,
> +	};
> +	const uint32_t bbe = MI_BATCH_BUFFER_END;
> +	unsigned long count = 0;
> +
> +	gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe));
> +
> +	gem_quiescent_gpu(fd);
> +	igt_require(i915_reset_control(true));
> +
> +	igt_until_timeout(5) {
> +		igt_spin_t *hang;
> +
> +		if (__gem_execbuf(fd, &execbuf) == -EIO) {
> +			igt_info("Banned after causing %lu hangs\n", count);
> +			igt_assert(count > 1);
> +			return;
> +		}
> +
> +		/* Trigger a reset, making sure we are detected as guilty */
> +		hang = spin_sync(fd, 0, 0);
> +		trigger_reset(fd);
> +		igt_spin_batch_free(fd, hang);
> +
> +		count++;
> +	}
> +
> +	igt_assert_f(false,
> +		     "Ran for 5s, %lu hangs without being banned\n",
> +		     count);
> +}
> +
> +static void test_banned(int fd)
> +{
> +	fd = gem_reopen_driver(fd);
> +	__test_banned(fd);
> +	close(fd);
> +}
> +
>   #define TEST_WEDGE (1)
>   
>   static void test_wait(int fd, unsigned int flags, unsigned int wait)
> @@ -693,6 +739,9 @@ igt_main
>   	igt_subtest("execbuf")
>   		test_execbuf(fd);
>   
> +	igt_subtest("banned")
> +		test_banned(fd);
> +
>   	igt_subtest("suspend")
>   		test_suspend(fd, SUSPEND_STATE_MEM);
>   
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-05-14 11:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14  8:02 [igt-dev] [PATCH i-g-t 1/6] overlay: Remove the miscalculation of window position Chris Wilson
2018-05-14  8:02 ` [igt-dev] [PATCH i-g-t 2/6] lib/audio: Replace sqrt(a*a + b*b) with hypot(a, b) Chris Wilson
2018-05-14 10:20   ` [igt-dev] [Intel-gfx] " Tvrtko Ursulin
2018-05-14  8:02 ` [igt-dev] [PATCH i-g-t 3/6] igt/gem_ctx_thrash: Order writes between contexts Chris Wilson
2018-05-14 10:59   ` [igt-dev] [Intel-gfx] " Tvrtko Ursulin
2018-05-14 15:10     ` Chris Wilson
2018-05-15  8:20       ` Tvrtko Ursulin
2018-05-15  8:29         ` Chris Wilson
2018-05-15  8:45           ` Tvrtko Ursulin
2018-05-14  8:02 ` [igt-dev] [PATCH i-g-t 4/6] igt/gem_eio: Exercise banning Chris Wilson
2018-05-14 11:01   ` Tvrtko Ursulin [this message]
2018-05-14  8:02 ` [igt-dev] [PATCH i-g-t 5/6] tests/gem_eio: Only wait-for-idle inside trigger_reset() Chris Wilson
2018-05-14 11:03   ` [igt-dev] [Intel-gfx] " Tvrtko Ursulin
2018-05-14 11:07     ` Chris Wilson
2018-05-14  8:02 ` [igt-dev] [PATCH i-g-t 6/6] tests/gem_exec_latency: New subtests for checking submission from RT tasks Chris Wilson
2018-05-14 11:13   ` [Intel-gfx] " Tvrtko Ursulin
2018-05-14 11:25     ` Chris Wilson
2018-05-14  8:52 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/6] overlay: Remove the miscalculation of window position Patchwork
2018-05-14 10:18 ` [igt-dev] [Intel-gfx] [PATCH i-g-t 1/6] " Tvrtko Ursulin
2018-05-14 10:31 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/6] " 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=167ca7cc-6c02-5e6c-a2a9-ccbcbc423e12@linux.intel.com \
    --to=tvrtko.ursulin@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox