All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] igt/gem_sync: Alternate stress for nop+sync
@ 2018-06-18 13:43 Chris Wilson
  2018-06-18 15:38 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chris Wilson @ 2018-06-18 13:43 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

Apply a different sort of stress by timing how long it takes to sync a
second nop batch in the the pipeline. We first start a spinner on the
engine, then when we now the GPU is active, we submit the second nop;
start timing as we then release the spinner and wait for the nop to
complete.

As with every other gem_sync test, it serves two roles. The first is
that it checks that we do not miss a wakeup under common stressful
conditions (the more conditions we check, the happier we will be that
they do not occur in practice). And the second role it fulfils, is that
it provides a very crude estimate for how long it takes for a nop to
execute from a running start (we already have a complimentary estimate
for an idle start).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 tests/gem_sync.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 90 insertions(+)

diff --git a/tests/gem_sync.c b/tests/gem_sync.c
index 1e2e089a1..4cd97c58b 100644
--- a/tests/gem_sync.c
+++ b/tests/gem_sync.c
@@ -177,6 +177,92 @@ idle_ring(int fd, unsigned ring, int timeout)
 	gem_close(fd, object.handle);
 }
 
+static void
+wakeup_ring(int fd, unsigned ring, int timeout)
+{
+	unsigned engines[16];
+	const char *names[16];
+	int num_engines = 0;
+
+	if (ring == ALL_ENGINES) {
+		for_each_physical_engine(fd, ring) {
+			if (!gem_can_store_dword(fd, ring))
+				continue;
+
+			names[num_engines] = e__->name;
+			engines[num_engines++] = ring;
+			if (num_engines == ARRAY_SIZE(engines))
+				break;
+		}
+		igt_require(num_engines);
+	} else {
+		gem_require_ring(fd, ring);
+		igt_require(gem_can_store_dword(fd, ring));
+		names[num_engines] = NULL;
+		engines[num_engines++] = ring;
+	}
+
+	intel_detect_and_clear_missed_interrupts(fd);
+	igt_fork(child, num_engines) {
+		const uint32_t bbe = MI_BATCH_BUFFER_END;
+		struct drm_i915_gem_exec_object2 object;
+		struct drm_i915_gem_execbuffer2 execbuf;
+		double end, this, elapsed, now;
+		unsigned long cycles;
+		uint32_t cmd;
+		igt_spin_t *spin;
+
+		memset(&object, 0, sizeof(object));
+		object.handle = gem_create(fd, 4096);
+		gem_write(fd, object.handle, 0, &bbe, sizeof(bbe));
+
+		memset(&execbuf, 0, sizeof(execbuf));
+		execbuf.buffers_ptr = to_user_pointer(&object);
+		execbuf.buffer_count = 1;
+		execbuf.flags = engines[child % num_engines];
+
+		spin = __igt_spin_batch_new_poll(fd, 0, execbuf.flags);
+		igt_assert(spin->running);
+		cmd = *spin->batch;
+
+		gem_execbuf(fd, &execbuf);
+
+		igt_spin_batch_end(spin);
+		gem_sync(fd, object.handle);
+
+		end = gettime() + timeout;
+		elapsed = 0;
+		cycles = 0;
+		do {
+			*spin->batch = cmd;
+			*spin->running = 0;
+			gem_execbuf(fd, &spin->execbuf);
+			while (!READ_ONCE(*spin->running))
+				;
+
+			gem_execbuf(fd, &execbuf);
+
+			this = gettime();
+			igt_spin_batch_end(spin);
+			gem_sync(fd, object.handle);
+			now = gettime();
+
+			elapsed += now - this;
+			cycles++;
+		} while (now < end);
+
+		igt_info("%s%sompleted %ld cycles: %.3f us\n",
+			 names[child % num_engines] ?: "",
+			 names[child % num_engines] ? " c" : "C",
+			 cycles, elapsed*1e6/cycles);
+
+		igt_spin_batch_free(fd, spin);
+		gem_close(fd, object.handle);
+	}
+	igt_waitchildren_timeout(timeout+10, NULL);
+	igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
+}
+
 static void
 store_ring(int fd, unsigned ring, int num_children, int timeout)
 {
@@ -762,6 +848,8 @@ igt_main
 			sync_ring(fd, e->exec_id | e->flags, 1, 150);
 		igt_subtest_f("idle-%s", e->name)
 			idle_ring(fd, e->exec_id | e->flags, 150);
+		igt_subtest_f("wakeup-%s", e->name)
+			wakeup_ring(fd, e->exec_id | e->flags, 150);
 		igt_subtest_f("store-%s", e->name)
 			store_ring(fd, e->exec_id | e->flags, 1, 150);
 		igt_subtest_f("many-%s", e->name)
@@ -782,6 +870,8 @@ igt_main
 		sync_ring(fd, ALL_ENGINES, ncpus, 150);
 	igt_subtest("forked-store-each")
 		store_ring(fd, ALL_ENGINES, ncpus, 150);
+	igt_subtest("wakeup-each")
+		wakeup_ring(fd, ALL_ENGINES, 150);
 
 	igt_subtest("basic-all")
 		sync_all(fd, 1, 5);
-- 
2.17.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for igt/gem_sync: Alternate stress for nop+sync
  2018-06-18 13:43 [igt-dev] [PATCH i-g-t] igt/gem_sync: Alternate stress for nop+sync Chris Wilson
@ 2018-06-18 15:38 ` Patchwork
  2018-06-18 17:12 ` [igt-dev] [PATCH i-g-t] " Antonio Argenziano
  2018-06-18 20:46 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-06-18 15:38 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: igt/gem_sync: Alternate stress for nop+sync
URL   : https://patchwork.freedesktop.org/series/44950/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4332 -> IGTPW_1476 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/44950/revisions/1/mbox/

== Known issues ==

  Here are the changes found in IGTPW_1476 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_flip@basic-flip-vs-dpms:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106097)

    
    ==== Possible fixes ====

    igt@kms_chamelium@dp-edid-read:
      fi-kbl-7500u:       FAIL (fdo#103841) -> PASS

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-glk-j4005:       FAIL (fdo#100368) -> PASS

    igt@kms_frontbuffer_tracking@basic:
      fi-hsw-peppy:       DMESG-FAIL (fdo#102614, fdo#106103) -> PASS

    
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
  fdo#103841 https://bugs.freedesktop.org/show_bug.cgi?id=103841
  fdo#106097 https://bugs.freedesktop.org/show_bug.cgi?id=106097
  fdo#106103 https://bugs.freedesktop.org/show_bug.cgi?id=106103


== Participating hosts (40 -> 38) ==

  Additional (3): fi-bwr-2160 fi-ilk-650 fi-kbl-r 
  Missing    (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u 


== Build changes ==

    * IGT: IGT_4522 -> IGTPW_1476

  CI_DRM_4332: 35d2e46192bf51f81d3d474b13cca1a607610843 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1476: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1476/
  IGT_4522: 077c6f7c3786334c5e5c34888ab446fdb4347331 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@gem_sync@wakeup-blt
+igt@gem_sync@wakeup-bsd
+igt@gem_sync@wakeup-bsd1
+igt@gem_sync@wakeup-bsd2
+igt@gem_sync@wakeup-default
+igt@gem_sync@wakeup-each
+igt@gem_sync@wakeup-render
+igt@gem_sync@wakeup-vebox

== Logs ==

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

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

* Re: [igt-dev] [PATCH i-g-t] igt/gem_sync: Alternate stress for nop+sync
  2018-06-18 13:43 [igt-dev] [PATCH i-g-t] igt/gem_sync: Alternate stress for nop+sync Chris Wilson
  2018-06-18 15:38 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-06-18 17:12 ` Antonio Argenziano
  2018-06-18 20:46 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
  2 siblings, 0 replies; 4+ messages in thread
From: Antonio Argenziano @ 2018-06-18 17:12 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev



On 18/06/18 06:43, Chris Wilson wrote:
> Apply a different sort of stress by timing how long it takes to sync a
> second nop batch in the the pipeline. We first start a spinner on the
> engine, then when we now the GPU is active, we submit the second nop;

Typo ^^^^^^^^^^^^^^

> start timing as we then release the spinner and wait for the nop to
> complete.
> 
> As with every other gem_sync test, it serves two roles. The first is
> that it checks that we do not miss a wakeup under common stressful
> conditions (the more conditions we check, the happier we will be that
> they do not occur in practice). And the second role it fulfils, is that
> it provides a very crude estimate for how long it takes for a nop to
> execute from a running start (we already have a complimentary estimate
> for an idle start).
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>   tests/gem_sync.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 90 insertions(+)
> 
> diff --git a/tests/gem_sync.c b/tests/gem_sync.c
> index 1e2e089a1..4cd97c58b 100644
> --- a/tests/gem_sync.c
> +++ b/tests/gem_sync.c
> @@ -177,6 +177,92 @@ idle_ring(int fd, unsigned ring, int timeout)
>   	gem_close(fd, object.handle);
>   }
>   
> +static void
> +wakeup_ring(int fd, unsigned ring, int timeout)
> +{

> +	intel_detect_and_clear_missed_interrupts(fd);
> +	igt_fork(child, num_engines) {
> +		const uint32_t bbe = MI_BATCH_BUFFER_END;
> +		struct drm_i915_gem_exec_object2 object;
> +		struct drm_i915_gem_execbuffer2 execbuf;
> +		double end, this, elapsed, now;
> +		unsigned long cycles;
> +		uint32_t cmd;
> +		igt_spin_t *spin;
> +
> +		memset(&object, 0, sizeof(object));
> +		object.handle = gem_create(fd, 4096);
> +		gem_write(fd, object.handle, 0, &bbe, sizeof(bbe));
> +
> +		memset(&execbuf, 0, sizeof(execbuf));
> +		execbuf.buffers_ptr = to_user_pointer(&object);
> +		execbuf.buffer_count = 1;
> +		execbuf.flags = engines[child % num_engines];
> +
> +		spin = __igt_spin_batch_new_poll(fd, 0, execbuf.flags);

Would be interesting to have the same test for batches on different 
contexts.

> +		igt_assert(spin->running);
> +		cmd = *spin->batch;
> +
> +		gem_execbuf(fd, &execbuf);
> +
> +		igt_spin_batch_end(spin);
> +		gem_sync(fd, object.handle);
> +

> +	}
> +	igt_waitchildren_timeout(timeout+10, NULL);
> +	igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);

When do you think we will (if ever) be ready to establish a baseline and 
fail this kind of tests on a performance regression?

Just for the lazy reader, do we have the same kind of test where the 
spinner is preempted by the nop batch?

Thanks,
Antonio

> +}
> +
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ Fi.CI.IGT: failure for igt/gem_sync: Alternate stress for nop+sync
  2018-06-18 13:43 [igt-dev] [PATCH i-g-t] igt/gem_sync: Alternate stress for nop+sync Chris Wilson
  2018-06-18 15:38 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  2018-06-18 17:12 ` [igt-dev] [PATCH i-g-t] " Antonio Argenziano
@ 2018-06-18 20:46 ` Patchwork
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-06-18 20:46 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: igt/gem_sync: Alternate stress for nop+sync
URL   : https://patchwork.freedesktop.org/series/44950/
State : failure

== Summary ==

= CI Bug Log - changes from IGT_4522_full -> IGTPW_1476_full =

== Summary - FAILURE ==

  Serious unknown changes coming with IGTPW_1476_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1476_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/44950/revisions/1/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in IGTPW_1476_full:

  === IGT changes ===

    ==== Possible regressions ====

    igt@gem_exec_suspend@basic-s4-devices:
      shard-snb:          PASS -> DMESG-WARN
      shard-glk:          PASS -> DMESG-WARN
      shard-kbl:          PASS -> DMESG-WARN

    
    ==== Warnings ====

    igt@gem_exec_schedule@deep-vebox:
      shard-kbl:          SKIP -> PASS +3

    igt@gem_mocs_settings@mocs-rc6-blt:
      shard-kbl:          PASS -> SKIP

    igt@gem_tiled_blits@interruptible:
      shard-apl:          SKIP -> PASS

    igt@kms_atomic@plane_invalid_params_fence:
      shard-snb:          SKIP -> PASS

    
== Known issues ==

  Here are the changes found in IGTPW_1476_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_schedule@pi-ringfull-bsd2:
      shard-kbl:          NOTRUN -> FAIL (fdo#103158)

    igt@kms_available_modes_crc@available_mode_test_crc:
      shard-glk:          NOTRUN -> FAIL (fdo#106641)
      shard-kbl:          NOTRUN -> FAIL (fdo#106641)
      shard-snb:          PASS -> FAIL (fdo#106641)

    igt@kms_flip@2x-plain-flip-fb-recreate:
      shard-glk:          PASS -> FAIL (fdo#100368)

    igt@kms_flip_tiling@flip-y-tiled:
      shard-glk:          PASS -> FAIL (fdo#103822, fdo#104724)

    igt@kms_rotation_crc@primary-rotation-180:
      shard-snb:          PASS -> FAIL (fdo#104724, fdo#103925)

    igt@perf_pmu@init-busy-vcs1:
      shard-snb:          PASS -> INCOMPLETE (fdo#105411)

    
    ==== Possible fixes ====

    igt@drv_selftest@live_gtt:
      shard-apl:          FAIL (fdo#105347) -> PASS

    igt@drv_selftest@live_hangcheck:
      shard-kbl:          DMESG-FAIL (fdo#106947) -> PASS

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-snb:          INCOMPLETE (fdo#105411) -> PASS

    igt@kms_flip@2x-plain-flip-fb-recreate-interruptible:
      shard-glk:          FAIL (fdo#100368) -> PASS +1

    igt@kms_flip@flip-vs-expired-vblank-interruptible:
      shard-glk:          FAIL (fdo#105363, fdo#102887) -> PASS

    igt@kms_flip@modeset-vs-vblank-race:
      shard-hsw:          FAIL (fdo#103060) -> PASS

    igt@kms_flip_tiling@flip-to-y-tiled:
      shard-glk:          FAIL (fdo#104724) -> PASS

    
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
  fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
  fdo#103158 https://bugs.freedesktop.org/show_bug.cgi?id=103158
  fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
  fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
  fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
  fdo#105347 https://bugs.freedesktop.org/show_bug.cgi?id=105347
  fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641
  fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * IGT: IGT_4522 -> IGTPW_1476
    * Linux: CI_DRM_4329 -> CI_DRM_4332

  CI_DRM_4329: 02d8db1a894b0e646b2debd64ce24b8e99fd2ffd @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4332: 35d2e46192bf51f81d3d474b13cca1a607610843 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1476: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1476/
  IGT_4522: 077c6f7c3786334c5e5c34888ab446fdb4347331 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

end of thread, other threads:[~2018-06-18 20:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18 13:43 [igt-dev] [PATCH i-g-t] igt/gem_sync: Alternate stress for nop+sync Chris Wilson
2018-06-18 15:38 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-06-18 17:12 ` [igt-dev] [PATCH i-g-t] " Antonio Argenziano
2018-06-18 20:46 ` [igt-dev] ✗ Fi.CI.IGT: failure for " 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.