From: Ming Lei <ming.lei@redhat.com>
To: John Garry <john.garry@huawei.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
Hannes Reinecke <hare@suse.com>, Christoph Hellwig <hch@lst.de>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH V9 00/11] blk-mq: improvement CPU hotplug
Date: Mon, 4 May 2020 16:38:31 +0800 [thread overview]
Message-ID: <20200504083831.GA1139563@T590> (raw)
In-Reply-To: <5db8635b-b606-3dd9-ce1d-5280097acbd3@huawei.com>
On Mon, May 04, 2020 at 09:14:20AM +0100, John Garry wrote:
> On 03/05/2020 00:54, Ming Lei wrote:
> > Hi,
> >
> > Thomas mentioned:
> > "
> > That was the constraint of managed interrupts from the very beginning:
> > The driver/subsystem has to quiesce the interrupt line and the associated
> > queue _before_ it gets shutdown in CPU unplug and not fiddle with it
> > until it's restarted by the core when the CPU is plugged in again.
> > "
> >
> > But no drivers or blk-mq do that before one hctx becomes inactive(all
> > CPUs for one hctx are offline), and even it is worse, blk-mq stills tries
> > to run hw queue after hctx is dead, see blk_mq_hctx_notify_dead().
> >
> > This patchset tries to address the issue by two stages:
> >
> > 1) add one new cpuhp state of CPUHP_AP_BLK_MQ_ONLINE
> >
> > - mark the hctx as internal stopped, and drain all in-flight requests
> > if the hctx is going to be dead.
> >
> > 2) re-submit IO in the state of CPUHP_BLK_MQ_DEAD after the hctx becomes dead
> >
> > - steal bios from the request, and resubmit them via generic_make_request(),
> > then these IO will be mapped to other live hctx for dispatch
> >
> > Thanks John Garry for running lots of tests on arm64 with this patchset
> > and co-working on investigating all kinds of issues.
> >
> > Thanks Christoph's review on V7.
> >
> > Please comment & review, thanks!
> >
>
> Hi Ming,
>
> Bad news, I see this on the first hotplug loop:
>
> [66.628964] CPU2: shutdown
> [66.631663] psci: CPU2 killed (polled 0 ms)
> [66.681062] CPU3: shutdown
> [66.683761] psci: CPU3 killed (polled 0 ms)
> [66.717097] CPU4: shutdown
> [66.719796] psci: CPU4 killed (polled 0 ms)
> [66.753136] CPU5: shutdown
> [66.755834] psci: CPU5 killed (polled 0 ms)
> [66.801234] CPU6: shutdown=2746MiB/s,w=0KiB/s][r=703k,w=0 IOPS][eta 00m:55s]
> [66.803932] psci: CPU6 killed (polled 0 ms)
> [66.837170] irq_shutdown irq150
> [66.840410] CPU7: shutdown
> [66.843112] psci: CPU7 killed (polled 0 ms)
> [66.885394] CPU8: shutdown
> [66.888092] psci: CPU8 killed (polled 0 ms)
> [66.925431] CPU9: shutdown
> [66.928128] psci: CPU9 killed (polled 0 ms)
> [66.965526] CPU10: shutdown
> [66.968311] psci: CPU10 killed (polled 0 ms)
> [67.025569] irq_shutdown irq151
> [67.028808] CPU11: shutdown
> [67.031599] psci: CPU11 killed (polled 0 ms)
> [67.306393] CPU12: shutdown
> [67.309179] psci: CPU12 killed (polled 0 ms)
> [67.347266] CPU13: shutdown
> [67.350058] psci: CPU13 killed (polled 0 ms)
> [67.410910] CPU14: shutdown
> [67.413695] psci: CPU14 killed (polled 0 ms)
> [67.454453] irq_shutdown irq152
> [67.457699] CPU15: shutdown
> [67.457799] ------------[ cut here ]------------
> [67.460506] psci: CPU15 killed (polled 0 ms)
> [67.465091] refcount_t: underflow; use-after-free.
> [67.465112] WARNING: CPU: 0 PID: 557 at lib/refcount.c:28
> refcount_warn_saturate+0x6c/0x13c
> [67.482468] Modules linked in:
> [67.485511] CPU: 0 PID: 557 Comm: irq/149-hisi_sa Not tainted
> 5.7.0-rc2-13190-gb615db31b5f4 #331
> [67.494281] Hardware name: Huawei Taishan 2280 /D05, BIOS Hisilicon D05 IT21
> Nemo 2.0 RC0 04/18/2018
> [67.503398] pstate: 20000005 (nzCv daif -PAN -UAO)
> [67.508176] pc : refcount_warn_saturate+0x6c/0x13c
> [67.512954] lr : refcount_warn_saturate+0x6c/0x13c
> [67.517730] sp : ffff80001fd3b920
> [67.521031] x29: ffff80001fd3b920 x28: ffff001f9c549500
> [67.526329] x27: ffff001f9c54956c x26: 000000000000d8d0
> [67.531627] x25: ffff001fb08c7378 x24: 0000000000000000
> [67.536925] x23: ffff001f9a6eef00 x22: 0000000000000000
> [67.542223] x21: 0000000000001000 x20: ffff001f9ebd0918
> [67.547521] x19: ffff001f9a6eef00 x18: 0000000000000000
> [67.552820] x17: 000000007fffffff x16: 0000000000000311
> [67.558118] x15: 000000000001ffff x14: 0000000000000001
> [67.563416] x13: 000000000000001f x12: 0000000000000000
> [67.568714] x11: ffff800011aca468 x10: 0000000000fddfa0
> [67.574012] x9 : 0000000000000000 x8 : ffff041faa022098
> [67.579310] x7 : 0000000000000000 x6 : ffff001ffbe871d0
> [67.584608] x5 : 0000000000000001 x4 : 0000000000000000
> [67.589906] x3 : 0000000000000000 x2 : 0000000000000007
> [67.595204] x1 : 0000000100000001 x0 : 0000000000000026
> [67.600503] Call trace:
> [67.602937] refcount_warn_saturate+0x6c/0x13c
> [67.607369] aio_complete_rw+0x350/0x384
> [67.611279] blkdev_bio_end_io+0xc4/0x12c
> [67.615276] bio_endio+0x104/0x130
> [67.618665] blk_update_request+0x98/0x37c
> [67.622748] blk_mq_end_request+0x24/0x138
> [67.626831] blk_mq_resubmit_end_rq+0x40/0x58
> [67.631174] __blk_mq_end_request+0xb0/0x10c
> [67.635432] scsi_end_request+0xdc/0x20c
Looks an old issue, I believe the following patch can fix the issue:
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 12dee4ecd5cc..3fc79d4b2fe0 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2415,6 +2415,10 @@ static void blk_mq_resubmit_rq(struct request *rq)
nrq->bio = rq->bio;
nrq->biotail = rq->biotail;
+ /* Now all bios ownership is transfered to 'nrq' */
+ rq->bio = rq->biotail = NULL;
+ rq->__data_len = 0;
+
if (blk_insert_cloned_request(nrq->q, nrq) != BLK_STS_OK)
blk_mq_request_bypass_insert(nrq, false, true);
}
Thanks,
Ming
next prev parent reply other threads:[~2020-05-04 8:38 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-02 23:54 [PATCH V9 00/11] blk-mq: improvement CPU hotplug Ming Lei
2020-05-02 23:54 ` [PATCH V9 01/11] block: clone nr_integrity_segments and write_hint in blk_rq_prep_clone Ming Lei
2020-05-02 23:54 ` [PATCH V9 02/11] block: add helper for copying request Ming Lei
2020-05-02 23:54 ` [PATCH V9 03/11] blk-mq: mark blk_mq_get_driver_tag as static Ming Lei
2020-05-02 23:54 ` [PATCH V9 04/11] blk-mq: assign rq->tag in blk_mq_get_driver_tag Ming Lei
2020-05-02 23:54 ` [PATCH V9 05/11] blk-mq: support rq filter callback when iterating rqs Ming Lei
2020-05-04 7:04 ` Hannes Reinecke
2020-05-02 23:54 ` [PATCH V9 06/11] blk-mq: prepare for draining IO when hctx's all CPUs are offline Ming Lei
2020-05-02 23:54 ` [PATCH V9 07/11] blk-mq: stop to handle IO and drain IO before hctx becomes inactive Ming Lei
2020-05-02 23:54 ` [PATCH V9 08/11] block: add blk_end_flush_machinery Ming Lei
2020-05-02 23:54 ` [PATCH V9 09/11] blk-mq: add blk_mq_hctx_handle_dead_cpu for handling cpu dead Ming Lei
2020-05-02 23:54 ` [PATCH V9 10/11] blk-mq: re-submit IO in case that hctx is inactive Ming Lei
2020-05-02 23:54 ` [PATCH V9 11/11] block: deactivate hctx when the hctx is actually inactive Ming Lei
2020-05-04 8:14 ` [PATCH V9 00/11] blk-mq: improvement CPU hotplug John Garry
2020-05-04 8:38 ` Ming Lei [this message]
2020-05-04 9:07 ` John Garry
2020-05-04 9:57 ` John Garry
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=20200504083831.GA1139563@T590 \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=john.garry@huawei.com \
--cc=linux-block@vger.kernel.org \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).