From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: "Li Qiang (Johnny Li)" <johnny.li@montage-tech.com>,
John Groves <john@jagalactic.com>, <linux-cxl@vger.kernel.org>,
Ben Widawsky <ben.widawsky@intel.com>,
John Groves <JGroves@micron.com>
Subject: Re: Should bios always mark CXL DRAM as EFI_MEMORY_SP?
Date: Fri, 28 Jan 2022 10:24:58 +0000 [thread overview]
Message-ID: <20220128102458.00006063@Huawei.com> (raw)
In-Reply-To: <CAPcyv4hWcxoEw=umN=0xDe4Ychfxe6GysYOBcxK6oHLEDhz1iw@mail.gmail.com>
On Thu, 27 Jan 2022 21:28:40 -0800
Dan Williams <dan.j.williams@intel.com> wrote:
> On Thu, Jan 27, 2022 at 8:12 PM Li Qiang (Johnny Li)
> <johnny.li@montage-tech.com> wrote:
> >
> > I think BIOS should follow CDAT spec v1.01 Device Scoped EFI Memory Type Structure (DSEMTS) structure
> >
> > In Table 8 Device Scoped EFI Memory Type Structure, field EFI Memory Type and Attribute has below definition
> > 0 – EfiConventionalMemory
> > 1 - EfiConventionalMemory Type with EFI_MEMORY_SP Attribute
> > 2 – EfiReservedMemoryType
> > 3-255 – Reserved encoding
> > The memory attribute EFI_MEMORY_NV may be inferred from NonVolatile flag in DSMAS.
> > Memory types other than EfiConventionalMemory and EfiReservedMemoryType are not permitted.
>
> Definitely BIOS should follow CDAT for the type, but it's not so clear
> to me the same can be said about the attribute. I think the bigger
> question is when should devices claim to be EFI_MEMORY_SP, and when
> should BIOS apply EFI_MEMORY_SP regardless of what the device
> advertises. EFI_MEMORY_SP is a claim about usage that the memory is
> either too high performance or too low performance to be added to the
> general memory pool by default. That's not a decision that a device
> necessarily knows how to make on its own. The platform BIOS might have
> a better chance to know intended application the system was built. The
> OS kernel is somewhat blind to usage but OS policy can do the last
> mile tuning of how much if any memory of a given performance class
> should be set aside for exclusive access.
I'd add another spin based on where EFI_MEMORY_SP originally came from,
though it's not relevant to memory only devices which I think is what
is being discussed here.
For some devices the memory will work fine as general purpose RAM, but
it was put there with an intended use. Typically something like DDR
attached to a GPU or other accelerator. Might be nice and quick for
general use, but it's even quicker if the GPU is using it :)
Again, how much to reserve for what usecase is an OS policy decision
hence the hint from the attribute. Neither the device nor the
bios can know the answer as it depends on what is actually being run
in the OS.
Jonathan
next prev parent reply other threads:[~2022-01-28 10:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <07cedbe6-00ab-52fc-9475-c8d7120f5a95@jagalactic.com>
2022-01-27 16:18 ` Should bios always mark CXL DRAM as EFI_MEMORY_SP? John Groves
2022-01-28 0:47 ` Dan Williams
2022-01-28 4:08 ` Li Qiang (Johnny Li)
2022-01-28 5:28 ` Dan Williams
2022-01-28 10:24 ` Jonathan Cameron [this message]
2022-01-28 16:12 ` 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=20220128102458.00006063@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=JGroves@micron.com \
--cc=ben.widawsky@intel.com \
--cc=dan.j.williams@intel.com \
--cc=john@jagalactic.com \
--cc=johnny.li@montage-tech.com \
--cc=linux-cxl@vger.kernel.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