[PATCH V15 17/18] block: kill QUEUE_FLAG_NO_SG_MERGE

2019-02-15 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

[dm-devel] [PATCH V15 16/18] block: document usage of bio iterator helpers

2019-02-15 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. Reviewed-by: Christoph Hellwig Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- Documentation/block/biovecs.txt | 25

[dm-devel] [PATCH V15 15/18] block: always define BIO_MAX_PAGES as 256

2019-02-15 Thread Ming Lei
-by: Christoph Hellwig 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 9f77adcfde82..bdd11d4c2f05 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -34,15 +34,7 @@ #define BIO_BUG_ON #endif

[Cluster-devel] [PATCH V15 15/18] block: always define BIO_MAX_PAGES as 256

2019-02-15 Thread Ming Lei
-by: Christoph Hellwig 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 9f77adcfde82..bdd11d4c2f05 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -34,15 +34,7 @@ #define BIO_BUG_ON #endif

[Cluster-devel] [PATCH V15 17/18] block: kill QUEUE_FLAG_NO_SG_MERGE

2019-02-15 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 V15 16/18] block: document usage of bio iterator helpers

2019-02-15 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. Reviewed-by: Christoph Hellwig Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- Documentation/block/biovecs.txt | 25

[PATCH V15 16/18] block: document usage of bio iterator helpers

2019-02-15 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. Reviewed-by: Christoph Hellwig Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- Documentation/block/biovecs.txt | 25

[PATCH V15 15/18] block: always define BIO_MAX_PAGES as 256

2019-02-15 Thread Ming Lei
-by: Christoph Hellwig 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 9f77adcfde82..bdd11d4c2f05 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -34,15 +34,7 @@ #define BIO_BUG_ON #endif

[PATCH V15 13/18] block: allow bio_for_each_segment_all() to iterate over multi-page bvec

2019-02-15 Thread Ming Lei
ngle patch, so that we can avoid to use a temporary helper for this conversion. Reviewed-by: Omar Sandoval Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- block/bio.c | 27 ++- block/bounce.c| 6 -- drivers/md/bc

[PATCH V15 14/18] block: enable multipage bvecs

2019-02-15 Thread Ming Lei
This patch pulls the trigger for multi-page bvecs. Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- block/bio.c | 22 +++--- fs/iomap.c | 4 ++-- fs/xfs/xfs_aops.c | 4 ++-- include/linux/bio.h | 2 +- 4 files changed, 20 insertions(+), 12 deletions

[PATCH V15 12/18] bcache: avoid to use bio_for_each_segment_all() in bch_bio_alloc_pages()

2019-02-15 Thread Ming Lei
Reviewed-by: Omar Sandoval Reviewed-by: Christoph Hellwig Signed-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

[Cluster-devel] [PATCH V15 14/18] block: enable multipage bvecs

2019-02-15 Thread Ming Lei
This patch pulls the trigger for multi-page bvecs. Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- block/bio.c | 22 +++--- fs/iomap.c | 4 ++-- fs/xfs/xfs_aops.c | 4 ++-- include/linux/bio.h | 2 +- 4 files changed, 20 insertions(+), 12 deletions

[dm-devel] [PATCH V15 14/18] block: enable multipage bvecs

2019-02-15 Thread Ming Lei
This patch pulls the trigger for multi-page bvecs. Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- block/bio.c | 22 +++--- fs/iomap.c | 4 ++-- fs/xfs/xfs_aops.c | 4 ++-- include/linux/bio.h | 2 +- 4 files changed, 20 insertions(+), 12 deletions

[Cluster-devel] [PATCH V15 11/18] block: loop: pass multi-page bvec to iov_iter

2019-02-15 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. Reviewed-by: Christoph Hellwig Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- drivers/block/loop.c | 20

[dm-devel] [PATCH V15 07/18] block: use bio_for_each_bvec() to map sg

2019-02-15 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 Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- block/blk-merge.c | 70

[Cluster-devel] [PATCH V15 10/18] btrfs: use mp_bvec_last_segment to get bio's last page

2019-02-15 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 dc8ba3ee515d..986ef49b0269 100644 --- a/fs/btrfs

[dm-devel] [PATCH V15 13/18] block: allow bio_for_each_segment_all() to iterate over multi-page bvec

