On x86-64, is the “movnti” or “movntdq” instruction atomic when system crash?

痴心易碎 提交于 2021-01-27 05:35:15

问题


When using persistent memory like Intel optane DCPMM, is it possible to see partial result after reboot if system crash(power outage) in execution of movnt instruction?

For:

  • 4 or 8 byte movnti which x86 guarantees atomic for other purposes?
  • 16-byte SSE movntdq / movntps which aren't guaranteed atomic but which in practice probably are on CPUs supporting persistent memory.
  • 32-byte AVX vmovntdq / vmovntps
  • 64-byte AVX512 vmovntdq / vmovntps full-line stores
  • bonus question: MOVDIR64B which has guaranteed 64-byte write atomicity, on future CPUs that support it and DC-PM. e.g. Sapphire Rapids Xeon / Tiger Lake / Tremont.

movntpd is assumed to be identical to movntps.


Related questions:

  • On x86-64, is the "movnti" instruction atomic? yes
  • Is clflush or clflushopt atomic when system crash?

回答1:


Atomicity guarantees on x86 in global observability and persistency are the same. This means that the following operations are persistently atomic:

  • A store uop that doesn't cross an 8-byte boundary to a location of any effective memory type, and
  • MOVDIR64B.

In addition, the following operations are persistently atomic:

  • A cache line flush (CLFLUSH or CLFLUSHOPT),
  • A cache line writeback (CLWB), and
  • A non-architectural cache line eviction.

It's not clear whether persistent atomicity is architecturally guaranteed for the following operations:

  • A full write-combining buffer flush.

There is no architectural persistent atomicity guarantee for everything else, including 64-byte AVX512 vmovntdq / vmovntps full-line stores.

These guarantees apply to Asynchronous DRAM Refresh (ADR) platforms and Enhanced Asynchronous DRAM Refresh (eADR) platforms. (On eADR, the cache hierarchy is in the persistence domain. See: Build Persistent Memory Applications with Reliability Availability and Serviceability.)

This answer is based on my private correspondence with Andy Rudoff (Intel).



来源:https://stackoverflow.com/questions/65558114/on-x86-64-is-the-movnti-or-movntdq-instruction-atomic-when-system-crash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!