block: flush plug based on hardware and software queue order
authorJens Axboe <axboe@kernel.dk>
Fri, 11 Mar 2022 17:24:17 +0000 (10:24 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 11 Mar 2022 18:08:34 +0000 (11:08 -0700)
commit26fed4ac4eab09c27fbae1859696cc38f0536407
treed408e8ae45e12c0c2418537e0d22753e3b62bbac
parent5b2050718d095cd3242d1f42aaaea3a2fec8e6f0
block: flush plug based on hardware and software queue order

We used to sort the plug list if we had multiple queues before dispatching
requests to the IO scheduler. This usually isn't needed, but for certain
workloads that interleave requests to disks, it's a less efficient to
process the plug list one-by-one if everything is interleaved.

Don't sort the list, but skip through it and flush out entries that have
the same target at the same time.

Fixes: df87eb0fce8f ("block: get rid of plug list sorting")
Reported-and-tested-by: Song Liu <song@kernel.org>
Reviewed-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c