2019-02-15 Thread Ming Lei
ngle patch, so that we can avoid to use a temporary helper for this conversion. Reviewed-by: Omar Sandoval Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- block/bio.c | 27 ++- block/bounce.c| 6 -- drivers/md/bc

[PATCH V15 09/18] fs/buffer.c: use bvec iterator to truncate the bio

2019-02-15 Thread Ming Lei
Once multi-page bvec is enabled, the last bvec may include more than one page, this patch use mp_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 V15 13/18] block: allow bio_for_each_segment_all() to iterate over multi-page bvec

2019-02-15 Thread Ming Lei
ngle patch, so that we can avoid to use a temporary helper for this conversion. Reviewed-by: Omar Sandoval Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- block/bio.c | 27 ++- block/bounce.c| 6 -- drivers/md/bc

[dm-devel] [PATCH V15 06/18] block: use bio_for_each_bvec() to compute multi-page bvec count

2019-02-15 Thread Ming Lei
-off-by: Ming Lei --- block/blk-merge.c | 103 +++--- 1 file changed, 83 insertions(+), 20 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index f85d878f313d..4ef56b2d2aa5 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -161,6

[dm-devel] [PATCH V15 10/18] btrfs: use mp_bvec_last_segment to get bio's last page

2019-02-15 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 dc8ba3ee515d..986ef49b0269 100644 --- a/fs/btrfs

[PATCH V15 11/18] block: loop: pass multi-page bvec to iov_iter

2019-02-15 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. Reviewed-by: Christoph Hellwig Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- drivers/block/loop.c | 20

[PATCH V15 07/18] block: use bio_for_each_bvec() to map sg

2019-02-15 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 Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- block/blk-merge.c | 70

[Cluster-devel] [PATCH V15 06/18] block: use bio_for_each_bvec() to compute multi-page bvec count

2019-02-15 Thread Ming Lei
-off-by: Ming Lei --- block/blk-merge.c | 103 +++--- 1 file changed, 83 insertions(+), 20 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index f85d878f313d..4ef56b2d2aa5 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -161,6

[dm-devel] [PATCH V15 12/18] bcache: avoid to use bio_for_each_segment_all() in bch_bio_alloc_pages()

2019-02-15 Thread Ming Lei
Reviewed-by: Omar Sandoval Reviewed-by: Christoph Hellwig Signed-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

[dm-devel] [PATCH V15 09/18] fs/buffer.c: use bvec iterator to truncate the bio

2019-02-15 Thread Ming Lei
Once multi-page bvec is enabled, the last bvec may include more than one page, this patch use mp_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

[dm-devel] [PATCH V15 11/18] block: loop: pass multi-page bvec to iov_iter

2019-02-15 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. Reviewed-by: Christoph Hellwig Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- drivers/block/loop.c | 20

[Cluster-devel] [PATCH V15 12/18] bcache: avoid to use bio_for_each_segment_all() in bch_bio_alloc_pages()

2019-02-15 Thread Ming Lei
Reviewed-by: Omar Sandoval Reviewed-by: Christoph Hellwig Signed-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

[Cluster-devel] [PATCH V15 09/18] fs/buffer.c: use bvec iterator to truncate the bio

2019-02-15 Thread Ming Lei
Once multi-page bvec is enabled, the last bvec may include more than one page, this patch use mp_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

[PATCH V15 10/18] btrfs: use mp_bvec_last_segment to get bio's last page

2019-02-15 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 dc8ba3ee515d..986ef49b0269 100644 --- a/fs/btrfs

[PATCH V15 06/18] block: use bio_for_each_bvec() to compute multi-page bvec count

2019-02-15 Thread Ming Lei
-off-by: Ming Lei --- block/blk-merge.c | 103 +++--- 1 file changed, 83 insertions(+), 20 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index f85d878f313d..4ef56b2d2aa5 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -161,6

[dm-devel] [PATCH V15 08/18] block: introduce mp_bvec_last_segment()

2019-02-15 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

[dm-devel] [PATCH V15 05/18] block: introduce bio_for_each_bvec() and rq_for_each_bvec()

2019-02-15 Thread Ming Lei
-off-by: Ming Lei --- include/linux/bio.h| 10 ++ include/linux/blkdev.h | 4 2 files changed, 14 insertions(+) diff --git a/include/linux/bio.h b/include/linux/bio.h index 72b4f7be2106..7ef8a7505c0a 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -156,6 +156,16 @@ st

[Cluster-devel] [PATCH V15 07/18] block: use bio_for_each_bvec() to map sg

