]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:13 +0000 (13:57 +0200)
commite19b0f839100a6032191002356497c598f0f53dd
tree78b8e44f6135b4f66564e510abe98470a9bb05ba
parentb0c1d88b83323bacbb82ac44d3d6ce23b4afee77
block: flush plug based on hardware and software queue order

commit 26fed4ac4eab09c27fbae1859696cc38f0536407 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/blk-mq.c