linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	<linux-block@vger.kernel.org>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	<linux-scsi@vger.kernel.org>,
	"Bart Van Assche" <bvanassche@acm.org>,
	Hannes Reinecke <hare@suse.com>,
	Keith Busch <keith.busch@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Don Brace <don.brace@microsemi.com>,
	Kashyap Desai <kashyap.desai@broadcom.com>,
	"Sathya Prakash" <sathya.prakash@broadcom.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH V2 5/5] blk-mq: Wait for for hctx inflight requests on CPU unplug
Date: Wed, 29 May 2019 10:42:00 +0100	[thread overview]
Message-ID: <5bc07fd5-9d2b-bf9c-eb77-b8cebadb9150@huawei.com> (raw)
In-Reply-To: <20190529024200.GC21398@ming.t460p>

On 29/05/2019 03:42, Ming Lei wrote:
> On Wed, May 29, 2019 at 10:28:52AM +0800, Ming Lei wrote:
>> On Tue, May 28, 2019 at 05:50:40PM +0100, John Garry wrote:
>>> On 27/05/2019 16:02, Ming Lei wrote:
>>>> Managed interrupts can not migrate affinity when their CPUs are offline.
>>>> If the CPU is allowed to shutdown before they're returned, commands
>>>> dispatched to managed queues won't be able to complete through their
>>>> irq handlers.
>>>>
>>>> Wait in cpu hotplug handler until all inflight requests on the tags
>>>> are completed or timeout. Wait once for each tags, so we can save time
>>>> in case of shared tags.
>>>>
>>>> Based on the following patch from Keith, and use simple delay-spin
>>>> instead.
>>>>
>>>> https://lore.kernel.org/linux-block/20190405215920.27085-1-keith.busch@intel.com/
>>>>
>>>> Some SCSI devices may have single blk_mq hw queue and multiple private
>>>> completion queues, and wait until all requests on the private completion
>>>> queue are completed.
>>>
>>> Hi Ming,
>>>
>>> I'm a bit concerned that this approach won't work due to ordering: it seems
>>> that the IRQ would be shutdown prior to the CPU dead notification for the
>>
>> Managed IRQ shutdown is run in irq_migrate_all_off_this_cpu(), which is
>> called in the callback of takedown_cpu(). And the CPU dead notification
>> is always sent after that CPU becomes offline, see cpuhp_invoke_callback().
>
> Hammm, looks we both say same thing.
>
> Yeah, it is too late to drain requests in the cpu hotplug DEAD handler,
> maybe we can try to move managed IRQ shutdown after sending the dead
> notification.
>

Even if the IRQ is shutdown later, all CPUs would still be dead, so none 
available to receive the interrupt or do the work for draining the queue.

> I need to think of it further.

It would seem that we just need to be informed of CPU offlining earlier, 
and plug the drain in there.

>

Cheers,
John

> Thanks,
> Ming
>
> .
>



  reply	other threads:[~2019-05-29  9:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27 15:02 [PATCH V2 0/5] blk-mq: Wait for for hctx inflight requests on CPU unplug Ming Lei
2019-05-27 15:02 ` [PATCH V2 1/5] scsi: select reply queue from request's CPU Ming Lei
2019-05-28  5:43   ` Hannes Reinecke
2019-05-28 10:33   ` John Garry
2019-05-29  2:36     ` Ming Lei
2019-05-27 15:02 ` [PATCH V2 2/5] blk-mq: introduce .complete_queue_affinity Ming Lei
2019-05-27 15:02 ` [PATCH V2 3/5] scsi: core: implement callback of .complete_queue_affinity Ming Lei
2019-05-27 15:02 ` [PATCH V2 4/5] scsi: implement .complete_queue_affinity Ming Lei
2019-05-27 15:02 ` [PATCH V2 5/5] blk-mq: Wait for for hctx inflight requests on CPU unplug Ming Lei
2019-05-28 16:50   ` John Garry
2019-05-29  2:28     ` Ming Lei
2019-05-29  2:42       ` Ming Lei
2019-05-29  9:42         ` John Garry [this message]
2019-05-29 10:10           ` Ming Lei
2019-05-29 15:33             ` Ming Lei
2019-05-29 16:10               ` John Garry
2019-05-30  2:28                 ` Ming Lei
2019-05-30  4:11                   ` Ming Lei
2019-05-30  9:31                   ` John Garry
2019-05-30  9:45                     ` 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=5bc07fd5-9d2b-bf9c-eb77-b8cebadb9150@huawei.com \
    --to=john.garry@huawei.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=don.brace@microsemi.com \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=kashyap.desai@broadcom.com \
    --cc=keith.busch@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ming.lei@redhat.com \
    --cc=sathya.prakash@broadcom.com \
    --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).