ACK: [SRU Z][PATCH] block: fix bio_will_gap() for first bvec with offset

Seth Forshee seth.forshee at
Mon Aug 7 14:47:51 UTC 2017

On Mon, Aug 07, 2017 at 02:43:30PM +0200, Fabian Gr├╝nbichler wrote:
> From: Ming Lei <ming.lei at>
> BugLink:
> Commit 729204ef49ec("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: 729204ef49ec ("block: relax check on sg gap")
> Tested-by: Johannes Thumshirn <jthumshirn at>
> Reviewed-by: Johannes Thumshirn <jthumshirn at>
> Signed-off-by: Ming Lei <ming.lei at>
> Rewrote parts of the commit message and comments.
> Signed-off-by: Jens Axboe <axboe at>
> (cherry picked from commit 5a8d75a1b8c99bdc926ba69b7b7dbe4fae81a5af)
> Signed-off-by: Fabian Gr├╝nbichler <f.gruenbichler at>

Clean upstream cherry pick, looks reasonable.

Acked-by: Seth Forshee <seth.forshee at>

More information about the kernel-team mailing list