ENUM FAULT_FLAG(9)
β¨ 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 dropmmap_lockand 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 hasvmf->orig_ptecached. We should only accessorig_pteif 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms