Re: [Cluster-devel] [PATCH V11 03/19] block: introduce bio_for_each_bvec()

2018-11-21 Thread Ming Lei
On Wed, Nov 21, 2018 at 05:10:25PM +0100, Christoph Hellwig wrote: > On Wed, Nov 21, 2018 at 11:31:36PM +0800, Ming Lei wrote: > > > But while looking over this I wonder why we even need the max_seg_len > > > here. The only thing __bvec_iter_advance does it to move bi_bvec_

Re: [Cluster-devel] [PATCH V11 02/19] block: introduce multi-page bvec helpers

2018-11-21 Thread Ming Lei
On Wed, Nov 21, 2018 at 05:08:11PM +0100, Christoph Hellwig wrote: > On Wed, Nov 21, 2018 at 11:06:11PM +0800, Ming Lei wrote: > > bvec_iter_* is used for single-page bvec in current linus tree, and there > > are > > lots of users now: > > > > [linux]$

Re: [Cluster-devel] [PATCH V11 15/19] block: enable multipage bvecs

2018-11-21 Thread Ming Lei
On Wed, Nov 21, 2018 at 03:55:02PM +0100, Christoph Hellwig wrote: > On Wed, Nov 21, 2018 at 11:23:23AM +0800, Ming Lei wrote: > > if (bio->bi_vcnt > 0) { > > - struct bio_vec *bv = >bi_io_vec[bio->bi_vcnt - 1]; > > + struct bio_vec bv; &g

Re: [Cluster-devel] [PATCH V11 14/19] block: handle non-cluster bio out of blk_bio_segment_split

2018-11-21 Thread Ming Lei
On Wed, Nov 21, 2018 at 03:33:55PM +0100, Christoph Hellwig wrote: > > + non-cluster.o > > Do we really need a new source file for these few functions? > > > default: > > + if (!blk_queue_cluster(q)) { > > + blk_queue_non_cluster_bio(q, bio); > >

Re: [Cluster-devel] [PATCH V11 03/19] block: introduce bio_for_each_bvec()

2018-11-21 Thread Ming Lei
On Wed, Nov 21, 2018 at 02:32:44PM +0100, Christoph Hellwig wrote: > > +#define bio_iter_mp_iovec(bio, iter) \ > > + segment_iter_bvec((bio)->bi_io_vec, (iter)) > > Besides the mp naming we'd like to get rid off there also is just > a single user of this macro,

Re: [Cluster-devel] [PATCH V11 02/19] block: introduce multi-page bvec helpers

2018-11-21 Thread Ming Lei
On Wed, Nov 21, 2018 at 02:19:28PM +0100, Christoph Hellwig wrote: > On Wed, Nov 21, 2018 at 11:23:10AM +0800, Ming Lei wrote: > > This patch introduces helpers of 'segment_iter_*' for multipage > > bvec support. > > > > The introduced helpers treate one bvec as real mu

Re: [Cluster-devel] [PATCH V10 09/19] block: introduce bio_bvecs()

2018-11-21 Thread Ming Lei
On Tue, Nov 20, 2018 at 09:35:07PM -0800, Sagi Grimberg wrote: > > > > Wait, I see that the bvec is still a single array per bio. When you said > > > a table I thought you meant a 2-dimentional array... > > > > I mean a new 1-d table A has to be created for multiple bios in one rq, > > and build

Re: [Cluster-devel] [PATCH V10 09/19] block: introduce bio_bvecs()

2018-11-20 Thread Ming Lei
On Tue, Nov 20, 2018 at 08:42:04PM -0800, Sagi Grimberg wrote: > > > > Yeah, that is the most common example, given merge is enabled > > > in most of cases. If the driver or device doesn't care merge, > > > you can disable it and always get single bio request, then the > > > bio's bvec table can

Re: [Cluster-devel] [PATCH V10 09/19] block: introduce bio_bvecs()

2018-11-20 Thread Ming Lei
On Tue, Nov 20, 2018 at 07:20:45PM -0800, Sagi Grimberg wrote: > > > Not sure I understand the 'blocking' problem in this case. > > > > We can build a bvec table from this req, and send them all > > in send(), > > I would like to avoid growing bvec tables and keep everything > preallocated.

[Cluster-devel] [PATCH V11 19/19] block: kill BLK_MQ_F_SG_MERGE

2018-11-20 Thread Ming Lei
QUEUE_FLAG_NO_SG_MERGE has been killed, so kill BLK_MQ_F_SG_MERGE too. Reviewed-by: Christoph Hellwig Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- block/blk-mq-debugfs.c | 1 - drivers/block/loop.c | 2 +- drivers/block/nbd.c | 2 +- drivers/block/rbd.c

[Cluster-devel] [PATCH V11 18/19] block: kill QUEUE_FLAG_NO_SG_MERGE

2018-11-20 Thread Ming Lei
Signed-off-by: Ming Lei --- block/blk-merge.c | 31 ++- block/blk-mq-debugfs.c | 1 - block/blk-mq.c | 3 --- drivers/md/dm-table.c | 13 - include/linux/blkdev.h | 1 - 5 files changed, 6 insertions(+), 43 deletions(-) diff --git a/block/blk

[Cluster-devel] [PATCH V11 17/19] block: document usage of bio iterator helpers

2018-11-20 Thread Ming Lei
Now multi-page bvec is supported, some helpers may return page by page, meantime some may return segment by segment, this patch documents the usage. Signed-off-by: Ming Lei --- Documentation/block/biovecs.txt | 24 1 file changed, 24 insertions(+) diff --git

[Cluster-devel] [PATCH V11 16/19] block: always define BIO_MAX_PAGES as 256

2018-11-20 Thread Ming Lei
-by: Ming Lei --- include/linux/bio.h | 8 1 file changed, 8 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 7edad188568a..e5b975fa0558 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -34,15 +34,7 @@ #define BIO_BUG_ON #endif -#ifdef CONFIG_THP_SWAP

[Cluster-devel] [PATCH V11 15/19] block: enable multipage bvecs

2018-11-20 Thread Ming Lei
This patch pulls the trigger for multi-page bvecs. Signed-off-by: Ming Lei --- block/bio.c | 32 +++- fs/iomap.c| 2 +- fs/xfs/xfs_aops.c | 2 +- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/block/bio.c b/block/bio.c index

[Cluster-devel] [PATCH V11 12/19] block: allow bio_for_each_segment_all() to iterate over multi-page bvec

2018-11-20 Thread Ming Lei
ngle patch, so that we can avoid to use a temporary helper for this conversion. Signed-off-by: Ming Lei --- block/bio.c | 27 ++- block/bounce.c| 6 -- drivers/md/bcache/btree.c | 3 ++- drivers/md/dm-cry

[Cluster-devel] [PATCH V11 14/19] block: handle non-cluster bio out of blk_bio_segment_split

2018-11-20 Thread Ming Lei
We will enable multi-page bvec soon, but non-cluster queue can't handle the multi-page bvec at all. This patch borrows bounce's idea to clone new single-page bio for non-cluster queue, and moves its handling out of blk_bio_segment_split(). Signed-off-by: Ming Lei --- block/Makefile | 3

[Cluster-devel] [PATCH V11 13/19] block: move bounce_clone_bio into bio.c

2018-11-20 Thread Ming Lei
We will reuse bounce_clone_bio() for cloning bio in case of !blk_queue_cluster(q), so move this helper into bio.c and rename it as bio_clone_bioset(). No function change. Signed-off-by: Ming Lei --- block/bio.c| 69 + block/blk.h

[Cluster-devel] [PATCH V11 11/19] bcache: avoid to use bio_for_each_segment_all() in bch_bio_alloc_pages()

2018-11-20 Thread Ming Lei
-off-by: Ming Lei --- drivers/md/bcache/util.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/md/bcache/util.c b/drivers/md/bcache/util.c index 20eddeac1531..62fb917f7a4f 100644 --- a/drivers/md/bcache/util.c +++ b/drivers/md/bcache/util.c @@ -270,7 +270,11 @@ int

[Cluster-devel] [PATCH V11 10/19] block: loop: pass multi-page bvec to iov_iter

2018-11-20 Thread Ming Lei
iov_iter is implemented on bvec itererator helpers, so it is safe to pass multi-page bvec to it, and this way is much more efficient than passing one page in each bvec. Signed-off-by: Ming Lei --- drivers/block/loop.c | 20 ++-- include/linux/blkdev.h | 4 2 files

[Cluster-devel] [PATCH V11 09/19] btrfs: move bio_pages_all() to btrfs

2018-11-20 Thread Ming Lei
BTRFS is the only user of this helper, so move this helper into BTRFS, and implement it via bio_for_each_segment_all(), since bio->bi_vcnt may not equal to number of pages after multipage bvec is enabled. Signed-off-by: Ming Lei --- fs/btrfs/extent_io.c | 14 +- include/linux/bi

[Cluster-devel] [PATCH V11 07/19] fs/buffer.c: use bvec iterator to truncate the bio

2018-11-20 Thread Ming Lei
Once multi-page bvec is enabled, the last bvec may include more than one page, this patch use bvec_last_segment() to truncate the bio. Reviewed-by: Omar Sandoval Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- fs/buffer.c | 5 - 1 file changed, 4 insertions(+), 1 deletion

[Cluster-devel] [PATCH V11 08/19] btrfs: use bvec_last_segment to get bio's last page

2018-11-20 Thread Ming Lei
Preparing for supporting multi-page bvec. Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- fs/btrfs/extent_io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index d228f706ff3e..5d5965297e7e 100644 --- a/fs/btrfs

[Cluster-devel] [PATCH V11 06/19] block: introduce bvec_last_segment()

2018-11-20 Thread Ming Lei
BTRFS and guard_bio_eod() need to get the last singlepage segment from one multipage bvec, so introduce this helper to make them happy. Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- include/linux/bvec.h | 22 ++ 1 file changed, 22 insertions(+) diff --git

[Cluster-devel] [PATCH V11 05/19] block: use bio_for_each_bvec() to map sg

2018-11-20 Thread Ming Lei
It is more efficient to use bio_for_each_bvec() to map sg, meantime we have to consider splitting multipage bvec as done in blk_bio_segment_split(). Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- block/blk-merge.c | 68 +++ 1 file

[Cluster-devel] [PATCH V11 04/19] block: use bio_for_each_bvec() to compute multi-page bvec count

2018-11-20 Thread Ming Lei
max segment size, so we have to split the big bvec into several segments. Thirdly when splitting multi-page bvec into segments, the max segment limit may be reached, so the bio split need to be considered under this situation too. Signed-off-by: Ming Lei --- block/blk-merge.c | 87

[Cluster-devel] [PATCH V11 03/19] block: introduce bio_for_each_bvec()

2018-11-20 Thread Ming Lei
This helper is used for iterating over multi-page bvec for bio split & merge code. Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- include/linux/bio.h | 25 ++--- include/linux/bvec.h | 36 +--- 2 files changed, 51 insertions(+)

[Cluster-devel] [PATCH V11 02/19] block: introduce multi-page bvec helpers

2018-11-20 Thread Ming Lei
ept not changed - returned(copied) single-page bvec is built in flight by bvec helpers from the stored multi-page bvec Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- include/linux/bvec.h | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/incl

[Cluster-devel] [PATCH V11 01/19] block: don't use bio->bi_vcnt to figure out segment number

2018-11-20 Thread Ming Lei
segments") Signed-off-by: Ming Lei --- block/blk-merge.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index b1df622cbd85..f52400ce2187 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -368,13 +368,7 @@ void blk_re

Re: [Cluster-devel] [PATCH V10 09/19] block: introduce bio_bvecs()

2018-11-20 Thread Ming Lei
On Tue, Nov 20, 2018 at 12:11:35PM -0800, Sagi Grimberg wrote: > > > > > The only user in your final tree seems to be the loop driver, and > > > > even that one only uses the helper for read/write bios. > > > > > > > > I think something like this would be much simpler in the end: > > > > > >

Re: [Cluster-devel] [PATCH V10 18/19] block: kill QUEUE_FLAG_NO_SG_MERGE

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:58:03PM +0100, Christoph Hellwig wrote: > On Thu, Nov 15, 2018 at 04:53:05PM +0800, Ming Lei wrote: > > Since bdced438acd83ad83a6c ("block: setup bi_phys_segments after > > splitting"), > > physical segment number is mainly figured out in

Re: [Cluster-devel] [PATCH V10 18/19] block: kill QUEUE_FLAG_NO_SG_MERGE

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 06:18:11PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:05PM +0800, Ming Lei wrote: > > Since bdced438acd83ad83a6c ("block: setup bi_phys_segments after > > splitting"), > > physical segment number is mainly figured out in blk_

Re: [Cluster-devel] [PATCH V10 17/19] block: don't use bio->bi_vcnt to figure out segment number

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 06:11:40PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:04PM +0800, Ming Lei wrote: > > It is wrong to use bio->bi_vcnt to figure out how many segments > > there are in the bio even though CLONED flag isn't set on this bio, > &

Re: [Cluster-devel] [PATCH V10 15/19] block: always define BIO_MAX_PAGES as 256

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 05:59:36PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:02PM +0800, Ming Lei wrote: > > Now multi-page bvec can cover CONFIG_THP_SWAP, so we don't need to > > increase BIO_MAX_PAGES for it. > > You mentioned to it in the cover letter

Re: [Cluster-devel] [PATCH V10 14/19] block: enable multipage bvecs

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:53:08PM +0100, Christoph Hellwig wrote: > > - > > - if (page == bv->bv_page && off == bv->bv_offset + bv->bv_len) { > > - bv->bv_len += len; > > - bio->bi_iter.bi_size += len; > > - return true; > > -

Re: [Cluster-devel] [PATCH V10 14/19] block: enable multipage bvecs

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 05:56:27PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:01PM +0800, Ming Lei wrote: > > This patch pulls the trigger for multi-page bvecs. > > > > Now any request queue which supports queue cluster will see multi-page > > bvecs

Re: [Cluster-devel] [PATCH V10 12/19] block: allow bio_for_each_segment_all() to iterate over multi-page bvec

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 05:22:45PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:52:59PM +0800, Ming Lei wrote: > > This patch introduces one extra iterator variable to > > bio_for_each_segment_all(), > > then we can allow bio_for_each_segment_all() to iterate over

Re: [Cluster-devel] [PATCH V10 12/19] block: allow bio_for_each_segment_all() to iterate over multi-page bvec

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 01:42:52PM +0100, David Sterba wrote: > On Thu, Nov 15, 2018 at 04:52:59PM +0800, Ming Lei wrote: > > diff --git a/block/blk-zoned.c b/block/blk-zoned.c > > index 13ba2011a306..789b09ae402a 100644 > > --- a/block/blk-zoned.c > > +++ b/block/blk-z

Re: [Cluster-devel] [PATCH V10 13/19] iomap & xfs: only account for new added page

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:49:36PM +0100, Christoph Hellwig wrote: > I'd much rather have __bio_try_merge_page only do merges in > the same page, and have a new __bio_try_merge_segment that does > multi-page merges. This will keep the accounting a lot simpler. Looks this way is clever, will do

Re: [Cluster-devel] [PATCH V10 13/19] iomap & xfs: only account for new added page

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 05:46:58PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:00PM +0800, Ming Lei wrote: > > After multi-page is enabled, one new page may be merged to a segment > > even though it is a new added page. > > > > This patch deals wi

Re: [Cluster-devel] [PATCH V10 11/19] bcache: avoid to use bio_for_each_segment_all() in bch_bio_alloc_pages()

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:46:45PM +0100, Christoph Hellwig wrote: > > - bio_for_each_segment_all(bv, bio, i) { > > + for (i = 0, bv = bio->bi_io_vec; i < bio->bi_vcnt; bv++) { > > This really needs a comment. Otherwise it looks fine to me. OK, will do it in next version. Thanks, Ming

Re: [Cluster-devel] [PATCH V10 11/19] bcache: avoid to use bio_for_each_segment_all() in bch_bio_alloc_pages()

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 04:44:02PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:52:58PM +0800, Ming Lei wrote: > > bch_bio_alloc_pages() is always called on one new bio, so it is safe > > to access the bvec table directly. Given it is the only kind of this > > cas

Re: [Cluster-devel] [PATCH V10 09/19] block: introduce bio_bvecs()

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:45:41PM +0100, Christoph Hellwig wrote: > On Thu, Nov 15, 2018 at 04:52:56PM +0800, Ming Lei wrote: > > There are still cases in which we need to use bio_bvecs() for get the > > number of multi-page segment, so introduce it. > > The only user in

Re: [Cluster-devel] [PATCH V10 08/19] btrfs: move bio_pages_all() to btrfs

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:38:45PM +0100, Christoph Hellwig wrote: > On Thu, Nov 15, 2018 at 04:52:55PM +0800, Ming Lei wrote: > > BTRFS is the only user of this helper, so move this helper into > > BTRFS, and implement it via bio_for_each_segment_all(), since > > bio-&

Re: [Cluster-devel] [PATCH V10 10/19] block: loop: pass multi-page bvec to iov_iter

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 04:40:22PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:52:57PM +0800, Ming Lei wrote: > > iov_iter is implemented with bvec itererator, so it is safe to pass > > multipage bvec to it, and this way is much more efficient than > > passing

Re: [Cluster-devel] [PATCH V10 08/19] btrfs: move bio_pages_all() to btrfs

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 04:23:56PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:52:55PM +0800, Ming Lei wrote: > > BTRFS is the only user of this helper, so move this helper into > > BTRFS, and implement it via bio_for_each_segment_all(), since > > bio->bi_vcnt

Re: [Cluster-devel] [PATCH V10 05/19] block: introduce bvec_last_segment()

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 03:23:56PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:52:52PM +0800, Ming Lei wrote: > > BTRFS and guard_bio_eod() need to get the last singlepage segment > > from one multipage bvec, so introduce this helper to make them happy. > >

Re: [Cluster-devel] [PATCH V10 07/19] btrfs: use bvec_last_segment to get bio's last page

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:37:10PM +0100, Christoph Hellwig wrote: > On Thu, Nov 15, 2018 at 04:52:54PM +0800, Ming Lei wrote: > > index 2955a4ea2fa8..161e14b8b180 100644 > > --- a/fs/btrfs/compression.c > > +++ b/fs/btrfs/compression.c > > @@ -40

Re: [Cluster-devel] [PATCH V10 03/19] block: use bio_for_each_bvec() to compute multi-page bvec count

2018-11-19 Thread Ming Lei
On Thu, Nov 15, 2018 at 12:20:28PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:52:50PM +0800, Ming Lei wrote: > > First it is more efficient to use bio_for_each_bvec() in both > > blk_bio_segment_split() and __blk_recalc_rq_segments() to compute how > >

Re: [Cluster-devel] [PATCH V10 04/19] block: use bio_for_each_bvec() to map sg

2018-11-19 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:33:14PM +0100, Christoph Hellwig wrote: > > + if (!*sg) > > + return sglist; > > + else { > > No need for an else after an early return. OK, good catch! Thanks, Ming

Re: [Cluster-devel] [PATCH V10 02/19] block: introduce bio_for_each_bvec()

2018-11-18 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:30:28PM +0100, Christoph Hellwig wrote: > > +static inline void __bio_advance_iter(struct bio *bio, struct bvec_iter > > *iter, > > + unsigned bytes, bool mp) > > I think these magic 'bool np' arguments and wrappers over wrapper > don't

Re: [Cluster-devel] [PATCH V10 01/19] block: introduce multi-page page bvec helpers

2018-11-18 Thread Ming Lei
On Sun, Nov 18, 2018 at 08:10:14PM -0700, Jens Axboe wrote: > On 11/18/18 7:23 PM, Ming Lei wrote: > > On Fri, Nov 16, 2018 at 02:13:05PM +0100, Christoph Hellwig wrote: > >>> -#define bvec_iter_page(bvec, iter) \ > >>> +#de

Re: [Cluster-devel] [PATCH V10 01/19] block: introduce multi-page page bvec helpers

2018-11-18 Thread Ming Lei
On Thu, Nov 15, 2018 at 10:25:59AM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:52:48PM +0800, Ming Lei wrote: > > This patch introduces helpers of 'mp_bvec_iter_*' for multipage > > bvec support. > > > > The introduced helpers treate one bvec as real multi-

Re: [Cluster-devel] [PATCH V10 01/19] block: introduce multi-page page bvec helpers

2018-11-18 Thread Ming Lei
On Fri, Nov 16, 2018 at 02:13:05PM +0100, Christoph Hellwig wrote: > > -#define bvec_iter_page(bvec, iter) \ > > +#define mp_bvec_iter_page(bvec, iter) \ > > (__bvec_iter_bvec((bvec), (iter))->bv_page) > > > > -#define bvec_iter_len(bvec,

Re: [Cluster-devel] [PATCH V10 00/19] block: support multi-page bvec

2018-11-16 Thread Ming Lei
On Fri, Nov 16, 2018 at 03:03:14PM +0100, Christoph Hellwig wrote: > It seems like bi_phys_segments is still around of this series. > Shouldn't it be superflous now? Even though multi-page bvec is supported, the segment number doesn't equal to the actual bvec count yet, for example, one bvec may

[Cluster-devel] [PATCH V10 18/19] block: kill QUEUE_FLAG_NO_SG_MERGE

2018-11-15 Thread Ming Lei
az Harrosh Cc: Bob Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- block/blk-merge.c | 31 ++- block/blk-mq-debugfs.c | 1 - block/blk-mq.c | 3 --- drivers/md/dm-table.c | 13 - include/linux/blkdev.h | 1 - 5 files

[Cluster-devel] [PATCH V10 17/19] block: don't use bio->bi_vcnt to figure out segment number

2018-11-15 Thread Ming Lei
: Christoph Hellwig Cc: Theodore Ts'o Cc: linux-e...@vger.kernel.org Cc: Coly Li Cc: linux-bca...@vger.kernel.org Cc: Boaz Harrosh Cc: Bob Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- block/blk-merge.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --gi

[Cluster-devel] [PATCH V10 07/19] btrfs: use bvec_last_segment to get bio's last page

2018-11-15 Thread Ming Lei
...@vger.kernel.org Cc: Darrick J. Wong Cc: linux-...@vger.kernel.org Cc: Gao Xiang Cc: Christoph Hellwig Cc: Theodore Ts'o Cc: linux-e...@vger.kernel.org Cc: Coly Li Cc: linux-bca...@vger.kernel.org Cc: Boaz Harrosh Cc: Bob Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- fs/btrfs

[Cluster-devel] [PATCH V10 09/19] block: introduce bio_bvecs()

2018-11-15 Thread Ming Lei
Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- include/linux/bio.h | 30 +- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 1f0dcf109841..3496c816946e 100644 --- a/include/linux/bio.h +++ b

[Cluster-devel] [PATCH V10 16/19] block: document usage of bio iterator helpers

2018-11-15 Thread Ming Lei
...@vger.kernel.org Cc: Boaz Harrosh Cc: Bob Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- Documentation/block/biovecs.txt | 26 ++ 1 file changed, 26 insertions(+) diff --git a/Documentation/block/biovecs.txt b/Documentation/block/biovecs.txt index 25689584e6e0

[Cluster-devel] [PATCH V10 13/19] iomap & xfs: only account for new added page

2018-11-15 Thread Ming Lei
lwig Cc: Theodore Ts'o Cc: linux-e...@vger.kernel.org Cc: Coly Li Cc: linux-bca...@vger.kernel.org Cc: Boaz Harrosh Cc: Bob Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- fs/iomap.c | 22 ++ fs/xfs/xfs_aops.c | 10 -- include/linux/b

[Cluster-devel] [PATCH V10 14/19] block: enable multipage bvecs

2018-11-15 Thread Ming Lei
Cc: Bob Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- block/bio.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/block/bio.c b/block/bio.c index 6486722d4d4b..ed6df6f8e63d 100644 --- a/block/bio.c +++ b/block/bio.c @@ -767,12

[Cluster-devel] [PATCH V10 12/19] block: allow bio_for_each_segment_all() to iterate over multi-page bvec

2018-11-15 Thread Ming Lei
erba Cc: Darrick J. Wong Cc: Gao Xiang Cc: Christoph Hellwig Cc: Theodore Ts'o Cc: linux-e...@vger.kernel.org Cc: Coly Li Cc: linux-bca...@vger.kernel.org Cc: Boaz Harrosh Cc: Bob Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- block/bio.c

[Cluster-devel] [PATCH V10 00/19] block: support multi-page bvec

2018-11-15 Thread Ming Lei
http://marc.info/?t=14982021534=1=2 Ming Lei (19): block: introduce multi-page page bvec helpers block: introduce bio_for_each_bvec() block: use bio_for_each_bvec() to compute multi-page bvec count block: use bio_for_each_bvec() to map sg block: introduce bvec_last_segment() fs/buff

[Cluster-devel] [PATCH V10 06/19] fs/buffer.c: use bvec iterator to truncate the bio

2018-11-15 Thread Ming Lei
Harrosh Cc: Bob Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- fs/buffer.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index 1286c2b95498..fa37ad52e962 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -3032,7 +3032,10 @@ void

[Cluster-devel] [PATCH V10 19/19] block: kill BLK_MQ_F_SG_MERGE

2018-11-15 Thread Ming Lei
-by: Ming Lei --- block/blk-mq-debugfs.c | 1 - drivers/block/loop.c | 2 +- drivers/block/nbd.c | 2 +- drivers/block/rbd.c | 2 +- drivers/block/skd_main.c | 1 - drivers/block/xen-blkfront.c | 2 +- drivers/md/dm-rq.c | 2 +- drivers/mmc/core/queue.c

[Cluster-devel] [PATCH V10 15/19] block: always define BIO_MAX_PAGES as 256

2018-11-15 Thread Ming Lei
-devel@redhat.com Signed-off-by: Ming Lei --- include/linux/bio.h | 8 1 file changed, 8 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 5040e9a2eb09..277921ad42e7 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -34,15 +34,7 @@ #define BIO_BUG_ON

[Cluster-devel] [PATCH V10 02/19] block: introduce bio_for_each_bvec()

2018-11-15 Thread Ming Lei
.com Signed-off-by: Ming Lei --- include/linux/bio.h | 34 +++--- include/linux/bvec.h | 36 2 files changed, 63 insertions(+), 7 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 056fb627edb3..1f0dcf10

[Cluster-devel] [PATCH V10 05/19] block: introduce bvec_last_segment()

2018-11-15 Thread Ming Lei
Harrosh Cc: Bob Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- include/linux/bvec.h | 25 + 1 file changed, 25 insertions(+) diff --git a/include/linux/bvec.h b/include/linux/bvec.h index 3d61352cd8cf..01616a0b6220 100644 --- a/include/linux/bvec.h +++ b

[Cluster-devel] [PATCH V10 08/19] btrfs: move bio_pages_all() to btrfs

2018-11-15 Thread Ming Lei
x-e...@vger.kernel.org Cc: Coly Li Cc: linux-bca...@vger.kernel.org Cc: Boaz Harrosh Cc: Bob Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- fs/btrfs/extent_io.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_i

[Cluster-devel] [PATCH V10 04/19] block: use bio_for_each_bvec() to map sg

2018-11-15 Thread Ming Lei
...@vger.kernel.org Cc: Boaz Harrosh Cc: Bob Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- block/blk-merge.c | 72 +++ 1 file changed, 52 insertions(+), 20 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index 6f7deb94a23f

[Cluster-devel] [PATCH V10 10/19] block: loop: pass multi-page bvec to iov_iter

2018-11-15 Thread Ming Lei
...@vger.kernel.org Cc: Boaz Harrosh Cc: Bob Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- drivers/block/loop.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index bf6bc35aaf88

[Cluster-devel] [PATCH V10 01/19] block: introduce multi-page page bvec helpers

2018-11-15 Thread Ming Lei
-bca...@vger.kernel.org Cc: Boaz Harrosh Cc: Bob Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- include/linux/bvec.h | 63 +--- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/include/linux/bvec.h b/include/linux

[Cluster-devel] [PATCH V9 12/19] block: allow bio_for_each_segment_all() to iterate over multi-page bvec

2018-11-13 Thread Ming Lei
Cc: Christoph Hellwig Cc: Theodore Ts'o Cc: linux-e...@vger.kernel.org Cc: Coly Li Cc: linux-bca...@vger.kernel.org Cc: Boaz Harrosh Cc: Bob Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- block/bio.c | 27 ++- block/blk-zon

[Cluster-devel] [PATCH V8 12/18] block: allow bio_for_each_segment_all() to iterate over multi-page bvec

2018-11-09 Thread Ming Lei
Cc: Christoph Hellwig Cc: Theodore Ts'o Cc: linux-e...@vger.kernel.org Cc: Coly Li Cc: linux-bca...@vger.kernel.org Cc: Boaz Harrosh Cc: Bob Peterson Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei --- block/bio.c | 27 ++- block/blk-zon

[Cluster-devel] [PATCH v3 42/49] gfs2: convert to bio_for_each_segment_all_sp()

2017-08-08 Thread Ming Lei
Cc: Steven Whitehouse <swhit...@redhat.com> Cc: Bob Peterson <rpete...@redhat.com> Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei <ming@redhat.com> --- fs/gfs2/lops.c| 3 ++- fs/gfs2/meta_io.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git

[Cluster-devel] [PATCH v2 44/51] gfs2: convert to bio_for_each_segment_all_sp()

2017-06-26 Thread Ming Lei
Cc: Steven Whitehouse <swhit...@redhat.com> Cc: Bob Peterson <rpete...@redhat.com> Cc: cluster-devel@redhat.com Signed-off-by: Ming Lei <ming@redhat.com> --- fs/gfs2/lops.c| 3 ++- fs/gfs2/meta_io.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git

[Cluster-devel] [PATCH v1 00/54] block: support multipage bvec

2017-01-05 Thread Ming Lei
- address comments in V0 [1], http://marc.info/?l=linux-kernel=141680246629547=2 [2], https://patchwork.kernel.org/patch/9451523/ [3], http://marc.info/?t=14773544711=1=2 [4], http://marc.info/?l=linux-mm=147745525801433=2 Ming Lei (54): block: drbd: comment on direct access bvec table

[Cluster-devel] [PATCH v1 43/54] gfs2: convert to bio_for_each_segment_all_sp()

2017-01-05 Thread Ming Lei
Signed-off-by: Ming Lei <tom.leim...@gmail.com> --- fs/gfs2/lops.c| 3 ++- fs/gfs2/meta_io.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index b1f9144b42c7..ddbd1f772cdb 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -

Re: [Cluster-devel] [PATCH 00/60] block: support multipage bvec

2016-11-01 Thread Ming Lei
help reducing the OK, that is just the 1st part of the patchset. > actual series to a sane size, and it should also help to cut > down the Cc list. > Thanks, Ming Lei

[Cluster-devel] [PATCH 00/60] block: support multipage bvec

2016-10-31 Thread Ming Lei
33=2 Ming Lei (60): block: bio: introduce bio_init_with_vec_table() block drivers: convert to bio_init_with_vec_table() block: drbd: remove impossible failure handling block: floppy: use bio_add_page() target: avoid to access .bi_vcnt directly bcache: debug: avoid to access .bi_io

[Cluster-devel] [PATCH 53/60] gfs2: convert to bio_for_each_segment_all_rd()

2016-10-31 Thread Ming Lei
Signed-off-by: Ming Lei <tom.leim...@gmail.com> --- fs/gfs2/lops.c| 3 ++- fs/gfs2/meta_io.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 49d5a1b61b06..f03a52e06ce5 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -

<    1   2