]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
io_uring: get rid of tw_pending for !DEFER task work
authorJens Axboe <axboe@kernel.dk>
Mon, 15 Jun 2026 19:43:16 +0000 (13:43 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 16 Jun 2026 15:48:00 +0000 (09:48 -0600)
commitca4aa97194ae353c2882d7cb4ed123a544892bcf
tree6847313caee411c23aba37bf5bbce3e51a0ef9e5
parentc554246ff4c68abf71b61a89c6e39d3cf94f523e
io_uring: get rid of tw_pending for !DEFER task work

The normal task_work path used a tw_pending bit to ensure the callback
was only added once: the mpscq drains incrementally, so a single
tctx_task_work() run can take the queue through empty -> non-empty
several times, and each transition would otherwise re-add the already
pending callback_head. This corrupts the task_work list, and is what
tw_pending protects again.

This can go away, if we stop running the task_work as soon as the queue
empties.

Suggested-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
io_uring/mpscq.h
io_uring/tw.c