Skip to content

Commit df376b2

Browse files
Johannes Thumshirnaxboe
authored andcommitted
block: respect virtual boundary mask in bvecs
With drivers that are settting a virtual boundary constrain, we are seeing a lot of bio splitting and smaller I/Os being submitted to the driver. This happens because the bio gap detection code does not account cases where PAGE_SIZE - 1 is bigger than queue_virt_boundary() and thus will split the bio unnecessarily. Cc: Jan Kara <jack@suse.cz> Cc: Bart Van Assche <bvanassche@acm.org> Cc: Ming Lei <ming.lei@redhat.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Keith Busch <keith.busch@intel.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 9fe5c59 commit df376b2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

block/blk-merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static inline bool bio_will_gap(struct request_queue *q,
4646
bio_get_first_bvec(prev_rq->bio, &pb);
4747
else
4848
bio_get_first_bvec(prev, &pb);
49-
if (pb.bv_offset)
49+
if (pb.bv_offset & queue_virt_boundary(q))
5050
return true;
5151

5252
/*

block/blk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static inline bool biovec_phys_mergeable(struct request_queue *q,
169169
static inline bool __bvec_gap_to_prev(struct request_queue *q,
170170
struct bio_vec *bprv, unsigned int offset)
171171
{
172-
return offset ||
172+
return (offset & queue_virt_boundary(q)) ||
173173
((bprv->bv_offset + bprv->bv_len) & queue_virt_boundary(q));
174174
}
175175

0 commit comments

Comments
 (0)