public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Jens Axboe <axboe@kernel.dk>, Ming Lei <ming.lei@redhat.com>
Cc: linux-block@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>,
	Stefan Haberland <sth@linux.vnet.ibm.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues()
Date: Wed, 28 Mar 2018 09:45:10 +0200	[thread overview]
Message-ID: <ebd41c63-5b64-23a7-1914-4abdedf3c9b2@de.ibm.com> (raw)
In-Reply-To: <ab28ea2a-9061-a4bb-723f-7db46d9a61c2@kernel.dk>

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
[   21.454968] Modules linked in: scsi_dh_rdac scsi_dh_emc scsi_dh_alua dm_mirror dm_region_hash dm_log dm_multipath dm_mod autofs4
[   21.454984] CPU: 3 PID: 1882 Comm: dasdconf.sh Not tainted 4.16.0-rc7+ #26
[   21.454987] Hardware name: IBM 2964 NC9 704 (LPAR)
[   21.454990] Krnl PSW : 00000000c0131ea3 000000003ea2f7bf (__blk_mq_delay_run_hw_queue+0xbe/0xd8)
[   21.454996]            R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 RI:0 EA:3
[   21.455005] Krnl GPRS: 0000013abb69a000 0000013a00000000 0000013ac6c0dc00 0000000000000001
[   21.455008]            0000000000000000 0000013abb69a710 0000013a00000000 00000001b691fd98
[   21.455011]            00000001b691fd98 0000013ace4775c8 0000000000000001 0000000000000000
[   21.455014]            0000013ac6c0dc00 0000000000b47238 00000001b691fc08 00000001b691fbd0
[   21.455032] Krnl Code: 000000000069c596: ebaff0a00004	lmg	%r10,%r15,160(%r15)
                          000000000069c59c: c0f4ffff7a5e	brcl	15,68ba58
                         #000000000069c5a2: a7f40001		brc	15,69c5a4
                         >000000000069c5a6: e340f0c00004	lg	%r4,192(%r15)
                          000000000069c5ac: ebaff0a00004	lmg	%r10,%r15,160(%r15)
                          000000000069c5b2: 07f4		bcr	15,%r4
                          000000000069c5b4: c0e5fffffeea	brasl	%r14,69c388
                          000000000069c5ba: a7f4fff6		brc	15,69c5a6
[   21.455067] Call Trace:
[   21.455072] ([<00000001b691fd98>] 0x1b691fd98)
[   21.455079]  [<000000000069c692>] blk_mq_run_hw_queue+0xba/0x100 
[   21.455083]  [<000000000069c740>] blk_mq_run_hw_queues+0x68/0x88 
[   21.455089]  [<000000000069b956>] __blk_mq_complete_request+0x11e/0x1d8 
[   21.455091]  [<000000000069ba9c>] blk_mq_complete_request+0x8c/0xc8 
[   21.455103]  [<00000000008aa250>] dasd_block_tasklet+0x158/0x490 
[   21.455110]  [<000000000014c742>] tasklet_hi_action+0x92/0x120 
[   21.455118]  [<0000000000a7cfc0>] __do_softirq+0x120/0x348 
[   21.455122]  [<000000000014c212>] irq_exit+0xba/0xd0 
[   21.455130]  [<000000000010bf92>] do_IRQ+0x8a/0xb8 
[   21.455133]  [<0000000000a7c298>] io_int_handler+0x130/0x298 
[   21.455136] Last Breaking-Event-Address:
[   21.455138]  [<000000000069c5a2>] __blk_mq_delay_run_hw_queue+0xba/0xd8
[   21.455140] ---[ end trace be43f99a5d1e553e ]---
[   21.510046] dasdconf.sh Warning: 0.0.241e is already online, not configuring


On 03/28/2018 05:22 AM, Jens Axboe wrote:
> On 3/27/18 7:20 PM, Ming Lei wrote:
>> From commit 20e4d813931961fe ("blk-mq: simplify queue mapping & schedule
>> with each possisble CPU") on, it should be easier to see unmapped hctx
>> in some CPU topo, such as, hctx may not be mapped to any CPU.
>>
>> This patch avoids the warning in __blk_mq_delay_run_hw_queue() by
>> checking if the hctx is mapped in blk_mq_run_hw_queues().
>>
>> blk_mq_run_hw_queues() is often run in SCSI or some driver's completion
>> path, so this warning has to be addressed.
> 
> I don't like this very much. You're catching just one particular case,
> and if the hw queue has pending IO (for instance), then it's just wrong.
> 
> How about something like the below? Totally untested...
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 16e83e6df404..4c04ac124e5d 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -1307,6 +1307,14 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
>  	int srcu_idx;
> 
>  	/*
> +	 * Warn if the queue isn't mapped AND we have pending IO. Not being
> +	 * mapped isn't necessarily a huge issue, if we don't have pending IO.
> +	 */
> +	if (!blk_mq_hw_queue_mapped(hctx) &&
> +	    !WARN_ON_ONCE(blk_mq_hctx_has_pending(hctx)))
> +		return;
> +
> +	/*
>  	 * We should be running this queue from one of the CPUs that
>  	 * are mapped to it.
>  	 *
> 

  reply	other threads:[~2018-03-28  7:45 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28  1:20 [PATCH] blk-mq: only run mapped hw queues in blk_mq_run_hw_queues() Ming Lei
2018-03-28  3:22 ` Jens Axboe
2018-03-28  7:45   ` Christian Borntraeger [this message]
2018-03-28 14:38     ` Jens Axboe
2018-03-28 14:53       ` Jens Axboe
2018-03-28 15:38         ` Christian Borntraeger
2018-03-28 15:26     ` Ming Lei
2018-03-28 15:36       ` Christian Borntraeger
2018-03-28 15:44         ` Christian Borntraeger
2018-03-29  2:00         ` Ming Lei
2018-03-29  7:23           ` Christian Borntraeger
2018-03-29  9:09             ` Christian Borntraeger
2018-03-29  9:40               ` Ming Lei
2018-03-29 10:10                 ` Christian Borntraeger
2018-03-29 10:48                   ` Ming Lei
2018-03-29 10:49                     ` Christian Borntraeger
2018-03-29 11:43                       ` Ming Lei
2018-03-29 11:49                         ` Christian Borntraeger
2018-03-30  2:53                           ` Ming Lei
2018-04-04  8:18                             ` Christian Borntraeger
2018-04-05 16:05                               ` Ming Lei
2018-04-05 16:11                                 ` Ming Lei
2018-04-05 17:39                                   ` Christian Borntraeger
2018-04-05 17:43                                     ` Christian Borntraeger
2018-04-06  8:41                                     ` Ming Lei
2018-04-06  8:51                                       ` Christian Borntraeger
2018-04-06  8:53                                         ` Christian Borntraeger
2018-04-06  9:23                                         ` Ming Lei
2018-04-06 10:19                                           ` Christian Borntraeger
2018-04-06 13:41                                             ` Ming Lei
2018-04-06 14:26                                               ` Christian Borntraeger
2018-04-06 14:58                                                 ` Ming Lei
2018-04-06 15:11                                                   ` Christian Borntraeger
2018-04-06 15:40                                                     ` Ming Lei
2018-04-06 11:37                                           ` Christian Borntraeger
2018-04-06  8:35                                 ` Christian Borntraeger
2018-03-29  9:52             ` Ming Lei
2018-03-29 10:11               ` Christian Borntraeger
2018-03-29 10:12                 ` Christian Borntraeger
2018-03-29 10:13               ` Ming Lei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ebd41c63-5b64-23a7-1914-4abdedf3c9b2@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=sth@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox