linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "Williams, Dan J" <dan.j.williams@intel.com>
Cc: "aneesh.kumar@linux.ibm.com" <aneesh.kumar@linux.ibm.com>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [ndctl PATCH 2/2] ndctl/namespace: introduce ndctl_namespace_is_configurable()
Date: Mon, 4 Nov 2019 18:48:06 +0000	[thread overview]
Message-ID: <4e09051006f7714344c1d230061de0cfcb5377a9.camel@intel.com> (raw)
In-Reply-To: <CAPcyv4jWXXUgjd-_hsP+sUjBRfwQZQQOSUHUqSrdEYzfz3oS-g@mail.gmail.com>

On Mon, 2019-11-04 at 08:35 -0800, Dan Williams wrote:
> On Fri, Nov 1, 2019 at 1:27 PM Vishal Verma <vishal.l.verma@intel.com> wrote:
> > The motivation for this change is that we want to refrain from
> > (re)configuring what appear to be partially configured namespaces.
> > Namespaces may end up in a state that looks partially configured when
> > the kernel isn't able to enable a namespace due to mismatched
> > PAGE_SIZE expectations. In such cases, ndctl should not treat those
> > as unconfigured 'seed' namespaces, and reuse them.
> > 
> > Add a new ndctl_namespace_is_configurable API, whish tests whether a
> > namespaces is active, and whether it is partially configured. If neither
> > are true, then it can be used for (re)configuration. Additionally, deal
> > with the corner case of ND_DEVICE_NAMESPACE_IO (legacy PMEM) namespaces
> > by testing whether the size attribute is read-only (which indicates such
> > a namespace). Legacy namespaces always appear as configured, since their
> > size cannot be changed, but they are also always re-configurable.
> > 
> > Use this API in namespace_reconfig() and namespace_create() to enable
> > this partial configuration detection.
> 
> A couple comments.... I think it's probably sufficient to just check
> for ND_DEVICE_NAMESPACE_IO as I don't anticipate we'll ever have more
> than one namespace type with a read-only size attribute.

Yep I did notice I could do that, but I decided to go to the source of
it instead of adding another ND_DEVICE_NAMESPACE_IO assumption. Also I
had already written sysfs_attr_writable() before I noticed that :)
But there are already assumptions around ND_DEVICE_NAMESPACE_IO, so
adding another one here is fine.

> Also, how about s/ndctl_namespace_is_configurable/ndctl_namespace_is_configuration_idle/?
> Because to me all namespaces are always "configurable", but some may
> have active non-default properties set.

Sounds reasonable, but how about ndctl_namespace_has_partial_config(),
which I think describes the situation better, and makes it
straightforward for a potential future --really-force (or -ff) option
where we might still want to blow away anything on this namespace and
reclaim it.
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

  reply	other threads:[~2019-11-04 18:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-01 20:27 [ndctl PATCH 1/2] ndctl/namespace: remove open coded is_namespace_active() Vishal Verma
2019-11-01 20:27 ` [ndctl PATCH 2/2] ndctl/namespace: introduce ndctl_namespace_is_configurable() Vishal Verma
2019-11-04 16:35   ` Dan Williams
2019-11-04 18:48     ` Verma, Vishal L [this message]
2019-11-04 18:58       ` Dan Williams
2019-11-04 19:04         ` Verma, Vishal L

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=4e09051006f7714344c1d230061de0cfcb5377a9.camel@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    /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).