Re: [PATCH 00/13] deprecate pcommit

From: Rudoff, Andy
Date: Sun Jun 05 2016 - 14:48:25 EST

>> Platforms supporting NVDIMMs are now required to provide persistence
>> guarantees once pmem stores are accepted by the memory subsystem.
>Can you point us to a precise definition of what exactly constitutes
>stores being "accepted by the memory subsystem"? Back when pcommit
>was a thing (hah!), it was precisely documented in the SDM.

The Instruction Set Extensions document that describes PCOMMIT
says it applies to stores that were accepted by the memory subsystem
but were still potentially queued there. So Danâs description was
building on that same language. A concrete example might help:

MOV to location X

is the sequence for flushing a store to pmem. Before PCOMMIT
was deprecated, software needed to understand if the platform
had ADR and add:

PCOMMIT ; the old way
SFENCE ; the old way

to the above sequence if ADR wasnât present on the platform. Now
that ADR is required for all persistent memory, as it always has
been for NVDIMM-N devices available today, the simpler programming
model already in use for NVDIMM-N is used for all pmem.

>> is usually achieved by a platform-level feature known as ADR
>> (Asynchronous DRAM Refresh) that flushes any memory subsystem write
>> pending queues on power loss/shutdown.
>Blech. Does this mean that we need some NMI handler or similar that
>does wbinvd? Will CPU caches automatically write themselves back on
>power loss? Will we lose data if something goes wrong with an SMI

No, ADR is a platform-level feature that flushes any buffers in the memory
subsystem on power loss. No software is involved and the CPU caches are
not touched by ADR. So any stores flushed by CLFLUSH, CLFLUSHOPT, CLWB,
WBINVD, or non-temporal stores that go around the CPU caches can now be
considered persistent once those operations are complete.

>> The 'pcommit' instruction (which has not shipped on any product) is no
>> longer needed and is deprecated.
>Does this mean it will never ship?

Yes. The new instructions like CLWB and CLFLUSHOPT will be rolled
into the SDM but PCOMMIT will be removed from the Extensions doc
and not rolled into the SDM.