ENUM FAULT_FLAG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

enum fault_flag β€” Fault flag definitions. This is enum fault_flag(9), straight outta the Kernel API Manual, and it’s literally the cheat sheet for all the fault-flag vibes πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

enum fault_flag {
    FAULT_FLAG_WRITE ,
    FAULT_FLAG_MKWRITE ,
    FAULT_FLAG_ALLOW_RETRY ,
    FAULT_FLAG_RETRY_NOWAIT ,
    FAULT_FLAG_KILLABLE ,
    FAULT_FLAG_TRIED ,
    FAULT_FLAG_USER ,
    FAULT_FLAG_REMOTE ,
    FAULT_FLAG_INSTRUCTION ,
    FAULT_FLAG_INTERRUPTIBLE ,
    FAULT_FLAG_UNSHARE ,
    FAULT_FLAG_ORIG_PTE_VALID ,
    FAULT_FLAG_VMA_LOCK

};

🌸 Constants 🌸

  • FAULT_FLAG_WRITE β€” Fault was a write fault. ✍️
  • FAULT_FLAG_MKWRITE β€” Fault was mkwrite of existing PTE.
  • FAULT_FLAG_ALLOW_RETRY β€” Allow to retry the fault if blocked.
  • FAULT_FLAG_RETRY_NOWAIT β€” Don't drop mmap_lock and wait when retrying.
  • FAULT_FLAG_KILLABLE β€” The fault task is in SIGKILL killable region.
  • FAULT_FLAG_TRIED β€” The fault has been tried once.
  • FAULT_FLAG_USER β€” The fault originated in userspace. 🫢
  • FAULT_FLAG_REMOTE β€” The fault is not for current task/mm.
  • FAULT_FLAG_INSTRUCTION β€” The fault was during an instruction fetch.
  • FAULT_FLAG_INTERRUPTIBLE β€” The fault can be interrupted by non-fatal signals.
  • FAULT_FLAG_UNSHARE β€” The fault is an unsharing request to break COW in a COW mapping, making sure that an exclusive anon page is mapped after the fault.
  • FAULT_FLAG_ORIG_PTE_VALID β€” whether the fault has vmf->orig_pte cached. We should only access orig_pte if this flag set.
  • FAULT_FLAG_VMA_LOCK β€” The fault is handled under VMA lock. πŸ”’

πŸ”₯ Description πŸ”₯

About FAULT_FLAG_ALLOW_RETRY and FAULT_FLAG_TRIED: we can specify whether we would allow page faults to retry by specifying these two fault flags correctly. Currently there can be three legal combinations:

  • (a) ALLOW_RETRY and !TRIED: this means the page fault allows retry, and this is the first try
  • (b) ALLOW_RETRY and TRIED: this means the page fault allows retry, and we've already tried at least once
  • (c) !ALLOW_RETRY and !TRIED: this means the page fault does not allow retry

The unlisted combination (!ALLOW_RETRY && TRIED) is illegal and should never be used. 🚨 Note that page faults can be allowed to retry for multiple times, in which case we'll have an initial fault with flags (a) then later on continuous faults with flags (b). We should always try to detect pending signals before a retry to make sure the continuous page faults can still be interrupted if necessary.

The combination FAULT_FLAG_WRITE|FAULT_FLAG_UNSHARE is illegal. FAULT_FLAG_UNSHARE is ignored and treated like an ordinary read fault when applied to mappings that are not COW mappings.


🧚 SEE ALSO 🧚

Kernel file ./include/linux/mm_types.h β€” softleaf_t(9), struct folio(9), struct ptdesc(9), vm_fault_t(9), enum vm_fault_reason(9)


okay that’s the whole page, bestie 🫢 β€” source/version is ./include/linux, date is October 2026, and the manual is enum fault_flag(9) from the Kernel API Manual. periodt πŸ’–βœ¨

πŸ“¦ where this page comes from