io_uring: only plug when appropriate
authorJens Axboe <axboe@kernel.dk>
Wed, 28 Oct 2020 15:33:23 +0000 (09:33 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 9 Dec 2020 19:03:59 +0000 (12:03 -0700)
commit27926b683db03be307c6905b44ecfc1f081d9d6f
treec69f639ecee342d78023fb3d0767bf54155be266
parent0415767e7f0542b3cd1ab270c2e61e90e87aafa2
io_uring: only plug when appropriate

We unconditionally call blk_start_plug() when starting the IO
submission, but we only really should do that if we have more than 1
request to submit AND we're potentially dealing with block based storage
underneath. For any other type of request, it's just a waste of time to
do so.

Add a ->plug bit to io_op_def and set it for read/write requests. We
could make this more precise and check the file itself as well, but it
doesn't matter that much and would quickly become more expensive.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c