Skip to contentSkip to conversation

tests/gem_ringfill: Add {render, blitter}-forked-1 subtests.

PATCH In review Joonas Lahtinen 3 participants 3 messages Jun 26, 2015 – Jul 1, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 tests/gem_ringfill: Add {render, blitter}-forked-1 subtests.

Add forking subtests to gem_ringfill. Tests cause consistent GPU hangs on SKL.

v2: Removed noop parts.
v3:
- Allow executing the tests in order too (Chris Wilson).
- Rename the tests to -forked-1

Cc Mika Kuoppala <[email protected]>
Cc Chris Wilson <[email protected]>

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89959

---
 tests/gem_ringfill.c | 91 ++++++++++++++++++++++++++++++++--------------------
 1 file changed, 57 insertions(+), 34 deletions(-)
tests/gem_ringfill.c +57 -34
index 85b01ea..06da1c2 100644
@@ -55,6 +55,7 @@ struct bo {
 };
 
 static const int width = 512, height = 512;
+int fd;
 
 static void create_bo(drm_intel_bufmgr *bufmgr,
 		      struct bo *b,
@@ -193,9 +194,52 @@ static void blt_copy(struct intel_batchbuffer *batch,
 	intel_batchbuffer_flush(batch);
 }
 
-drm_intel_bufmgr *bufmgr;
-struct intel_batchbuffer *batch;
-int fd;
+static void run_test(int ring, bool interruptible, int nchild) {
+	drm_intel_bufmgr *bufmgr;
+	struct intel_batchbuffer *batch;
+	igt_render_copyfunc_t copy;
+	const char* ring_name;
+
+	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
+	igt_require(bufmgr);
+	drm_intel_bufmgr_gem_enable_reuse(bufmgr);
+
+	batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd));
+	igt_require(batch);
+
+	if (ring == I915_EXEC_RENDER) {
+		copy = igt_get_render_copyfunc(batch->devid);
+		ring_name = "render";
+	} else if (ring == I915_EXEC_BLT) {
+		copy = blt_copy;
+		ring_name = "blt";
+	} else {
+		igt_fail_on_f(true, "Unsupported ring.");
+	}
+
+	/* Not all platforms have dedicated render ring. */
+	igt_require(copy);
+
+	if (interruptible) {
+		igt_fork_signal_helper();
+	}
+
+	if (nchild) {
+		igt_fork(child, nchild) {
+			check_ring(bufmgr, batch, ring_name, copy);
+		}
+		igt_waitchildren();
+	} else {
+		check_ring(bufmgr, batch, ring_name, copy);
+	}
+
+	if (interruptible) {
+		igt_stop_signal_helper();
+	}
+
+	intel_batchbuffer_free(batch);
+	drm_intel_bufmgr_destroy(bufmgr);
+}
 
 igt_main
 {
@@ -203,48 +247,27 @@ igt_main
 
 	igt_fixture {
 		fd = drm_open_any();
-
-		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
-		drm_intel_bufmgr_gem_enable_reuse(bufmgr);
-		batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd));
 	}
 
 	igt_subtest("blitter")
-		check_ring(bufmgr, batch, "blt", blt_copy);
+		run_test(I915_EXEC_BLT, false, 0);
 
-	/* Strictly only required on architectures with a separate BLT ring,
-	 * but lets stress everybody.
-	 */
-	igt_subtest("render") {
-		igt_render_copyfunc_t copy;
-
-		copy = igt_get_render_copyfunc(batch->devid);
-		igt_require(copy);
+	igt_subtest("render")
+		run_test(I915_EXEC_RENDER, false, 0);
 
-		check_ring(bufmgr, batch, "render", copy);
-	}
-
-	igt_fork_signal_helper();
 	igt_subtest("blitter-interruptible")
-		check_ring(bufmgr, batch, "blt", blt_copy);
+		run_test(I915_EXEC_BLT, true, 0);
 
-	/* Strictly only required on architectures with a separate BLT ring,
-	 * but lets stress everybody.
-	 */
-	igt_subtest("render-interruptible") {
-		igt_render_copyfunc_t copy;
+	igt_subtest("render-interruptible")
+		run_test(I915_EXEC_RENDER, true, 0);
 
-		copy = igt_get_render_copyfunc(batch->devid);
-		igt_require(copy);
+	igt_subtest("blitter-forked-1")
+		run_test(I915_EXEC_BLT, false, 1);
 
-		check_ring(bufmgr, batch, "render", copy);
-	}
-	igt_stop_signal_helper();
+	igt_subtest("render-forked-1")
+		run_test(I915_EXEC_RENDER, false, 1);
 
 	igt_fixture {
-		intel_batchbuffer_free(batch);
-		drm_intel_bufmgr_destroy(bufmgr);
-
 		close(fd);
 	}
 }
Signature · 8 lines
1.8.5.5



_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 8 lines · Joonas Lahtinen

Add forking subtests to gem_ringfill. Tests cause consistent GPU hangs on SKL.

v2: Removed noop parts.
v3:
- Allow executing the tests in order too (Chris Wilson).
- Rename the tests to -forked-1

Quoted 4 lines
Cc Mika Kuoppala <[email protected]>
Cc Chris Wilson <[email protected]>

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89959

I extended the test to cover the forked-N case and found that we shared the first batch handle (due to creating the intel_batch_buffer in the parent). Fixed that up and pushed, hopefully it still causes SKL to die horribly.
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 14 lines · Chris Wilson
Quoted 8 lines · Joonas Lahtinen

Add forking subtests to gem_ringfill. Tests cause consistent GPU hangs on SKL.

v2: Removed noop parts.
v3:
- Allow executing the tests in order too (Chris Wilson).
- Rename the tests to -forked-1

Quoted 4 lines
Cc Mika Kuoppala <[email protected]>
Cc Chris Wilson <[email protected]>

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89959

Quoted 4 lines

I extended the test to cover the forked-N case and found that we shared the first batch handle (due to creating the intel_batch_buffer in the parent). Fixed that up and pushed, hopefully it still causes SKL to die horribly.

It does, very well. And has already helped to isolate the blitter ctx switches out from the pool of suspects. Thanks for the test and pushing it.
-Mika

Quoted 4 lines

-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx