public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH 1/1] io_uring: break iopolling on signal
@ 2023-08-09 15:20 Pavel Begunkov
  2023-08-09 15:30 ` Jens Axboe
  2023-08-09 16:18 ` Jens Axboe
  0 siblings, 2 replies; 9+ messages in thread
From: Pavel Begunkov @ 2023-08-09 15:20 UTC (permalink / raw)
  To: io-uring; +Cc: Jens Axboe, asml.silence

Don't keep spinning iopoll with a signal set. It'll eventually return
back, e.g. by virtue of need_resched(), but it's not a nice user
experience.

Cc: [email protected]
Fixes: def596e9557c9 ("io_uring: support for IO polling")
Signed-off-by: Pavel Begunkov <[email protected]>
---
 io_uring/io_uring.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index f32092d90960..1810cf719a02 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1684,6 +1684,9 @@ static int io_iopoll_check(struct io_ring_ctx *ctx, long min)
 			break;
 		nr_events += ret;
 		ret = 0;
+
+		if (task_sigpending(current))
+			return -EINTR;
 	} while (nr_events < min && !need_resched());
 
 	return ret;
-- 
2.41.0


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

end of thread, other threads:[~2023-08-09 16:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-09 15:20 [PATCH 1/1] io_uring: break iopolling on signal Pavel Begunkov
2023-08-09 15:30 ` Jens Axboe
2023-08-09 15:38   ` Pavel Begunkov
2023-08-09 15:50     ` Jens Axboe
2023-08-09 15:58       ` Pavel Begunkov
2023-08-09 16:01         ` Jens Axboe
2023-08-09 16:01           ` Pavel Begunkov
2023-08-09 16:05             ` Jens Axboe
2023-08-09 16:18 ` Jens Axboe

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