[PATCH 0/4] blk-mq: allow to unfreeze queue when io isn't drained

2018-09-18 Thread Ming Lei
draininig IO. The 4th patch applies blk_mq_unfreeze_queue_no_drain_io() to NVMe PCI timeout, so that IO hang may be avoided inside nvme_reset_work() when new IO timeout is triggered. Part of idea is from Jianchao's early work: https://marc.info/?l=linux-kernel=153612052611020=2 Ming Lei (4

Re: [PATCH] percpu-refcount: relax limit on percpu_ref_reinit()

2018-09-09 Thread Ming Lei
On Sun, Sep 09, 2018 at 11:46:20AM -0700, Bart Van Assche wrote: > On Sun, 2018-09-09 at 20:58 +0800, Ming Lei wrote: > > Now percpu_ref_reinit() can only be done on one percpu refcounter > > when it drops zero. And the limit shouldn't be so strict, and it > > is

Re: [PATCH] percpu-refcount: relax limit on percpu_ref_reinit()

2018-09-09 Thread Ming Lei
On Sun, Sep 09, 2018 at 11:46:20AM -0700, Bart Van Assche wrote: > On Sun, 2018-09-09 at 20:58 +0800, Ming Lei wrote: > > Now percpu_ref_reinit() can only be done on one percpu refcounter > > when it drops zero. And the limit shouldn't be so strict, and it > > is

Re: Affinity managed interrupts vs non-managed interrupts

2018-08-31 Thread Ming Lei
On Wed, Aug 29, 2018 at 6:47 PM Sumit Saxena wrote: > > > -Original Message- > > From: Ming Lei [mailto:ming@redhat.com] > > Sent: Wednesday, August 29, 2018 2:16 PM > > To: Sumit Saxena > > Cc: t...@linutronix.de; h...@lst.de; linux-kernel@vger.ker

Re: Affinity managed interrupts vs non-managed interrupts

2018-08-31 Thread Ming Lei
On Wed, Aug 29, 2018 at 6:47 PM Sumit Saxena wrote: > > > -Original Message- > > From: Ming Lei [mailto:ming@redhat.com] > > Sent: Wednesday, August 29, 2018 2:16 PM > > To: Sumit Saxena > > Cc: t...@linutronix.de; h...@lst.de; linux-kernel@vger.ker

Re: Affinity managed interrupts vs non-managed interrupts

2018-08-29 Thread Ming Lei
Hello Sumit, On Tue, Aug 28, 2018 at 12:04:52PM +0530, Sumit Saxena wrote: > Affinity managed interrupts vs non-managed interrupts > > Hi Thomas, > > We are working on next generation MegaRAID product where requirement is- to > allocate additional 16 MSI-x vectors in addition to number of

Re: Affinity managed interrupts vs non-managed interrupts

2018-08-29 Thread Ming Lei
Hello Sumit, On Tue, Aug 28, 2018 at 12:04:52PM +0530, Sumit Saxena wrote: > Affinity managed interrupts vs non-managed interrupts > > Hi Thomas, > > We are working on next generation MegaRAID product where requirement is- to > allocate additional 16 MSI-x vectors in addition to number of

Re: [PATCH V2 1/2] blk-mq: init hctx sched after update ctx and hctx mapping

2018-08-17 Thread Ming Lei
; > > + /* > +* switch io scheduler to NULL to clean up the data in it. > +* will get it back after update mapping between cpu and hw queues. > +*/ > + list_for_each_entry(q, >tag_list, tag_set_list) { > + if (!q->elevator) { > + q->elv_type = NULL; > + continue; > + } > + q->elv_type = q->elevator->type; > + mutex_lock(>sysfs_lock); > + /* > +* elevator_release will put it. > +*/ > + __module_get(q->elv_type->elevator_owner); I understand what elevator_release() frees is the 'ref-counter' got in elevator_get(), but who will be the counter-pair of the above __module_get()? Thanks, Ming Lei

Re: [PATCH V2 1/2] blk-mq: init hctx sched after update ctx and hctx mapping

2018-08-17 Thread Ming Lei
; > > + /* > +* switch io scheduler to NULL to clean up the data in it. > +* will get it back after update mapping between cpu and hw queues. > +*/ > + list_for_each_entry(q, >tag_list, tag_set_list) { > + if (!q->elevator) { > + q->elv_type = NULL; > + continue; > + } > + q->elv_type = q->elevator->type; > + mutex_lock(>sysfs_lock); > + /* > +* elevator_release will put it. > +*/ > + __module_get(q->elv_type->elevator_owner); I understand what elevator_release() frees is the 'ref-counter' got in elevator_get(), but who will be the counter-pair of the above __module_get()? Thanks, Ming Lei

Re: How to secure erase PCI-E NVME SSD connected via USB3?

2018-07-31 Thread Ming Lei
re-erase the NVME SSD connected via the JMS583 chip? You may try 'blkdiscard --secure' and see if you are luck. Thanks, Ming Lei

Re: How to secure erase PCI-E NVME SSD connected via USB3?

2018-07-31 Thread Ming Lei
re-erase the NVME SSD connected via the JMS583 chip? You may try 'blkdiscard --secure' and see if you are luck. Thanks, Ming Lei

Re: [RESEND PATCH V5 00/33] block: support multipage bvec

2018-06-08 Thread Ming Lei
On Fri, Jun 01, 2018 at 04:09:54PM +0200, David Sterba wrote: > On Fri, May 25, 2018 at 11:45:48AM +0800, Ming Lei wrote: > > fs/btrfs/check-integrity.c | 6 +- > > fs/btrfs/compression.c | 8 +- > > fs/btrfs/disk-io.c | 3 +- >

Re: [RESEND PATCH V5 00/33] block: support multipage bvec

2018-06-08 Thread Ming Lei
On Fri, Jun 01, 2018 at 04:09:54PM +0200, David Sterba wrote: > On Fri, May 25, 2018 at 11:45:48AM +0800, Ming Lei wrote: > > fs/btrfs/check-integrity.c | 6 +- > > fs/btrfs/compression.c | 8 +- > > fs/btrfs/disk-io.c | 3 +- >

Re: [PATCH 0/3] Provide more fine grained control over multipathing

2018-05-30 Thread Ming Lei
On Tue, May 29, 2018 at 09:22:40AM +0200, Johannes Thumshirn wrote: > On Mon, May 28, 2018 at 11:02:36PM -0400, Mike Snitzer wrote: > > No, what both Red Hat and SUSE are saying is: cool let's have a go at > > "Plan A" but, in parallel, what harm is there in allowing "Plan B" (dm > > multipath) to

Re: [PATCH 0/3] Provide more fine grained control over multipathing

2018-05-30 Thread Ming Lei
On Tue, May 29, 2018 at 09:22:40AM +0200, Johannes Thumshirn wrote: > On Mon, May 28, 2018 at 11:02:36PM -0400, Mike Snitzer wrote: > > No, what both Red Hat and SUSE are saying is: cool let's have a go at > > "Plan A" but, in parallel, what harm is there in allowing "Plan B" (dm > > multipath) to

Re: [PATCH] block: kyber: make kyber more friendly with merging

2018-05-30 Thread Ming Lei
On Wed, May 30, 2018 at 4:36 PM, jianchao.wang wrote: > Hi ming > > Thanks for your kindly response. > > On 05/30/2018 04:22 PM, Ming Lei wrote: >>>> you could keep the software queues as-is but add our own version of >>>> flush_busy_ctxs() that only remo

Re: [PATCH] block: kyber: make kyber more friendly with merging

2018-05-30 Thread Ming Lei
On Wed, May 30, 2018 at 4:36 PM, jianchao.wang wrote: > Hi ming > > Thanks for your kindly response. > > On 05/30/2018 04:22 PM, Ming Lei wrote: >>>> you could keep the software queues as-is but add our own version of >>>> flush_busy_ctxs() that only remo

Re: [RESEND PATCH V5 00/33] block: support multipage bvec

2018-05-27 Thread Ming Lei
On Sun, May 27, 2018 at 07:44:52PM -0600, Jens Axboe wrote: > On 5/27/18 1:23 AM, Ming Lei wrote: > > On Fri, May 25, 2018 at 10:30:46AM -0600, Jens Axboe wrote: > >> On 5/24/18 10:53 PM, Kent Overstreet wrote: > >>> On Fri, May 25, 2018 at 11:45:48AM +0

Re: [RESEND PATCH V5 00/33] block: support multipage bvec

2018-05-27 Thread Ming Lei
On Sun, May 27, 2018 at 07:44:52PM -0600, Jens Axboe wrote: > On 5/27/18 1:23 AM, Ming Lei wrote: > > On Fri, May 25, 2018 at 10:30:46AM -0600, Jens Axboe wrote: > >> On 5/24/18 10:53 PM, Kent Overstreet wrote: > >>> On Fri, May 25, 2018 at 11:45:48AM +0

Re: [RESEND PATCH V5 00/33] block: support multipage bvec

2018-05-27 Thread Ming Lei
On Fri, May 25, 2018 at 10:30:46AM -0600, Jens Axboe wrote: > On 5/24/18 10:53 PM, Kent Overstreet wrote: > > On Fri, May 25, 2018 at 11:45:48AM +0800, Ming Lei wrote: > >> Hi, > >> > >> This patchset brings multipage bvec into block layer: > > > &g

Re: [RESEND PATCH V5 00/33] block: support multipage bvec

2018-05-27 Thread Ming Lei
On Fri, May 25, 2018 at 10:30:46AM -0600, Jens Axboe wrote: > On 5/24/18 10:53 PM, Kent Overstreet wrote: > > On Fri, May 25, 2018 at 11:45:48AM +0800, Ming Lei wrote: > >> Hi, > >> > >> This patchset brings multipage bvec into block layer: > > > &g

[RESEND PATCH V5 23/33] ext4: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Signed-off-by: Ming Lei <ming@redhat.com> --- fs/ext4/page-io.c | 3 ++- fs/ext4/readpage.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)

[RESEND PATCH V5 23/33] ext4: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Signed-off-by: Ming Lei --- fs/ext4/page-io.c | 3 ++- fs/ext4/readpage.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/ext4/page-io.c

[RESEND PATCH V5 30/33] block: enable multipage bvecs

2018-05-24 Thread Ming Lei
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@redhat.com> --- block/bio.c | 13 + 1 file changed, 13 insertions(+) diff --git a/block/bio.c b/block/bio.c

[RESEND PATCH V5 30/33] block: enable multipage bvecs

2018-05-24 Thread Ming Lei
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 --- block/bio.c | 13 + 1 file changed, 13 insertions(+) diff --git a/block/bio.c b/block/bio.c index c160c143cc1b..bc3992f52fe8

[RESEND PATCH V5 29/33] block: rename bio_for_each_page_all2 as bio_for_each_page_all

2018-05-24 Thread Ming Lei
Now bio_for_each_page_all() is gone, we can reuse the name to iterate bio page by page, which is done via bio_for_each_page_all2() now. Signed-off-by: Ming Lei <ming@redhat.com> --- block/bio.c | 14 +++--- block/blk-zoned.c | 4 ++-- block/bo

[RESEND PATCH V5 29/33] block: rename bio_for_each_page_all2 as bio_for_each_page_all

2018-05-24 Thread Ming Lei
Now bio_for_each_page_all() is gone, we can reuse the name to iterate bio page by page, which is done via bio_for_each_page_all2() now. Signed-off-by: Ming Lei --- block/bio.c | 14 +++--- block/blk-zoned.c | 4 ++-- block/bounce.c| 4 ++-- drivers/md

[RESEND PATCH V5 33/33] block: document usage of bio iterator helpers

2018-05-24 Thread Ming Lei
Now multipage bvec is supported, and some helpers may return page by page, and some may return segment by segment, this patch documents the usage for helping us use them correctly. Signed-off-by: Ming Lei <ming@redhat.com> --- Documentation/block/biovecs.tx

[RESEND PATCH V5 28/33] block: kill bio_for_each_page_all()

2018-05-24 Thread Ming Lei
No one uses it any more, so kill it and we can reuse this helper name. Signed-off-by: Ming Lei <ming@redhat.com> --- include/linux/bio.h | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 5ae2bc876295..c5e692

[RESEND PATCH V5 31/33] block: bio: pass segments to bio if bio_add_page() is bypassed

2018-05-24 Thread Ming Lei
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@redhat.

[RESEND PATCH V5 28/33] block: kill bio_for_each_page_all()

2018-05-24 Thread Ming Lei
No one uses it any more, so kill it and we can reuse this helper name. Signed-off-by: Ming Lei --- include/linux/bio.h | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 5ae2bc876295..c5e692d43f23 100644 --- a/include/linux

[RESEND PATCH V5 31/33] block: bio: pass segments to bio if bio_add_page() is bypassed

2018-05-24 Thread Ming Lei
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 --- block/bio.c

[RESEND PATCH V5 33/33] block: document usage of bio iterator helpers

2018-05-24 Thread Ming Lei
Now multipage bvec is supported, and some helpers may return page by page, and some may return segment by segment, this patch documents the usage for helping us use them correctly. Signed-off-by: Ming Lei --- Documentation/block/biovecs.txt | 32 1 file changed

[RESEND PATCH V5 32/33] block: always define BIO_MAX_PAGES as 256

2018-05-24 Thread Ming Lei
Now multipage bvec can cover CONFIG_THP_SWAP, so we don't need to increase BIO_MAX_PAGES for it. Signed-off-by: Ming Lei <ming@redhat.com> --- include/linux/bio.h | 8 1 file changed, 8 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index fc8a82

[RESEND PATCH V5 32/33] block: always define BIO_MAX_PAGES as 256

2018-05-24 Thread Ming Lei
Now multipage bvec can cover CONFIG_THP_SWAP, so we don't need to increase BIO_MAX_PAGES for it. 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 fc8a8238805e..839dddf81d09 100644

[RESEND PATCH V5 22/33] btrfs: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Signed-off-by: Ming Lei <ming@redhat.com> --- fs/btrfs/compression.c | 3 ++- fs/btrfs/disk-io.c | 3 ++- fs/btrfs/extent_io.c | 9 ++--- fs

[RESEND PATCH V5 22/33] btrfs: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Signed-off-by: Ming Lei --- fs/btrfs/compression.c | 3 ++- fs/btrfs/disk-io.c | 3 ++- fs/btrfs/extent_io.c | 9 ++--- fs/btrfs/inode.c | 6

[RESEND PATCH V5 24/33] f2fs: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Signed-off-by: Ming Lei <ming@redhat.com> --- fs/f2fs/data.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/data.

[RESEND PATCH V5 24/33] f2fs: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Signed-off-by: Ming Lei --- fs/f2fs/data.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index

[RESEND PATCH V5 26/33] exofs: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Signed-off-by: Ming Lei <ming@redhat.com> --- fs/exofs/ore.c | 3 ++- fs/exofs/ore_raid.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)

