]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: optimise submission loop invariant
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 12 Apr 2022 14:09:49 +0000 (15:09 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Apr 2022 00:02:46 +0000 (18:02 -0600)
commitf7177cbaeafef96b29552483fd050e0750dfd3ea
tree3d2d3d4a7885c5263b08d05e7af7e010a7629f2d
parent1caccf4bdcf94ea9571d7f111caf7dde2cb844a5
io_uring: optimise submission loop invariant

Instead of keeping @submitted in io_submit_sqes(), which for each
iteration requires comparison with the initial number of SQEs, store the
number of SQEs left to submit. We'll need nr only for when we're done
with SQE handling.

note: if we can't allocate a req for the first SQE we always has been
returning -EAGAIN to the userspace, save this behaviour by looking into
the cache in a slow path.

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