mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 00:04:15 +08:00
io_uring: break iopolling on signal
[ upstream commitdc314886cb
] 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: stable@vger.kernel.org Fixes:def596e955
("io_uring: support for IO polling") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/eeba551e82cad12af30c3220125eb6cb244cc94c.1691594339.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0def123f12
commit
c29848249f
@ -2668,6 +2668,11 @@ static int io_iopoll_check(struct io_ring_ctx *ctx, long min)
|
||||
break;
|
||||
}
|
||||
ret = io_do_iopoll(ctx, &nr_events, min);
|
||||
|
||||
if (task_sigpending(current)) {
|
||||
ret = -EINTR;
|
||||
goto out;
|
||||
}
|
||||
} while (!ret && nr_events < min && !need_resched());
|
||||
out:
|
||||
mutex_unlock(&ctx->uring_lock);
|
||||
|
Loading…
Reference in New Issue
Block a user