Skip to contentSkip to conversation

igt/gem_exec_scheduler: Add small priority sorting smoketest

PATCH In review Chris Wilson 3 participants 3 messages Oct 5, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igt/gem_exec_scheduler: Add small priority sorting smoketest

Not a test that inspects strict ordering of execution, but one that makes sure that we can sure a small bit of stress. From each cpu we submit a small number of batches at different priorities to different engines, with the expectation that they pass through unscathed.

Cc Michał Winiarski <[email protected]
Cc Joonas Lahtinen <[email protected]>
---
 tests/gem_exec_schedule.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)
tests/gem_exec_schedule.c +74 -0
index 25704399..a48bebd5 100644
@@ -215,6 +215,74 @@ static void fifo(int fd, unsigned ring)
 	munmap(ptr, 4096);
 }
 
+static bool ignore_engine(int fd, unsigned engine)
+{
+	if (engine == 0)
+		return true;
+
+	if (gem_has_bsd2(fd) && engine == I915_EXEC_BSD)
+		return true;
+
+	return false;
+}
+
+static void smoketest(int fd, unsigned ring, unsigned timeout)
+{
+	const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
+	unsigned engines[16];
+	unsigned nengine;
+	unsigned engine;
+	uint32_t scratch;
+	uint32_t *ptr;
+
+	nengine = 0;
+	for_each_engine(fd, engine) {
+		if (ignore_engine(fd, engine))
+			continue;
+
+		engines[nengine++] = engine;
+	}
+	igt_require(nengine);
+
+	scratch = gem_create(fd, 4096);
+	igt_fork(child, ncpus) {
+		unsigned long count = 0;
+		uint32_t ctx;
+
+		hars_petruska_f54_1_random_perturb(child);
+
+		ctx = gem_context_create(fd);
+		igt_until_timeout(timeout) {
+			int prio;
+
+			prio = hars_petruska_f54_1_random_unsafe_max(MAX_PRIO - MIN_PRIO) + MIN_PRIO;
+			ctx_set_priority(fd, ctx, prio);
+
+			engine = engines[hars_petruska_f54_1_random_unsafe_max(nengine)];
+			store_dword(fd, ctx, engine, scratch,
+				    8*child + 0, ~child,
+				    0, 0);
+			for (unsigned int step = 0; step < 8; step++)
+				store_dword(fd, ctx, engine, scratch,
+					    8*child + 4, count++,
+					    0, 0);
+		}
+		gem_context_destroy(fd, ctx);
+	}
+	igt_waitchildren();
+
+	ptr = gem_mmap__gtt(fd, scratch, 4096, PROT_READ);
+	gem_set_domain(fd, scratch, /* no write hazard lies! */
+			I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+	gem_close(fd, scratch);
+
+	for (unsigned n = 0; n < ncpus; n++) {
+		igt_assert_eq_u32(ptr[2*n], ~n);
+		igt_info("Child[%d] completed %u cycles\n",  n, ptr[2*n+1]);
+	}
+	munmap(ptr, 4096);
+}
+
 static void reorder(int fd, unsigned ring, unsigned flags)
 #define EQUAL 1
 {
@@ -999,6 +1067,9 @@ igt_main
 			ctx_has_priority(fd);
 		}
 
+		igt_subtest("smoketest-all")
+			smoketest(fd, -1, 30);
+
 		for (e = intel_execution_engines; e->name; e++) {
 			/* default exec-id is purely symbolic */
 			if (e->exec_id == 0)
@@ -1045,6 +1116,9 @@ igt_main
 
 				igt_subtest_f("reorder-wide-%s", e->name)
 					reorder_wide(fd, e->exec_id | e->flags);
+
+				igt_subtest_f("smoketest-%s", e->name)
+					smoketest(fd, e->exec_id | e->flags, 5);
 			}
 		}
 	}
Signature · 6 lines
2.14.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✗ Fi.CI.BAT: failure for igt/gem_exec_scheduler: Add small priority sorting smoketest

== Series Details ==

== Series Details ==

Series: igt/gem_exec_scheduler: Add small priority sorting smoketest
URL : https://patchwork.freedesktop.org/series/31419/
State : failure

== Summary ==

IGT patchset tested on top of latest successful build 7f93a2632aae7c5865823b4a2fa4cd8c2a1c0977 Update NEWS, bump version to 1.20.

with latest DRM-Tip kernel build CI_DRM_3179
247cb84af034 drm-tip: 2017y-10m-05d-06h-44m-09s UTC integration manifest

Testlist changes:
+igt@gem_exec_schedule@smoketest-all
+igt@gem_exec_schedule@smoketest-blt
+igt@gem_exec_schedule@smoketest-bsd
+igt@gem_exec_schedule@smoketest-bsd1
+igt@gem_exec_schedule@smoketest-bsd2
+igt@gem_exec_schedule@smoketest-render
+igt@gem_exec_schedule@smoketest-vebox

Test chamelium:

        Subgroup hdmi-hpd-fast:
                skip       -> FAIL       (fi-kbl-7500u) fdo#102672
        Subgroup hdmi-edid-read:
                skip       -> FAIL       (fi-kbl-7500u)
Test drv_module_reload:
        Subgroup basic-no-display:
                incomplete -> PASS       (fi-cfl-s) fdo#103022

fdo#102672 https://bugs.freedesktop.org/show_bug.cgi?id=102672
fdo#103022 https://bugs.freedesktop.org/show_bug.cgi?id=103022

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:455s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:474s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:398s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:571s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:290s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:527s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:537s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:549s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:527s
fi-cfl-s         total:289  pass:256  dwarn:1   dfail:0   fail:0   skip:32  time:563s
fi-cnl-y         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:639s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:445s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:601s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:441s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:421s
fi-ilk-650       total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:466s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:508s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:485s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:2   skip:22  time:513s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:588s
fi-kbl-7567u     total:289  pass:265  dwarn:4   dfail:0   fail:0   skip:20  time:495s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:592s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:656s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:470s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:657s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:535s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:525s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:477s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:591s
fi-snb-2600      total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:434s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_301/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#2 lore raw
In reply to Chris Wilson
Quoted 8 lines · Chris Wilson

Not a test that inspects strict ordering of execution, but one that makes sure that we can sure a small bit of stress. From each cpu we submit a small number of batches at different priorities to different engines, with the expectation that they pass through unscathed.

Cc Michał Winiarski <[email protected]
Cc Joonas Lahtinen <[email protected]>

Regards, Joonas

Signature · 7 lines
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx