All of 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
Subject: Re: [PATCH igt 1/5] igt/perf_pmu: Tighten busy measurement
Date: Fri, 22 Dec 2017 13:18:47 +0000	[thread overview]
Message-ID: <7db9c1be-ee2d-c15d-c6f2-b280af17e4e4@linux.intel.com> (raw)
In-Reply-To: <20171222110323.21230-1-chris@chris-wilson.co.uk>


On 22/12/2017 11:03, Chris Wilson wrote:
> Sleep for a known duration. In particular, CI once saw a measurement for
> busyness greater than the intended batch_duration!
> 
> v2: Go back to starting pmu sampling outside of spinner; the GPU should
> be idle.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104241
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   tests/perf_pmu.c | 22 ++++++++++------------
>   1 file changed, 10 insertions(+), 12 deletions(-)
> 
> diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> index db7696115..38fd05dc9 100644
> --- a/tests/perf_pmu.c
> +++ b/tests/perf_pmu.c
> @@ -103,7 +103,7 @@ static void pmu_read_multi(int fd, unsigned int num, uint64_t *val)
>   	igt_assert_f((double)(x) <= (1.0 + (tolerance)) * (double)(ref) && \
>   		     (double)(x) >= (1.0 - (tolerance)) * (double)(ref), \
>   		     "'%s' != '%s' (%f not within %f%% tolerance of %f)\n",\
> -		     #x, #ref, (double)(x), (tolerance) * 100.0, (double)ref)
> +		     #x, #ref, (double)(x), (tolerance) * 100.0, (double)(ref))
>   
>   /*
>    * Helper for cases where we assert on time spent sleeping (directly or
> @@ -133,30 +133,28 @@ static unsigned int e2ring(int gem_fd, const struct intel_execution_engine2 *e)
>   static void
>   single(int gem_fd, const struct intel_execution_engine2 *e, bool busy)
>   {
> -	double ref = busy ? batch_duration_ns : 0.0f;
> +	unsigned long slept;
>   	igt_spin_t *spin;
>   	uint64_t val;
>   	int fd;
>   
>   	fd = open_pmu(I915_PMU_ENGINE_BUSY(e->class, e->instance));
>   
> -	if (busy) {
> +	if (busy)
>   		spin = igt_spin_batch_new(gem_fd, 0, e2ring(gem_fd, e), 0);
> -		igt_spin_batch_set_timeout(spin, batch_duration_ns);
> -	} else {
> -		usleep(batch_duration_ns / 1000);
> -	}
> +	else
> +		spin = NULL;
>   
> -	if (busy)
> -		gem_sync(gem_fd, spin->handle);
> +	slept = measured_usleep(batch_duration_ns / 1000);
> +	igt_spin_batch_end(spin);
>   
>   	val = pmu_read_single(fd);
>   
> -	if (busy)
> -		igt_spin_batch_free(gem_fd, spin);
> +	igt_spin_batch_free(gem_fd, spin);
>   	close(fd);
>   
> -	assert_within_epsilon(val, ref, tolerance);
> +	assert_within_epsilon(val, busy ? slept : 0.f, tolerance);
> +	gem_quiescent_gpu(gem_fd);
>   }
>   
>   static void log_busy(int fd, unsigned int num_engines, uint64_t *val)
> 

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

  parent reply	other threads:[~2017-12-22 13:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-22 11:03 [PATCH igt 1/5] igt/perf_pmu: Tighten busy measurement Chris Wilson
2017-12-22 11:03 ` [PATCH igt 2/5] igt/perf_pmu: Tighten measurements for most-busy Chris Wilson
2017-12-22 13:21   ` Tvrtko Ursulin
2017-12-22 11:03 ` [PATCH igt 3/5] igt/perf_pmu: Measure the reference batch for busy-check-all Chris Wilson
2017-12-22 13:22   ` Tvrtko Ursulin
2017-12-22 11:03 ` [PATCH igt 4/5] igt/perf_pmu: Measure the reference batch for all-busy-check-all Chris Wilson
2017-12-22 13:24   ` Tvrtko Ursulin
2017-12-22 11:03 ` [PATCH igt 5/5] igt/perf_pmu: Speed up frequency measurement Chris Wilson
2017-12-22 13:27   ` Tvrtko Ursulin
2017-12-22 12:33 ` ✓ Fi.CI.BAT: success for series starting with [1/5] igt/perf_pmu: Tighten busy measurement Patchwork
2017-12-22 13:18 ` Tvrtko Ursulin [this message]
2017-12-22 13:49 ` ✓ 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=7db9c1be-ee2d-c15d-c6f2-b280af17e4e4@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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.