io_uring: refactor tctx task_work list splicing
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 17 Jun 2021 17:14:08 +0000 (18:14 +0100)
committerJens Axboe <axboe@kernel.dk>
Fri, 18 Jun 2021 15:22:02 +0000 (09:22 -0600)
commitc6538be9e4883d1371adaff45712b1b2172773dd
tree0732aa5ff3731634d10a9be55998ffe202c2e291
parentebd0df2e63426bbd9ed50966e888c87eac88fc30
io_uring: refactor tctx task_work list splicing

We don't need a full copy of tctx->task_list in tctx_task_work(), but
only a first one, so just assign node directly.

Taking into account that task_works are run in a context of a task,
it's very unlikely to first see non-empty tctx->task_list and then
splice it empty, can only happen with task_work cancellations that is
not-normal slow path anyway. Hence, get rid of the check in the end,
it's there not for validity but "performance" purposes.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/d076c83fedb8253baf43acb23b8fafd7c5da1714.1623949695.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c