All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt v2 1/4] igt/perf_pmu: Tighten busy measurement
@ 2017-12-15 16:10 Chris Wilson
  2017-12-15 16:10 ` [PATCH igt v2 2/4] igt/perf_pmu: Tighten measurements for most-busy Chris Wilson
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Chris Wilson @ 2017-12-15 16:10 UTC (permalink / raw
  To: intel-gfx

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)
-- 
2.15.1

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH igt v2 2/4] igt/perf_pmu: Tighten measurements for most-busy
  2017-12-15 16:10 [PATCH igt v2 1/4] igt/perf_pmu: Tighten busy measurement Chris Wilson
@ 2017-12-15 16:10 ` Chris Wilson
  2017-12-15 16:10 ` [PATCH igt v2 3/4] igt/perf_pmu: Measure the reference batch for busy-check-all Chris Wilson
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2017-12-15 16:10 UTC (permalink / raw
  To: intel-gfx

Create all the spinners before starting the sampler and then measure how
long we sleep.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104160
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/perf_pmu.c | 45 +++++++++++++++++++++++++--------------------
 1 file changed, 25 insertions(+), 20 deletions(-)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 38fd05dc9..96091b853 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -228,53 +228,58 @@ most_busy_check_all(int gem_fd, const struct intel_execution_engine2 *e,
 	const struct intel_execution_engine2 *e_;
 	uint64_t val[num_engines];
 	int fd[num_engines];
-	igt_spin_t *spin[num_engines];
+	unsigned long slept;
+	igt_spin_t *spin = NULL;
 	unsigned int idle_idx, i;
 
 	gem_require_engine(gem_fd, e->class, e->instance);
 
 	i = 0;
-	fd[0] = -1;
 	for_each_engine_class_instance(fd, e_) {
 		if (!gem_has_engine(gem_fd, e_->class, e_->instance))
 			continue;
 
-		fd[i] = open_group(I915_PMU_ENGINE_BUSY(e_->class,
-							e_->instance),
-				   fd[0]);
-
 		if (e == e_) {
 			idle_idx = i;
+		} else if (spin) {
+			struct drm_i915_gem_exec_object2 obj = {
+				.handle = spin->handle
+			};
+			struct drm_i915_gem_execbuffer2 eb = {
+				.buffer_count = 1,
+				.buffers_ptr = to_user_pointer(&obj),
+				.flags = e2ring(gem_fd, e_),
+			};
+			gem_execbuf(gem_fd, &eb);
 		} else {
-			spin[i] = igt_spin_batch_new(gem_fd, 0,
-						     e2ring(gem_fd, e_), 0);
-			igt_spin_batch_set_timeout(spin[i], batch_duration_ns);
+			spin = igt_spin_batch_new(gem_fd, 0,
+						  e2ring(gem_fd, e_), 0);
 		}
 
-		i++;
+		val[i++] = I915_PMU_ENGINE_BUSY(e_->class, e_->instance);
 	}
+	igt_assert(i == num_engines);
 
-	for (i = 0; i < num_engines; i++) {
-		if (i != idle_idx)
-			gem_sync(gem_fd, spin[i]->handle);
-	}
+	fd[0] = -1;
+	for (i = 0; i < num_engines; i++)
+		fd[i] = open_group(val[i], fd[0]);
+
+	slept = measured_usleep(batch_duration_ns / 1000);
+	igt_spin_batch_end(spin);
 
 	pmu_read_multi(fd[0], num_engines, val);
 	log_busy(fd[0], num_engines, val);
 
-	for (i = 0; i < num_engines; i++) {
-		if (i != idle_idx)
-			igt_spin_batch_free(gem_fd, spin[i]);
-	}
+	igt_spin_batch_free(gem_fd, spin);
 	close(fd[0]);
 
 	for (i = 0; i < num_engines; i++) {
 		if (i == idle_idx)
 			assert_within_epsilon(val[i], 0.0f, tolerance);
 		else
-			assert_within_epsilon(val[i], batch_duration_ns,
-					      tolerance);
+			assert_within_epsilon(val[i], slept, tolerance);
 	}
+	gem_quiescent_gpu(gem_fd);
 }
 
 static void
-- 
2.15.1

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH igt v2 3/4] igt/perf_pmu: Measure the reference batch for busy-check-all
  2017-12-15 16:10 [PATCH igt v2 1/4] igt/perf_pmu: Tighten busy measurement Chris Wilson
  2017-12-15 16:10 ` [PATCH igt v2 2/4] igt/perf_pmu: Tighten measurements for most-busy Chris Wilson
