All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Gregory Price <gregory.price@memverge.com>
Cc: Gregory Price <gourry.memverge@gmail.com>,
	<qemu-devel@nongnu.org>, <linux-cxl@vger.kernel.org>,
	Alison Schofield <alison.schofield@intel.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	"a.manzanares@samsung.com" <a.manzanares@samsung.com>,
	Ben Widawsky <bwidawsk@kernel.org>
Subject: Re: [PATCH RFC] hw/cxl: type 3 devices can now present volatile or persistent memory
Date: Mon, 10 Oct 2022 17:26:11 +0100	[thread overview]
Message-ID: <20221010172611.00007f61@huawei.com> (raw)
In-Reply-To: <Y0Q4JWa6hddtHIcO@memverge.com>

On Mon, 10 Oct 2022 11:20:05 -0400
Gregory Price <gregory.price@memverge.com> wrote:

> > > 
> > > Maybe we should consider 2 new options:
> > > --persistent-memdevs=pm1 pm2 pm3
> > > --volatile-memdevs=vm1 vm2 vm3
> > > 
> > > etc, and deprecate --memdev, and go with your array of memdevs idea.
> > > 
> > > I think I could probably whip that up in a day or two.  Thoughts?  
> > 
> > I wonder if we care to emulate beyond 1 volatile and 1 persistent.
> > Sure devices might exist, but if we can exercise all the code paths
> > with a simpler configuration, perhaps we don't need to handle the
> > more complex ones?
> > 
> > The sticky corner here is Set Partition Info 
> > CXL r3.0 8.2.9.8.2.1
> > 
> > Separation between volatile and non volatile is configurable at runtime.
> >   
> 
> Set Partition Info (Opcode 4101h)
> ... snip ... Paritionable capacity is equal to
> (total capacity - (volatile-only) - (persistent-only))
> 
> By definition, volatile backed memory can only contain volatile regions.
> That's simple.

I guess that's a reasonable model for the QEMU command line.

> 
> For persistent-backed memory, capacity can be chopped up (iif Identify
> Memory Device reports Paritition Alignment to be non-zero).
> 
> --persistent-memdev=pmem-backing
> --volatile-memdev=vmem-backing
> 
> By default, maybe we should make the entire size of persistent regions
> to be persistent-only for the initial prototype. 

Agreed.  Partitioning wasn't high on my todo list though maybe it is
for others...


> This would let us
> merge without support for Set Partition Info.  Then add an additional
> argument to enable additional argument to set the partition alignment.
> 
> --partitionable-pmem=
>   : Defaults to 0. If non-zero, up to N XBytes of PMem may be
>     used as vmem by the operating system at runtime.
> 
> On the CXL tool side we should then see the following output for these
> settings:
> 
> --persistent-memdev=pmem0     1GB
> --volatile-memdev=vmem0       1GB
> --partitionable-pmem=512M
> 
> Capacities:
> ----------------
> Total Capacity: 2GB
> Volatile Capacity: 1GB
> Persistent Capacity: 1GB
> Partitionable Capacity: 512MB
> Partitioned Memory: 0MB
> 
> Available Memory:
> -----------------
> Volatile Memory: 1GB
> Persistent Memory: 1GB
> 
> 
> Then Run something along the lines of:
> `cxl partition-pmem 512MB`   (or whatever args are needed)
> 
> 
> Capacities:
> ----------------
> Total Capacity: 2GB
> Volatile Capacity: 1GB
> Persistent Capacity: 1GB
> Partitionable Capacity: 512MB
> Partitioned Memory: 512MB
> 
> Available Memory:
> -----------------
> Volatile Memory: 1.5GB
> Persistent Memory: 512MB
> 
> 
> Thoughts?

Looks good to me.  Alison, I think you were looking at the partitioning stuff...
What do you think of this?

Jonathan



WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Gregory Price <gregory.price@memverge.com>
Cc: Gregory Price <gourry.memverge@gmail.com>,
	<qemu-devel@nongnu.org>, <linux-cxl@vger.kernel.org>,
	Alison Schofield <alison.schofield@intel.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	"a.manzanares@samsung.com" <a.manzanares@samsung.com>,
	Ben Widawsky <bwidawsk@kernel.org>
Subject: Re: [PATCH RFC] hw/cxl: type 3 devices can now present volatile or persistent memory
Date: Mon, 10 Oct 2022 17:26:11 +0100	[thread overview]
Message-ID: <20221010172611.00007f61@huawei.com> (raw)
In-Reply-To: <Y0Q4JWa6hddtHIcO@memverge.com>

On Mon, 10 Oct 2022 11:20:05 -0400
Gregory Price <gregory.price@memverge.com> wrote:

> > > 
> > > Maybe we should consider 2 new options:
> > > --persistent-memdevs=pm1 pm2 pm3
> > > --volatile-memdevs=vm1 vm2 vm3
> > > 
> > > etc, and deprecate --memdev, and go with your array of memdevs idea.
> > > 
> > > I think I could probably whip that up in a day or two.  Thoughts?  
> > 
> > I wonder if we care to emulate beyond 1 volatile and 1 persistent.
> > Sure devices might exist, but if we can exercise all the code paths
> > with a simpler configuration, perhaps we don't need to handle the
> > more complex ones?
> > 
> > The sticky corner here is Set Partition Info 
> > CXL r3.0 8.2.9.8.2.1
> > 
> > Separation between volatile and non volatile is configurable at runtime.
> >   
> 
> Set Partition Info (Opcode 4101h)
> ... snip ... Paritionable capacity is equal to
> (total capacity - (volatile-only) - (persistent-only))
> 
> By definition, volatile backed memory can only contain volatile regions.
> That's simple.

I guess that's a reasonable model for the QEMU command line.

> 
> For persistent-backed memory, capacity can be chopped up (iif Identify
> Memory Device reports Paritition Alignment to be non-zero).
> 
> --persistent-memdev=pmem-backing
> --volatile-memdev=vmem-backing
> 
> By default, maybe we should make the entire size of persistent regions
> to be persistent-only for the initial prototype. 

Agreed.  Partitioning wasn't high on my todo list though maybe it is
for others...


> This would let us
> merge without support for Set Partition Info.  Then add an additional
> argument to enable additional argument to set the partition alignment.
> 
> --partitionable-pmem=
>   : Defaults to 0. If non-zero, up to N XBytes of PMem may be
>     used as vmem by the operating system at runtime.
> 
> On the CXL tool side we should then see the following output for these
> settings:
> 
> --persistent-memdev=pmem0     1GB
> --volatile-memdev=vmem0       1GB
> --partitionable-pmem=512M
> 
> Capacities:
> ----------------
> Total Capacity: 2GB
> Volatile Capacity: 1GB
> Persistent Capacity: 1GB
> Partitionable Capacity: 512MB
> Partitioned Memory: 0MB
> 
> Available Memory:
> -----------------
> Volatile Memory: 1GB
> Persistent Memory: 1GB
> 
> 
> Then Run something along the lines of:
> `cxl partition-pmem 512MB`   (or whatever args are needed)
> 
> 
> Capacities:
> ----------------
> Total Capacity: 2GB
> Volatile Capacity: 1GB
> Persistent Capacity: 1GB
> Partitionable Capacity: 512MB
> Partitioned Memory: 512MB
> 
> Available Memory:
> -----------------
> Volatile Memory: 1.5GB
> Persistent Memory: 512MB
> 
> 
> Thoughts?

Looks good to me.  Alison, I think you were looking at the partitioning stuff...
What do you think of this?

Jonathan




  reply	other threads:[~2022-10-10 16:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06  0:01 [PATCH RFC] hw/cxl: type 3 devices can now present volatile or persistent memory Gourry
2022-10-06  8:45 ` Jonathan Cameron
2022-10-06  8:45   ` Jonathan Cameron via
2022-10-06  8:50   ` Jonathan Cameron
2022-10-06  8:50     ` Jonathan Cameron via
2022-10-06 15:52     ` Gregory Price
2022-10-06 16:42       ` Jonathan Cameron
2022-10-06 16:42         ` Jonathan Cameron via
2022-10-06 17:29         ` Gregory Price
2022-10-07 14:50           ` Gregory Price
2022-10-10 15:18             ` Jonathan Cameron
2022-10-10 15:18               ` Jonathan Cameron via
2022-10-10 15:25               ` Gregory Price
2022-10-11  1:23                 ` Gregory Price
2022-10-11 17:14                   ` Davidlohr Bueso
2022-10-11 17:22                     ` Gregory Price
2022-10-11 17:28                       ` Jonathan Cameron
2022-10-11 17:28                         ` Jonathan Cameron via
2022-10-10 14:43           ` Jonathan Cameron
2022-10-10 14:43             ` Jonathan Cameron via
2022-10-10 15:20             ` Gregory Price
2022-10-10 16:26               ` Jonathan Cameron [this message]
2022-10-10 16:26                 ` Jonathan Cameron via
2022-10-10 16:32             ` Jonathan Cameron
2022-10-10 16:32               ` Jonathan Cameron via
2022-10-10 17:18             ` Davidlohr Bueso
2022-10-07 18:16         ` Davidlohr Bueso
2022-10-07 18:46           ` Gregory Price
2022-10-07 19:55             ` Davidlohr Bueso
2022-10-07 19:52     ` Davidlohr Bueso

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=20221010172611.00007f61@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=a.manzanares@samsung.com \
    --cc=alison.schofield@intel.com \
    --cc=bwidawsk@kernel.org \
    --cc=dave@stgolabs.net \
    --cc=gourry.memverge@gmail.com \
    --cc=gregory.price@memverge.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=qemu-devel@nongnu.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 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.