Linux-NVDIMM Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "Williams, Dan J" <dan.j.williams@intel.com>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [ndctl PATCH 7/7] ndctl: auto initialize labels
Date: Tue, 29 Aug 2017 21:32:54 +0000	[thread overview]
Message-ID: <1504042255.7034.1.camel@intel.com> (raw)
In-Reply-To: <150403692821.8240.17921098591962254302.stgit@dwillia2-desk3.amr.corp.intel.com>

On Tue, 2017-08-29 at 13:02 -0700, Dan Williams wrote:
> If we are reconfiguring an ND_DEVICE_NAMESPACE_IO namespace take the
> opportunity to potentially initialize labels. DIMM capacity that is
> not
> aliased will surface as a label-less namespace by default. If every
> DIMM
> in the interleave set supports labels we can switch a more dynamic
> configuration, i.e. enable pmem sub-division.
> 
> The --no-autolabel option is added to disable this behavior if it is
> not
> wanted.
> 
> Cc: Vishal Verma <vishal.l.verma@intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  Documentation/ndctl/ndctl-create-namespace.txt |    7 ++
>  ndctl/namespace.c                              |   90
> +++++++++++++++++++++++-
>  2 files changed, 95 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/ndctl/ndctl-create-namespace.txt
> b/Documentation/ndctl/ndctl-create-namespace.txt
> index 85d1f8db792f..3844ff74a9f1 100644
> --- a/Documentation/ndctl/ndctl-create-namespace.txt
> +++ b/Documentation/ndctl/ndctl-create-namespace.txt
> @@ -138,6 +138,13 @@ OPTIONS
>  	active.  Specifying --force causes the namespace to be
> disabled
>  	before reconfiguring.
>  
> +-L::
> +--autolabel::

Shouldn't this be --no-autolabel

> +	When ndctl encounters a label-less namespace while
> +	performing a reconfigure operation it will try to enable
> labels
> +	for the region. This behavior can be suppressed with
> +	"--no-autolabel".

And the text description matched to describe only the --no-autolabel
option instead of describing both a positive and negative

> +
>  -v::
>  --verbose::
>  	Emit debug messages for the namespace creation process
> 

[...]

> +
> +	/* all the dimms must support labelling */

s/labelling/labeling/

> +	if (count != mappings)
> +		return;
> +
> +	ndctl_region_disable_invalidate(region);
> +	count = 0;
> +	ndctl_dimm_foreach_in_region(region, dimm)
> +		if (ndctl_dimm_is_active(dimm)) {
> +			count++;
> +			break;
> +		}
> +
> +	/* some of the dimms belong to multiple regions?? */
> +	if (count)
> +		goto out;
> +
> +	v = NDCTL_NS_VERSION_1_2;
> +retry:
> +	ndctl_dimm_foreach_in_region(region, dimm) {
> +		int num_labels, avail;
> +
> +		ndctl_cmd_unref(cmd_read);
> +		cmd_read = ndctl_dimm_read_labels(dimm);
> +		if (!cmd_read)
> +			continue;
> +
> +		num_labels = ndctl_dimm_init_labels(dimm, v);
> +		if (num_labels < 0)
> +			continue;
> +
> +		ndctl_dimm_disable(dimm);
> +		ndctl_dimm_enable(dimm);
> +
> +		/*
> +		 * If the kernel appears to not understand v1.2
> labels,
> +		 * try v1.1. Note, we increment avail by 1 to account
> +		 * for the one free label that the kernel always
> +		 * maintains for ongoing updates.
> +		 */
> +		avail = ndctl_dimm_get_available_labels(dimm) + 1;
> +		if (num_labels != avail && v == NDCTL_NS_VERSION_1_2)
> {
> +			v = NDCTL_NS_VERSION_1_1;
> +			goto retry;
> +		}
> +
> +	}
> +	ndctl_cmd_unref(cmd_read);
> +out:
> +	ndctl_region_enable(region);
> +}
> +
>  static int namespace_reconfig(struct ndctl_region *region,
>  		struct ndctl_namespace *ndns)
>  {
> @@ -824,6 +905,11 @@ static int namespace_reconfig(struct ndctl_region
> *region,
>  	if (rc)
>  		return rc;
>  
> +	/* check if we can enable labels on this region */
> +	if (ndctl_namespace_get_type(ndns) == ND_DEVICE_NAMESPACE_IO
> +			&& p.autolabel)
> +		enable_labels(region);
> +
>  	ndns = region_get_namespace(region);
>  	if (!ndns || is_namespace_active(ndns)) {
>  		debug("%s: no %s namespace seed\n",
> 
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  reply	other threads:[~2017-08-29 21:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29 20:01 [ndctl PATCH 0/7] ndctl: automatically initialize labels Dan Williams
2017-08-29 20:01 ` [ndctl PATCH 1/7] ndctl, init-labels: fix '--label-version' option Dan Williams
2017-08-29 20:01 ` [ndctl PATCH 2/7] ndctl: drop the "libndctl-" prefix on library source files Dan Williams
2017-08-29 20:01 ` [ndctl PATCH 3/7] ndctl: move label manipulation routines to their own file Dan Williams
2017-08-29 20:01 ` [ndctl PATCH 4/7] ndctl: consolidate namespace definitions in namespace.h Dan Williams
2017-08-29 20:01 ` [ndctl PATCH 5/7] ndctl: refactor read_labels() helper into a library call Dan Williams
2017-08-29 20:02 ` [ndctl PATCH 6/7] ndctl: introduce ndctl_dimm_{validate_labels, init_labels} Dan Williams
2017-08-29 20:02 ` [ndctl PATCH 7/7] ndctl: auto initialize labels Dan Williams
2017-08-29 21:32   ` Verma, Vishal L [this message]
2017-08-29 21:48     ` Dan Williams
2017-08-29 21:52       ` Verma, Vishal L
2017-08-29 22:43         ` Vishal Verma

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=1504042255.7034.1.camel@intel.com \
    --to=vishal.l.verma@intel.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