{
  "slug": "sfence",
  "term": "SFENCE",
  "aliases": [
    "Store Fence",
    "store-fence instruction"
  ],
  "definition": "SFENCE is an x86 instruction that orders earlier stores to become globally visible before later stores.",
  "note": "Scope: SFENCE does not order memory loads or LFENCE. Store visibility is not, by itself, proof that data will survive a power failure. [sdm-sfence]\n\nOn an ADR-backed persistent-memory mapping, write back the required cache lines before the fence. A detected eADR domain can remove explicit cache-line writeback, but ordering obligations remain. A fence does not make ordinary DRAM nonvolatile. [pmem-glossary]\n\nBatching: a mapping-specific drain can complete prior flushes without a separate drain for each region. Mappings can share one drain call when their drain function is the same. This does not flush arbitrary dirty data or provide an atomic commit. [pmdk-drain] [pmdk-persist]\n\nRecovery must tolerate stores becoming persistent before an explicit persist call. Completing persistence of a range does not make a multi-line update all-or-nothing. [pmdk-persist]",
  "related": [
    "clwb",
    "clflushopt",
    "persistence-ordering",
    "eadr"
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-28",
  "citations": [
    {
      "id": "sdm-sfence",
      "title": "Intel SDM 093, Vol. 2B: SFENCE, printed page 4-628.",
      "url": "https://cdrdv2-public.intel.com/929354/253667-093-sdm-vol-2b.pdf",
      "accessed": "2026-11-28"
    },
    {
      "id": "pmem-glossary",
      "title": "PMem project glossary: Fence, ADR and eADR.",
      "url": "https://pmem.io/glossary/",
      "accessed": "2026-11-28"
    },
    {
      "id": "pmdk-drain",
      "title": "PMDK 1.13.1: pmem2_get_drain_fn, mapping-specific flush completion.",
      "url": "https://github.com/pmem/pmdk/blob/1.13.1/doc/libpmem2/pmem2_get_drain_fn.3.md",
      "accessed": "2026-11-28"
    },
    {
      "id": "pmdk-persist",
      "title": "PMDK 1.13.1: pmem2_get_persist_fn, batching and non-transactional semantics.",
      "url": "https://github.com/pmem/pmdk/blob/1.13.1/doc/libpmem2/pmem2_get_persist_fn.3.md",
      "accessed": "2026-11-28"
    },
    {
      "id": "hesela-pmem",
      "title": "Hesela: Persistent memory: DAX is not a durable commit.",
      "url": "https://hesela.com/analyses/pmem-persistence-domains-dax/#cache-line-writeback",
      "accessed": "2026-11-28"
    }
  ],
  "provenance": [
    "Instruction semantics follow Intel SDM revision 093, September 2026. The PMDK interface contract is pinned to 1.13.1.",
    "Source synthesis only; no persistent-memory device, power-cut experiment or latency measurement."
  ]
}
