]> www.infradead.org Git - users/dwmw2/linux.git/commit
block: ensure plug merging checks the correct queue at least once
authorJens Axboe <axboe@kernel.dk>
Fri, 11 Mar 2022 17:21:43 +0000 (10:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:13 +0000 (13:57 +0200)
commite8969bc51294af850b2b4e8c7efe81f25cd3676b
treed3ed77860e62861c6ae6533b5d12f93aa0eb8bc0
parente19b0f839100a6032191002356497c598f0f53dd
block: ensure plug merging checks the correct queue at least once

commit 5b2050718d095cd3242d1f42aaaea3a2fec8e6f0 upstream.

Song reports that a RAID rebuild workload runs much slower recently,
and it is seeing a lot less merging than it did previously. The reason
is that a previous commit reduced the amount of work we do for plug
merging. RAID rebuild interleaves requests between disks, so a last-entry
check in plug merging always misses a merge opportunity since we always
find a different disk than what we are looking for.

Modify the logic such that it's still a one-hit cache, but ensure that
we check enough to find the right target before giving up.

Fixes: d38a9c04c0d5 ("block: only check previous entry for plug merge attempt")
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-merge.c