]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86, pmem: clarify that ARCH_HAS_PMEM_API implies PMEM mapped WB
authorDan Williams <dan.j.williams@intel.com>
Mon, 24 Aug 2015 22:29:38 +0000 (18:29 -0400)
committerDan Duval <dan.duval@oracle.com>
Wed, 7 Dec 2016 17:19:30 +0000 (12:19 -0500)
commitabcbb1020539416808c049f4cc63226f86fe4f16
tree31e1e4d3211f5b402c700cb17fd7a08d5fdea247
parentdf1a17c5159592968a47686d996fa5802a456ace
x86, pmem: clarify that ARCH_HAS_PMEM_API implies PMEM mapped WB

Orabug: 22913653

Given that a write-back (WB) mapping plus non-temporal stores is
expected to be the most efficient way to access PMEM, update the
definition of ARCH_HAS_PMEM_API to imply arch support for
WB-mapped-PMEM.  This is needed as a pre-requisite for adding PMEM to
the direct map and mapping it with struct page.

The above clarification for X86_64 means that memcpy_to_pmem() is
permitted to use the non-temporal arch_memcpy_to_pmem() rather than
needlessly fall back to default_memcpy_to_pmem() when the pcommit
instruction is not available.  When arch_memcpy_to_pmem() is not
guaranteed to flush writes out of cache, i.e. on older X86_32
implementations where non-temporal stores may just dirty cache,
ARCH_HAS_PMEM_API is simply disabled.

The default fall back for persistent memory handling remains.  Namely,
map it with the WT (write-through) cache-type and hope for the best.

arch_has_pmem_api() is updated to only indicate whether the arch
provides the proper helpers to meet the minimum "writes are visible
outside the cache hierarchy after memcpy_to_pmem() + wmb_pmem()".  Code
that cares whether wmb_pmem() actually flushes writes to pmem must now
call arch_has_wmb_pmem() directly.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
[hch: set ARCH_HAS_PMEM_API=n on x86_32]
Reviewed-by: Christoph Hellwig <hch@lst.de>
[toshi: x86_32 compile fixes]
Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
(cherry picked from commit 96601adb745186ccbcf5b078d4756f13381ec2af)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
arch/x86/Kconfig
arch/x86/include/asm/pmem.h
drivers/acpi/nfit.c
drivers/nvdimm/pmem.c
include/linux/pmem.h