Re: [block regression] kernel oops triggered by removing scsi device dring IO

2018-04-08 Thread Ming Lei
On Sun, Apr 08, 2018 at 05:25:42PM +0800, Ming Lei wrote: > On Sun, Apr 08, 2018 at 04:11:51PM +0800, Joseph Qi wrote: > > This is because scsi_remove_device() will call blk_cleanup_queue(), and > > then all blkgs have been destroyed and root_blkg is NULL. > > Thus tg is

[PATCH 8/8] blk-mq: remove code for dealing with remapping queue

2018-04-08 Thread Ming Lei
ctx. So queue mapping has became static and fixed just like percpu variable, and we don't need to handle queue remapping any more. Cc: Christian Borntraeger <borntrae...@de.ibm.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Stefan Haberland <s...@linux.vnet.ibm.com> Sig

[PATCH 6/8] blk-mq: don't check queue mapped in __blk_mq_delay_run_hw_queue()

2018-04-08 Thread Ming Lei
wig <h...@lst.de> Cc: Stefan Haberland <s...@linux.vnet.ibm.com> Signed-off-by: Ming Lei <ming@redhat.com> --- block/blk-mq.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 8743e9105612..3b4ce83a0ba2 100644 --- a/block/blk-mq.c +++ b/b

[PATCH 7/8] blk-mq: reimplement blk_mq_hw_queue_mapped

2018-04-08 Thread Ming Lei
com> Signed-off-by: Ming Lei <ming@redhat.com> --- block/blk-mq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq.h b/block/blk-mq.h index 88c558f71819..502af371b83b 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -181,7 +181,7 @@ static inline bool bl

[PATCH 4/8] blk-mq: introduce blk_mq_hw_queue_first_cpu() to figure out first cpu

2018-04-08 Thread Ming Lei
This patch introduces helper of blk_mq_hw_queue_first_cpu() for figuring out the hctx's first cpu, and code duplication can be avoided. Cc: Christian Borntraeger <borntrae...@de.ibm.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Stefan Haberland <s...@linux.vnet.ibm.com> Signe

[PATCH 3/8] blk-mq: avoid to write intermediate result to hctx->next_cpu

2018-04-08 Thread Ming Lei
linux.vnet.ibm.com> Signed-off-by: Ming Lei <ming@redhat.com> --- block/blk-mq.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 9b220dc415ac..a16efa6f2e7f 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@

[PATCH 2/8] blk-mq: don't keep offline CPUs mapped to hctx 0

2018-04-08 Thread Ming Lei
; Cc: Stefan Haberland <s...@linux.vnet.ibm.com> Cc: Keith Busch <keith.bu...@intel.com> Cc: sta...@vger.kernel.org Signed-off-by: Ming Lei <ming@redhat.com> --- block/blk-mq-cpumap.c | 5 - 1 file changed, 5 deletions(-) diff --git a/block/blk-mq-cpumap.c b/block/blk-mq-cpumap.c index 9f

[PATCH 1/8] blk-mq: make sure that correct hctx->next_cpu is set

