io_uring: optimise io_free_batch_list
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 21 Mar 2022 22:02:22 +0000 (22:02 +0000)
committerJens Axboe <axboe@kernel.dk>
Sun, 17 Apr 2022 22:51:24 +0000 (16:51 -0600)
commit0ff4f49809b06a8b635daa406eaacf1785388558
treee4b1effa1e90cc22aa7cddc04b81cff2912b8dc1
parentd52191774986c1c8844d596a7a2bdfa2275fca7c
io_uring: optimise io_free_batch_list

We do several req->flags checks in the fast path of
io_free_batch_list(). One explicit check of REQ_F_REFCOUNT, and two
other hidden in io_queue_next() and io_dismantle_req(). Moreover, there
is a io_req_put_rsrc_locked() call in between, so there is no hope
req->flags will be preserved in registers.

All those flags if not a slow path than definitely a slower path, so
put them all under a single flags mask check and save several mem
reloads and ifs.

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