summaryrefslogtreecommitdiff
path: root/io_uring/timeout.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2025-09-23 04:25:22 -0600
committerJens Axboe <axboe@kernel.dk>2025-10-20 10:37:48 -0600
commit7be20254a743be4f02414b9d56cc3fe5f84e6500 (patch)
tree08aae95dac6af07ce8999f7177525651a507b169 /io_uring/timeout.c
parent211ddde0823f1442e4ad052a2f30f050145ccada (diff)
downloadlinux-7be20254a743be4f02414b9d56cc3fe5f84e6500.tar.gz
linux-7be20254a743be4f02414b9d56cc3fe5f84e6500.tar.bz2
linux-7be20254a743be4f02414b9d56cc3fe5f84e6500.zip
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>
Diffstat (limited to 'io_uring/timeout.c')
-rw-r--r--io_uring/timeout.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/timeout.c b/io_uring/timeout.c
index 17e3aab0af36..444142ba9d04 100644
--- a/io_uring/timeout.c
+++ b/io_uring/timeout.c
@@ -324,7 +324,7 @@ static void io_req_task_link_timeout(struct io_kiocb *req, io_tw_token_t tw)
int ret;
if (prev) {
- if (!io_should_terminate_tw(req->ctx)) {
+ if (!tw.cancel) {
struct io_cancel_data cd = {
.ctx = req->ctx,
.data = prev->cqe.user_data,