[RESEND PATCH V5 26/33] exofs: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Signed-off-by: Ming Lei --- fs/exofs/ore.c | 3 ++- fs/exofs/ore_raid.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/exofs/ore.c

[RESEND PATCH V5 25/33] xfs: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Given bvec can't be changed under bio_for_each_page_all2(), this patch marks the bvec parameter as 'const' for xfs_finish_page_writeback(). Signed-off-by: Ming Lei

[RESEND PATCH V5 27/33] gfs2: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Given bvec can't be changed inside bio_for_each_page_all2(), this patch marks the bvec parameter as 'const' for gfs2_end_log_write_bh(). Signed-off-by: Ming Lei

[RESEND PATCH V5 25/33] xfs: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Given bvec can't be changed under bio_for_each_page_all2(), this patch marks the bvec parameter as 'const' for xfs_finish_page_writeback(). Signed-off-by: Ming Lei

[RESEND PATCH V5 27/33] gfs2: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Given bvec can't be changed inside bio_for_each_page_all2(), this patch marks the bvec parameter as 'const' for gfs2_end_log_write_bh(). Signed-off-by: Ming Lei

[RESEND PATCH V5 20/33] md/dm/bcache: conver to bio_for_each_page_all2 and bio_for_each_segment

2018-05-24 Thread Ming Lei
we have to convert to bio_for_each_page_all2(). Signed-off-by: Ming Lei <ming@redhat.com> --- drivers/md/bcache/btree.c | 3 ++- drivers/md/bcache/util.c | 2 +- drivers/md/dm-crypt.c | 3 ++- drivers/md/raid1.c| 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff

[RESEND PATCH V5 21/33] fs: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Signed-off-by: Ming Lei <ming@redhat.com> --- fs/block_dev.c | 6 -- fs/crypto/bio.c | 3 ++- fs/direct-io.c | 4 +++- fs/iomap.c | 3 ++- fs/m

[RESEND PATCH V5 20/33] md/dm/bcache: conver to bio_for_each_page_all2 and bio_for_each_segment

2018-05-24 Thread Ming Lei
we have to convert to bio_for_each_page_all2(). Signed-off-by: Ming Lei --- drivers/md/bcache/btree.c | 3 ++- drivers/md/bcache/util.c | 2 +- drivers/md/dm-crypt.c | 3 ++- drivers/md/raid1.c| 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/md/bcache

[RESEND PATCH V5 21/33] fs: conver to bio_for_each_page_all2

2018-05-24 Thread Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Signed-off-by: Ming Lei --- fs/block_dev.c | 6 -- fs/crypto/bio.c | 3 ++- fs/direct-io.c | 4 +++- fs/iomap.c | 3 ++- fs/mpage.c | 3 ++- 5 files

[RESEND PATCH V5 19/33] block: convert to bio_for_each_page_all2()

2018-05-24 Thread Ming Lei
We have to convert to bio_for_each_page_all2() for iterating page by page. bio_for_each_page_all() can't be used any more after multipage bvec is enabled. Signed-off-by: Ming Lei <ming@redhat.com> --- block/bio.c | 18 -- block/blk-zoned.c | 5 +++--

[RESEND PATCH V5 19/33] block: convert to bio_for_each_page_all2()

2018-05-24 Thread Ming Lei
We have to convert to bio_for_each_page_all2() for iterating page by page. bio_for_each_page_all() can't be used any more after multipage bvec is enabled. Signed-off-by: Ming Lei --- block/bio.c | 18 -- block/blk-zoned.c | 5 +++-- block/bounce.c | 6

[RESEND PATCH V5 18/33] block: deal with dirtying pages for multipage bvec

2018-05-24 Thread Ming Lei
ase all these pages if all are dirtied, otherwise dirty them all in deferred wrokqueue. This patch introduces segment_for_each_page_all() to deal with the case a bit easier. Signed-off-by: Ming Lei <ming@redhat.com> --- block/bio.c | 45 +

[RESEND PATCH V5 18/33] block: deal with dirtying pages for multipage bvec

2018-05-24 Thread Ming Lei
ase all these pages if all are dirtied, otherwise dirty them all in deferred wrokqueue. This patch introduces segment_for_each_page_all() to deal with the case a bit easier. Signed-off-by: Ming Lei --- block/bio.c | 45 + include/linux/bvec

[RESEND PATCH V5 17/33] block: bio: introduce bio_for_each_page_all2 and bio_for_each_segment_all

2018-05-24 Thread Ming Lei
table directly, and users should be carful about this helper since it returns real multipage segment now. Signed-off-by: Ming Lei <ming@redhat.com> --- include/linux/bio.h | 18 ++ include/linux/bvec.h | 6 ++ 2 files changed, 24 insertions(+) diff --git a/include

[RESEND PATCH V5 13/33] block: introduce rq_for_each_segment()

2018-05-24 Thread Ming Lei
There are still cases in which rq_for_each_segment() is required, for example, loop. Signed-off-by: Ming Lei <ming@redhat.com> --- include/linux/blkdev.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 1e8e9b430008..0b15bc

[RESEND PATCH V5 15/33] block: introduce bio_clone_seg_bioset()