@ 2017-12-15 16:10 ` Chris Wilson
  2017-12-15 16:10 ` [PATCH igt v2 4/4] igt/perf_pmu: Measure the reference batch for all-busy-check-all Chris Wilson
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2017-12-15 16:10 UTC (permalink / raw
  To: intel-gfx

Don't rely on the timer being precise when we can sleep for a known
duration.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/perf_pmu.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 96091b853..b3b289656 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -183,6 +183,7 @@ busy_check_all(int gem_fd, const struct intel_execution_engine2 *e,
 	const struct intel_execution_engine2 *e_;
 	uint64_t val[num_engines];
 	int fd[num_engines];
+	unsigned long slept;
 	igt_spin_t *spin;
 	unsigned int busy_idx, i;
 
@@ -202,9 +203,8 @@ busy_check_all(int gem_fd, const struct intel_execution_engine2 *e,
 	igt_assert_eq(i, num_engines);
 
 	spin = igt_spin_batch_new(gem_fd, 0, e2ring(gem_fd, e), 0);
-	igt_spin_batch_set_timeout(spin, batch_duration_ns);
-
-	gem_sync(gem_fd, spin->handle);
+	slept = measured_usleep(batch_duration_ns / 1000);
+	igt_spin_batch_end(spin);
 
 	pmu_read_multi(fd[0], num_engines, val);
 	log_busy(fd[0], num_engines, val);
@@ -212,13 +212,13 @@ busy_check_all(int gem_fd, const struct intel_execution_engine2 *e,
 	igt_spin_batch_free(gem_fd, spin);
 	close(fd[0]);
 
-	assert_within_epsilon(val[busy_idx], batch_duration_ns, tolerance);
+	assert_within_epsilon(val[busy_idx], slept, tolerance);
 	for (i = 0; i < num_engines; i++) {
 		if (i == busy_idx)
 			continue;
 		assert_within_epsilon(val[i], 0.0f, tolerance);
 	}
-
+	gem_quiescent_gpu(gem_fd);
 }
 
 static void
-- 
2.15.1

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH igt v2 4/4] igt/perf_pmu: Measure the reference batch for all-busy-check-all
  2017-12-15 16:10 [PATCH igt v2 1/4] igt/perf_pmu: Tighten busy measurement Chris Wilson
  2017-12-15 16:10 ` [PATCH igt v2 2/4] igt/perf_pmu: Tighten measurements for most-busy Chris Wilson
  2017-12-15 16:10 ` [PATCH igt v2 3/4] igt/perf_pmu: Measure the reference batch for busy-check-all Chris Wilson
@ 2017-12-15 16:10 ` Chris Wilson
  2017-12-15 18:04 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/4] igt/perf_pmu: Tighten busy measurement Patchwork
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2017-12-15 16:10 UTC (permalink / raw
  To: intel-gfx

Don't rely on the timer being precise when we can sleep for a known
duration.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/perf_pmu.c | 38 ++++++++++++++++++++++++++------------
 1 file changed, 26 insertions(+), 12 deletions(-)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index b3b289656..d88287c17 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -288,36 +288,50 @@ all_busy_check_all(int gem_fd, const unsigned int num_engines)
 	const struct intel_execution_engine2 *e;
 	uint64_t val[num_engines];
 	int fd[num_engines];
-	igt_spin_t *spin[num_engines];
+	unsigned long slept;
+	igt_spin_t *spin = NULL;
 	unsigned int i;
 
 	i = 0;
-	fd[0] = -1;
 	for_each_engine_class_instance(fd, e) {
 		if (!gem_has_engine(gem_fd, e->class, e->instance))
 			continue;
 
-		fd[i] = open_group(I915_PMU_ENGINE_BUSY(e->class, e->instance),
-				   fd[0]);
-
-		spin[i] = igt_spin_batch_new(gem_fd, 0, e2ring(gem_fd, e), 0);
-		igt_spin_batch_set_timeout(spin[i], batch_duration_ns);
+		if (spin) {
+			struct drm_i915_gem_exec_object2 obj = {
+				.handle = spin->handle
+			};
+			struct drm_i915_gem_execbuffer2 eb = {
+				.buffer_count = 1,
+				.buffers_ptr = to_user_pointer(&obj),
+				.flags = e2ring(gem_fd, e),
+			};
+			gem_execbuf(gem_fd, &eb);
+		} else {
+			spin = igt_spin_batch_new(gem_fd, 0,
+						  e2ring(gem_fd, e), 0);
+		}
 
-		i++;
+		val[i++] = I915_PMU_ENGINE_BUSY(e->class, e->instance);
 	}
+	igt_assert(i == num_engines);
 
+	fd[0] = -1;
 	for (i = 0; i < num_engines; i++)
-		gem_sync(gem_fd, spin[i]->handle);
+		fd[i] = open_group(val[i], fd[0]);
+
+	slept = measured_usleep(batch_duration_ns / 1000);
+	igt_spin_batch_end(spin);
 
 	pmu_read_multi(fd[0], num_engines, val);
 	log_busy(fd[0], num_engines, val);
 
-	for (i = 0; i < num_engines; i++)
-		igt_spin_batch_free(gem_fd, spin[i]);
+	igt_spin_batch_free(gem_fd, spin);
 	close(fd[0]);
 
 	for (i = 0; i < num_engines; i++)
-		assert_within_epsilon(val[i], batch_duration_ns, tolerance);
+		assert_within_epsilon(val[i], slept, tolerance);
+	gem_quiescent_gpu(gem_fd);
 }
 
 static void
-- 
2.15.1

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* ✓ Fi.CI.BAT: success for series starting with [v2,1/4] igt/perf_pmu: Tighten busy measurement
  2017-12-15 16:10 [PATCH igt v2 1/4] igt/perf_pmu: Tighten busy measurement Chris Wilson
                   ` (2 preceding siblings ...)
  2017-12-15 16:10 ` [PATCH igt v2 4/4] igt/perf_pmu: Measure the reference batch for all-busy-check-all Chris Wilson
@ 2017-12-15 18:04 ` Patchwork
  2017-12-15 18:16 ` [PATCH igt v2 1/4] " Tvrtko Ursulin
  2017-12-15 20:44 ` ✗ Fi.CI.IGT: failure for series starting with [v2,1/4] " Patchwork
  5 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2017-12-15 18:04 UTC (permalink / raw
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v2,1/4] igt/perf_pmu: Tighten busy measurement
URL   : https://patchwork.freedesktop.org/series/35421/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
c0be3310715e2f744b892c51f09e62273bcc8e57 tests/kms_frontbuffer_tracking: Correctly handle debugfs errors

with latest DRM-Tip kernel build CI_DRM_3523
84ac2c35b2ab drm-tip: 2017y-12m-15d-15h-36m-28s UTC integration manifest

No testlist changes.

Test kms_frontbuffer_tracking:
        Subgroup basic:
                incomplete -> SKIP       (fi-elk-e7500) fdo#103989 +1
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                pass       -> DMESG-WARN (fi-kbl-r) fdo#104172 +1
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713
Test kms_psr_sink_crc:
        Subgroup psr_basic:
                dmesg-warn -> PASS       (fi-skl-6700hq) fdo#101144

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#104172 https://bugs.freedesktop.org/show_bug.cgi?id=104172
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#101144 https://bugs.freedesktop.org/show_bug.cgi?id=101144

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:435s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:441s
fi-blb-e6850     total:288  pass:222  dwarn:1   dfail:1   fail:0   skip:64  time:401s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:512s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:278s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:496s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:500s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:492s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:482s
fi-elk-e7500     total:229  pass:167  dwarn:14  dfail:1   fail:0   skip:46 
fi-gdg-551       total:288  pass:178  dwarn:1   dfail:0   fail:1   skip:108 time:269s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:541s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:413s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:414s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:393s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:471s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:429s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:470s
fi-kbl-7560u     total:288  pass:268  dwarn:1   dfail:0   fail:0   skip:19  time:528s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:476s
fi-kbl-r         total:288  pass:260  dwarn:1   dfail:0   fail:0   skip:27  time:524s
fi-pnv-d510      total:288  pass:221  dwarn:1   dfail:0   fail:1   skip:65  time:593s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:447s
fi-skl-6600u     total:288  pass:260  dwarn:1   dfail:0   fail:0   skip:27  time:529s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:558s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:486s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:445s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:548s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:427s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:591s
fi-cnl-y         total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:635s
fi-glk-dsi       total:288  pass:177  dwarn:1   dfail:4   fail:0   skip:106 time:345s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:507s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_685/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH igt v2 1/4] igt/perf_pmu: Tighten busy measurement
  2017-12-15 16:10 [PATCH igt v2 1/4] igt/perf_pmu: Tighten busy measurement Chris Wilson
                   ` (3 preceding siblings ...)
  2017-12-15 18:04 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/4] igt/perf_pmu: Tighten busy measurement Patchwork
@ 2017-12-15 18:16 ` Tvrtko Ursulin
  2017-12-15 20:51   ` Chris Wilson
  2017-12-15 20:44 ` ✗ Fi.CI.IGT: failure for series starting with [v2,1/4] " Patchwork
  5 siblings, 1 reply; 8+ messages in thread
From: Tvrtko Ursulin @ 2017-12-15 18:16 UTC (permalink / raw
  To: Chris Wilson, intel-gfx


On 15/12/2017 16:10, 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);

Why you think it is needed to quiescent after each subtest? It would 
make more sense to do so at the beginning of each, if needed, but I 
thought it wasn't.

Regards,

Tvrtko

>   }
>   
>   static void log_busy(int fd, unsigned int num_engines, uint64_t *val)
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* ✗ Fi.CI.IGT: failure for series starting with [v2,1/4] igt/perf_pmu: Tighten busy measurement
  2017-12-15 16:10 [PATCH igt v2 1/4] igt/perf_pmu: Tighten busy measurement Chris Wilson
                   ` (4 preceding siblings ...)
  2017-12-15 18:16 ` [PATCH igt v2 1/4] " Tvrtko Ursulin
@ 2017-12-15 20:44 ` Patchwork
  5 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2017-12-15 20:44 UTC (permalink / raw
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v2,1/4] igt/perf_pmu: Tighten busy measurement
URL   : https://patchwork.freedesktop.org/series/35421/
State : failure

== Summary ==

Test kms_flip:
        Subgroup flip-vs-panning:
                pass       -> DMESG-WARN (shard-hsw) fdo#103540
        Subgroup flip-vs-panning-vs-hang:
                dmesg-warn -> PASS       (shard-snb) fdo#103821
        Subgroup vblank-vs-suspend:
                incomplete -> PASS       (shard-hsw) fdo#103375
        Subgroup blt-wf_vblank-vs-modeset-interruptible:
                incomplete -> PASS       (shard-hsw)
Test perf:
        Subgroup blocking:
                pass       -> FAIL       (shard-hsw) fdo#102252
Test drv_suspend:
        Subgroup debugfs-reader:
                pass       -> FAIL       (shard-snb)

fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540
fdo#103821 https://bugs.freedesktop.org/show_bug.cgi?id=103821
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252

shard-hsw        total:2712 pass:1535 dwarn:2   dfail:0   fail:11  skip:1164 time:9450s
shard-snb        total:2712 pass:1306 dwarn:1   dfail:0   fail:14  skip:1391 time:8022s
Blacklisted hosts:
shard-apl        total:2690 pass:1656 dwarn:1   dfail:0   fail:31  skip:1001 time:13533s
shard-kbl        total:2677 pass:1778 dwarn:1   dfail:0   fail:33  skip:864 time:10886s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_685/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH igt v2 1/4] igt/perf_pmu: Tighten busy measurement
  2017-12-15 18:16 ` [PATCH igt v2 1/4] " Tvrtko Ursulin
