[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DF4PR84MB016972BE1CA018A9AC4BE592AB6F0@DF4PR84MB0169.NAMPRD84.PROD.OUTLOOK.COM>
Date: Mon, 2 Jan 2017 02:35:36 +0000
From: "Elliott, Robert (Persistent Memory)" <elliott@....com>
To: Al Viro <viro@...IV.linux.org.uk>,
Dan Williams <dan.j.williams@...el.com>
CC: Boaz Harrosh <boaz@...xistor.com>,
"linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>,
"Moreno, Oliver" <oliver.moreno@....com>,
"x86@...nel.org" <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
"boylston@...romesa.net" <boylston@...romesa.net>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: RE: [RFC] memcpy_nocache() and memcpy_writethrough()
> -----Original Message-----
> From: linux-kernel-owner@...r.kernel.org [mailto:linux-kernel-
> owner@...r.kernel.org] On Behalf Of Al Viro
> Sent: Friday, December 30, 2016 8:26 PM
> Subject: [RFC] memcpy_nocache() and memcpy_writethrough()
>
...
> Why does pmem need writethrough warranties, anyway?
Using either
* nontemporal store instructions; or
* following regular store instructions with a sequence of cache flush
and store fence instructions (e.g., clflushopt or clwb + sfence)
ensures that write data has reached an "ADR-safe zone" that the system
promises will be persistent even if there is a surprise power loss or
a CPU suffers from an error that isn't totally catastrophic (e.g., the
CPU getting disconnected from the SDRAM will always lose data on an
NVDIMM-N).
The ACPI NFIT Flush Hints provide a guarantee that data is safe even
in the case of a CPU error, but that feature is not present in all
systems for all types of persistent memory.
> All explanations I've found on the net had been along the lines of
> "we should not store a pointer to pmem data structure until the
> structure itself had been committed to pmem itself" and it looks
> like something that ought to be a job for barriers - after all,
> we don't want the pointer store to be observed by _anything_
> in the system until the earlier stores are visible, so what makes
> pmem different from e.g. another CPU or a PCI busmaster, or...
Newly written data becomes globally visible before it becomes ADR-safe.
This means software could act on the new data before a power loss, then
see the old data reappear after the power loss - not good. Software
needs to understand that any data in the process of being written is
indeterminate until the persistence guarantee is met. The BTT shows
one way that software can avoid that problem.
---
Robert Elliott, HPE Persistent Memory
Powered by blists - more mailing lists