io_uring: switch deferred task_work to an io_wq_work_list
authorJens Axboe <axboe@kernel.dk>
Sun, 24 Mar 2024 16:05:20 +0000 (10:05 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 28 Mar 2024 20:05:14 +0000 (14:05 -0600)
commitafa22ccfbeeb5c4c1238b3150abaf0389cf877a4
treeaebea84bf7dc5f6cda0b942abdf03b992c5c56a1
parent5b799fa796e38cdcfcc3cd87a9b9c803d6f0bb86
io_uring: switch deferred task_work to an io_wq_work_list

Lockless lists may be handy for some things, but they mean that items
are in the reverse order as we can only add to the head of the list.
That in turn means that iterating items on the list needs to reverse it
first, if it's sensitive to ordering between items on the list.

Switch the DEFER_TASKRUN work list from an llist to a normal
io_wq_work_list, and protect it with a lock. Then we can get rid of the
manual reversing of the list when running it, which takes considerable
cycles particularly for bursty task_work additions.

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