Skip to contentSkip to conversation

tests/gem_eio: Disable reset for wait subtests

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/gem_eio: Disable reset for wait subtests

This testcase tries to validate -EIO behaviour by disabling gpu reset support in the kernel. Except that the wait subtest forgot to do that, and therefore gets a return value of 0 instead of the expected -EIO.

With this fix gem_eio passes on a kernel with my fixes completely.

---
 tests/gem_eio.c | 4 ++++
 1 file changed, 4 insertions(+)
tests/gem_eio.c +4 -0
index a24c8f1c53b5..ad67332eae59 100644
@@ -161,10 +161,14 @@ static void test_wait(int fd)
 {
 	igt_hang_ring_t hang;
 
+	igt_require(i915_reset_control(false));
+
 	hang = igt_hang_ring(fd, I915_EXEC_DEFAULT);
 	igt_assert_eq(__gem_wait(fd, hang.handle, -1), -EIO);
 	igt_post_hang_ring(fd, hang);
 
+	igt_assert(i915_reset_control(true));
+
 	trigger_reset(fd);
 }
 
Signature · 6 lines
2.1.0

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

This testcase tries to validate -EIO behaviour by disabling gpu reset support in the kernel. Except that the wait subtest forgot to do that, and therefore gets a return value of 0 instead of the expected -EIO.

Wrong. It was intentionally not using reset=false. -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 4 lines · Daniel Vetter

This testcase tries to validate -EIO behaviour by disabling gpu reset support in the kernel. Except that the wait subtest forgot to do that, and therefore gets a return value of 0 instead of the expected -EIO.

Wrong. It was intentionally not using reset=false.

To be more precise, the reason here is that we are not wedging the GPU but the expectation is that a wait upon a request that hangs reports the hang. Since the wait on GPU activity is explicit in the ioctl, the presumption is that the user actually cares about that activity and so should be given greater information about how it completes (timeout, GPU hung, or success).
-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
#3 lore raw
Quoted 7 lines · Chris Wilson
Quoted 6 lines · Chris Wilson
Quoted 4 lines · Daniel Vetter

This testcase tries to validate -EIO behaviour by disabling gpu reset support in the kernel. Except that the wait subtest forgot to do that, and therefore gets a return value of 0 instead of the expected -EIO.

Quoted 8 lines
Quoted 1 line

Wrong. It was intentionally not using reset=false.

To be more precise, the reason here is that we are not wedging the GPU but the expectation is that a wait upon a request that hangs reports the hang. Since the wait on GPU activity is explicit in the ioctl, the presumption is that the user actually cares about that activity and so should be given greater information about how it completes (timeout, GPU hung, or success).

The only place we reprt hangs is in the reset_stats_ioctl. And fundamentally wait_ioctl can't do (right now) what you want, since if the reset recovery happens before userspace calls wait_ioctl then it will happily return 0 for success.

So if you want this then we need:
- a reason for userspace to want this
- reorg all our reset handling and move (or well copy) the reset stats to every object

I don't see the point in that.
-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
#4 lore raw
Quoted 22 lines · Daniel Vetter
Quoted 7 lines · Chris Wilson
Quoted 6 lines · Chris Wilson
Quoted 4 lines · Daniel Vetter

This testcase tries to validate -EIO behaviour by disabling gpu reset support in the kernel. Except that the wait subtest forgot to do that, and therefore gets a return value of 0 instead of the expected -EIO.

Quoted 8 lines
Quoted 1 line

Wrong. It was intentionally not using reset=false.

To be more precise, the reason here is that we are not wedging the GPU but the expectation is that a wait upon a request that hangs reports the hang. Since the wait on GPU activity is explicit in the ioctl, the presumption is that the user actually cares about that activity and so should be given greater information about how it completes (timeout, GPU hung, or success).

The only place we reprt hangs is in the reset_stats_ioctl. And fundamentally wait_ioctl can't do (right now) what you want, since if the reset recovery happens before userspace calls wait_ioctl then it will happily return 0 for success.

Quoted 4 lines

So if you want this then we need:
- a reason for userspace to want this
- reorg all our reset handling and move (or well copy) the reset stats to every object

I buy that if it resets before the wait_ioctl then it is invisible, which makes the information incomplete. I still think that as a caller of wait_ioctl, knowing that my wait was broken by a reset is valuable information. The drivers use some form of waiting to throttle themselves, therefore it is a convenient way of having the information that a reset has occurred and take action. This usecase also wouldn't miss a reset happening.

You may disagree about wait_ioctl, but a wait_fence must definitely report EIO. (And this is as close to wait_fence as we currently have in the code and in use today.)
-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
#5 lore raw
Quoted 28 lines · Chris Wilson
Quoted 22 lines · Daniel Vetter
Quoted 7 lines · Chris Wilson
Quoted 6 lines · Chris Wilson
Quoted 4 lines · Daniel Vetter

This testcase tries to validate -EIO behaviour by disabling gpu reset support in the kernel. Except that the wait subtest forgot to do that, and therefore gets a return value of 0 instead of the expected -EIO.

Quoted 8 lines
Quoted 1 line

Wrong. It was intentionally not using reset=false.

To be more precise, the reason here is that we are not wedging the GPU but the expectation is that a wait upon a request that hangs reports the hang. Since the wait on GPU activity is explicit in the ioctl, the presumption is that the user actually cares about that activity and so should be given greater information about how it completes (timeout, GPU hung, or success).

The only place we reprt hangs is in the reset_stats_ioctl. And fundamentally wait_ioctl can't do (right now) what you want, since if the reset recovery happens before userspace calls wait_ioctl then it will happily return 0 for success.

Quoted 4 lines

So if you want this then we need:
- a reason for userspace to want this
- reorg all our reset handling and move (or well copy) the reset stats to every object

Quoted 7 lines

I buy that if it resets before the wait_ioctl then it is invisible, which makes the information incomplete. I still think that as a caller of wait_ioctl, knowing that my wait was broken by a reset is valuable information. The drivers use some form of waiting to throttle themselves, therefore it is a convenient way of having the information that a reset has occurred and take action. This usecase also wouldn't miss a reset happening.

Iirc we even discussed this when doing arb robustness, but the trouble is that arb robusteness really wants its reset stats per context. Until that changes (with fences or not) I think we should just curb the EIO from wait_ioctl like in all the other places.

Quoted 3 lines

You may disagree about wait_ioctl, but a wait_fence must definitely report EIO. (And this is as close to wait_fence as we currently have in the code and in use today.)

Hm, the plan for fence waiting is to use the android syncpt stuff. I didn't check whether that bothers with reporting failures, but should be simple to add. And definitely makes sense.
-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