2019-02-15 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 Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- block/blk-merge.c | 70

[Cluster-devel] [PATCH V15 08/18] block: introduce mp_bvec_last_segment()

2019-02-15 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 V15 05/18] block: introduce bio_for_each_bvec() and rq_for_each_bvec()

2019-02-15 Thread Ming Lei
-off-by: Ming Lei --- include/linux/bio.h| 10 ++ include/linux/blkdev.h | 4 2 files changed, 14 insertions(+) diff --git a/include/linux/bio.h b/include/linux/bio.h index 72b4f7be2106..7ef8a7505c0a 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -156,6 +156,16 @@ st

[PATCH V15 05/18] block: introduce bio_for_each_bvec() and rq_for_each_bvec()

2019-02-15 Thread Ming Lei
-off-by: Ming Lei --- include/linux/bio.h| 10 ++ include/linux/blkdev.h | 4 2 files changed, 14 insertions(+) diff --git a/include/linux/bio.h b/include/linux/bio.h index 72b4f7be2106..7ef8a7505c0a 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -156,6 +156,16 @@ st

[PATCH V15 08/18] block: introduce mp_bvec_last_segment()

2019-02-15 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

[dm-devel] [PATCH V15 03/18] block: remove bvec_iter_rewind()

2019-02-15 Thread Ming Lei
Commit 7759eb23fd980 ("block: remove bio_rewind_iter()") removes bio_rewind_iter(), then no one uses bvec_iter_rewind() any more, so remove it. Reviewed-by: Omar Sandoval Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- include/linux/bvec.h | 24 --

[dm-devel] [PATCH V15 04/18] block: introduce multi-page bvec helpers

2019-02-15 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: Christoph Hellwig Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- include/linux/bvec.h | 30 +++--- 1 file changed, 27 insertions(+)

[PATCH V15 03/18] block: remove bvec_iter_rewind()

2019-02-15 Thread Ming Lei
Commit 7759eb23fd980 ("block: remove bio_rewind_iter()") removes bio_rewind_iter(), then no one uses bvec_iter_rewind() any more, so remove it. Reviewed-by: Omar Sandoval Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- include/linux/bvec.h | 24 --

[PATCH V15 02/18] block: don't use bio->bi_vcnt to figure out segment number

2019-02-15 Thread Ming Lei
t if it isn't less than max 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 71e9ac03f621..f85d878f313d 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@

[dm-devel] [PATCH V15 02/18] block: don't use bio->bi_vcnt to figure out segment number

2019-02-15 Thread Ming Lei
t if it isn't less than max 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 71e9ac03f621..f85d878f313d 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@

[Cluster-devel] [PATCH V15 04/18] block: introduce multi-page bvec helpers

2019-02-15 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: Christoph Hellwig Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- include/linux/bvec.h | 30 +++--- 1 file changed, 27 insertions(+)

[PATCH V15 04/18] block: introduce multi-page bvec helpers

2019-02-15 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: Christoph Hellwig Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- include/linux/bvec.h | 30 +++--- 1 file changed, 27 insertions(+)

[Cluster-devel] [PATCH V15 03/18] block: remove bvec_iter_rewind()

2019-02-15 Thread Ming Lei
Commit 7759eb23fd980 ("block: remove bio_rewind_iter()") removes bio_rewind_iter(), then no one uses bvec_iter_rewind() any more, so remove it. Reviewed-by: Omar Sandoval Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- include/linux/bvec.h | 24 --

[Cluster-devel] [PATCH V15 00/18] block: support multi-page bvec

2019-02-15 Thread Ming Lei
6], http://marc.info/?t=14982021534=1=2 Christoph Hellwig (1): btrfs: look at bi_size for repair decisions Ming Lei (17): block: don't use bio->bi_vcnt to figure out segment number block: remove bvec_iter_rewind() block: introduce multi-page bvec helpers block: introduce bio_fo

[Cluster-devel] [PATCH V15 01/18] btrfs: look at bi_size for repair decisions

2019-02-15 Thread Ming Lei
From: Christoph Hellwig bio_readpage_error currently uses bi_vcnt to decide if it is worth retrying an I/O. But the vector count is mostly an implementation artifact - it really should figure out if there is more than a single sector worth retrying. Use bi_size for that and shift by

[Cluster-devel] [PATCH V15 02/18] block: don't use bio->bi_vcnt to figure out segment number

