io_uring: optimise io_import_iovec nonblock passing
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 14 Oct 2021 15:10:17 +0000 (16:10 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 19 Oct 2021 11:49:55 +0000 (05:49 -0600)
commit51aac424aef980a6238d4907a5bb5a411fa926eb
tree3f7fe1dc3ae21c9a6561dfcf171f736f24261185
parentc88598a92a587109d915b4d97831bcea774c8b6f
io_uring: optimise io_import_iovec nonblock passing

First, change IO_URING_F_NONBLOCK to take sign bit of the int, so
checking for it can be turned into test + sign-based-jump, makes the
binary smaller and may be faster.

Then, instead of passing need_lock boolean into io_import_iovec() just
give it issue_flags, which is already stored somewhere. Saves some space
on stack, a couple of test + cmov operations and other conversions.

note: we still leave
force_nonblock = issue_flags & IO_URING_F_NONBLOCK
variable, but it's optimised out by the compiler into testing
issue_flags directly.

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