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>
Mon, 22 Mar 2021 13:42:53 +0000 (07:42 -0600)
commit323c02f2db0efb9fd1eab84ec48690cb10e9a53b
treec4dabcbf4e9d57d4d20db977b70891d7de855c16
parentfdad776c2b2b2a70b3cd74d221eecc66628be22e
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