2019-02-15 Thread Ming Lei
t if it isn't less than max 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 71e9ac03f621..f85d878f313d 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@

[dm-devel] [PATCH V15 01/18] btrfs: look at bi_size for repair decisions

2019-02-15 Thread Ming Lei
From: Christoph Hellwig bio_readpage_error currently uses bi_vcnt to decide if it is worth retrying an I/O. But the vector count is mostly an implementation artifact - it really should figure out if there is more than a single sector worth retrying. Use bi_size for that and shift by

[dm-devel] [PATCH V15 00/18] block: support multi-page bvec

2019-02-15 Thread Ming Lei
6], http://marc.info/?t=14982021534=1=2 Christoph Hellwig (1): btrfs: look at bi_size for repair decisions Ming Lei (17): block: don't use bio->bi_vcnt to figure out segment number block: remove bvec_iter_rewind() block: introduce multi-page bvec helpers block: introduce bio_fo

[PATCH V15 00/18] block: support multi-page bvec

2019-02-15 Thread Ming Lei
6], http://marc.info/?t=14982021534=1=2 Christoph Hellwig (1): btrfs: look at bi_size for repair decisions Ming Lei (17): block: don't use bio->bi_vcnt to figure out segment number block: remove bvec_iter_rewind() block: introduce multi-page bvec helpers block: introduce bio_fo

[PATCH V15 01/18] btrfs: look at bi_size for repair decisions

2019-02-15 Thread Ming Lei
From: Christoph Hellwig bio_readpage_error currently uses bi_vcnt to decide if it is worth retrying an I/O. But the vector count is mostly an implementation artifact - it really should figure out if there is more than a single sector worth retrying. Use bi_size for that and shift by

Re: [PATCH V2] blk-mq: insert rq with DONTPREP to hctx dispatch list when requeue

2019-02-14 Thread Ming Lei
On Fri, Feb 15, 2019 at 10:34:39AM +0800, jianchao.wang wrote: > Hi Ming > > Thanks for your kindly response. > > On 2/15/19 10:00 AM, Ming Lei wrote: > > On Tue, Feb 12, 2019 at 09:56:25AM +0800, Jianchao Wang wrote: > >> When requeue, if RQF_DONTPREP, rq has conta

Re: [PATCH AUTOSEL 4.20 49/77] block: cover another queue enter recursion via BIO_QUEUE_ENTERED

2019-02-14 Thread Ming Lei
On Thu, Feb 14, 2019 at 09:08:27PM -0500, Sasha Levin wrote: > From: Ming Lei > > [ Upstream commit 698cef173983b086977e633e46476e0f925ca01e ] > > Except for blk_queue_split(), bio_split() is used for splitting bio too, > then the remained bio is often resubmit to queue via ge

Re: [PATCH v7 21/23] block: Avoid that flushing triggers a lockdep complaint

2019-02-14 Thread Ming Lei
sh_complete_seq+0xe5/0x350 > flush_end_io+0x12f/0x1d0 > blk_done_softirq+0x9f/0xd0 > __do_softirq+0xca/0x440 > run_ksoftirqd+0x24/0x50 > smpboot_thread_fn+0x113/0x1e0 > kthread+0x121/0x140 > ret_from_fork+0x3a/0x50 > > Cc: Jens Axboe > Cc: Ming Lei > Cc: Theodore Ts'o

Re: [PATCH V2] blk-mq: insert rq with DONTPREP to hctx dispatch list when requeue

