io_uring: unify task_work cancelation checks
authorJens Axboe <axboe@kernel.dk>
Tue, 23 Sep 2025 10:25:22 +0000 (04:25 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 20 Oct 2025 16:37:48 +0000 (10:37 -0600)
commit7be20254a743be4f02414b9d56cc3fe5f84e6500
tree08aae95dac6af07ce8999f7177525651a507b169
parent211ddde0823f1442e4ad052a2f30f050145ccada
io_uring: unify task_work cancelation checks

Rather than do per-tw checking, which needs to dip into the task_struct
for checking flags, do it upfront before running task_work. This places
a 'cancel' member in io_tw_token_t, which is assigned before running
task_work for that given ctx.

This is both more efficient in doing it upfront rather than for every
task_work, and it means that io_should_terminate_tw() can be made
private in io_uring.c rather than need to be called by various
callbacks of task_work.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
io_uring/io_uring.c
io_uring/io_uring.h
io_uring/poll.c
io_uring/timeout.c
io_uring/uring_cmd.c