All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antonio Argenziano <antonio.argenziano@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] [PATCH i-g-t] igt/perf_pmu: Flush to idle after hang
Date: Tue, 29 May 2018 13:05:17 -0700	[thread overview]
Message-ID: <6f085b16-93d6-d5f2-2c4a-c43d13cd6e06@intel.com> (raw)
In-Reply-To: <20180525151439.12438-1-chris@chris-wilson.co.uk>



On 25/05/18 08:14, Chris Wilson wrote:
> We may not idle immediately after a hang, and indeed may send a pulse
> down the pipeline periodically to become idle. Rather than make a flimsy
> assumption about how long we need to sleep before the system idles,
> wait for the system to declare itself idle; flushing it to idle in the
> process!
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>

LGTM.
Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>

> ---
>   tests/perf_pmu.c | 11 ++---------
>   1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> index 590e6526b..9af192dd8 100644
> --- a/tests/perf_pmu.c
> +++ b/tests/perf_pmu.c
> @@ -281,16 +281,9 @@ single(int gem_fd, const struct intel_execution_engine2 *e, unsigned int flags)
>   
>   	/* Check for idle after hang. */
>   	if (flags & FLAG_HANG) {
> -		/* Sleep for a bit for reset unwind to settle. */
> -		usleep(500e3);
> -		/*
> -		 * Ensure batch was executing before reset, meaning it must be
> -		 * idle by now. Unless it did not even manage to start before we
> -		 * triggered the reset, in which case the idleness check below
> -		 * might fail. The latter is very unlikely since there are two
> -		 * sleeps during which it had an opportunity to start.
> -		 */
> +		gem_quiescent_gpu(gem_fd);
>   		igt_assert(!gem_bo_busy(gem_fd, spin->handle));
> +
>   		val = pmu_read_single(fd);
>   		slept = measured_usleep(batch_duration_ns / 1000);
>   		val = pmu_read_single(fd) - val;
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Antonio Argenziano <antonio.argenziano@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] [PATCH i-g-t] igt/perf_pmu: Flush to idle after hang
Date: Tue, 29 May 2018 13:05:17 -0700	[thread overview]
Message-ID: <6f085b16-93d6-d5f2-2c4a-c43d13cd6e06@intel.com> (raw)
In-Reply-To: <20180525151439.12438-1-chris@chris-wilson.co.uk>



On 25/05/18 08:14, Chris Wilson wrote:
> We may not idle immediately after a hang, and indeed may send a pulse
> down the pipeline periodically to become idle. Rather than make a flimsy
> assumption about how long we need to sleep before the system idles,
> wait for the system to declare itself idle; flushing it to idle in the
> process!
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>

LGTM.
Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>

> ---
>   tests/perf_pmu.c | 11 ++---------
>   1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> index 590e6526b..9af192dd8 100644
> --- a/tests/perf_pmu.c
> +++ b/tests/perf_pmu.c
> @@ -281,16 +281,9 @@ single(int gem_fd, const struct intel_execution_engine2 *e, unsigned int flags)
>   
>   	/* Check for idle after hang. */
>   	if (flags & FLAG_HANG) {
> -		/* Sleep for a bit for reset unwind to settle. */
> -		usleep(500e3);
> -		/*
> -		 * Ensure batch was executing before reset, meaning it must be
> -		 * idle by now. Unless it did not even manage to start before we
> -		 * triggered the reset, in which case the idleness check below
> -		 * might fail. The latter is very unlikely since there are two
> -		 * sleeps during which it had an opportunity to start.
> -		 */
> +		gem_quiescent_gpu(gem_fd);
>   		igt_assert(!gem_bo_busy(gem_fd, spin->handle));
> +
>   		val = pmu_read_single(fd);
>   		slept = measured_usleep(batch_duration_ns / 1000);
>   		val = pmu_read_single(fd) - val;
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2018-05-29 20:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25 15:14 [PATCH i-g-t] igt/perf_pmu: Flush to idle after hang Chris Wilson
2018-05-25 15:14 ` [igt-dev] " Chris Wilson
2018-05-25 16:12 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-05-26  0:50 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-05-29 20:05 ` Antonio Argenziano [this message]
2018-05-29 20:05   ` [igt-dev] [PATCH i-g-t] " Antonio Argenziano
2018-05-30 10:48 ` Tvrtko Ursulin
2018-05-30 10:48   ` [igt-dev] " Tvrtko Ursulin
2018-05-30 10:57   ` Chris Wilson
2018-05-30 10:57     ` [Intel-gfx] " Chris Wilson

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=6f085b16-93d6-d5f2-2c4a-c43d13cd6e06@intel.com \
    --to=antonio.argenziano@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.