Skip to content
Permalink
Ming-Lei/block…

Commits on Aug 10, 2017

  1. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  2. block: enable multipage bvecs

    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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  3. fs/direct-io: convert to bio_for_each_segment_all_sp()

    Signed-off-by: Ming Lei <ming.lei@redhat.com>
    Ming Lei authored and fengguang committed Aug 10, 2017
  4. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  5. fs: crypto: convert to bio_for_each_segment_all_sp()

    Signed-off-by: Ming Lei <ming.lei@redhat.com>
    Ming Lei authored and fengguang committed Aug 10, 2017
  6. exofs: convert to bio_for_each_segment_all_sp()

    Cc: Boaz Harrosh <ooo@electrozaur.com>
    Signed-off-by: Ming Lei <ming.lei@redhat.com>
    Ming Lei authored and fengguang committed Aug 10, 2017
  7. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  8. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  9. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  10. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  11. fs/iomap: convert to bio_for_each_segment_all_sp()

    Signed-off-by: Ming Lei <ming.lei@redhat.com>
    Ming Lei authored and fengguang committed Aug 10, 2017
  12. fs/block: convert to bio_for_each_segment_all_sp()

    Signed-off-by: Ming Lei <ming.lei@redhat.com>
    Ming Lei authored and fengguang committed Aug 10, 2017
  13. fs/mpage: convert to bio_for_each_segment_all_sp()

    Signed-off-by: Ming Lei <ming.lei@redhat.com>
    Ming Lei authored and fengguang committed Aug 10, 2017
  14. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  15. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  16. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  17. bcache: convert to bio_for_each_segment_all_sp()

    Cc: linux-bcache@vger.kernel.org
    Signed-off-by: Ming Lei <ming.lei@redhat.com>
    Ming Lei authored and fengguang committed Aug 10, 2017
  18. block: convert to singe/multi page version of bio_for_each_segment_all()

    Signed-off-by: Ming Lei <ming.lei@redhat.com>
    Ming Lei authored and fengguang committed Aug 10, 2017
  19. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  20. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  21. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  22. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  23. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  24. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  25. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  26. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  27. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  28. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  29. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  30. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  31. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  32. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  33. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  34. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
  35. 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>
    Ming Lei authored and fengguang committed Aug 10, 2017
Older
You can’t perform that action at this time.