ENUM XE_MADV_PURGEABLE_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… enum xe_madv_purgeable_state(9)

okay so bestie, this is a page from the Kernel API Manual and it's literally all about enum xe_madv_purgeable_state β€” the buffer object purgeable state enumeration πŸŽ€. yes, that's a mouthful, but stick with me, it's actually iconic.


🌸 NAME 🌸

enum xe_madv_purgeable_state β€” the Buffer object purgeable state enumeration ✨ (that's it, that's the name, she's pretty self-explanatory iykyk)


πŸ¦‹ SYNOPSIS πŸ¦‹

enum xe_madv_purgeable_state {
    XE_MADV_PURGEABLE_WILLNEED ,
    XE_MADV_PURGEABLE_DONTNEED ,
    XE_MADV_PURGEABLE_PURGED

};

like, that's the whole vibe right there πŸ‘‘


✨ Constants ✨

so these are your three states, bestie β€” know them, love them:

  • XE_MADV_PURGEABLE_WILLNEED β€” the buffer object is needed and should not be purged πŸ’–. and fun fact: this is the default state, so if you don't do anything, this is where you're at. lowkey the main character default.
  • XE_MADV_PURGEABLE_DONTNEED β€” the buffer object is not currently needed and the kernel is allowed to purge it under memory pressure 😭. it's giving "you can let this one go if things get tight".
  • XE_MADV_PURGEABLE_PURGED β€” the buffer object has been purged by the kernel πŸ’€. yeah. it happened. she's gone.

🫢 Description 🫢

okay so what is this enum even for? it defines the possible purgeable states for a buffer object, which lets userspace hand memory usage hints to the kernel so memory management under pressure is better 🌈. it's literally teamwork between you and the kernel, no cap.

⚠️ real talk though: accessing a purged buffer will result in an error. and per i915 semantics, once purged, a BO remains permanently invalid and must be destroyed and recreated 😳. not "maybe", not "sometimes" β€” permanently. so don't try to be cute and reuse it, bestie, it's over.

πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, they're all in the Kernel file ./drivers/gpu/drm/xe/xe_bo.h:

like, that's a whole reading list, but you got this πŸ§šπŸ’œ


mwah πŸ’‹ this lil page lives under ./drivers/gpu/drm/xe, dated October 2026, and it's filed as enum xe_madv...geable_state(9) β€” ok bye, go purge responsibly πŸ“

πŸ“¦ where this page comes from