All of lore.kernel.org
 help / color / mirror / Atom feed
From: jianchao.w.wang@oracle.com (jianchao.wang)
Subject: [PATCHv4 3/4] nvme: Introduce frozen controller state
Date: Tue, 17 Jul 2018 13:49:17 +0800	[thread overview]
Message-ID: <bfd4154b-a8e0-8688-8b77-40a8041418e3@oracle.com> (raw)
In-Reply-To: <20180717012301.GB22593@ming.t460p>



On 07/17/2018 09:23 AM, Ming Lei wrote:
> On Mon, Jul 16, 2018@07:36:40AM -0600, Keith Busch wrote:
>> On Mon, Jul 16, 2018@07:09:04PM +0800, Ming Lei wrote:
>>> On Fri, Jul 13, 2018@02:56:08PM -0600, Keith Busch wrote:
>>>> +	if (ctrl->state == NVME_CTRL_FROZEN) {
>>>> +		nvme_wait_freeze(ctrl);
>>>> +		blk_mq_update_nr_hw_queues(ctrl->tagset, ctrl->queue_count - 1);
>>>> +		nvme_unfreeze(ctrl);
>>>> +		if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_LIVE))
>>>> +			return;
>>>> +	}
>>>> +
>>>
>>> Now you move unfreezing into start work function, seems this way can't
>>> guarantee that nvme_unfreeze() is strictly paired with nvme_start_freeze() done
>>> in nvme_dev_disable().
>>
>> The state machine is supposed to guarantee this. We only start freeze
>> in certain states from nvme_dev_disable, and transition to frozen when
>> exiting those states. I agree it's not the easiest API to follow, and
>> I'll double check to see if it's correct. I think I have the
>> reset/connecting/frozen/live transitions okay for nvme-pci, but I need
>> to look again at the deleting/dead states.
> 
> I am afraid that may not work well wrt. reset vs. timeout because
> timeout still may happen during reset on admin queue, and nvme_dev_disable()
> may call nvme_start_freeze() one more time, meantime reset_work won't be
> scheduled.
> 

Hi Ming

In nvme_dev_disable, except for the shutdown case which will try to drain the IO,
what we want is to stop new IO coming in. freeze queue interfaces looks too heavy,
after freeze, we have to wait for the q_usage_counter to be drained.
Is there any chance to just stop new IO coming in or just drain IO ?
For example, use another per-cpu-ref to track the IO.

Thanks
Jianchao

  reply	other threads:[~2018-07-17  5:49 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-13 20:56 [PATCHv4 0/4] nvme timeout updates Keith Busch
2018-07-13 20:56 ` [PATCHv4 1/4] nvme: Sync request queues on reset Keith Busch
2018-07-16  8:52   ` jianchao.wang
2018-07-16 10:39     ` Ming Lei
2018-07-16 13:30       ` Keith Busch
2018-07-17  5:37         ` jianchao.wang
2018-07-16 14:51   ` Sagi Grimberg
2018-07-16 15:37     ` Keith Busch
2018-07-16 16:36       ` Sagi Grimberg
2018-07-16 17:12         ` Keith Busch
2018-07-17 13:40           ` Christoph Hellwig
2018-07-17 14:54             ` Keith Busch
2018-07-18 11:46           ` Sagi Grimberg
2018-07-18 13:52             ` Keith Busch
2018-07-13 20:56 ` [PATCHv4 2/4] nvme: Start controller in own work queue Keith Busch
2018-07-16 15:00   ` Sagi Grimberg
2018-07-16 15:35     ` Keith Busch
2018-07-13 20:56 ` [PATCHv4 3/4] nvme: Introduce frozen controller state Keith Busch
2018-07-16  9:02   ` jianchao.wang
2018-07-16 11:09   ` Ming Lei
2018-07-16 13:36     ` Keith Busch
2018-07-17  1:23       ` Ming Lei
2018-07-17  5:49         ` jianchao.wang [this message]
2018-07-17  7:21           ` Ming Lei
2018-07-17  7:28             ` jianchao.wang
2018-07-17 14:32               ` Keith Busch
2018-07-18  2:57                 ` jianchao.wang
2018-07-17 14:06         ` Keith Busch
2018-07-16 16:34   ` Sagi Grimberg
2018-07-17 16:05     ` James Smart
2018-07-17 16:17       ` Keith Busch
2018-07-18 12:20         ` Sagi Grimberg
2018-07-18 13:53           ` Keith Busch
2018-07-13 20:56 ` [PATCHv4 4/4] nvme-pci: Use controller start work to dispath IO Keith Busch
2018-07-19 19:48 ` [PATCHv4 0/4] nvme timeout updates Scott Bauer

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=bfd4154b-a8e0-8688-8b77-40a8041418e3@oracle.com \
    --to=jianchao.w.wang@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.