All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] tests/gem_reset_stats: add defer-hangcheck test
Date: Tue, 11 Nov 2014 16:20:35 +0100	[thread overview]
Message-ID: <20141111152035.GA25711@phenom.ffwll.local> (raw)
In-Reply-To: <1415373648-5003-1-git-send-email-mika.kuoppala@intel.com>

On Fri, Nov 07, 2014 at 05:20:48PM +0200, Mika Kuoppala wrote:
> to see if one can fool hangcheck by keeping non hanging
> ring busy
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
>  tests/gem_reset_stats.c | 43 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 43 insertions(+)
> 
> diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c
> index 3f5a01f..6473cf3 100644
> --- a/tests/gem_reset_stats.c
> +++ b/tests/gem_reset_stats.c
> @@ -1019,6 +1019,45 @@ static void test_params(void)
>  
>  }
>  
> +static void defer_hangcheck(int ring_num)
> +{
> +	int fd, count_start, count_end;
> +	int seconds = 30;
> +	const struct target_ring *next_ring;
> +	fd = drm_open_any();
> +	igt_assert(fd >= 0);
> +
> +	do {
> +		next_ring = &rings[(++ring_num) % NUM_RINGS];
> +
> +		if (next_ring->present(fd))
> +			break;
> +
> +	} while(next_ring != current_ring);
> +
> +	igt_skip_on(next_ring == current_ring);
> +
> +	count_start = get_reset_count(fd, 0);
> +	igt_assert(count_start >= 0);
> +
> +	igt_assert(inject_hang_ring(fd, 0, current_ring->exec, true));
> +	while (--seconds) {
> +		igt_assert(exec_valid_ring(fd, 0, next_ring->exec));
> +
> +		count_end = get_reset_count(fd, 0);
> +		igt_assert(count_end >= 0);
> +
> +		if (count_end > count_start)
> +			return;

s/return/break/ here? Otherwise lgtm, pls push with that fixed.
-Daniel

> +
> +		sleep(1);
> +	}
> +
> +	igt_assert(count_end > count_start);
> +
> +	close(fd);
> +}
> +
>  static bool gem_has_hw_contexts(int fd)
>  {
>  	struct local_drm_i915_gem_context_create create;
> @@ -1159,5 +1198,9 @@ igt_main
>  
>  		igt_subtest_f("close-pending-fork-reverse-%s", name)
>  			RUN_TEST(test_close_pending_fork(true));
> +
> +		igt_subtest_f("defer-hangcheck-%s", name)
> +			RUN_TEST(defer_hangcheck(i));
> +
>  	}
>  }
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2014-11-11 15:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 15:20 [PATCH] tests/gem_reset_stats: add defer-hangcheck test Mika Kuoppala
2014-11-11 15:20 ` Daniel Vetter [this message]

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=20141111152035.GA25711@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@linux.intel.com \
    /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.