diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-07-08 04:44:50 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-07-12 01:13:42 +0200 |
commit | f284a4f23752d0334e482d04e0a584d19c9c8cd0 (patch) | |
tree | 98bf766185ec55c8f1f3d3251dfb6ad21fdfa92d /ipc | |
parent | libnvdimm: keep region data alive over namespace removal (diff) | |
download | linux-f284a4f23752d0334e482d04e0a584d19c9c8cd0.tar.xz linux-f284a4f23752d0334e482d04e0a584d19c9c8cd0.zip |
libnvdimm: introduce nvdimm_flush() and nvdimm_has_flush()
nvdimm_flush() is a replacement for the x86 'pcommit' instruction. It is
an optional write flushing mechanism that an nvdimm bus can provide for
the pmem driver to consume. In the case of the NFIT nvdimm-bus-provider
nvdimm_flush() is implemented as a series of flush-hint-address [1]
writes to each dimm in the interleave set (region) that backs the
namespace.
The nvdimm_has_flush() routine relies on platform firmware to describe
the flushing capabilities of a platform. It uses the heuristic of
whether an nvdimm bus provider provides flush address data to return a
ternary result:
1: flush addresses defined
0: dimm topology described without flush addresses (assume ADR)
-errno: no topology information, unable to determine flush mechanism
The pmem driver is expected to take the following actions on this ternary
result:
1: nvdimm_flush() in response to REQ_FUA / REQ_FLUSH and shutdown
0: do not set, WC or FUA on the queue, take no further action
-errno: warn and then operate as if nvdimm_has_flush() returned '0'
The caveat of this heuristic is that it can not distinguish the "dimm
does not have flush address" case from the "platform firmware is broken
and failed to describe a flush address". Given we are already
explicitly trusting the NFIT there's not much more we can do beyond
blacklisting broken firmwares if they are ever encountered.
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions