ENUM XE_MADV_PURGEABLE_STATE(9)
π 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:
xe_bo_is_purged(9)xe_bo_madv_is_dontneed(9)xe_bo_willneed_get_locked(9)xe_bo_willneed_put_locked(9)xe_bo_vma_count_inc_locked(9)xe_bo_vma_count_dec_locked(9)xe_bo_size(9)xe_bo_has_valid_ccs_bb(9)xe_bo_put_deferred(9)xe_bo_put_async(9)xe_bo_sg_is_contiguous(9)struct xe_bo_shrink_flags(9)xe_bo_is_mem_type(9)
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
- 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