Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: optimize blk_bio_segment_split for single-page bvec

Introduce a fast path for single-page bvec IO, then we can avoid
to call bvec_split_segs() unnecessarily.

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

authored by

Ming Lei and committed by
Jens Axboe
bbcbbd56 48d7727c

+9 -3
+9 -3
block/blk-merge.c
··· 286 286 bvprv = bv; 287 287 bvprvp = &bvprv; 288 288 289 - if (bvec_split_segs(q, &bv, &nsegs, &seg_size, 290 - &front_seg_size, &sectors)) 289 + if (bv.bv_offset + bv.bv_len <= PAGE_SIZE) { 290 + nsegs++; 291 + seg_size = bv.bv_len; 292 + sectors += bv.bv_len >> 9; 293 + if (nsegs == 1 && seg_size > front_seg_size) 294 + front_seg_size = seg_size; 295 + } else if (bvec_split_segs(q, &bv, &nsegs, &seg_size, 296 + &front_seg_size, &sectors)) { 291 297 goto split; 292 - 298 + } 293 299 } 294 300 295 301 do_split = false;