From: hare@suse.de (Hannes Reinecke)
Subject: [PATCH 06/10] nvme: add ANA support
Date: Tue, 12 Jun 2018 10:45:44 +0200 [thread overview]
Message-ID: <20180612104544.4fd45421@pentland.suse.de> (raw)
In-Reply-To: <20180611141139.30462-7-hch@lst.de>
Hi Christoph,
after reviewing your patch (and my comment) I do agree that using a
per-controller timer will work if we are only worried about terminating
the timer eventually. So I retract my issues.
But during testing I found this:
On Mon, 11 Jun 2018 16:11:35 +0200
Christoph Hellwig <hch@lst.de> wrote:
[ .. ]
> +
> +static int nvme_update_ana_state(struct nvme_ctrl *ctrl,
> + struct nvme_ana_group_desc *desc, void *data)
> +{
> + u32 nr_nsids = le32_to_cpu(desc->nnsids), n = 0;
> + unsigned *nr_change_groups = data;
> + struct nvme_ns *ns;
> +
> + dev_info(ctrl->device, "ANA group %d: %s.\n",
> + le32_to_cpu(desc->grpid),
> + nvme_ana_state_names[desc->state]);
> +
> + if (!nr_nsids)
> + return 0;
> +
This will cause any 'change' state during runtime never to be evaluated
as we're setting the RGO bit, and consequently 'nnsids' is zero:
[ 326.612670] nvme nvme1: ANATT timeout, resetting controller.
[ 326.613761] nvme nvme1: Cancel ANATT timer
[ 326.637365] nvme nvme1: ANA group 1: optimized.
[ 326.637369] nvme nvme1: ANA group 2: change.
[ 326.637372] nvme nvme1: ANA group 3: optimized.
[ 326.637374] nvme nvme1: Stop ANATT timer
[ 326.637938] nvme nvme1: creating 1 I/O queues.
better to use a label here to skip namespace evaluation.
> + down_write(&ctrl->namespaces_rwsem);
> + list_for_each_entry(ns, &ctrl->namespaces, list) {
> + if (ns->head->ns_id != le32_to_cpu(desc->nsids[n]))
> + continue;
> + nvme_update_ns_ana_state(desc, ns);
> + if (++n == nr_nsids)
> + break;
> + }
> + up_write(&ctrl->namespaces_rwsem);
> + WARN_ON_ONCE(n < nr_nsids);
> +
And jump to here:
> + if (desc->state == NVME_ANA_CHANGE)
> + (*nr_change_groups)++;
> + return 0;
> +}
> +
With that we're tracking 'change' states correctly.
Cheers,
Hannes
next prev parent reply other threads:[~2018-06-12 8:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-11 14:11 draft ANA support v4 Christoph Hellwig
2018-06-11 14:11 ` [PATCH 01/10] nvme: don't rely on the changed namespace list log Christoph Hellwig
2018-06-12 6:02 ` Hannes Reinecke
2018-06-11 14:11 ` [PATCH 02/10] nvme.h: add support for the log specific field Christoph Hellwig
2018-06-11 14:11 ` [PATCH 03/10] nvme.h: add ANA definitions Christoph Hellwig
2018-06-11 14:11 ` [PATCH 04/10] nvme: simplify the API for getting log pages Christoph Hellwig
2018-06-11 14:11 ` [PATCH 05/10] nvme: remove nvme_req_needs_failover Christoph Hellwig
2018-06-11 14:11 ` [PATCH 06/10] nvme: add ANA support Christoph Hellwig
2018-06-12 8:45 ` Hannes Reinecke [this message]
2018-06-13 7:38 ` Christoph Hellwig
2018-06-11 14:11 ` [PATCH 07/10] nvmet: keep a port pointer in nvmet_ctrl Christoph Hellwig
2018-06-12 6:02 ` Hannes Reinecke
2018-06-11 14:11 ` [PATCH 08/10] nvmet: track and limit the number of namespaces per subsystem Christoph Hellwig
2018-06-11 14:11 ` [PATCH 09/10] nvmet: add minimal ANA support Christoph Hellwig
2018-06-11 14:11 ` [PATCH 10/10] nvmet: support configuring ANA groups Christoph Hellwig
2018-06-12 6:08 ` Hannes Reinecke
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=20180612104544.4fd45421@pentland.suse.de \
--to=hare@suse.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