2019-02-14 Thread Ming Lei
On Tue, Feb 12, 2019 at 09:56:25AM +0800, Jianchao Wang wrote: > When requeue, if RQF_DONTPREP, rq has contained some driver > specific data, so insert it to hctx dispatch list to avoid any > merge. Take scsi as example, here is the trace event log (no > io scheduler, because RQF_STARTED would

Re: [patch V5 4/8] nvme-pci: Simplify interrupt allocation

2019-02-14 Thread Ming Lei
On Thu, Feb 14, 2019 at 09:47:59PM +0100, Thomas Gleixner wrote: > From: Ming Lei > > The NVME PCI driver contains a tedious mechanism for interrupt > allocation, which is necessary to adjust the number and size of interrupt > sets to the maximum available number of interrupt

[PATCH V4 4/4] PCI: Document .calc_sets as required in case of multiple interrupt sets

2019-02-14 Thread Ming Lei
.calc_sets as required explicitly for multiple interrupt sets. Reviewed-by: Jens Axboe Acked-by: Bjorn Helgaas Signed-off-by: Ming Lei --- drivers/pci/msi.c | 14 -- include/linux/interrupt.h | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers

[PATCH V4 3/4] nvme-pci: Simplify interrupt allocation

2019-02-14 Thread Ming Lei
configuration to the current loop value. This replaces the adaptive loop in the driver completely. Implement the NVME specific callback which adjusts the interrupt sets configuration and remove the adaptive allocation loop. Reviewed-by: Jens Axboe Reviewed-by: Keith Busch Signed-off-by: Ming Lei

[PATCH V4 2/4] genirq/affinity: add new callback for caculating interrupt sets size

2019-02-14 Thread Ming Lei
is handed in from the driver and passed through to several core functions is marked 'const'. This patch adds callback to recalculate the number and size of interrupt sets, also removes the 'const' qualifier for 'affd'. Reviewed-by: Jens Axboe Signed-off-by: Ming Lei --- drivers/pci/msi.c

[PATCH V4 1/4] genirq/affinity: store interrupt sets size in 'struct irq_affinity'

2019-02-14 Thread Ming Lei
does the 1st thing and stores interrupt sets size in 'struct irq_affinity'. Reviewed-by: Jens Axboe Signed-off-by: Ming Lei --- drivers/nvme/host/pci.c | 5 ++--- include/linux/interrupt.h | 6 -- kernel/irq/affinity.c | 15 --- 3 files changed, 18 insertions(+), 8

[PATCH V4 0/4] genirq/affinity: add .calc_sets for improving IRQ allocation & spread

2019-02-14 Thread Ming Lei
nt in msi.c V2: - add .calc_sets instead of .setup_affinity() which is easy to be abused by drivers Ming Lei (4): genirq/affinity: store interrupt sets size in 'struct irq_affinity' genirq/affinity: add new callback for caculating interrupt sets size nvme-pci: Simplify interrupt a

[PATCH V3 0/5] genirq/affinity: add .calc_sets for improving IRQ allocation & spread

2019-02-13 Thread Ming Lei
ffd->nr_sets - remove the local variable of 'nr_sets' in irq_create_affinity_masks - set .nr_sets as 2 in nvme - update comment in msi.c V2: - add .calc_sets instead of .setup_affinity() which is easy to be abused by drivers Ming Lei (5): genirq/affin

[PATCH V3 1/5] genirq/affinity: don't mark 'affd' as const

2019-02-13 Thread Ming Lei
'. Also both the two interfaces are core APIs, which should be trusted. So don't mark 'affd' as const both pci_alloc_irq_vectors_affinity() and irq_create_affinity_masks(). Signed-off-by: Ming Lei --- drivers/pci/msi.c | 18 +- include/linux/interrupt.h | 2 +- include

[PATCH V3 3/5] genirq/affinity: add new callback for caculating set vectors

2019-02-13 Thread Ming Lei
d-by: Thomas Gleixner Signed-off-by: Ming Lei --- include/linux/interrupt.h | 4 kernel/irq/affinity.c | 8 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index a20150627a32..7a27f6ba1f2f 100644 --- a/include/linux

[PATCH V3 5/5] genirq/affinity: Document .calc_sets as required in case of multiple sets

2019-02-13 Thread Ming Lei
explicitly for multiple sets. Acked-by: Bjorn Helgaas Signed-off-by: Ming Lei --- drivers/pci/msi.c | 16 ++-- include/linux/interrupt.h | 3 ++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 96978459e2a0..199d708b4099

[PATCH V3 4/5] nvme-pci: avoid irq allocation retrying via .calc_sets

2019-02-13 Thread Ming Lei
gned-off-by: Ming Lei --- drivers/nvme/host/pci.c | 62 + 1 file changed, 16 insertions(+), 46 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 0086bdf80ea1..8c51252a897e 100644 --- a/drivers/nvme/host/pci.c +++ b/dri

[PATCH V3 2/5] genirq/affinity: store irq set vectors in 'struct irq_affinity'

2019-02-13 Thread Ming Lei
. Signed-off-by: Ming Lei --- drivers/nvme/host/pci.c | 5 ++--- include/linux/interrupt.h | 6 -- kernel/irq/affinity.c | 18 +++--- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 022ea1ee63f8

[PATCH V2 3/4] nvme-pci: avoid irq allocation retrying via .calc_sets

2019-02-12 Thread Ming Lei
ided by providing one reasonable 'min_vecs'. Implement the callback of .calc_sets, so that pci_alloc_irq_vectors_affinity() can calculate each set's vector after IRQ vectors is allocated and before spread IRQ, then NVMe's retry in case of irq allocation failure can be removed. Signed-off-by: Ming

[PATCH V2 4/4] genirq/affinity: Document .calc_sets as required in case of multiple sets

2019-02-12 Thread Ming Lei
for multiple sets. Signed-off-by: Ming Lei --- drivers/pci/msi.c | 4 ++-- include/linux/interrupt.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 4c0b47867258..9f91fa713141 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci

[PATCH V2 1/4] genirq/affinity: store irq set vectors in 'struct irq_affinity'

2019-02-12 Thread Ming Lei
. Signed-off-by: Ming Lei --- drivers/nvme/host/pci.c | 5 ++--- include/linux/interrupt.h | 8 +--- kernel/irq/affinity.c | 10 ++ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 022ea1ee63f8..0086bdf80ea1

[PATCH V2 2/4] genirq/affinity: add new callback for caculating set vectors

2019-02-12 Thread Ming Lei
d-by: Thomas Gleixner Signed-off-by: Ming Lei --- include/linux/interrupt.h | 4 kernel/irq/affinity.c | 13 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index a20150627a32..7a27f6ba1f2f 100644 --- a/i

[PATCH V2 0/4] genirq/affinity: add .calc_sets for improving IRQ allocation & spread

2019-02-12 Thread Ming Lei
- add .calc_sets instead of .setup_affinity() which is easy to be abused by drivers Ming Lei (4): genirq/affinity: store irq set vectors in 'struct irq_affinity' genirq/affinity: add new callback for caculating set vectors nvme-pci: avoid irq allocation retrying via .calc_s

Re: [PATCH 2/5] genirq/affinity: allow driver to setup managed IRQ's affinity

2019-02-12 Thread Ming Lei
Hi Thomas, On Mon, Feb 11, 2019 at 11:38:07PM +0100, Thomas Gleixner wrote: > Ming, > > On Mon, 11 Feb 2019, Bjorn Helgaas wrote: > > > On Mon, Feb 11, 2019 at 11:54:00AM +0800, Ming Lei wrote: > > > On Sun, Feb 10, 2019 at 05:30:41PM +0100, Thomas Gleixner wrote:

Re: [PATCH 4/5] nvme-pci: simplify nvme_setup_irqs() via .setup_affinity callback

2019-02-10 Thread Ming Lei
On Sun, Feb 10, 2019 at 07:49:12PM +0100, Thomas Gleixner wrote: > On Fri, 25 Jan 2019, Ming Lei wrote: > > +static int nvme_setup_affinity(const struct irq_affinity *affd, > > + struct irq_affinity_desc *masks, > > +

Re: [PATCH 4/5] nvme-pci: simplify nvme_setup_irqs() via .setup_affinity callback

2019-02-10 Thread Ming Lei
On Sun, Feb 10, 2019 at 05:39:20PM +0100, Thomas Gleixner wrote: > On Fri, 25 Jan 2019, Ming Lei wrote: > > > Use the callback of .setup_affinity() to re-caculate number > > of queues, and build irqs affinity with help of irq_build_affinity(). > > > > Then nvme_setu

Re: [PATCH 2/5] genirq/affinity: allow driver to setup managed IRQ's affinity

2019-02-10 Thread Ming Lei
Hello Thomas, On Sun, Feb 10, 2019 at 05:30:41PM +0100, Thomas Gleixner wrote: > Ming, > > On Fri, 25 Jan 2019, Ming Lei wrote: > > > This patch introduces callback of .setup_affinity into 'struct > > irq_affinity', so that: > > Please see Documentation/process/

[tip:irq/core] genirq/affinity: Move allocation of 'node_to_cpumask' to irq_build_affinity_masks()

2019-02-10 Thread tip-bot for Ming Lei
Commit-ID: 347253c42d7c673aa2a659d756bc7ff893459247 Gitweb: https://git.kernel.org/tip/347253c42d7c673aa2a659d756bc7ff893459247 Author: Ming Lei AuthorDate: Fri, 25 Jan 2019 17:53:43 +0800 Committer: Thomas Gleixner CommitDate: Sun, 10 Feb 2019 19:53:55 +0100 genirq/affinity: Move

Re: [PATCH 2/5] genirq/affinity: allow driver to setup managed IRQ's affinity

2019-02-10 Thread Ming Lei
On Thu, Feb 07, 2019 at 04:21:30PM -0600, Bjorn Helgaas wrote: > On Fri, Jan 25, 2019 at 05:53:44PM +0800, Ming Lei wrote: > > This patch introduces callback of .setup_affinity into 'struct > > irq_affinity', so that: > > > > 1) allow drivers to customize t

Re: [PATCH 0/5] genirq/affinity: introduce .setup_affinity to support allocating interrupt sets

2019-01-25 Thread Ming Lei
On Fri, Jan 25, 2019 at 05:53:42PM +0800, Ming Lei wrote: > Hi, > > The current support for allocating interrupt sets requires that same 'max_vec' > and 'min_vec' is passed to pci_alloc_irq_vectors_affinity(), then driver has > to > try to allocate again and again

[PATCH 3/5] genirq/affinity: introduce irq_build_affinity()

2019-01-25 Thread Ming Lei
Drivers may use this API to build customized irq affinity, one example is NVMe, which needs to build multiple irq sets, on each of which all CPUs are spread. Signed-off-by: Ming Lei --- include/linux/interrupt.h | 12 kernel/irq/affinity.c | 27 +++ 2

[PATCH 4/5] nvme-pci: simplify nvme_setup_irqs() via .setup_affinity callback

2019-01-25 Thread Ming Lei
Use the callback of .setup_affinity() to re-caculate number of queues, and build irqs affinity with help of irq_build_affinity(). Then nvme_setup_irqs() gets simplified a lot. Signed-off-by: Ming Lei --- drivers/nvme/host/pci.c | 97 - 1 file

[PATCH 1/5] genirq/affinity: move allocation of 'node_to_cpumask' to irq_build_affinity_masks

2019-01-25 Thread Ming Lei
'node_to_cpumask' is just one temparay variable for irq_build_affinity_masks(), so move it into irq_build_affinity_masks(). No functioanl change. Signed-off-by: Ming Lei --- kernel/irq/affinity.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git

[PATCH 5/5] genirq/affinity: remove support for allocating interrupt sets

2019-01-25 Thread Ming Lei
. Signed-off-by: Ming Lei --- drivers/pci/msi.c | 14 - include/linux/interrupt.h | 4 kernel/irq/affinity.c | 52 +++ 3 files changed, 12 insertions(+), 58 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c

[PATCH 2/5] genirq/affinity: allow driver to setup managed IRQ's affinity

2019-01-25 Thread Ming Lei
y. Signed-off-by: Ming Lei --- include/linux/interrupt.h | 26 +- kernel/irq/affinity.c | 6 ++ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index c672f34235e7..f6cea778cf50 100644 --- a

[PATCH 0/5] genirq/affinity: introduce .setup_affinity to support allocating interrupt sets

2019-01-25 Thread Ming Lei
interrupt sets and build affinity for each set after irq vectors are allocated. Turns out both genirq/affinity and nvme code get simplified a lot. Please review and comment! Ming Lei (5): genirq/affinity: move allocation of 'node_to_cpumask' to irq_build_affinity_masks genirq/affinity

Re: [dm-devel] [PATCH 3/4] dm: fix missing bio_split() pattern code in __split_and_process_bio()

2019-01-21 Thread Ming Lei
On Mon, Jan 21, 2019 at 10:35:11PM -0500, Mike Snitzer wrote: > On Mon, Jan 21 2019 at 10:17pm -0500, > Mike Snitzer wrote: > > > On Mon, Jan 21 2019 at 9:46pm -0500, > > Ming Lei wrote: > > > > > On Mon, Jan 21, 2019 at 11:02:04AM -0500, Mike Snitzer wrot

Re: [dm-devel] [PATCH V14 00/18] block: support multi-page bvec

2019-01-21 Thread Ming Lei
On Mon, Jan 21, 2019 at 01:43:21AM -0800, Sagi Grimberg wrote: > > > V14: > > - drop patch(patch 4 in V13) for renaming bvec helpers, as suggested by > > Jens > > - use mp_bvec_* as multi-page bvec helper name > > - fix one build issue, which is caused by missing one converion of > >

Re: [Cluster-devel] [PATCH V14 00/18] block: support multi-page bvec

2019-01-21 Thread Ming Lei
On Mon, Jan 21, 2019 at 01:43:21AM -0800, Sagi Grimberg wrote: > > > V14: > > - drop patch(patch 4 in V13) for renaming bvec helpers, as suggested by > > Jens > > - use mp_bvec_* as multi-page bvec helper name > > - fix one build issue, which is caused by missing one converion of > >

Re: [PATCH V14 00/18] block: support multi-page bvec

2019-01-21 Thread Ming Lei
On Mon, Jan 21, 2019 at 01:43:21AM -0800, Sagi Grimberg wrote: > > > V14: > > - drop patch(patch 4 in V13) for renaming bvec helpers, as suggested by > > Jens > > - use mp_bvec_* as multi-page bvec helper name > > - fix one build issue, which is caused by missing one converion of > >

Re: [dm-devel] [PATCH V14 00/18] block: support multi-page bvec

2019-01-21 Thread Ming Lei
On Mon, Jan 21, 2019 at 09:38:10AM +0100, Christoph Hellwig wrote: > On Mon, Jan 21, 2019 at 04:37:12PM +0800, Ming Lei wrote: > > On Mon, Jan 21, 2019 at 09:22:46AM +0100, Christoph Hellwig wrote: > > > On Mon, Jan 21, 2019 at 04:17:47PM +0800, Ming Lei wrote: > > > &g

Re: [Cluster-devel] [PATCH V14 00/18] block: support multi-page bvec

2019-01-21 Thread Ming Lei
On Mon, Jan 21, 2019 at 09:38:10AM +0100, Christoph Hellwig wrote: > On Mon, Jan 21, 2019 at 04:37:12PM +0800, Ming Lei wrote: > > On Mon, Jan 21, 2019 at 09:22:46AM +0100, Christoph Hellwig wrote: > > > On Mon, Jan 21, 2019 at 04:17:47PM +0800, Ming Lei wrote: > > > &g

Re: [PATCH V14 00/18] block: support multi-page bvec

2019-01-21 Thread Ming Lei
On Mon, Jan 21, 2019 at 09:38:10AM +0100, Christoph Hellwig wrote: > On Mon, Jan 21, 2019 at 04:37:12PM +0800, Ming Lei wrote: > > On Mon, Jan 21, 2019 at 09:22:46AM +0100, Christoph Hellwig wrote: > > > On Mon, Jan 21, 2019 at 04:17:47PM +0800, Ming Lei wrote: > > > &g

Re: [dm-devel] [PATCH V14 00/18] block: support multi-page bvec

2019-01-21 Thread Ming Lei
On Mon, Jan 21, 2019 at 09:22:46AM +0100, Christoph Hellwig wrote: > On Mon, Jan 21, 2019 at 04:17:47PM +0800, Ming Lei wrote: > > V14: > > - drop patch(patch 4 in V13) for renaming bvec helpers, as suggested by > > Jens > > - use mp_bvec_* as multi-page bvec h

Re: [PATCH V14 00/18] block: support multi-page bvec

2019-01-21 Thread Ming Lei
On Mon, Jan 21, 2019 at 09:22:46AM +0100, Christoph Hellwig wrote: > On Mon, Jan 21, 2019 at 04:17:47PM +0800, Ming Lei wrote: > > V14: > > - drop patch(patch 4 in V13) for renaming bvec helpers, as suggested by > > Jens > > - use mp_bvec_* as multi-page bvec h

[dm-devel] [PATCH V14 18/18] block: kill BLK_MQ_F_SG_MERGE

2019-01-21 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 V14 17/18] block: kill QUEUE_FLAG_NO_SG_MERGE

2019-01-21 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

[PATCH V14 15/18] block: always define BIO_MAX_PAGES as 256

2019-01-21 Thread Ming Lei
-by: Christoph Hellwig 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 af288f6e8ab0..1d279a6ae737 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -34,15 +34,7 @@ #define BIO_BUG_ON #endif

[dm-devel] [PATCH V14 16/18] block: document usage of bio iterator helpers

2019-01-21 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. Reviewed-by: Christoph Hellwig Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- Documentation/block/biovecs.txt | 25

<    5   6   7   8   9   10   11   12   13   14   >