]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: optimise out req->opcode reloading
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 6 Oct 2021 15:06:49 +0000 (16:06 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 19 Oct 2021 11:49:55 +0000 (05:49 -0600)
commit459074c7ca2371990396b305eaa1f550136dab25
tree519b920651e76343cb0af5abb3822a3a583356e7
parent61b8e8a17a3524a21968ffbc05ba72b3f0f14cb4
io_uring: optimise out req->opcode reloading

Looking at the assembly, the compiler decided to reload req->opcode in
io_op_defs[opcode].needs_file instead of one it had in a register, so
store it in a temp variable so it can be optimised out. Also move the
personality block later, it's better for spilling/etc. as it only
depends on @sqe, which we're keeping anyway.

By the way, zero req->opcode if it over IORING_OP_LAST, not a problem,
at the moment but is safer.

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