diff mbox

[i-g-t,3/6] igt/gem_sync: Double the wakeups, twice the pain

Message ID 20180619104920.17528-3-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson June 19, 2018, 10:49 a.m. UTC
To further defeat any contemplated spin-optimisations to avoid the irq
latency for synchronous wakeups, increase the queue length.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_sync.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Comments

Joonas Lahtinen June 19, 2018, 1:38 p.m. UTC | #1
Quoting Chris Wilson (2018-06-19 13:49:17)
> To further defeat any contemplated spin-optimisations to avoid the irq
> latency for synchronous wakeups, increase the queue length.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
diff mbox

Patch

diff --git a/tests/gem_sync.c b/tests/gem_sync.c
index 4cd97c58b..5901e1476 100644
--- a/tests/gem_sync.c
+++ b/tests/gem_sync.c
@@ -178,7 +178,7 @@  idle_ring(int fd, unsigned ring, int timeout)
 }
 
 static void
-wakeup_ring(int fd, unsigned ring, int timeout)
+wakeup_ring(int fd, unsigned ring, int timeout, int wlen)
 {
 	unsigned engines[16];
 	const char *names[16];
@@ -240,7 +240,8 @@  wakeup_ring(int fd, unsigned ring, int timeout)
 			while (!READ_ONCE(*spin->running))
 				;
 
-			gem_execbuf(fd, &execbuf);
+			for (int n = 0; n < wlen; n++)
+				gem_execbuf(fd, &execbuf);
 
 			this = gettime();
 			igt_spin_batch_end(spin);
@@ -849,7 +850,9 @@  igt_main
 		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);
+			wakeup_ring(fd, e->exec_id | e->flags, 150, 1);
+		igt_subtest_f("double-wakeup-%s", e->name)
+			wakeup_ring(fd, e->exec_id | e->flags, 150, 2);
 		igt_subtest_f("store-%s", e->name)
 			store_ring(fd, e->exec_id | e->flags, 1, 150);
 		igt_subtest_f("many-%s", e->name)
@@ -871,7 +874,9 @@  igt_main
 	igt_subtest("forked-store-each")
 		store_ring(fd, ALL_ENGINES, ncpus, 150);
 	igt_subtest("wakeup-each")
-		wakeup_ring(fd, ALL_ENGINES, 150);
+		wakeup_ring(fd, ALL_ENGINES, 150, 1);
+	igt_subtest("double-wakeup-each")
+		wakeup_ring(fd, ALL_ENGINES, 150, 2);
 
 	igt_subtest("basic-all")
 		sync_all(fd, 1, 5);