2018-04-08 Thread Ming Lei
mask if all CPUs in hctx->cpumask are offline. Cc: Christian Borntraeger <borntrae...@de.ibm.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Stefan Haberland <s...@linux.vnet.ibm.com> Fixes: 20e4d81393196 ("blk-mq: simplify queue mapping & schedule with each possisble CPU&qu

[PATCH 0/8] blk-mq: fix and improve queue mapping

2018-04-08 Thread Ming Lei
-blk-fix_mapping_v1 Thanks, Ming Ming Lei (8): blk-mq: make sure that correct hctx->next_cpu is set blk-mq: don't keep offline CPUs mapped to hctx 0 blk-mq: avoid to write intermediate result to hctx->next_cpu blk-mq: introduce blk_mq_hw_queue_first_cpu() to figure out first cpu

Re: [block regression] kernel oops triggered by removing scsi device dring IO

2018-04-08 Thread Ming Lei
On Sun, Apr 08, 2018 at 04:11:51PM +0800, Joseph Qi wrote: > This is because scsi_remove_device() will call blk_cleanup_queue(), and > then all blkgs have been destroyed and root_blkg is NULL. > Thus tg is NULL and trigger NULL pointer dereference when get td from > tg (tg->td). > It seems that we

[block regression] kernel oops triggered by removing scsi device dring IO

2018-04-07 Thread Ming Lei
Hi, The following kernel oops is triggered by 'removing scsi device' during heavy IO. 'git bisect' shows that commit a063057d7c731cffa7d10740(block: Fix a race between request queue removal and the block cgroup controller) introduced this regression: [ 42.268257] BUG: unable to handle kernel

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

Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()

2018-04-06 Thread Ming Lei
On Fri, Apr 06, 2018 at 05:11:53PM +0200, Christian Borntraeger wrote: > > > On 04/06/2018 04:58 PM, Ming Lei wrote: > > On Fri, Apr 06, 2018 at 04:26:49PM +0200, Christian Borntraeger wrote: > >> > >> > >> On 04/06/2018 03:41 PM, Ming Lei wrote: >

Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()

2018-04-06 Thread Ming Lei
On Fri, Apr 06, 2018 at 04:26:49PM +0200, Christian Borntraeger wrote: > > > On 04/06/2018 03:41 PM, Ming Lei wrote: > > On Fri, Apr 06, 2018 at 12:19:19PM +0200, Christian Borntraeger wrote: > >> > >> > >> On 04/06/2018 11:23 AM, Ming Lei wrote: >

Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()

2018-04-06 Thread Ming Lei
On Fri, Apr 06, 2018 at 12:19:19PM +0200, Christian Borntraeger wrote: > > > On 04/06/2018 11:23 AM, Ming Lei wrote: > > On Fri, Apr 06, 2018 at 10:51:28AM +0200, Christian Borntraeger wrote: > >> > >> > >> On 04/06/2018 10:41 AM, Ming Lei wrote: >

Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()

2018-04-06 Thread Ming Lei
On Fri, Apr 06, 2018 at 10:51:28AM +0200, Christian Borntraeger wrote: > > > On 04/06/2018 10:41 AM, Ming Lei wrote: > > On Thu, Apr 05, 2018 at 07:39:56PM +0200, Christian Borntraeger wrote: > >> > >> > >> On 04/05/2018 06:11 PM, Ming Lei w

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

2018-04-06 Thread Ming Lei
Hi Thomas, On Wed, Apr 04, 2018 at 09:38:26PM +0200, Thomas Gleixner wrote: > On Wed, 4 Apr 2018, Ming Lei wrote: > > On Wed, Apr 04, 2018 at 10:25:16AM +0200, Thomas Gleixner wrote: > > > In the example above: > > > > > > > > > irq 39, cpu

Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()

2018-04-06 Thread Ming Lei
On Thu, Apr 05, 2018 at 07:39:56PM +0200, Christian Borntraeger wrote: > > > On 04/05/2018 06:11 PM, Ming Lei wrote: > >> > >> Could you please apply the following patch and provide the dmesg boot log? > > > > And please post out the 'lscpu' log together f

Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()

2018-04-05 Thread Ming Lei
On Fri, Apr 06, 2018 at 12:05:03AM +0800, Ming Lei wrote: > On Wed, Apr 04, 2018 at 10:18:13AM +0200, Christian Borntraeger wrote: > > > > > > On 03/30/2018 04:53 AM, Ming Lei wrote: > > > On Thu, Mar 29, 2018 at 01:49:29PM +0200, Christian Borntraeger wrote: >

Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()

2018-04-05 Thread Ming Lei
On Wed, Apr 04, 2018 at 10:18:13AM +0200, Christian Borntraeger wrote: > > > On 03/30/2018 04:53 AM, Ming Lei wrote: > > On Thu, Mar 29, 2018 at 01:49:29PM +0200, Christian Borntraeger wrote: > >> > >> > >> On 03/29/2018 01:43 PM, Ming Lei wrote: >

BUG: KASAN: use-after-free in bt_for_each+0x1ea/0x29f

2018-04-04 Thread Ming Lei
Hi, The following warning is observed once when running dbench on NVMe with the linus tree(top commit is 642e7fd23353). [ 1446.882043] == [ 1446.886884] BUG: KASAN: use-after-free in bt_for_each+0x1ea/0x29f [ 1446.888045] Read of

[PATCH] blk-mq: order getting budget and driver tag

2018-04-04 Thread Ming Lei
org Fixes: de1482974080ec9e ("blk-mq: introduce .get_budget and .put_budget in blk_mq_ops") Cc: Christoph Hellwig <h...@lst.de> Cc: Bart Van Assche <bart.vanass...@wdc.com> Cc: Omar Sandoval <osan...@fb.com> Signed-off-by: Ming Lei <ming@redhat.com> --- block/b

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

2018-04-04 Thread Ming Lei
On Wed, Apr 04, 2018 at 02:45:18PM +0200, Thomas Gleixner wrote: > On Wed, 4 Apr 2018, Thomas Gleixner wrote: > > I'm aware how that hw-queue stuff works. But that only works if the > > spreading algorithm makes the interrupts affine to offline/not-present CPUs > > when the block device is

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

2018-04-04 Thread Ming Lei
On Wed, Apr 04, 2018 at 10:25:16AM +0200, Thomas Gleixner wrote: > On Wed, 4 Apr 2018, Ming Lei wrote: > > On Tue, Apr 03, 2018 at 03:32:21PM +0200, Thomas Gleixner wrote: > > > On Thu, 8 Mar 2018, Ming Lei wrote: > > > > 1) before 84676c1f21 ("genirq/affin

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

2018-04-03 Thread Ming Lei
On Tue, Apr 03, 2018 at 03:32:21PM +0200, Thomas Gleixner wrote: > On Thu, 8 Mar 2018, Ming Lei wrote: > > 1) before 84676c1f21 ("genirq/affinity: assign vectors to all possible > > CPUs") > > irq 39, cpu list 0 > > irq 40, cpu list 1 > > ir

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

2018-03-29 Thread Ming Lei
Hi Thomas, On Fri, Mar 09, 2018 at 04:08:19PM +0100, Thomas Gleixner wrote: > On Fri, 9 Mar 2018, Ming Lei wrote: > > On Fri, Mar 09, 2018 at 11:08:54AM +0100, Thomas Gleixner wrote: > > > > > So my understanding is that these irq patches are enhancements and > >

Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()

2018-03-29 Thread Ming Lei
On Thu, Mar 29, 2018 at 01:49:29PM +0200, Christian Borntraeger wrote: > > > On 03/29/2018 01:43 PM, Ming Lei wrote: > > On Thu, Mar 29, 2018 at 12:49:55PM +0200, Christian Borntraeger wrote: > >> > >> > >> On 03/29/2018 12:48 PM, Ming Lei wrote: >

Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()

