public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] i915/gem_eio: Reduce amount of incidental work after the delayed hang
@ 2019-10-08 11:16 Chris Wilson
  2019-10-08 11:46 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  2019-10-08 16:01 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2019-10-08 11:16 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

Since we time how long it takes for the waiter to be woken upon
injecting the hang, we want to avoid as much distractions as possible
along the critical path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_eio.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/tests/i915/gem_eio.c b/tests/i915/gem_eio.c
index 892f3657c..aa73b4deb 100644
--- a/tests/i915/gem_eio.c
+++ b/tests/i915/gem_eio.c
@@ -27,6 +27,7 @@
  *
  */
 
+#include <sched.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -223,16 +224,20 @@ struct hang_ctx {
 static void hang_handler(union sigval arg)
 {
 	struct hang_ctx *ctx = arg.sival_ptr;
+	struct timespec *ts = ctx->ts;
+	int dir = ctx->debugfs;
 
 	igt_debug("hang delay = %.2fus\n",
 		  igt_nsec_elapsed(&ctx->delay) / 1000.0);
-
-	igt_nsec_elapsed(ctx->ts);
-	igt_assert(igt_sysfs_set(ctx->debugfs, "i915_wedged", "-1"));
-
 	igt_assert_eq(timer_delete(ctx->timer), 0);
-	close(ctx->debugfs);
 	free(ctx);
+
+	igt_nsec_elapsed(ts);
+	igt_assert(igt_sysfs_set(dir, "i915_wedged", "-1"));
+	/* -> wake up gem_sync() in check_wait() */
+
+	sched_yield();
+	close(dir);
 }
 
 static void hang_after(int fd, unsigned int us, struct timespec *ts)
-- 
2.23.0

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

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

end of thread, other threads:[~2019-10-08 16:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-08 11:16 [igt-dev] [PATCH i-g-t] i915/gem_eio: Reduce amount of incidental work after the delayed hang Chris Wilson
2019-10-08 11:46 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-10-08 16:01 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox