Hi Dang,
In a system crash or power-outage scenario, there's no opportunity for your app to call clflush/clflushopt since all operations are halted other than the critical ones needed to handle the event. You appear to be asking "What is my persistence domain?", "How does it work?", and "As a developer, what do I need to do from the app?". The last part of Hadi's response in the StackOverflow thread has a link to the article that describes what ADR and eADR persistence domains are, how they work, and what this means for applications (or developers).
To summarise that article, an ADR persistence domain contains the memory controller write pending queue (WPQ) and PMem write buffers. It does not contain the CPU caches, which is why the app has the responsibility to call clflush/clflushopt and SFENCE. However on platforms that provide eADR, the CPU caches are included in the persistence domain, so the app no longer needs to call clflush/clflushopt, but it should still call SFENCE when appropriate. If you use the
Persistent Memory Development Kit, the libraries support both ADR and eADR platforms and 'do the right thing' regarding flushing and fencing. As a developer using the higher level PMDK libraries (eg: libpmemobj), you don't need to worry about the hardware, you focus on your app. Cascade Lake platforms only support ADR, which is a mandatory requirement. Next-generation Ice Lake platforms will have the
option to provide eADR or fall back to ADR if eADR isn't supported or implemented. eADR support is a platform specific feature and not all platforms will provide eADR support by default, so check with your server OEM before purchase.
HTH
Steve