2018-03-29 Thread Ming Lei
On Thu, Mar 29, 2018 at 12:49:55PM +0200, Christian Borntraeger wrote: > > > On 03/29/2018 12:48 PM, Ming Lei wrote: > > On Thu, Mar 29, 2018 at 12:10:11PM +0200, Christian Borntraeger wrote: > >> > >> > >> On 03/29/2018 11:40 AM, Ming Lei wrote: >

Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()

2018-03-29 Thread Ming Lei
On Thu, Mar 29, 2018 at 12:10:11PM +0200, Christian Borntraeger wrote: > > > On 03/29/2018 11:40 AM, Ming Lei wrote: > > On Thu, Mar 29, 2018 at 11:09:08AM +0200, Christian Borntraeger wrote: > >> > >> > >> On 03/29/2018 09:23 AM, Christian Borntraeger

Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()

2018-03-29 Thread Ming Lei
On Thu, Mar 29, 2018 at 05:52:16PM +0800, Ming Lei wrote: > On Thu, Mar 29, 2018 at 09:23:10AM +0200, Christian Borntraeger wrote: > > > > > > On 03/29/2018 04:00 AM, Ming Lei wrote: > > > On Wed, Mar 28, 2018 at 05:36:53PM +0200, Christian Borntraeger wrote: >

Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()

2018-03-29 Thread Ming Lei
On Thu, Mar 29, 2018 at 09:23:10AM +0200, Christian Borntraeger wrote: > > > On 03/29/2018 04:00 AM, Ming Lei wrote: > > On Wed, Mar 28, 2018 at 05:36:53PM +0200, Christian Borntraeger wrote: > >> > >> > >> On 03/28/2018 05:26 PM, Ming Lei wrote: >

Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()

2018-03-29 Thread Ming Lei
On Thu, Mar 29, 2018 at 11:09:08AM +0200, Christian Borntraeger wrote: > > > On 03/29/2018 09:23 AM, Christian Borntraeger wrote: > > > > > > On 03/29/2018 04:00 AM, Ming Lei wrote: > >> On Wed, Mar 28, 2018 at 05:36:53PM +0200, Christian Borntraeger wrote

Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()

2018-03-28 Thread Ming Lei
Hi Christian, On Wed, Mar 28, 2018 at 09:45:10AM +0200, Christian Borntraeger wrote: > FWIW, this patch does not fix the issue for me: > > ostname=? addr=? terminal=? res=success' > [ 21.454961] WARNING: CPU: 3 PID: 1882 at block/blk-mq.c:1410 > __blk_mq_delay_run_hw_queue+0xbe/0xd8 > [

Re: [PATCH 3/3] nvme-pci: Separate IO and admin queue IRQ vectors

2018-03-27 Thread Ming Lei
e remaining managed vectors. > > In case a controller has only one interrupt vector available, the admin > and IO queues will share the pre_vector with all CPUs assigned. > > Cc: Jianchao Wang <jianchao.w.w...@oracle.com> > Cc: Ming Lei <ming@redhat.com> > Signed-

Re: [PATCH 2/3] nvme-pci: Remove unused queue parameter

