All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t] lib: Use read() for timerfd timeout detection
@ 2020-04-14 19:05 ` Chris Wilson
  0 siblings, 0 replies; 18+ messages in thread
From: Chris Wilson @ 2020-04-14 19:05 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, michal.winiarski, Chris Wilson

The poll() is proving unreliable, where our tests timeout without the
spinner being terminated. Let's try a blocking read instead!

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1676
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_dummyload.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 99ca84ad8..a59afd45b 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -399,12 +399,13 @@ igt_spin_factory(int fd, const struct igt_spin_factory *opts)
 static void *timer_thread(void *data)
 {
 	igt_spin_t *spin = data;
-	struct pollfd pfd = {
-		.fd = spin->timerfd,
-		.events = POLLIN,
-	};
+	uint64_t overruns = 0;
+	int ret;
 
-	if (poll(&pfd, 1, -1) >= 0)
+	do {
+		ret = read(spin->timerfd, &overruns, sizeof(overruns));
+	} while (ret == -1 && errno == EINTR);
+	if (overruns)
 		igt_spin_end(spin);
 
 	return NULL;
-- 
2.26.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2020-04-16 10:55 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14 19:05 [Intel-gfx] [PATCH i-g-t] lib: Use read() for timerfd timeout detection Chris Wilson
2020-04-14 19:05 ` [igt-dev] " Chris Wilson
2020-04-14 19:58 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-04-14 21:37 ` [Intel-gfx] [PATCH i-g-t] " Dixit, Ashutosh
2020-04-14 21:37   ` [igt-dev] " Dixit, Ashutosh
2020-04-14 21:54   ` Chris Wilson
2020-04-14 21:54     ` [igt-dev] " Chris Wilson
2020-04-15 11:57 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
2020-04-15 12:54 ` [Intel-gfx] [PATCH i-g-t] " Chris Wilson
2020-04-15 12:54   ` [igt-dev] " Chris Wilson
2020-04-15 13:36 ` [igt-dev] ✗ Fi.CI.BUILD: failure for lib: Use read() for timerfd timeout detection (rev2) Patchwork
2020-04-15 13:39 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
2020-04-15 14:39 ` [Intel-gfx] [PATCH i-g-t] lib: Use read() for timerfd timeout detection Chris Wilson
2020-04-15 14:39   ` [igt-dev] " Chris Wilson
2020-04-15 18:04   ` [Intel-gfx] " Dixit, Ashutosh
2020-04-15 18:04     ` [igt-dev] " Dixit, Ashutosh
2020-04-15 15:16 ` [igt-dev] ✓ Fi.CI.BAT: success for lib: Use read() for timerfd timeout detection (rev3) Patchwork
2020-04-16 10:55 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.