From: Niklas Cassel <Niklas.Cassel@wdc.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Damien Le Moal <Damien.LeMoal@wdc.com>,
Sagi Grimberg <sagi@grimberg.me>,
"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH 17/20] nvme: query namespae identifiers before adding the namespace
Date: Thu, 1 Oct 2020 17:43:23 +0000 [thread overview]
Message-ID: <20201001174321.GA343057@localhost.localdomain> (raw)
In-Reply-To: <20201001171457.GA29475@lst.de>
On Thu, Oct 01, 2020 at 07:14:57PM +0200, Christoph Hellwig wrote:
> On Wed, Sep 30, 2020 at 10:04:54AM +0000, Niklas Cassel wrote:
> > > For the subject of this patch:
> > > s/namespae/namespace
>
> Fixed and force pushed.
>
> > > nvme: remove the namespace identifier verification in __nvme_validate_ns
> > >
> > > None of the identifiers (including the new CSI) can cange over the life
> > > time of a namespace, so don't bother with the extra query here.
> > > "
> > >
> > > which now seems to have been squashed with this patch.
> > >
> > > Squashing it is fine, but perhaps you could add that information in this
> > > commit message?
> >
> > Hm..
> >
> > I now see that nvme_validate_or_alloc_ns() in v2 of this series does a
> > nvme_identify_ns_descs(), while nvme_validate_or_alloc_ns() in v1 doesnt.
> >
> > I don't see a change log, but considering this, my suggestion that you
> > the above sentence from the squashed v1 commit no longer makes sense.
> >
> > What was the reason for this change?
>
> Where does this this still show up in a change log?
The sentence only exists in the V1 patch series,
not in the V2 patch series. So that is all good.
My questions is rather:
In V1 nvme_validate_or_alloc_ns():
http://git.infradead.org/users/hch/misc.git/blob/refs/heads/nvme-scanning-cleanup:/drivers/nvme/host/core.c#l3975
You will only call nvme_identify_ns_descs() once, and once only per NSID,
in the nvme_alloc_ns() path.
Subsequent calls that goes through the nvme_validate_ns() path will not
call nvme_identify_ns_descs().
In V2 nvme_validate_or_alloc_ns():
http://git.infradead.org/users/hch/misc.git/blob/refs/heads/nvme-scanning-cleanup.2:/drivers/nvme/host/core.c#l3971
You will call nvme_identify_ns_descs() both for the initial nvme_alloc_ns()
path, but then also in each subsequent call, which goes through the
nvme_validate_ns() path.
V1 seems more optimized.
Since we know that none of the identifiers can change during the lifetime
of a namespace, why not do like V1, and only call it in the nvme_alloc_ns()
path?
Something like this:
static void nvme_validate_or_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
{
...
ns = nvme_find_get_ns(ctrl, nsid);
if (ns) {
nvme_validate_ns(ns, &ids);
nvme_put_ns(ns);
return;
}
/* only fetch the ns id desc list if we didn't find a ns */
if (nvme_identify_ns_descs(ctrl, nsid, &ids))
return;
switch (ids.csi) {
...
}
...
}
Is there something I'm missing, or why did you change this between V1 and V2?
Kind regards,
Niklas
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2020-10-01 17:43 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-28 12:34 refactor the nvme scanning and validation code Christoph Hellwig
2020-09-28 12:34 ` [PATCH 01/20] block: optimize blk_queue_zoned_model for !CONFIG_BLK_DEV_ZONED Christoph Hellwig
2020-09-28 14:11 ` Damien Le Moal
2020-09-29 8:29 ` Sagi Grimberg
2020-09-29 18:25 ` Christoph Hellwig
2020-09-29 21:12 ` Chaitanya Kulkarni
2020-09-28 12:34 ` [PATCH 02/20] nvme: fix initialization of the zone bitmaps Christoph Hellwig
2020-09-28 14:13 ` Damien Le Moal
2020-09-28 14:16 ` Damien Le Moal
2020-09-28 14:26 ` Christoph Hellwig
2020-09-29 21:27 ` Keith Busch
2020-09-28 12:34 ` [PATCH 03/20] nvme: remove the disk argument to nvme_update_zone_info Christoph Hellwig
2020-09-28 14:17 ` Damien Le Moal
2020-09-29 8:32 ` Sagi Grimberg
2020-09-29 21:15 ` Chaitanya Kulkarni
2020-09-28 12:34 ` [PATCH 04/20] nvme: rename nvme_validate_ns to nvme_validate_or_alloc_ns Christoph Hellwig
2020-09-28 14:19 ` Damien Le Moal
2020-09-29 8:33 ` Sagi Grimberg
2020-09-29 21:17 ` Chaitanya Kulkarni
2020-09-28 12:34 ` [PATCH 05/20] nvme: rename _nvme_revalidate_disk Christoph Hellwig
2020-09-28 14:20 ` Damien Le Moal
2020-09-29 8:34 ` Sagi Grimberg
2020-09-29 21:18 ` Chaitanya Kulkarni
2020-09-28 12:34 ` [PATCH 06/20] nvme: rename __nvme_revalidate_disk Christoph Hellwig
2020-09-28 14:21 ` Damien Le Moal
2020-09-29 8:35 ` Sagi Grimberg
2020-09-29 21:20 ` Chaitanya Kulkarni
2020-09-28 12:34 ` [PATCH 07/20] nvme: lift the check for an unallocated namespace into nvme_identify_ns Christoph Hellwig
2020-09-28 14:27 ` Damien Le Moal
2020-09-29 18:29 ` Christoph Hellwig
2020-09-29 8:36 ` Sagi Grimberg
2020-09-29 21:22 ` Chaitanya Kulkarni
2020-09-28 12:34 ` [PATCH 08/20] nvme: call nvme_identify_ns as the first thing in nvme_alloc_ns_block Christoph Hellwig
2020-09-28 14:32 ` Damien Le Moal
2020-09-29 8:39 ` Sagi Grimberg
2020-09-29 18:30 ` Christoph Hellwig
2020-09-29 21:24 ` Chaitanya Kulkarni
2020-09-28 12:34 ` [PATCH 09/20] nvme: factor out a nvme_configure_metadata helper Christoph Hellwig
2020-09-28 14:35 ` Damien Le Moal
2020-09-29 8:40 ` Sagi Grimberg
2020-09-29 21:27 ` Chaitanya Kulkarni
2020-09-28 12:34 ` [PATCH 10/20] nvme: freeze the queue over ->lba_shift updates Christoph Hellwig
2020-09-28 14:49 ` Damien Le Moal
2020-09-29 8:48 ` Sagi Grimberg
2020-09-29 18:32 ` Christoph Hellwig
2020-09-29 19:07 ` Sagi Grimberg
2020-10-02 16:03 ` Sagi Grimberg
2020-10-05 8:32 ` Christoph Hellwig
2020-09-28 12:34 ` [PATCH 11/20] nvme: clean up the check for too large logic block sizes Christoph Hellwig
2020-09-28 14:50 ` Damien Le Moal
2020-09-29 18:33 ` Christoph Hellwig
2020-09-29 8:50 ` Sagi Grimberg
2020-09-29 18:34 ` Christoph Hellwig
2020-09-28 12:34 ` [PATCH 12/20] nvme: remove the 0 lba_shift check in nvme_update_ns_info Christoph Hellwig
2020-09-28 14:51 ` Damien Le Moal
2020-09-29 8:52 ` Sagi Grimberg
2020-09-29 18:34 ` Christoph Hellwig
2020-09-29 21:46 ` Chaitanya Kulkarni
2020-09-28 12:34 ` [PATCH 13/20] nvme: set the queue limits " Christoph Hellwig
2020-09-28 14:55 ` Damien Le Moal
2020-09-29 8:54 ` Sagi Grimberg
2020-09-29 21:52 ` Chaitanya Kulkarni
2020-09-30 6:12 ` Christoph Hellwig
2020-09-28 12:34 ` [PATCH 14/20] nvme: update the known admin effects Christoph Hellwig
2020-09-28 14:57 ` Damien Le Moal
2020-09-29 8:55 ` Sagi Grimberg
2020-09-29 21:54 ` Chaitanya Kulkarni
2020-09-28 12:34 ` [PATCH 15/20] nvme: remove nvme_update_formats Christoph Hellwig
2020-09-28 15:02 ` Damien Le Moal
2020-09-28 12:34 ` [PATCH 16/20] nvme: revalidate zone bitmaps in nvme_update_ns_info Christoph Hellwig
2020-09-28 15:06 ` Damien Le Moal
2020-09-29 18:37 ` Christoph Hellwig
2020-09-28 12:34 ` [PATCH 17/20] nvme: query namespae identifiers before adding the namespace Christoph Hellwig
2020-09-28 15:11 ` Damien Le Moal
2020-09-30 9:44 ` Niklas Cassel
2020-09-30 10:04 ` Niklas Cassel
2020-10-01 17:14 ` Christoph Hellwig
2020-10-01 17:43 ` Niklas Cassel [this message]
2020-10-02 6:41 ` Christoph Hellwig
2020-09-28 12:35 ` [PATCH 18/20] nvme: move nvme_validate_ns Christoph Hellwig
2020-09-28 15:12 ` Damien Le Moal
2020-09-30 0:22 ` Chaitanya Kulkarni
2020-09-30 6:13 ` Christoph Hellwig
2020-09-28 12:35 ` [PATCH 19/20] nvme: refactor nvme_validate_ns Christoph Hellwig
2020-09-28 15:15 ` Damien Le Moal
2020-09-29 18:40 ` Christoph Hellwig
2020-09-28 12:35 ` [PATCH 20/20] nvme: remove nvme_identify_ns_list Christoph Hellwig
2020-09-29 23:59 ` Chaitanya Kulkarni
2020-09-29 16:51 ` refactor the nvme scanning and validation code Keith Busch
2020-09-30 6:41 ` Christoph Hellwig
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=20201001174321.GA343057@localhost.localdomain \
--to=niklas.cassel@wdc.com \
--cc=Damien.LeMoal@wdc.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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).