2018-05-24 Thread Ming Lei
There is one use case(DM) which requires to clone bio segment by segement, so introduce this API. Signed-off-by: Ming Lei <ming@redhat.com> --- block/bio.c | 56 +++-- include/linux/bio.h | 1 + 2 files changed, 43 insertions(

[RESEND PATCH V5 16/33] dm: clone bio via bio_clone_seg_bioset

2018-05-24 Thread Ming Lei
multipage bio. Signed-off-by: Ming Lei <ming@redhat.com> --- drivers/md/dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index f1db181e082e..425e99e20f5c 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1581,8 +1581,8 @@

[RESEND PATCH V5 17/33] block: bio: introduce bio_for_each_page_all2 and bio_for_each_segment_all

2018-05-24 Thread Ming Lei
table directly, and users should be carful about this helper since it returns real multipage segment now. Signed-off-by: Ming Lei --- include/linux/bio.h | 18 ++ include/linux/bvec.h | 6 ++ 2 files changed, 24 insertions(+) diff --git a/include/linux/bio.h b/include/linux

[RESEND PATCH V5 13/33] block: introduce rq_for_each_segment()

2018-05-24 Thread Ming Lei
There are still cases in which rq_for_each_segment() is required, for example, loop. Signed-off-by: Ming Lei --- include/linux/blkdev.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 1e8e9b430008..0b15bc625bd7 100644 --- a/include

[RESEND PATCH V5 15/33] block: introduce bio_clone_seg_bioset()

2018-05-24 Thread Ming Lei
There is one use case(DM) which requires to clone bio segment by segement, so introduce this API. Signed-off-by: Ming Lei --- block/bio.c | 56 +++-- include/linux/bio.h | 1 + 2 files changed, 43 insertions(+), 14 deletions(-) diff

[RESEND PATCH V5 16/33] dm: clone bio via bio_clone_seg_bioset

2018-05-24 Thread Ming Lei
multipage bio. Signed-off-by: Ming Lei --- drivers/md/dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index f1db181e082e..425e99e20f5c 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1581,8 +1581,8 @@ static blk_qc_t

[RESEND PATCH V5 12/33] block: introduce bio_segments()

2018-05-24 Thread Ming Lei
There are still cases in which we need to use bio_segments() for get the number of segment, so introduce it. Signed-off-by: Ming Lei <ming@redhat.com> --- include/linux/bio.h | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/include/linux/b

[RESEND PATCH V5 12/33] block: introduce bio_segments()

2018-05-24 Thread Ming Lei
There are still cases in which we need to use bio_segments() for get the number of segment, so introduce it. Signed-off-by: Ming Lei --- include/linux/bio.h | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h

[RESEND PATCH V5 14/33] block: loop: pass segments to iov_iter

2018-05-24 Thread Ming Lei
iov_iter is implemented with bvec itererator, so it is safe to pass segment to it, and this way is much more efficient than passing one page in each bvec. Signed-off-by: Ming Lei <ming@redhat.com> --- drivers/block/loop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[RESEND PATCH V5 14/33] block: loop: pass segments to iov_iter

2018-05-24 Thread Ming Lei
iov_iter is implemented with bvec itererator, so it is safe to pass segment 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block

[RESEND PATCH V5 09/33] fs/buffer.c: use bvec iterator to truncate the bio

2018-05-24 Thread Ming Lei
Once multipage bvec is enabled, the last bvec may include more than one page, this patch use segment_last_page() to truncate the bio. Signed-off-by: Ming Lei <ming@redhat.com> --- fs/buffer.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/bu

[RESEND PATCH V5 09/33] fs/buffer.c: use bvec iterator to truncate the bio

2018-05-24 Thread Ming Lei
Once multipage bvec is enabled, the last bvec may include more than one page, this patch use segment_last_page() to truncate the bio. 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 249b83fafe48

[RESEND PATCH V5 07/33] block: use bio_for_each_segment() to map sg

2018-05-24 Thread Ming Lei
It is more efficient to use bio_for_each_segment() to map sg, meantime we have to consider splitting multipage bvec as done in blk_bio_segment_split(). Signed-off-by: Ming Lei <ming@redhat.com> --- block/blk-merge.c | 72 +++ 1 file c

[RESEND PATCH V5 08/33] block: introduce segment_last_page()

2018-05-24 Thread Ming Lei
BTRFS and guard_bio_eod() need to get the last page from one segment, so introduce this helper to make them happy. Signed-off-by: Ming Lei <ming@redhat.com> --- include/linux/bvec.h | 22 ++ 1 file changed, 22 insertions(+) diff --git a/include/linux/bvec.h b/i

[RESEND PATCH V5 07/33] block: use bio_for_each_segment() to map sg

2018-05-24 Thread Ming Lei
It is more efficient to use bio_for_each_segment() to map sg, meantime we have to consider splitting multipage bvec as done in blk_bio_segment_split(). Signed-off-by: Ming Lei --- block/blk-merge.c | 72 +++ 1 file changed, 52 insertions

[RESEND PATCH V5 08/33] block: introduce segment_last_page()

2018-05-24 Thread Ming Lei
BTRFS and guard_bio_eod() need to get the last page from one segment, so introduce this helper to make them happy. Signed-off-by: Ming Lei --- include/linux/bvec.h | 22 ++ 1 file changed, 22 insertions(+) diff --git a/include/linux/bvec.h b/include/linux/bvec.h index

[RESEND PATCH V5 06/33] block: use bio_for_each_segment() to compute segments count

2018-05-24 Thread Ming Lei
max segment size, so we have to split the big bvec into several segments. Thirdly during splitting multipage 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@redhat.com> --- block/blk-merge.

[RESEND PATCH V5 06/33] block: use bio_for_each_segment() to compute segments count

2018-05-24 Thread Ming Lei
max segment size, so we have to split the big bvec into several segments. Thirdly during splitting multipage bvec into segments, max segment number may be reached, then the bio need to be splitted when this happens. Signed-off-by: Ming Lei --- block/blk-merge.c | 90

[RESEND PATCH V5 10/33] btrfs: use segment_last_page to get bio's last page

2018-05-24 Thread Ming Lei
Preparing for supporting multipage bvec. Cc: Chris Mason <c...@fb.com> Cc: Josef Bacik <jba...@fb.com> Cc: David Sterba <dste...@suse.com> Cc: linux-bt...@vger.kernel.org Signed-off-by: Ming Lei <ming@redhat.com> --- fs/btrfs/compression.c | 5 - fs/btrfs/extent_i

[RESEND PATCH V5 11/33] block: implement bio_pages_all() via bio_for_each_page_all()

2018-05-24 Thread Ming Lei
As multipage bvec will be enabled soon, bio->bi_vcnt isn't same with page count in the bio any more, so use bio_for_each_page_all() to compute the number. Signed-off-by: Ming Lei <ming@redhat.com> --- include/linux/bio.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion

[RESEND PATCH V5 10/33] btrfs: use segment_last_page to get bio's last page

2018-05-24 Thread Ming Lei
Preparing for supporting multipage bvec. Cc: Chris Mason Cc: Josef Bacik Cc: David Sterba Cc: linux-bt...@vger.kernel.org Signed-off-by: Ming Lei --- fs/btrfs/compression.c | 5 - fs/btrfs/extent_io.c | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/btrfs

[RESEND PATCH V5 11/33] block: implement bio_pages_all() via bio_for_each_page_all()

2018-05-24 Thread Ming Lei
As multipage bvec will be enabled soon, bio->bi_vcnt isn't same with page count in the bio any more, so use bio_for_each_page_all() to compute the number. Signed-off-by: Ming Lei --- include/linux/bio.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/li

[RESEND PATCH V5 01/33] block: rename bio_for_each_segment* with bio_for_each_page*

2018-05-24 Thread Ming Lei
bvec is in, each bvec will store a real multipage segment, so people won't be confused with these wrong names. Signed-off-by: Ming Lei <ming@redhat.com> --- Documentation/block/biovecs.txt | 4 ++-- arch/m68k/emu/nfblock.c | 2 +- arch/xtensa/platforms/iss/simdisk.

[RESEND PATCH V5 05/33] block: introduce bio_for_each_segment()

2018-05-24 Thread Ming Lei
This helper is used to iterate multipage bvec for bio spliting/merge, and it is required in bio_clone_bioset() too, so introduce it. Signed-off-by: Ming Lei <ming@redhat.com> --- include/linux/bio.h | 34 +++--- include/linux/bvec.

[RESEND PATCH V5 02/33] block: rename rq_for_each_segment as rq_for_each_page

2018-05-24 Thread Ming Lei
rq_for_each_segment() still deceives us since this helper only returns one page in each bvec, so fixes its name. Signed-off-by: Ming Lei <ming@redhat.com> --- Documentation/block/biodoc.txt | 6 +++--- block/blk-core.c | 2 +- drivers/block/floppy.c | 4 ++-- d

[RESEND PATCH V5 03/33] block: rename bio_segments() with bio_pages()

2018-05-24 Thread Ming Lei
bio_segments() never returns count of actual segment, just like original bio_for_each_segment(), so rename it as bio_pages(). Signed-off-by: Ming Lei <ming@redhat.com> --- block/bio.c| 2 +- block/blk-merge.c | 2 +- drivers/block/

[RESEND PATCH V5 04/33] block: introduce multipage page bvec helpers

2018-05-24 Thread Ming Lei
current bvec iterator which is thought as singlepage only by drivers, fs, dm and etc. These helpers will build singlepage bvec in flight, so users of current bio/bvec iterator still can work well and needn't change even though we store real multipage segment into bvec table. Signed-off-by: Ming Lei

[RESEND PATCH V5 01/33] block: rename bio_for_each_segment* with bio_for_each_page*

2018-05-24 Thread Ming Lei
bvec is in, each bvec will store a real multipage segment, so people won't be confused with these wrong names. Signed-off-by: Ming Lei --- Documentation/block/biovecs.txt | 4 ++-- arch/m68k/emu/nfblock.c | 2 +- arch/xtensa/platforms/iss/simdisk.c | 2 +- block/bio-integrity.c

[RESEND PATCH V5 05/33] block: introduce bio_for_each_segment()

2018-05-24 Thread Ming Lei
This helper is used to iterate multipage bvec for bio spliting/merge, and it is required in bio_clone_bioset() too, so introduce it. Signed-off-by: Ming Lei --- include/linux/bio.h | 34 +++--- include/linux/bvec.h | 36 2 files

[RESEND PATCH V5 02/33] block: rename rq_for_each_segment as rq_for_each_page

2018-05-24 Thread Ming Lei
rq_for_each_segment() still deceives us since this helper only returns one page in each bvec, so fixes its name. Signed-off-by: Ming Lei --- Documentation/block/biodoc.txt | 6 +++--- block/blk-core.c | 2 +- drivers/block/floppy.c | 4 ++-- drivers/block/loop.c

[RESEND PATCH V5 03/33] block: rename bio_segments() with bio_pages()

2018-05-24 Thread Ming Lei
bio_segments() never returns count of actual segment, just like original bio_for_each_segment(), so rename it as bio_pages(). Signed-off-by: Ming Lei --- block/bio.c| 2 +- block/blk-merge.c | 2 +- drivers/block/loop.c | 4 ++-- drivers/md

[RESEND PATCH V5 04/33] block: introduce multipage page bvec helpers

2018-05-24 Thread Ming Lei
current bvec iterator which is thought as singlepage only by drivers, fs, dm and etc. These helpers will build singlepage bvec in flight, so users of current bio/bvec iterator still can work well and needn't change even though we store real multipage segment into bvec table. Signed-off-by: Ming Lei

[RESEND PATCH V5 00/33] block: support multipage bvec

2018-05-24 Thread Ming Lei
://marc.info/?t=14982021534=1=2 Ming Lei (33): block: rename bio_for_each_segment* with bio_for_each_page* block: rename rq_for_each_segment as rq_for_each_page block: rename bio_segments() with bio_pages() block: introduce multipage page bvec helpers block: introduce

[RESEND PATCH V5 00/33] block: support multipage bvec

2018-05-24 Thread Ming Lei
://marc.info/?t=14982021534=1=2 Ming Lei (33): block: rename bio_for_each_segment* with bio_for_each_page* block: rename rq_for_each_segment as rq_for_each_page block: rename bio_segments() with bio_pages() block: introduce multipage page bvec helpers block: introduce

[PATCH V5 00/33] block: support multipage bvec

2018-05-24 Thread Ming Lei
://marc.info/?t=14982021534=1=2 Ming Lei (33): block: rename bio_for_each_segment* with bio_for_each_page* block: rename rq_for_each_segment as rq_for_each_page block: rename bio_segments() with bio_pages() block: introduce multipage page bvec helpers block: introduce

[PATCH V5 00/33] block: support multipage bvec

2018-05-24 Thread Ming Lei
://marc.info/?t=14982021534=1=2 Ming Lei (33): block: rename bio_for_each_segment* with bio_for_each_page* block: rename rq_for_each_segment as rq_for_each_page block: rename bio_segments() with bio_pages() block: introduce multipage page bvec helpers block: introduce

Re: Another NVMe failure, this time with AER info

2018-05-11 Thread Ming Lei
ered in hardware without > software intervention, and AER logs them for informational purposes. > > But it seems very likely that these corrected errors are related to > the nvme timeout: the first corrected errors were logged at > 12720.894411, nvme_io_timeout defaults to 30 seconds, and the nvme > timeout was at 12750.281158. The following patchset might help this issue: https://marc.info/?l=linux-block=152604179903505=2 -- Ming Lei

Re: Another NVMe failure, this time with AER info

2018-05-11 Thread Ming Lei
ware intervention, and AER logs them for informational purposes. > > But it seems very likely that these corrected errors are related to > the nvme timeout: the first corrected errors were logged at > 12720.894411, nvme_io_timeout defaults to 30 seconds, and the nvme > timeout was at 12750.281158. The following patchset might help this issue: https://marc.info/?l=linux-block=152604179903505=2 -- Ming Lei

Re: [PATCH 1/1] block: fix race between opening blkext device and freeing it

2018-05-09 Thread Ming Lei
gt; but this raid device is already in closing state and is > about to free internal structures, afterwards an oops > happens and mdadm gets killed. Looks the issue is still there, so could we consider Roman's approach for this issue? Thanks, Ming Lei

Re: [PATCH 1/1] block: fix race between opening blkext device and freeing it

2018-05-09 Thread Ming Lei
y in closing state and is > about to free internal structures, afterwards an oops > happens and mdadm gets killed. Looks the issue is still there, so could we consider Roman's approach for this issue? Thanks, Ming Lei

Re: PATCH V4 0/5 nvme-pci: fixes on nvme_timeout and nvme_dev_disable

2018-04-18 Thread Ming Lei
On Thu, Apr 19, 2018 at 09:51:16AM +0800, jianchao.wang wrote: > Hi Ming > > Thanks for your kindly response. > > On 04/18/2018 11:40 PM, Ming Lei wrote: > >> Regarding to this patchset, it is mainly to fix the dependency between > >> nvme_timeout and

Re: PATCH V4 0/5 nvme-pci: fixes on nvme_timeout and nvme_dev_disable

2018-04-18 Thread Ming Lei
On Thu, Apr 19, 2018 at 09:51:16AM +0800, jianchao.wang wrote: > Hi Ming > > Thanks for your kindly response. > > On 04/18/2018 11:40 PM, Ming Lei wrote: > >> Regarding to this patchset, it is mainly to fix the dependency between > >> nvme_timeout and

Re: PATCH V4 0/5 nvme-pci: fixes on nvme_timeout and nvme_dev_disable

2018-04-18 Thread Ming Lei
On Wed, Apr 18, 2018 at 10:24:28PM +0800, jianchao.wang wrote: > Hi Ming > > On 04/17/2018 11:17 PM, Ming Lei wrote: > > Looks blktest(block/011) can trigger IO hang easily on NVMe PCI device, > > and all are related with nvme_dev_disable(): > > > &g

Re: PATCH V4 0/5 nvme-pci: fixes on nvme_timeout and nvme_dev_disable

2018-04-18 Thread Ming Lei
On Wed, Apr 18, 2018 at 10:24:28PM +0800, jianchao.wang wrote: > Hi Ming > > On 04/17/2018 11:17 PM, Ming Lei wrote: > > Looks blktest(block/011) can trigger IO hang easily on NVMe PCI device, > > and all are related with nvme_dev_disable(): > > > &g

Re: PATCH V4 0/5 nvme-pci: fixes on nvme_timeout and nvme_dev_disable

2018-04-17 Thread Ming Lei
On Thu, Mar 08, 2018 at 02:19:26PM +0800, Jianchao Wang wrote: > Firstly, really appreciate Keith and Sagi's precious advice on previous > versions. > And this is the version 4. > > Some patches of the previous patchset have been submitted and the left is > this patchset > which has been

<    1   2   3   4   5   6   7   8   9   10   >