io_uring: optimise io_req_task_work_add()
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 19 Mar 2021 17:22:44 +0000 (17:22 +0000)
committerJens Axboe <axboe@kernel.dk>
Thu, 25 Mar 2021 16:24:24 +0000 (10:24 -0600)
commit663930690fc991f29f2afbbb8c2d2a6bf6f3a56a
treeec2da2ef00ef63129b0205fef4543798886dc854
parentb80c77e2d41424d9beb60ca2b4b576e43c34b81a
io_uring: optimise io_req_task_work_add()

Inline io_task_work_add() into io_req_task_work_add(). They both work
with a request, so keeping them separate doesn't make things much more
clear, but merging allows optimise it. Apart from small wins like not
reading req->ctx or not calculating @notify in the hot path, i.e. with
tctx->task_state set, it avoids doing wake_up_process() for every single
add, but only after actually done task_work_add().

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c