@ 2017-12-15 20:51   ` Chris Wilson
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2017-12-15 20:51 UTC (permalink / raw
  To: Tvrtko Ursulin, intel-gfx

Quoting Tvrtko Ursulin (2017-12-15 18:16:52)
> 
> On 15/12/2017 16:10, 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>
> > ---
> > -     assert_within_epsilon(val, ref, tolerance);
> > +     assert_within_epsilon(val, busy ? slept : 0.f, tolerance);
> > +     gem_quiescent_gpu(gem_fd);
> 
> Why you think it is needed to quiescent after each subtest? It would 
> make more sense to do so at the beginning of each, if needed, but I 
> thought it wasn't.

After the test makes sure that the spinner is completed before we move
on. We are trying to tidy up after the mess we made, and idle the system
before the next measurement.

Take your pick, before or after, we depend upon the system being in a
certain state. Or both. I picked both for the frequency subtest as the
transition to idle for it is a little more interesting (I was thinking of
gen6_rps_idle side-effects).
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-12-15 20:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-15 16:10 [PATCH igt v2 1/4] igt/perf_pmu: Tighten busy measurement Chris Wilson
2017-12-15 16:10 ` [PATCH igt v2 2/4] igt/perf_pmu: Tighten measurements for most-busy Chris Wilson
2017-12-15 16:10 ` [PATCH igt v2 3/4] igt/perf_pmu: Measure the reference batch for busy-check-all Chris Wilson
2017-12-15 16:10 ` [PATCH igt v2 4/4] igt/perf_pmu: Measure the reference batch for all-busy-check-all Chris Wilson
2017-12-15 18:04 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/4] igt/perf_pmu: Tighten busy measurement Patchwork
2017-12-15 18:16 ` [PATCH igt v2 1/4] " Tvrtko Ursulin
2017-12-15 20:51   ` Chris Wilson
2017-12-15 20:44 ` ✗ Fi.CI.IGT: failure for series starting with [v2,1/4] " Patchwork

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.