]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - fs/io_uring.c
io_uring: simplify SQPOLL cancellations
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 25 Apr 2021 22:34:46 +0000 (23:34 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 26 Apr 2021 12:59:25 +0000 (06:59 -0600)
commit9f59a9d88d3bb2708d08e0e1d03899c469c27190
tree73b49f0805107b074112981b1fb40700200e086c
parent28090c133869b461c5366195a856d73469ab87d9
io_uring: simplify SQPOLL cancellations

All sqpoll rings (even sharing sqpoll task) are currently dead bound
to the task that created them, iow when owner task dies it kills all
its SQPOLL rings and their inflight requests via task_work infra. It's
neither the nicist way nor the most convenient as adds extra
locking/waiting and dependencies.

Leave it alone and rely on SIGKILL being delivered on its thread group
exit, so there are only two cases left:

1) thread group is dying, so sqpoll task gets a signal and exit itself
   cancelling all requests.

2) an sqpoll ring is dying. Because refs_kill() is called the sqpoll not
   going to submit any new request, and that's what we need. And
   io_ring_exit_work() will do all the cancellation itself before
   actually killing ctx, so sqpoll doesn't need to worry about it.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/3cd7f166b9c326a2c932b70e71a655b03257b366.1619389911.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c