[igt-dev] [PATCH i-g-t] i915/sysfs_heartbeat_interval: Watch out for CPU scheduler delays

Chris Wilson chris at chris-wilson.co.uk
Wed May 13 10:47:15 UTC 2020


If our CPU client is very slow to notice that the GPU spinner has
started, we may consume the full heartbeat interval without noticing.
This is bad if we are trying to test that a client that yield within the
heartbeat interval is not selected for termination.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1879
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 tests/i915/sysfs_heartbeat_interval.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/i915/sysfs_heartbeat_interval.c b/tests/i915/sysfs_heartbeat_interval.c
index 6d4413d62..fe0cc046c 100644
--- a/tests/i915/sysfs_heartbeat_interval.c
+++ b/tests/i915/sysfs_heartbeat_interval.c
@@ -308,8 +308,13 @@ static void client(int i915, int engine, int *ctl, int duration, int expect)
 					      IGT_SPIN_POLL_RUN |
 					      IGT_SPIN_FENCE_OUT));
 
+		/* XXX we need more precise means of limiting the spinner */
 		igt_spin_busywait_until_started(spin);
-		igt_assert_eq(sync_fence_status(spin->out_fence), 0);
+		if (sync_fence_status(spin->out_fence)) {
+			/* CPU too slow! */
+			igt_spin_free(i915, spin);
+			continue;
+		}
 
 		elapsed = measured_usleep(duration * 1000);
 		igt_spin_end(spin);
-- 
2.26.2



More information about the igt-dev mailing list