BUG: v4.20-rc5+ warning on two tests(xfstests ext4/034 and generic/406)

2018-12-07 Thread Ming Lei
079] EXT4-fs (sdb1): ext4_writepages: jbd2_start: 1024 pages, ino 407195; err -30 Thanks, Ming Lei

Re: [PATCH 2/2] loop: Better discard support for block devices

2018-11-27 Thread Ming Lei
On Tue, Oct 30, 2018 at 04:06:24PM -0700, Evan Green wrote: > If the backing device for a loop device is a block device, > then mirror the discard properties of the underlying block > device into the loop device. While in there, differentiate > between REQ_OP_DISCARD and REQ_OP_WRITE_ZEROES, which

[PATCH V12 05/20] block: remove bvec_iter_rewind()

2018-11-25 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. Signed-off-by: Ming Lei --- include/linux/bvec.h | 24 1 file changed, 24 deletions(-) diff --git a/include/linu

Re: [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: [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: [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: [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: [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: [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: [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: [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: [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: [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: [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: [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: [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: [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: [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: [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: [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: [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: [PATCH V10 05/19] block: introduce bvec_last_segment()

2018-11-18 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: [PATCH V10 04/19] block: use bio_for_each_bvec() to map sg

2018-11-18 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: [PATCH V10 03/19] block: use bio_for_each_bvec() to compute multi-page bvec count

2018-11-18 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: [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: [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

[PATCH V9 14/19] block: enable multipage bvecs

2018-11-13 Thread Ming Lei
This patch pulls the trigger for multi-page bvecs. Now any request queue which supports queue cluster will see multi-page bvecs. Cc: Christoph Hellwig Signed-off-by: Ming Lei --- block/bio.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/block

[PATCH V9 06/19] fs/buffer.c: use bvec iterator to truncate the bio

2018-11-13 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. Cc: Christoph Hellwig Cc: linux-fsde...@vger.kernel.org Signed-off-by: Ming Lei --- fs/buffer.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

Re: kobject lifetime issues in blk-mq

2018-11-12 Thread Ming Lei
On Tue, Nov 13, 2018 at 08:22:26AM +0800, Ming Lei wrote: > On Mon, Nov 12, 2018 at 12:02:36PM -0800, Greg Kroah-Hartman wrote: > > On Mon, Nov 12, 2018 at 08:48:48AM -0800, Guenter Roeck wrote: > > > On Mon, Nov 12, 2018 at 05:44:07PM +0800, Ming Lei wrote: > > > >

Re: Does the discard bug introduced in 4.19 by 744889b7cbb56a6 and fixed by 1adfc5e4136f5967 have potential for fstrim-caused corruption?

2018-11-11 Thread Ming Lei
On Sat, Nov 10, 2018 at 12:06:35AM -0800, Vito Caputo wrote: > I ask because I recently performed some fstrims on my 4.19-running > laptop after a good house cleaning, and things started going rather > haywire today at the filesystem level, on different filesystems of > differing types (ext2 and

Re: [PATCH] block: respect virtual boundary mask in bvecs

2018-11-05 Thread Ming Lei
On Mon, Nov 05, 2018 at 12:50:50PM +0100, Johannes Thumshirn wrote: > On 05/11/2018 11:55, Ming Lei wrote: > > On Mon, Nov 05, 2018 at 11:23:01AM +0100, Johannes Thumshirn wrote: > >> With drivers like iSer we are seeing a lot of bio splitting and smaller > >>

[tip:irq/core] genirq/affinity: Pass first vector to __irq_build_affinity_masks()

2018-11-05 Thread tip-bot for Ming Lei
Commit-ID: 060746d9e394084b7401e7532f2de528ecbfb521 Gitweb: https://git.kernel.org/tip/060746d9e394084b7401e7532f2de528ecbfb521 Author: Ming Lei AuthorDate: Fri, 2 Nov 2018 22:59:50 +0800 Committer: Thomas Gleixner CommitDate: Mon, 5 Nov 2018 12:16:26 +0100 genirq/affinity: Pass first

[tip:irq/core] genirq/affinity: Move two stage affinity spreading into a helper function

2018-11-05 Thread tip-bot for Ming Lei
Commit-ID: 5c903e108d0b005cf59904ca3520934fca4b9439 Gitweb: https://git.kernel.org/tip/5c903e108d0b005cf59904ca3520934fca4b9439 Author: Ming Lei AuthorDate: Fri, 2 Nov 2018 22:59:49 +0800 Committer: Thomas Gleixner CommitDate: Mon, 5 Nov 2018 12:16:26 +0100 genirq/affinity: Move two

[PATCH 2/4] irq: move 2-stage irq spread into one helper

2018-11-02 Thread Ming Lei
No functional change, and prepare for the following patch to support allocating (and affinitizing) sets of IRQs. Cc: Thomas Gleixner Cc: linux-kernel@vger.kernel.org Cc: Hannes Reinecke Cc: Ming Lei Cc: Keith Busch Cc: Sagi Grimberg Signed-off-by: Ming Lei --- kernel/irq/affinity.c | 92

[PATCH 4/4] irq: add support for allocating (and affinitizing) sets of IRQs

2018-11-02 Thread Ming Lei
Gleixner Cc: linux-kernel@vger.kernel.org Reviewed-by: Hannes Reinecke Reviewed-by: Ming Lei Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Jens Axboe Signed-off-by: Ming Lei --- drivers/pci/msi.c | 14 ++ include/linux/interrupt.h | 4 +++ kernel/irq

Re: [PATCH V2 1/3] blk-mq: refactor the code of issue request directly

2018-10-28 Thread Ming Lei
On Sat, Oct 27, 2018 at 12:01:09AM +0800, Jianchao Wang wrote: > Merge blk_mq_try_issue_directly and __blk_mq_try_issue_directly > into one interface which is able to handle the return value from > .queue_rq callback. Due to we can only issue directly w/o io > scheduler, so remove the

Re: [PATCH 0/7] hisi_sas: Misc bugfixes and an optimisation patch

2018-10-11 Thread Ming Lei
On Thu, Oct 11, 2018 at 02:12:11PM +0100, John Garry wrote: > On 11/10/2018 11:15, Christoph Hellwig wrote: > > On Thu, Oct 11, 2018 at 10:59:11AM +0100, John Garry wrote: > > > > > > > blk-mq tags are always per-host (which has actually caused problems for > > > > ATA, which is now using its own

[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: 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: [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: [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] 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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: [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 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-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

Re: [PATCH] blk-mq: start request gstate with gen 1

2018-04-16 Thread Ming Lei
fore the > scsi_cmnd is not initialized, scsi_cmnd->device is still NULL at > the moment, then we will get crash. > > Cc: Bart Van Assche <bart.vanass...@wdc.com> > Cc: Tejun Heo <t...@kernel.org> > Cc: Ming Lei <ming@redhat.com> > Cc: Martin Steigerwald

Re: [PATCH] blk-mq: mark hctx RESTART when get budget fails

2018-04-16 Thread Ming Lei
On Mon, Apr 16, 2018 at 03:55:36PM +0800, Jianchao Wang wrote: > When get budget fails, blk_mq_sched_dispatch_requests does not do > anything to ensure the hctx to be restarted. We can survive from > this, because only the scsi implements .get_budget and it always > runs the hctx queues when

Re: 4.15.14 crash with iscsi target and dvd

2018-04-12 Thread Ming Lei
On Thu, Apr 12, 2018 at 09:43:02PM -0400, Wakko Warner wrote: > Ming Lei wrote: > > On Tue, Apr 10, 2018 at 08:45:25PM -0400, Wakko Warner wrote: > > > Sorry for the delay. I reverted my change, added this one. I didn't > > > reboot, I just unloaded and loaded thi

Re: 4.15.14 crash with iscsi target and dvd

2018-04-12 Thread Ming Lei
On Tue, Apr 10, 2018 at 08:45:25PM -0400, Wakko Warner wrote: > Ming Lei wrote: > > Sure, thanks for your sharing. > > > > Wakko, could you test the following patch and see if there is any > > difference? > > > > -- > > diff --git a/drivers/tar

Re: 4.15.14 crash with iscsi target and dvd

2018-04-09 Thread Ming Lei
On Mon, Apr 09, 2018 at 07:43:01PM -0400, Wakko Warner wrote: > Ming Lei wrote: > > On Mon, Apr 09, 2018 at 09:30:11PM +, Bart Van Assche wrote: > > > Hello Ming, > > > > > > Can you have a look at this? The start of this e-mail thread is available > &g

Re: 4.15.14 crash with iscsi target and dvd

2018-04-09 Thread Ming Lei
ac60eb58b145839b5893e > > Author: Ming Lei <tom.leim...@gmail.com> > > Date: Fri Nov 11 20:05:32 2016 +0800 > > > > target: avoid accessing .bi_vcnt directly > > > > When the bio is full, bio_add_pc_page() will return zero, > > so

Re: [s390x] New regression was found on kernel-4.16

2018-04-09 Thread Ming Lei
On Mon, Apr 09, 2018 at 06:18:04PM +0800, Li Wang wrote: > Hi, > > I got this BUG_ON() on s390x platform with kernel-v4.16.0. > > [1.200196] [ cut here ] > [1.200201] kernel BUG at block/bio.c:1798! > [1.200228] illegal operation: 0001 ilc:1 [#1] SMP > [

Re: [s390x] New regression was found on kernel-4.16

2018-04-09 Thread Ming Lei
Hi Li Wang, On Mon, Apr 09, 2018 at 06:18:04PM +0800, Li Wang wrote: > Hi, > > I got this BUG_ON() on s390x platform with kernel-v4.16.0. Today I saw this bug too, from my first look, seems it is because that get_max_io_size() returns zero in blk_bio_segment_split(). And I trigger that in one

Re: [PATCH V3 4/4] genirq/affinity: irq vector spread among online CPUs as far as possible

2018-04-07 Thread Ming Lei
On Fri, Apr 06, 2018 at 11:49:47PM +0200, Thomas Gleixner wrote: > On Fri, 6 Apr 2018, Thomas Gleixner wrote: > > > On Fri, 6 Apr 2018, Ming Lei wrote: > > > > > > I will post V4 soon by using cpu_present_mask in the 1st stage irq spread. > > > And

[tip:irq/core] genirq/affinity: Spread irq vectors among present CPUs as far as possible

2018-04-06 Thread tip-bot for Ming Lei
Commit-ID: d3056812e7dfe6bf4f8ad9e397a9116dd5d32d15 Gitweb: https://git.kernel.org/tip/d3056812e7dfe6bf4f8ad9e397a9116dd5d32d15 Author: Ming Lei <ming@redhat.com> AuthorDate: Thu, 8 Mar 2018 18:53:58 +0800 Committer: Thomas Gleixner <t...@linutronix.de> CommitDate: Fri, 6

[tip:irq/core] genirq/affinity: Allow irq spreading from a given starting point

2018-04-06 Thread tip-bot for Ming Lei
Commit-ID: 1a2d0914e23aab386f5d5acb689777e24151c2c8 Gitweb: https://git.kernel.org/tip/1a2d0914e23aab386f5d5acb689777e24151c2c8 Author: Ming Lei <ming@redhat.com> AuthorDate: Thu, 8 Mar 2018 18:53:57 +0800 Committer: Thomas Gleixner <t...@linutronix.de> CommitDate: Fri, 6

[tip:irq/core] genirq/affinity: Rename *node_to_possible_cpumask as *node_to_cpumask

2018-04-06 Thread tip-bot for Ming Lei
Commit-ID: 47778f33dcba7feb92031643b37e477892f82b62 Gitweb: https://git.kernel.org/tip/47778f33dcba7feb92031643b37e477892f82b62 Author: Ming Lei <ming@redhat.com> AuthorDate: Thu, 8 Mar 2018 18:53:55 +0800 Committer: Thomas Gleixner <t...@linutronix.de> CommitDate: Fri, 6

  1   2   3   4   5   6   7   8   9   10   >