Skip to contentSkip to conversation

tests/gem_eio: Resilience against "hanging too fast"

PATCH In review Daniel Vetter 3 participants 4 messages Nov 25, 2015 – Nov 26, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/gem_eio: Resilience against "hanging too fast"

Since $debugfs/i915_wedged restores a wedged gpu by using a normal gpu hang we need to be careful to not run into the "hanging too fast check":

- don't restore the ban period, but instead keep it at 0.
- make sure we idle the gpu fully before hanging it again (wait subtest missted that).

With this gem_eio works now reliable even when I don't run the subtests individually.

---
 tests/gem_eio.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
tests/gem_eio.c +9 -1
index ad67332eae59..f6e41db63a7d 100644
@@ -84,13 +84,17 @@ static void trigger_reset(int fd)
 
 static void wedge_gpu(int fd)
 {
+	igt_hang_ring_t hang;
+
 	/* First idle the GPU then disable GPU resets before injecting a hang */
 	gem_quiescent_gpu(fd);
 
 	igt_require(i915_reset_control(false));
 
 	igt_debug("Wedging GPU by injecting hang\n");
-	igt_post_hang_ring(fd, igt_hang_ring(fd, I915_EXEC_DEFAULT));
+	hang = igt_hang_ring(fd, I915_EXEC_DEFAULT);
+	hang.ban = 0;
+	igt_post_hang_ring(fd, hang);
 
 	igt_assert(i915_reset_control(true));
 }
@@ -161,10 +165,14 @@ static void test_wait(int fd)
 {
 	igt_hang_ring_t hang;
 
+	/* First idle the GPU then disable GPU resets before injecting a hang */
+	gem_quiescent_gpu(fd);
+
 	igt_require(i915_reset_control(false));
 
 	hang = igt_hang_ring(fd, I915_EXEC_DEFAULT);
 	igt_assert_eq(__gem_wait(fd, hang.handle, -1), -EIO);
+	hang.ban = 0;
 	igt_post_hang_ring(fd, hang);
 
 	igt_assert(i915_reset_control(true));
Signature · 6 lines
2.1.0

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

Since $debugfs/i915_wedged restores a wedged gpu by using a normal gpu hang we need to be careful to not run into the "hanging too fast check":

That's not how it works. It restores the GPU by triggering a manual reset.
-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 7 lines · Chris Wilson
Quoted 3 lines · Daniel Vetter

Since $debugfs/i915_wedged restores a wedged gpu by using a normal gpu hang we need to be careful to not run into the "hanging too fast check":

That's not how it works. It restores the GPU by triggering a manual reset.

Maybe in your tree, but here it goes through the full hang recovery. And the gem_eio default context _does_ get banned without this. Maybe it's a bug in the ban logic, but it didn't look like that. After all debugfs/i915_wedged is a hack for developers - by that time userspace has already either died or fallen back to sw rendering anyway. So I figured no point in fixing this in the kernel with special cases.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 10 lines · Daniel Vetter
Quoted 7 lines · Chris Wilson
Quoted 3 lines · Daniel Vetter

Since $debugfs/i915_wedged restores a wedged gpu by using a normal gpu hang we need to be careful to not run into the "hanging too fast check":

That's not how it works. It restores the GPU by triggering a manual reset.

Maybe in your tree, but here it goes through the full hang recovery.

Right.

Quoted 2 lines

And
the gem_eio default context _does_ get banned without this.

Wrong.

Quoted 2 lines

Maybe it's a
bug in the ban logic, but it didn't look like that.

Indeed, that is not where the *kernel* bug is.
-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