nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: "Elliott, Robert (Persistent Memory)" <elliott@hpe.com>
To: Brian Stark <brian.stark@sanmina.com>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: RE: caching options
Date: Thu, 2 Aug 2018 18:00:39 +0000	[thread overview]
Message-ID: <AT5PR8401MB1169EBD36A1A522F587A3A1CAB2C0@AT5PR8401MB1169.NAMPRD84.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CAKccVaykLyVKGuMpD8d1xABnsTzv+o=qt2ovnp1BXQHe0dnfHA@mail.gmail.com>

> -----Original Message-----
> From: Linux-nvdimm <linux-nvdimm-bounces@lists.01.org> On Behalf Of
> Brian Stark
> Sent: Tuesday, July 31, 2018 11:43 AM
> To: linux-nvdimm@lists.01.org
> Subject: caching options
> I have a customer that requires persistent memory be set to Write
> Combining cache attribute with the Skylake processor.  Is Write
> Combining for persistent memory supported in Linux?
> Brian Stark

There's no API for applications to specify that right now.

You can recompile the kernel with this patch:

$ git diff
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h
index 097072c5a852..d3f165d9ed77 100644
--- a/include/linux/libnvdimm.h
+++ b/include/linux/libnvdimm.h
@@ -206,7 +206,7 @@ int nvdimm_has_flush(struct nd_region *nd_region);
int nvdimm_has_cache(struct nd_region *nd_region);

void arch_wb_cache_pmem(void *addr, size_t size);
void arch_invalidate_pmem(void *addr, size_t size);

to cause persistent memory ranges used in "raw mode" to be marked as
write-combining rather than writeback cacheable. 

The other modes (sector, fsdax, and devdax) require different patches,
as the kernel maps memory differently for them.

You can confirm the write-combining settings if:
* the kernel is compiled with CONFIG_DEBUG_FS
* the debug filesystem is mounted with mount -t debugfs debugfs /sys/kernel/debug

$ sudo cat /sys/kernel/debug/x86/pat_memtype_list
PAT memtype list:
write-combining @ 0x880000000-0xa80000000
write-combining @ 0xa80000000-0xc80000000

The persistent memory addresses are reported in /proc/iomem
(e.g., starting at 0x880000000 on my test system).  

Robert Elliott, HPE Persistent Memory

Linux-nvdimm mailing list

  reply	other threads:[~2018-08-02 18:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31 16:43 caching options Brian Stark
2018-08-02 18:00 ` Elliott, Robert (Persistent Memory) [this message]
2018-08-02 18:10   ` Brian Stark

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AT5PR8401MB1169EBD36A1A522F587A3A1CAB2C0@AT5PR8401MB1169.NAMPRD84.PROD.OUTLOOK.COM \
    --to=elliott@hpe.com \
    --cc=brian.stark@sanmina.com \
    --cc=linux-nvdimm@lists.01.org \


* 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;
as well as URLs for NNTP newsgroup(s).