Linux CXL
 help / color / mirror / Atom feed
From: Ben Widawsky <ben.widawsky@intel.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: "Weiny, Ira" <ira.weiny@intel.com>,
	Alison Schofield <alison.schofield@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	linux-cxl@vger.kernel.org
Subject: Re: [PATCH 1/3] cxl/pci: Store memory capacity values
Date: Fri, 11 Jun 2021 10:50:30 -0700	[thread overview]
Message-ID: <20210611175030.gytdt3fu5fppy4kp@intel.com> (raw)
In-Reply-To: <CAPcyv4hpDFZj8zr47SLAx7Qy2UMz4c_E648e-ahGyu5nhzjcow@mail.gmail.com>

On 21-06-11 10:26:34, Dan Williams wrote:
> On Thu, Jun 10, 2021 at 5:22 PM <ira.weiny@intel.com> wrote:
> >
> > From: Ira Weiny <ira.weiny@intel.com>
> >
> > The Identify Memory Device command returns information about the
> > volatile and persistent memory capacities.  Store those values in the
> > cxl_mem structure for later use.  While at it, reuse the calculation of
> > the volatile and persistent memory byte values to calculate the ram and
> > pmem ranges.
> >
> > Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> > ---
> >  drivers/cxl/mem.h |  4 ++++
> >  drivers/cxl/pci.c | 36 +++++++++++++++++++++++++++++++++---
> >  2 files changed, 37 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/cxl/mem.h b/drivers/cxl/mem.h
> > index 13868ff7cadf..8bd0d0506b97 100644
> > --- a/drivers/cxl/mem.h
> > +++ b/drivers/cxl/mem.h
> > @@ -75,5 +75,9 @@ struct cxl_mem {
> >
> >         struct range pmem_range;
> >         struct range ram_range;
> > +       u64 total_cap_bytes;
> > +       u64 volatile_cap_bytes;
> > +       u64 persistent_cap_bytes;
> 
> Hmm, why these fields?
> 
> I would expect pmem_range and ram_range can already represent these
> values and range_len(pmem_range) + range_len(ram_range) == total
> capacity.

So the way Ira described it (AIUI), pmem_range will be the total partitioned
amount, while persistent_cap_bytes is min(info.persistent capacity, pmem_range)
(same for volatile). But perhaps I misunderstood.

  reply	other threads:[~2021-06-11 17:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11  0:22 [PATCH 0/3] Query and use Partition Info ira.weiny
2021-06-11  0:22 ` [PATCH 1/3] cxl/pci: Store memory capacity values ira.weiny
2021-06-11 17:18   ` Ben Widawsky
2021-06-11 17:26   ` Dan Williams
2021-06-11 17:50     ` Ben Widawsky [this message]
2021-06-11 19:58       ` Ira Weiny
2021-06-11  0:22 ` [PATCH 2/3] cxl/mem: Report correct ram/pmem size in sysfs ira.weiny
2021-06-11 11:00   ` Jonathan Cameron
2021-06-11 15:59     ` Ira Weiny
2021-06-11 17:14   ` Dan Williams
2021-06-11 19:59     ` Ira Weiny
2021-06-11  0:22 ` [PATCH 3/3] cxl/mem: Add partition information to sysfs ira.weiny
2021-06-11 11:05   ` Jonathan Cameron
2021-06-11 17:26   ` Ben Widawsky
2021-06-11 20:09     ` Ira Weiny

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=20210611175030.gytdt3fu5fppy4kp@intel.com \
    --to=ben.widawsky@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox