• Jens Axboe's avatar
    block: ensure plug merging checks the correct queue at least once · 5b205071
    Jens Axboe authored
    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: d38a9c04 ("block: only check previous entry for plug merge attempt")
    Reported-and-tested-by: default avatarSong Liu <song@kernel.org>
    Reviewed-by: default avatarSong Liu <songliubraving@fb.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    5b205071
blk-merge.c 30.8 KB