Ming-Lei/block…
Commits on Aug 10, 2017
-
block: bio: pass segments to bio if bio_add_page() is bypassed
Under some situations, such as block direct I/O, we can't use bio_add_page() for merging pages into multipage bvec, so a new function is implemented for converting page array into one segment array, then these cases can benefit from multipage bvec too. Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
This patch pulls the trigger for multipage bvecs. Now any request queue which supports queue cluster will see multipage bvecs. Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
fs/direct-io: convert to bio_for_each_segment_all_sp()
Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
fs/btrfs: convert to bio_for_each_segment_all_sp()
Cc: Chris Mason <clm@fb.com> Cc: Josef Bacik <jbacik@fb.com> Cc: David Sterba <dsterba@suse.com> Cc: linux-btrfs@vger.kernel.org Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
exofs: convert to bio_for_each_segment_all_sp()
Cc: Boaz Harrosh <ooo@electrozaur.com> Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
f2fs: convert to bio_for_each_segment_all_sp()
Cc: Jaegeuk Kim <jaegeuk@kernel.org> Cc: Chao Yu <yuchao0@huawei.com> Cc: linux-f2fs-devel@lists.sourceforge.net Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
gfs2: convert to bio_for_each_segment_all_sp()
Cc: Steven Whitehouse <swhiteho@redhat.com> Cc: Bob Peterson <rpeterso@redhat.com> Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
xfs: convert to bio_for_each_segment_all_sp()
Cc: "Darrick J. Wong" <darrick.wong@oracle.com> Cc: linux-xfs@vger.kernel.org Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
ext4: convert to bio_for_each_segment_all_sp()
Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Andreas Dilger <adilger.kernel@dilger.ca> Cc: linux-ext4@vger.kernel.org Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
dm-crypt: convert to bio_for_each_segment_all_sp()
Cc: Mike Snitzer <snitzer@redhat.com> Cc:dm-devel@redhat.com Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
dm-crypt: don't clear bvec->bv_page in crypt_free_buffer_pages()
The bio is always freed after running crypt_free_buffer_pages(), so it isn't necessary to clear the bv->bv_page. Cc: Mike Snitzer <snitzer@redhat.com> Cc:dm-devel@redhat.com Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
md: raid1: convert to bio_for_each_segment_all_sp()
Cc: Shaohua Li <shli@kernel.org> Cc: linux-raid@vger.kernel.org Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
bcache: convert to bio_for_each_segment_all_sp()
Cc: linux-bcache@vger.kernel.org Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
block: convert to singe/multi page version of bio_for_each_segment_all()
Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
block: deal with dirtying pages for multipage bvec
In bio_check_pages_dirty(), bvec->bv_page is used as flag for marking if the page has been dirtied & released, and if no, it will be dirtied in deferred workqueue. With multipage bvec, we can't do that any more, so change the logic into checking all pages in one mp bvec, and only release all these pages if all are dirtied, otherwise dirty them all in deferred wrokqueue. Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
btrfs: use bvec_get_last_page to get bio's last page
Preparing for supporting multipage bvec. Cc: Chris Mason <clm@fb.com> Cc: Josef Bacik <jbacik@fb.com> Cc: David Sterba <dsterba@suse.com> Cc: linux-btrfs@vger.kernel.org Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
fs/buffer.c: use bvec iterator to truncate the bio
Once multipage bvec is enabled, the last bvec may include more than one page, this patch use bvec_get_last_page() to truncate the bio. Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
block: introduce bvec_get_last_page()
BTRFS and guard_bio_eod() need to get the last page, so introduce this helper to make them happy. Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
block: bio: introduce single/multi page version of bio_for_each_segme…
…nt_all() This patches introduce bio_for_each_segment_all_sp() and bio_for_each_segment_all_mp(). bio_for_each_segment_all_sp() is for replacing bio_for_each_segment_all() in case that the returned bvec has to be single page bvec. bio_for_each_segment_all_mp() is for replacing bio_for_each_segment_all() in case that user wants to update the returned bvec via the pointer. Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
block: introduce bvec_for_each_sp_bvec()
This helper can be used to iterate each singlepage bvec from one multipage bvec. Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
block: use bio_for_each_segment_mp() to map sg
It is more efficient to use bio_for_each_segment_mp() for mapping sg, meantime we have to consider splitting multipage bvec as done in blk_bio_segment_split(). Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
block: use bio_for_each_segment_mp() to compute segments count
Firstly it is more efficient to use bio_for_each_segment_mp() in both blk_bio_segment_split() and __blk_recalc_rq_segments() to compute how many segments there are in the bio. Secondaly once bio_for_each_segment_mp() is used, the bvec may need to be splitted because its length can be very long and more than max segment size, so we have to support to split one bvec into several segments. Thirdly during splitting mp bvec into segments, max segment number may be reached, then the bio need to be splitted when this happens. Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
block: blk-merge: remove unnecessary check
In this case, 'sectors' can't be zero at all, so remove the check and let the bio be splitted. Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
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>
-
blk-merge: compute bio->bi_seg_front_size efficiently
It is enough to check and compute bio->bi_seg_front_size just after the 1st segment is found, but current code checks that for each bvec, which is inefficient. This patch follows the way in __blk_recalc_rq_segments() for computing bio->bi_seg_front_size, and it is more efficient and code becomes more readable too. Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
block: introduce bio_for_each_segment_mp()
This helper is used to iterate multipage bvec and it is required in bio_clone(). Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
block: implement sp version of bvec iterator helpers
This patch implements singlepage version of the following 3 helpers: - bvec_iter_offset_sp() - bvec_iter_len_sp() - bvec_iter_page_sp() So that one multipage bvec can be splited to singlepage bvec, and make users of current bvec iterator happy. Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
block: introduce multipage/single page bvec helpers
This patch introduces helpers which are suffixed with _mp and _sp for the multipage bvec/segment support. The helpers with _mp suffix are the interfaces for treating one bvec/segment as real multipage one, for example, .bv_len is the total length of the multipage segment. The helpers with _sp suffix are interfaces for supporting current bvec iterator which is thought as singlepage only by drivers, fs, dm and etc. These _sp helpers are introduced to build singlepage bvec in flight, so users of bio/bvec iterator still can work well and needn't change even though we store multipage into bvec. Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
block: comments on bio_for_each_segment[_all]
This patch clarifies the fact that even though both bio_for_each_segment() and bio_for_each_segment_all() are named as _segment/_segment_all, they still return one page in each vector, instead of real segment(multipage bvec). With comming multipage bvec, both the two helpers are capable of returning real segment(multipage bvec), but the callers(users) of the two helpers may not be capable of handling of the multipage bvec or real segment, so we still keep the interfaces of the helpers not changed. And new helpers for returning multipage bvec(real segment) will be introduced later. Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
block: bounce: don't access bio->bi_io_vec in copy_to_high_bio_irq
As we need to support multipage bvecs, so don't access bio->bi_io_vec in copy_to_high_bio_irq(), and just use the standard iterator to do that. Signed-off-by: Ming Lei <ming.lei@redhat.com>
-
bvec_iter: introduce BVEC_ITER_ALL_INIT
Introduce BVEC_ITER_ALL_INIT for iterating one bio from start to end. Signed-off-by: Ming Lei <ming.lei@redhat.com>