All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alison Schofield <alison.schofield@intel.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Ben Widawsky <ben.widawsky@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Linux NVDIMM <nvdimm@lists.linux.dev>,
	linux-cxl@vger.kernel.org
Subject: Re: [ndctl PATCH v3 6/6] cxl: add command set-partition-info
Date: Wed, 26 Jan 2022 21:44:21 -0800	[thread overview]
Message-ID: <20220127054421.GE890284@alison-desk> (raw)
In-Reply-To: <CAPcyv4gx+mvAPEmYstUXAsjWY=Aq7zb4y4V+QGzwnauk1F8DEw@mail.gmail.com>

On Wed, Jan 26, 2022 at 05:44:54PM -0800, Dan Williams wrote:
> On Tue, Jan 18, 2022 at 12:20 PM <alison.schofield@intel.com> wrote:
> >
> > From: Alison Schofield <alison.schofield@intel.com>
> >
> > Users may want to change the partition layout of a memory
> > device using the CXL command line tool.
> 
> How about:
> 
> CXL devices may support both volatile and persistent memory capacity.
> The amount of device capacity set aside for each type is typically
> established at the factory, but some devices also allow for dynamic
> re-partitioning, add a command for this purpose.

Thanks!
> 
> > Add a new CXL command,
> > 'cxl set-partition-info', that operates on a CXL memdev, or a
> > set of memdevs, and allows the user to change the partition
> > layout of the device(s).
> >
> > Synopsis:
> > Usage: cxl set-partition-info <mem0> [<mem1>..<memN>] [<options>]
> 
> It's unfortunate that the specification kept the word "info" in the
> set-partition command name, let's leave it out of this name and just
> call this 'cxl set-partition'.
> 
Will do. 

> >
> >         -v, --verbose           turn on debug
> >         -s, --volatile_size <n>
> >                                 next volatile partition size in bytes
> 
> Some users will come to this tool with the thought, "I want volatile
> capacity X", others "I want pmem capacity Y". All but the most
> advanced users will not understand how the volatile setting affects
> the pmem and vice versa, nor will they understand that capacity might
> be fixed and other capacity is dynamic.

I went very by the spec here, with those advance users in mind. I do
think the user with limited knowledge may get frustrated by the rules.
ie. like finding that their total capacity is not all partitionable
capacity. I looked at ipmctl goal setting, where they do percentages,
and didn't pursue - stuck with the spec.

I like this below. If user wants 100% of any type, no math needed. But,
anything else the user will have to specify a byte value.

> So how about a set of options like:
> 
> -t, --type=<volatile,pmem>
> -s,--size=<size>
> 
> ...where by default -t is 'pmem' and -s is '0' for 100% of the dynamic
> capacity set to PMEM.
>
I don't get the language "and -s is '0' for 100%", specifically, the
"-s is 0".

If -s is ommitted the default behavior will be to set 100% of the
partitionable capacity to type.

If both type and size are ommitted, 100% of partitionable capacity is
set to PMEM.

Humor me...are these right?  

set-partition mem0
	100% to pmem

set-partition mem0 -tpmem 
	100% to pmem

set-partition mem0 -tvolatile -s0
	100% to pmem          ^^ That's what I think a -s0 does?!?

set-partition mem0 -tvolatile
	100% to volatile

set-partition mem0 -tvolatile -s256MB
	256MB to volatile
	Remainder to pmem

set-partition mem0 -s256MB
	256MB to pmem
	Remainder to volatile

Thanks!

> The tool can then help the user get what they want relative to
> whatever frame of reference led them to read the set-partition man
> page. The tool can figure out the details behind the scenes, or warn
> them if they want something impossible like setting PMEM capacity to
> 1GB on a device where 2GB of PMEM is statically allocated.
> 
> This also helps with future proofing in case there are other types
> that come along.
> 
Got it.

> >
> > The included MAN page explains how to find the partitioning
> > capabilities and restrictions of a CXL memory device.
> >
snip

> > +-------
> > +<memory device(s)>::
> > +include::memdev-option.txt[]
> > +
> > +-s::
> > +--size=::
> 
> This is "--volatile_size" in the current patch, but that's moot with
> feedback to move to a --type + --size scheme.

Got it.

> 
> > +        Size in bytes of the volatile partition requested.
> > +
> > +        Size must align to the devices partition_alignment_bytes.
> > +        Use 'cxl list -m <memdev> -I' to find partition_alignment_bytes.
> 
> This a static 256M, that can just be documented here.
> 
My read of the spec says partition alignment is "Expressed in multiples
of 256MB", not static. Where is it defined as static?

> > +
> > +        Size must be less than or equal to the device's partitionable bytes.
> > +        Calculate partitionable bytes by subracting the volatile_only_bytes,
> 
> s/subracting/subtracting/
> 
> ...but rather than teaching the user to input valid values, tell them
> the validation and translation the tool will do on their behalf with
> the input based on type and the details they don't need to worry
> about.

Got it.

Thanks Dan.

  reply	other threads:[~2022-01-27  5:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-18 20:25 [ndctl PATCH v3 0/6] Add partitioning support for CXL memdevs alison.schofield
2022-01-18 20:25 ` [ndctl PATCH v3 1/6] libcxl: add GET_PARTITION_INFO mailbox command and accessors alison.schofield
2022-01-26 16:07   ` Dan Williams
2022-01-26 16:37     ` Alison Schofield
2022-01-26 17:50       ` Verma, Vishal L
2022-01-18 20:25 ` [ndctl PATCH v3 2/6] libcxl: add accessors for capacity fields of the IDENTIFY command alison.schofield
2022-01-26 16:16   ` Dan Williams
2022-01-18 20:25 ` [ndctl PATCH v3 3/6] libcxl: return the partition alignment field in bytes alison.schofield
2022-01-26 16:40   ` Dan Williams
2022-01-18 20:25 ` [ndctl PATCH v3 4/6] cxl: add memdev partition information to cxl-list alison.schofield
2022-01-26 17:23   ` Dan Williams
2022-01-26 19:03     ` Alison Schofield
2022-01-18 20:25 ` [ndctl PATCH v3 5/6] libcxl: add interfaces for SET_PARTITION_INFO mailbox command alison.schofield
2022-01-26 23:41   ` Dan Williams
2022-01-27 20:50     ` Alison Schofield
2022-02-01  1:24       ` Dan Williams
2022-02-01  1:34         ` Alison Schofield
2022-02-01  1:25     ` Alison Schofield
2022-02-01  1:32       ` Dan Williams
2022-01-18 20:25 ` [ndctl PATCH v3 6/6] cxl: add command set-partition-info alison.schofield
2022-01-27  1:44   ` Dan Williams
2022-01-27  5:44     ` Alison Schofield [this message]
2022-01-27 19:03       ` Dan Williams

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=20220127054421.GE890284@alison-desk \
    --to=alison.schofield@intel.com \
    --cc=ben.widawsky@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=vishal.l.verma@intel.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.