block: blk-merge: try to make front segments in full size
authorMing Lei <ming.lei@redhat.com>
Mon, 18 Dec 2017 12:22:15 +0000 (20:22 +0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 6 Jan 2018 16:18:00 +0000 (09:18 -0700)
commita2d37968d784363842f87820a21e106741d28004
tree63d4475d4de594b94b638c76269660102ac0b1b1
parent6a501bf0807b5dc024fe52a4f956800a352c39ab
block: blk-merge: try to make front segments in full size

When merging one bvec into segment, if the bvec is too big
to merge, current policy is to move the whole bvec into another
new segment.

This patchset changes the policy into trying to maximize size of
front segments, that means in above situation, part of bvec
is merged into current segment, and the remainder is put
into next segment.

This patch prepares for support multipage bvec because
it can be quite common to see this case and we should try
to make front segments in full size.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-merge.c