2018-03-27 Thread Ming Lei
if (nvme_alloc_queue(dev, i, dev->q_depth, > - pci_irq_get_node(to_pci_dev(dev->dev), i - 1))) { > + if (nvme_alloc_queue(dev, i, dev->q_depth)) { > ret = -ENOMEM; > break; > } > -- > 2.14.3 > Reviewed-by: Ming Lei <ming@redhat.com> -- Ming

Re: [PATCH 1/3] blk-mq: Allow PCI vector offset for mapping queues

2018-03-27 Thread Ming Lei
inux/blk-mq-pci.h > index 6338551e0fb9..9f4c17f0d2d8 100644 > --- a/include/linux/blk-mq-pci.h > +++ b/include/linux/blk-mq-pci.h > @@ -5,6 +5,7 @@ > struct blk_mq_tag_set; > struct pci_dev; > > -int blk_mq_pci_map_queues(struct blk_mq_tag_set *set, struct pci_dev *pdev); > +int blk_mq_pci_map_queues(struct blk_mq_tag_set *set, struct pci_dev *pdev, > + int offset); > > #endif /* _LINUX_BLK_MQ_PCI_H */ > -- > 2.14.3 > Reviewed-by: Ming Lei <ming@redhat.com> -- Ming

[PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()

2018-03-27 Thread Ming Lei
uot;blk-mq: simplify queue mapping & schedule with each possisble CPU") Signed-off-by: Ming Lei <ming@redhat.com> --- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 16e83e6df404..48f25a63833b 100644 ---

Re: 4.16-RC7 WARNING: CPU: 2 PID: 0 at block/blk-mq.c:1400 __blk_mq_delay_run_hw_queue

2018-03-27 Thread Ming Lei
ks held by swapper/0/0: > [    2.170658]  #0:  (&(>lock)->rlock){..-.}, at: [<b45eaf9e>] > dasd_block_tasklet+0x1cc/0x480 > [    2.170676]  #1:  (rcu_read_lock){}, at: [<bc7fa045>] > hctx_lock+0x34/0x110 > [    2.170750] Last Breaking-Event-Address: > [

Re: [PATCH 1/3] blk-mq: Allow PCI vector offset for mapping queues

2018-03-25 Thread Ming Lei
On Fri, Mar 23, 2018 at 04:19:21PM -0600, Keith Busch wrote: > The PCI interrupt vectors intended to be associated with a queue may > not start at 0. This patch adds an offset parameter so blk-mq may find > the intended affinity mask. The default value is 0 so existing drivers > that don't care

Re: [PATCH 2/3] nvme-pci: Remove unused queue parameter

2018-03-25 Thread Ming Lei
On Fri, Mar 23, 2018 at 04:19:22PM -0600, Keith Busch wrote: > All nvme queue memory is allocated up front. We don't take the node > into consideration when creating queues anymore, so removing the unused > parameter. > > Signed-off-by: Keith Busch > --- >

Re: [PATCH V5 1/5] scsi: hpsa: fix selection of reply queue

2018-03-19 Thread Ming Lei
On Mon, Mar 19, 2018 at 04:42:09PM +0200, Artem Bityutskiy wrote: > On Mon, 2018-03-19 at 08:31 -0600, Jens Axboe wrote: > > I'm assuming that Martin will eventually queue this up. But probably > > for 4.17, then we can always flag it for a backport to stable once > > it's been thoroughly tested.

Re: [Possible REGRESSION, 4.16-rc4] Error updating SMART data during runtime and could not connect to lvmetad at some boot attempts

2018-03-13 Thread Ming Lei
On Tue, Mar 13, 2018 at 02:08:23PM +0100, Martin Steigerwald wrote: > Hans de Goede - 11.03.18, 15:37: > > Hi Martin, > > > > On 11-03-18 09:20, Martin Steigerwald wrote: > > > Hello. > > > > > > Since 4.16-rc4 (upgraded from 4.15.2 which worked) I have an issue > > > with SMART checks

[PATCH V5 4/5] scsi: virtio_scsi: fix IO hang caused by irq vector automatic affinity

2018-03-13 Thread Ming Lei
Paolo Bonzini <pbonz...@redhat.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Fixes: 84676c1f21e8 ("genirq/affinity: assign vectors to all possible CPUs") Signed-off-by: Ming Lei <ming@redhat.com> --- drivers/scsi/virtio_scsi.c | 59 +++--

[PATCH V5 2/5] scsi: megaraid_sas: fix selection of reply queue

2018-03-13 Thread Ming Lei
redhat.com> Cc: Mike Snitzer <snit...@redhat.com> Cc: Meelis Roos <mr...@linux.ee> Cc: Artem Bityutskiy <artem.bityuts...@intel.com> Fixes: 84676c1f21e8 ("genirq/affinity: assign vectors to all possible CPUs") Signed-off-by: Ming Lei <ming@redh

[PATCH V5 5/5] scsi: virtio_scsi: unify scsi_host_template

2018-03-13 Thread Ming Lei
en" <martin.peter...@oracle.com>, Cc: James Bottomley <james.bottom...@hansenpartnership.com>, Cc: Christoph Hellwig <h...@lst.de>, Cc: Paolo Bonzini <pbonz...@redhat.com> Cc: Mike Snitzer <snit...@redhat.com> Cc: Laurence Oberman <lober...@redhat.com> Cc: Ha

[PATCH V5 3/5] scsi: introduce force_blk_mq

2018-03-13 Thread Ming Lei
osemi.com> Cc: Kashyap Desai <kashyap.de...@broadcom.com> Cc: Mike Snitzer <snit...@redhat.com> Cc: Laurence Oberman <lober...@redhat.com> Reviewed-by: Hannes Reinecke <h...@suse.de> Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Ming Lei <ming@redhat.com>

[PATCH V5 1/5] scsi: hpsa: fix selection of reply queue

2018-03-13 Thread Ming Lei
..@intel.com> Acked-by: Don Brace <don.br...@microsemi.com> Fixes: 84676c1f21e8 ("genirq/affinity: assign vectors to all possible CPUs") Signed-off-by: Ming Lei <ming@redhat.com> --- drivers/scsi/hpsa.c | 73 +++-- drivers/s

[PATCH V5 0/5] SCSI: fix selection of reply(hw) queue

2018-03-13 Thread Ming Lei
- cover legacy vector for megaraid_sas(2/5) - patch style change (4/5) - add one virtio-scsi cleanup patch(5/5) V4: - splitted from previous patchset - handle virtio-scsi by force_blk_mq Ming Lei (5): scsi: hpsa: fix selection of reply queue scsi: megarai

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

2018-03-13 Thread Ming Lei
On Tue, Mar 13, 2018 at 09:38:41AM +0200, Artem Bityutskiy wrote: > On Tue, 2018-03-13 at 11:11 +0800, Dou Liyang wrote: > > I also > > met the situation that BIOS told to ACPI that it could support > > physical > > CPUs hotplug, But actually, there was no hardware slots in the > > machine. > >

Re: [PATCH V4 1/4] scsi: hpsa: fix selection of reply queue

2018-03-12 Thread Ming Lei
On Mon, Mar 12, 2018 at 08:52:02AM +0100, Christoph Hellwig wrote: > On Sat, Mar 10, 2018 at 11:01:43PM +0800, Ming Lei wrote: > > > I really dislike this being open coded in drivers. It really should > > > be helper chared with the blk-mq map building that drivers just use.

Re: [PATCH V2] nvme-pci: assign separate irq vectors for adminq and ioq0

2018-03-12 Thread Ming Lei
On Fri, Mar 09, 2018 at 10:24:45AM -0700, Keith Busch wrote: > On Thu, Mar 08, 2018 at 08:42:20AM +0100, Christoph Hellwig wrote: > > > > So I suspect we'll need to go with a patch like this, just with a way > > better changelog. > > I have to agree this is required for that use case. I'll run

Re: [PATCH V4 4/4] scsi: virtio_scsi: fix IO hang caused by irq vector automatic affinity

2018-03-12 Thread Ming Lei
On Sat, Mar 10, 2018 at 11:15:20AM +0100, Christoph Hellwig wrote: > This looks generally fine to me: > > Reviewed-by: Christoph Hellwig > > As a follow on we should probably kill virtscsi_queuecommand_single and > thus virtscsi_host_template_single as well. > > Given storage IO is

Re: [PATCH V4 1/4] scsi: hpsa: fix selection of reply queue

2018-03-10 Thread Ming Lei
On Sat, Mar 10, 2018 at 11:09:59AM +0100, Christoph Hellwig wrote: > > +static void hpsa_setup_reply_map(struct ctlr_info *h) > > +{ > > + const struct cpumask *mask; > > + unsigned int queue, cpu; > > + > > + for (queue = 0; queue < h->msix_vectors; queue++) { > > + mask =

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

2018-03-09 Thread Ming Lei
On Fri, Mar 09, 2018 at 11:08:54AM +0100, Thomas Gleixner wrote: > On Fri, 9 Mar 2018, Ming Lei wrote: > > On Fri, Mar 09, 2018 at 12:20:09AM +0100, Thomas Gleixner wrote: > > > On Thu, 8 Mar 2018, Ming Lei wrote: > > > > Actually, it isn't a real fix, the re

Re: [PATCH V4 2/4] scsi: megaraid_sas: fix selection of reply queue

2018-03-09 Thread Ming Lei
On Fri, Mar 09, 2018 at 04:37:56PM +0530, Kashyap Desai wrote: > > -Original Message- > > From: Ming Lei [mailto:ming@redhat.com] > > Sent: Friday, March 9, 2018 9:02 AM > > To: James Bottomley; Jens Axboe; Martin K . Petersen > > Cc: Christoph Hellw

Re: [PATCH V3 8/8] scsi: megaraid: improve scsi_mq performance via .host_tagset

2018-03-09 Thread Ming Lei
On Fri, Mar 09, 2018 at 12:26:57PM +0530, Kashyap Desai wrote: > > -Original Message- > > From: Ming Lei [mailto:ming@redhat.com] > > Sent: Thursday, March 8, 2018 4:54 PM > > To: Kashyap Desai > > Cc: Jens Axboe; linux-block@vger.kernel.org; Chr

Re: [PATCH V4 0/4] SCSI: fix selection of reply(hw) queue

2018-03-08 Thread Ming Lei
On Fri, Mar 09, 2018 at 08:00:52AM +0100, Hannes Reinecke wrote: > On 03/09/2018 04:32 AM, Ming Lei wrote: > > Hi All, > > > > The patches fixes reply queue(virt-queue on virtio-scsi) selection on hpsa, > > megaraid_sa and virtio-scsi, and IO hang can be

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

2018-03-08 Thread Ming Lei
On Fri, Mar 09, 2018 at 09:00:08AM +0200, Artem Bityutskiy wrote: > On Fri, 2018-03-09 at 09:24 +0800, Ming Lei wrote: > > Hi Thomas, > > > > On Fri, Mar 09, 2018 at 12:20:09AM +0100, Thomas Gleixner wrote: > > > On Thu, 8 Mar 2018, Ming Lei wrote: > > > &g

[PATCH V4 3/4] scsi: introduce force_blk_mq

2018-03-08 Thread Ming Lei
osemi.com> Cc: Kashyap Desai <kashyap.de...@broadcom.com> Cc: Mike Snitzer <snit...@redhat.com> Cc: Laurence Oberman <lober...@redhat.com> Reviewed-by: Hannes Reinecke <h...@suse.de> Signed-off-by: Ming Lei <ming@redhat.com> --- drivers/scsi/hosts.c | 1 + inclu

[PATCH V4 4/4] scsi: virtio_scsi: fix IO hang caused by irq vector automatic affinity

2018-03-08 Thread Ming Lei
d-by: Paolo Bonzini <pbonz...@redhat.com> Fixes: 84676c1f21e8 ("genirq/affinity: assign vectors to all possible CPUs") Signed-off-by: Ming Lei <ming@redhat.com> --- drivers/scsi/virtio_scsi.c | 59 +++--- 1 file changed, 3 insertions(+),

[PATCH V4 1/4] scsi: hpsa: fix selection of reply queue

2018-03-08 Thread Ming Lei
dhat.com> Cc: Meelis Roos <mr...@linux.ee> Cc: Artem Bityutskiy <artem.bityuts...@intel.com> Cc: Mike Snitzer <snit...@redhat.com> Tested-by: Laurence Oberman <lober...@redhat.com> Tested-by: Don Brace <don.br...@microsemi.com> Fixes: 84676c1f21e8 ("genirq/af

[PATCH V4 0/4] SCSI: fix selection of reply(hw) queue

2018-03-08 Thread Ming Lei
fix-V4 V4: - splitted from previous patchset - handle virtio-scsi by force_blk_mq Ming Lei (4): scsi: hpsa: fix selection of reply queue scsi: megaraid_sas: fix selection of reply queue scsi: introduce force_blk_mq scsi: virtio_scsi: fix IO hang caused by irq vector automatic affinity dr

Re: [PATCH V3 1/8] scsi: hpsa: fix selection of reply queue

2018-03-08 Thread Ming Lei
On Wed, Mar 07, 2018 at 09:11:37AM -0500, Laurence Oberman wrote: > On Tue, 2018-03-06 at 14:24 -0500, Martin K. Petersen wrote: > > Ming, > > > > > Given both Don and Laurence have verified that patch 1 and patch 2 > > > does fix IO hang, could you consider to merge the two first? > > > > Oh,

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

2018-03-08 Thread Ming Lei
On Thu, Mar 08, 2018 at 03:18:33PM +0200, Artem Bityutskiy wrote: > On Thu, 2018-03-08 at 18:53 +0800, Ming Lei wrote: > > Hi, > > > > This patchset tries to spread among online CPUs as far as possible, so > > that we can avoid to allocate too less irq vectors

Re: [PATCH V3 8/8] scsi: megaraid: improve scsi_mq performance via .host_tagset

2018-03-08 Thread Ming Lei
On Thu, Mar 08, 2018 at 07:06:25PM +0800, Ming Lei wrote: > On Thu, Mar 08, 2018 at 03:34:31PM +0530, Kashyap Desai wrote: > > > -Original Message- > > > From: Ming Lei [mailto:ming@redhat.com] > > > Sent: Thursday, March 8, 2018 6:46 AM > > >

Re: [PATCH V3 8/8] scsi: megaraid: improve scsi_mq performance via .host_tagset

2018-03-08 Thread Ming Lei
On Thu, Mar 08, 2018 at 03:34:31PM +0530, Kashyap Desai wrote: > > -Original Message- > > From: Ming Lei [mailto:ming@redhat.com] > > Sent: Thursday, March 8, 2018 6:46 AM > > To: Kashyap Desai > > Cc: Jens Axboe; linux-block@vger.kernel.org; Chr

Re: [PATCH V3 7/8] scsi: hpsa: improve scsi_mq performance via .host_tagset

2018-03-08 Thread Ming Lei
On Thu, Mar 08, 2018 at 08:54:43AM +0100, Christoph Hellwig wrote: > > + /* 256 tags should be high enough to saturate device */ > > + int max_queues = DIV_ROUND_UP(h->scsi_host->can_queue, 256); > > + > > + /* per NUMA node hw queue */ > > + h->scsi_host->nr_hw_queues = min_t(int,

[PATCH V3 2/4] genirq/affinity: move actual irq vector spread into one helper

2018-03-08 Thread Ming Lei
No functional change, just prepare for converting to 2-stage irq vector spread. Cc: Thomas Gleixner <t...@linutronix.de> Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Ming Lei <ming@redhat.com> --- kernel/i

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

2018-03-08 Thread Ming Lei
-by: Laurence Oberman <lober...@redhat.com> Signed-off-by: Ming Lei <ming@redhat.com> --- kernel/irq/affinity.c | 35 +-- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index 616f040c5d02.

[PATCH V3 3/4] genirq/affinity: support to do irq vectors spread starting from any vector

2018-03-08 Thread Ming Lei
CPUs. Cc: Thomas Gleixner <t...@linutronix.de> Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Ming Lei <ming@redhat.com> --- kernel/irq/affinity.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/kernel/irq/affin

[PATCH V3 1/4] genirq/affinity: rename *node_to_possible_cpumask as *node_to_cpumask

2018-03-08 Thread Ming Lei
The following patches will introduce two stage irq spread for improving irq spread on all possible CPUs. No funtional change. Cc: Thomas Gleixner <t...@linutronix.de> Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Ming Lei <ming@redhat.com> --- kernel/i

Re: [PATCH V2 3/5] genirq/affinity: move actual irq vector spread into one helper

2018-03-08 Thread Ming Lei
rong git tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Ming-Lei/genirq-affinity-irq-vector-spread-among-online-CPUs-as-far-as-possible/20180305-184912 > config: i386-randconfig-a1-201809 (attached as .config) > c

Re: [PATCH V3 4/8] blk-mq: introduce BLK_MQ_F_HOST_TAGS

2018-03-08 Thread Ming Lei
On Thu, Mar 08, 2018 at 08:52:52AM +0100, Christoph Hellwig wrote: > On Tue, Feb 27, 2018 at 06:07:46PM +0800, Ming Lei wrote: > > This patch can support to partition host-wide tags to multiple hw queues, > > so each hw queue related data structures(tags, hctx) can be accessed in &g

Re: [PATCH V3 1/8] scsi: hpsa: fix selection of reply queue

2018-03-08 Thread Ming Lei
On Thu, Mar 08, 2018 at 09:41:16AM +0100, Hannes Reinecke wrote: > On 03/08/2018 09:15 AM, Ming Lei wrote: > > On Thu, Mar 08, 2018 at 08:50:35AM +0100, Christoph Hellwig wrote: > >>> +static void hpsa_setup_reply_map(struct ctlr_info *h) > >>> +{ &

Re: [PATCH V3 1/8] scsi: hpsa: fix selection of reply queue

2018-03-08 Thread Ming Lei
On Thu, Mar 08, 2018 at 08:50:35AM +0100, Christoph Hellwig wrote: > > +static void hpsa_setup_reply_map(struct ctlr_info *h) > > +{ > > + const struct cpumask *mask; > > + unsigned int queue, cpu; > > + > > + for (queue = 0; queue < h->msix_vectors; queue++) { > > + mask =

Re: [PATCH V3 8/8] scsi: megaraid: improve scsi_mq performance via .host_tagset

2018-03-07 Thread Ming Lei
On Wed, Mar 07, 2018 at 10:58:34PM +0530, Kashyap Desai wrote: > > > > > > Also one observation using V3 series patch. I am seeing below Affinity > > > mapping whereas I have only 72 logical CPUs. It means we are really > > > not going to use all reply queues. > > > e.a If I bind fio jobs on CPU

Re: [PATCH V3 8/8] scsi: megaraid: improve scsi_mq performance via .host_tagset

2018-03-07 Thread Ming Lei
On Wed, Mar 07, 2018 at 08:31:31PM +0530, Kashyap Desai wrote: > > -Original Message- > > From: Ming Lei [mailto:ming@redhat.com] > > Sent: Wednesday, March 7, 2018 10:58 AM > > To: Kashyap Desai > > Cc: Jens Axboe; linux-block@vger.kernel.org; Chr

Re: [PATCH V3 8/8] scsi: megaraid: improve scsi_mq performance via .host_tagset

2018-03-06 Thread Ming Lei
On Wed, Feb 28, 2018 at 08:28:48PM +0530, Kashyap Desai wrote: > Ming - > > Quick testing on my setup - Performance slightly degraded (4-5% drop)for > megaraid_sas driver with this patch. (From 1610K IOPS it goes to 1544K) > I confirm that after applying this patch, we have #queue = #numa node.

Re: [PATCH V3 1/8] scsi: hpsa: fix selection of reply queue

2018-03-06 Thread Ming Lei
On Tue, Mar 06, 2018 at 02:24:25PM -0500, Martin K. Petersen wrote: > > Ming, > > > Given both Don and Laurence have verified that patch 1 and patch 2 > > does fix IO hang, could you consider to merge the two first? > > Oh, and I would still need a formal Acked-by: from Don and Tested-by: >

[PATCH V2] block: null_blk: fix 'Invalid parameters' when loading module

2018-03-05 Thread Ming Lei
l.org> Cc: Kyungchan Koh <kkc6...@fb.com>, Cc: weiping zhang <zhangweip...@didichuxing.com> Cc: Yi Zhang <yi.zh...@redhat.com> Reported-by: Yi Zhang <yi.zh...@redhat.com> Signed-off-by: Ming Lei <ming@redhat.com> --- drivers/block/null_blk.c | 46

Re: [PATCH] block: null_blk: fix 'Invalid parameters' failure when loading module

2018-03-05 Thread Ming Lei
On Mon, Mar 05, 2018 at 03:57:07PM +, Bart Van Assche wrote: > On Sat, 2018-03-03 at 10:24 +0800, Ming Lei wrote: > > struct nullb_page { > > struct page *page; > > - unsigned long bitmap; > > + unsigned long bitmap[DIV_ROUND_UP(MAP_SZ, sizeof(unsigned long

[PATCH V2 3/5] genirq/affinity: move actual irq vector spread into one helper

2018-03-04 Thread Ming Lei
No functional change, just prepare for converting to 2-stage irq vector spread. Cc: Thomas Gleixner <t...@linutronix.de> Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Ming Lei <ming@redhat.com> --- kernel/i

[PATCH V2 2/5] genirq/affinity: mark 'node_to_cpumask' as const for get_nodes_in_cpumask()

2018-03-04 Thread Ming Lei
Inside irq_create_affinity_masks(), once 'node_to_cpumask' is created, it is accessed read-only, so mark it as const for get_nodes_in_cpumask(). Cc: Thomas Gleixner <t...@linutronix.de> Cc: Christoph Hellwig <h...@lst.de> Signed-off-by: Ming Lei <ming@redhat.com> --- ker

[PATCH V2 4/5] genirq/affinity: support to do irq vectors spread starting from any vector

2018-03-04 Thread Ming Lei
CPUs. Cc: Thomas Gleixner <t...@linutronix.de> Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Ming Lei <ming@redhat.com> --- kernel/irq/affinity.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/kernel/irq/affin

[PATCH V2 5/5] genirq/affinity: irq vector spread among online CPUs as far as possible

2018-03-04 Thread Ming Lei
-by: Laurence Oberman <lober...@redhat.com> Signed-off-by: Ming Lei <ming@redhat.com> --- kernel/irq/affinity.c | 35 +-- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index a8c5d07890a6.

[PATCH V2 0/5] genirq/affinity: irq vector spread among online CPUs as far as possible

2018-03-04 Thread Ming Lei
to be allocated, otherwise performance can be hurt in current assignment. V2: - address coments from Christoph - mark irq_build_affinity_masks as static - move constification of get_nodes_in_cpumask's parameter into one prep patch - add Reviewed-by tag Thanks Ming Ming

Re: [PATCH V3 1/8] scsi: hpsa: fix selection of reply queue

2018-03-04 Thread Ming Lei
On Fri, Mar 02, 2018 at 04:53:21PM -0500, Laurence Oberman wrote: > On Fri, 2018-03-02 at 15:03 +, Don Brace wrote: > > > -Original Message- > > > From: Laurence Oberman [mailto:lober...@redhat.com] > > > Sent: Friday, March 02, 2018 8:09 AM > >

Re: [PATCH V3 1/8] scsi: hpsa: fix selection of reply queue

2018-03-01 Thread Ming Lei
On Thu, Mar 01, 2018 at 04:19:34PM -0500, Laurence Oberman wrote: > On Thu, 2018-03-01 at 14:01 -0500, Laurence Oberman wrote: > > On Thu, 2018-03-01 at 16:18 +, Don Brace wrote: > > > > -Original Message----- > > > > From: Ming Lei [mailto:ming@

Re: [PATCH V3 1/8] scsi: hpsa: fix selection of reply queue

2018-03-01 Thread Ming Lei
Hi Don, Thanks for your test! On Thu, Mar 01, 2018 at 04:18:17PM +, Don Brace wrote: > > -Original Message- > > From: Ming Lei [mailto:ming@redhat.com] > > Sent: Tuesday, February 27, 2018 4:08 AM > > To: Jens Axboe <ax...@kernel.dk>; linux-bl

Re: [PATCH V3 8/8] scsi: megaraid: improve scsi_mq performance via .host_tagset

2018-02-28 Thread Ming Lei
On Thu, Mar 01, 2018 at 10:54:17AM +0530, Kashyap Desai wrote: > > -Original Message- > > From: Laurence Oberman [mailto:lober...@redhat.com] > > Sent: Wednesday, February 28, 2018 9:52 PM > > To: Ming Lei; Kashyap Desai > > Cc: Jens Axboe; linux-block@vger

Re: [PATCH] mq-deadline: Make sure to always unlock zones

2018-02-28 Thread Ming Lei
t.vanass...@wdc.com> > [ bvanassche: edited patch description ] > Cc: Hannes Reinecke <h...@suse.com> > Cc: Ming Lei <ming@redhat.com> > --- > block/mq-deadline.c | 16 +--- > 1 file changed, 13 insertions(+), 3 deletions(-) > > diff --git a/b

Re: [PATCH V3 8/8] scsi: megaraid: improve scsi_mq performance via .host_tagset

2018-02-28 Thread Ming Lei
On Wed, Feb 28, 2018 at 08:28:48PM +0530, Kashyap Desai wrote: > Ming - > > Quick testing on my setup - Performance slightly degraded (4-5% drop)for > megaraid_sas driver with this patch. (From 1610K IOPS it goes to 1544K) > I confirm that after applying this patch, we have #queue = #numa node.

Re: [PATCH] blk-mq: Make sure that the affected zone is unlocked if a request times out

2018-02-27 Thread Ming Lei
Hi Damien, On Wed, Feb 28, 2018 at 02:21:49AM +, Damien Le Moal wrote: > Ming, > > On 2018/02/27 17:35, Ming Lei wrote: > > On Tue, Feb 27, 2018 at 04:28:30PM -0800, Bart Van Assche wrote: > >> If a request times out the .completed_request() method is not called &g

Re: [PATCH] blk-mq: Make sure that the affected zone is unlocked if a request times out

2018-02-27 Thread Ming Lei
rites are accepted for that zone. > > Fixes: 5700f69178e9 ("mq-deadline: Introduce zone locking support") > Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> > Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> > Cc: Hannes Reinecke <h...@suse.c

[PATCH V3 8/8] scsi: megaraid: improve scsi_mq performance via .host_tagset

2018-02-27 Thread Ming Lei
ce <don.br...@microsemi.com> Cc: Kashyap Desai <kashyap.de...@broadcom.com> Cc: Peter Rivera <peter.riv...@broadcom.com> Cc: Laurence Oberman <lober...@redhat.com> Cc: Hannes Reinecke <h...@suse.de> Cc: Mike Snitzer <snit...@redhat.com> Signed-off-by: Ming

[PATCH V3 7/8] scsi: hpsa: improve scsi_mq performance via .host_tagset

2018-02-27 Thread Ming Lei
ce <don.br...@microsemi.com> Cc: Kashyap Desai <kashyap.de...@broadcom.com> Cc: Peter Rivera <peter.riv...@broadcom.com> Cc: Laurence Oberman <lober...@redhat.com> Cc: Hannes Reinecke <h...@suse.de> Cc: Mike Snitzer <snit...@redhat.com> Signed-off-by: Ming Lei

[PATCH V3 5/8] scsi: Add template flag 'host_tagset'

2018-02-27 Thread Ming Lei
c: Mike Snitzer <snit...@redhat.com> Signed-off-by: Hannes Reinecke <h...@suse.com> Signed-off-by: Ming Lei <ming@redhat.com> --- drivers/scsi/scsi_lib.c | 2 ++ include/scsi/scsi_host.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scs

[PATCH V3 6/8] block: null_blk: introduce module parameter of 'g_host_tags'

2018-02-27 Thread Ming Lei
t;h...@lst.de>, Cc: Don Brace <don.br...@microsemi.com> Cc: Kashyap Desai <kashyap.de...@broadcom.com> Cc: Peter Rivera <peter.riv...@broadcom.com> Cc: Laurence Oberman <lober...@redhat.com> Cc: Hannes Reinecke <h...@suse.de> Cc: Mike Snitzer <snit...@redhat.com> Sig

[PATCH V3 4/8] blk-mq: introduce BLK_MQ_F_HOST_TAGS

2018-02-27 Thread Ming Lei
on Brace <don.br...@microsemi.com> Cc: Kashyap Desai <kashyap.de...@broadcom.com> Cc: Peter Rivera <peter.riv...@broadcom.com> Cc: Mike Snitzer <snit...@redhat.com> Cc: Laurence Oberman <lober...@redhat.com> Signed-off-by: Ming Lei <ming@redhat.com> ---

[PATCH V3 3/8] blk-mq: introduce 'start_tag' field to 'struct blk_mq_tags'

2018-02-27 Thread Ming Lei
kashyap.de...@broadcom.com> Cc: Peter Rivera <peter.riv...@broadcom.com> Cc: Mike Snitzer <snit...@redhat.com> Signed-off-by: Ming Lei <ming@redhat.com> --- block/blk-mq-tag.c | 3 ++- block/blk-mq-tag.h | 6 -- block/blk-mq.c | 7 --- 3 files changed, 10 insertions(+)

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