Re: [PATCH] block: advance by bvec's length for bio_for_each_bvec
From: Jens Axboe <axboe@kernel.dk>
Date: 2019-02-28 13:00:19
From: Jens Axboe <axboe@kernel.dk>
Date: 2019-02-28 13:00:19
On 2/27/19 8:24 PM, Ming Lei wrote:
bio_for_each_bvec is used in fast path of bio splitting and sg mapping, and what we want to do is to iterate over multi-page bvecs, instead of pages. However, bvec_iter_advance() is invisble for this requirement, and always advance by page size. This way isn't efficient for multipage bvec iterator, also bvec_iter_len() isn't as fast as mp_bvec_iter_len(). So advance by multi-page bvec's length instead of page size for bio_for_each_bvec(). More than 1% IOPS improvement can be observed in io_uring test on null_blk.
Thanks Ming, I tested this last night with good results. -- Jens Axboe