• M
    block: fix bio_will_gap() for first bvec with offset · 5a8d75a1
    Ming Lei 提交于
    Commit 729204ef("block: relax check on sg gap") allows us to merge
    bios, if both are physically contiguous.  This change can merge a huge
    number of small bios, through mkfs for example, mkfs.ntfs running time
    can be decreased to ~1/10.
    
    But if one rq starts with a non-aligned buffer (the 1st bvec's bv_offset
    is non-zero) and if we allow the merge, it is quite difficult to respect
    sg gap limit, especially the max segment size, or we risk having an
    unaligned virtual boundary.  This patch tries to avoid the issue by
    disallowing a merge, if the req starts with an unaligned buffer.
    
    Also add comments to explain why the merged segment can't end in
    unaligned virt boundary.
    
    Fixes: 729204ef ("block: relax check on sg gap")
    Tested-by: NJohannes Thumshirn <jthumshirn@suse.de>
    Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
    Signed-off-by: NMing Lei <ming.lei@redhat.com>
    
    Rewrote parts of the commit message and comments.
    Signed-off-by: NJens Axboe <axboe@fb.com>
    5a8d75a1
blkdev.h 57.9 KB