ENUM MMU_NOTIFIER_EVENT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… enum mmu_notifier_event(9)

okay so bestie, welcome to the kernel API manual ✨ β€” this is the enum mmu_notifier_event page, and honestly it's giving "small enum, big feelings" because every one of these little constants is a reason the mmu notifier callback is firing πŸŽ€

🌸 NAME 🌸

enum mmu_notifier_event β€” the reason your mmu notifier callback just got pinged, like, the actual why πŸ’–

✨ SYNOPSIS ✨

enum mmu_notifier_event {
    MMU_NOTIFY_UNMAP ,
    MMU_NOTIFY_CLEAR ,
    MMU_NOTIFY_PROTECTION_VMA ,
    MMU_NOTIFY_PROTECTION_PAGE ,
    MMU_NOTIFY_SOFT_DIRTY ,
    MMU_NOTIFY_RELEASE ,
    MMU_NOTIFY_MIGRATE ,
    MMU_NOTIFY_EXCLUSIVE

};

not me pasting the whole enum verbatim, but fr fr that's the whole vibe 🌈


πŸ¦‹ Constants πŸ¦‹

okay so here's the cast of characters, one by one, no skips πŸ™ˆ

  • MMU_NOTIFY_UNMAP β€” either a munmap that unmaps the range, or a mremap that moves the range. basically the range is yeeted or relocated πŸ’€
  • MMU_NOTIFY_CLEAR β€” a page table entry got cleared. and bestie there are SO. MANY. REASONS. like madvise, or replacing a page by another one, ... you get it, the list goes on 😭
  • MMU_NOTIFY_PROTECTION_VMA β€” the update is because of a protection change for the range, i.e. just using the vma access permission (vm_page_prot) to update the whole range is enough β€” no need to go inspect changes to the CPU page table. this is the mprotect syscall being iconic πŸ‘‘
  • MMU_NOTIFY_PROTECTION_PAGE β€” the update is because the read/write flag changed for pages in the range, so to mirror those changes the user must inspect the CPU page table (from the end callback). yes, must. no shortcuts here 🫢
  • MMU_NOTIFY_SOFT_DIRTY β€” soft dirty accounting (still same page, still same access flags ✨). the user should soft dirty the page in the end callback so that literally anyone relying on soft dirtiness catches pages that might be written through non-CPU mappings. lowkey important, don't skip it πŸ’œ
  • MMU_NOTIFY_RELEASE β€” used during mmu_interval_notifier invalidate to signal that the mm refcount is zero and the range is no longer accessible πŸ”₯
  • MMU_NOTIFY_MIGRATE β€” used during migrate_vma_collect invalidate to signal a device driver to possibly ignore the invalidation if the owner field matches the driver's device private pgmap owner 🧚
  • MMU_NOTIFY_EXCLUSIVE β€” conversion of a page table entry to device-exclusive. the owner is initialized to the value provided by the caller of make_device_exclusive, such that this caller can filter out these events πŸŽ€

⭐ SEE ALSO ⭐

ngl the see-also section is basically the friendship bracelet of this whole page β€” go read those next, iykyk 🫢

and that's the page, bestie πŸ’– this one lives in ./include/linux, dated October 2026, and it's literally titled enum mmu_notifier_event(9) β€” slay, go forth and notify your mmu πŸ¦‹βœ¨

πŸ“¦ where this page comes from