ENUM PANTHOR_GEM_RECLAIM_STATE(9)
β¨ NAME β¨
enum panthor_gem_reclaim_state β literally the reclaim state of a GEM object, and yes bestie, the whole kernel API manual is gonna walk you through it π
This is a page from the Kernel API Manual, so you know it's official official.
πΈ SYNOPSIS πΈ
enum panthor_gem_reclaim_state {
PANTHOR_GEM_UNUSED ,
PANTHOR_GEM_MMAPPED ,
PANTHOR_GEM_GPU_MAPPED_SINGLE_VM ,
PANTHOR_GEM_GPU_MAPPED_MULTI_VM ,
PANTHOR_GEM_UNRECLAIMABLE
};
okay so that's the whole enum, and now we're gonna go through every single constant one by one because nobody gets left behind on my watch π«Ά
π Constants π
PANTHOR_GEM_UNUSED
GEM is currently unused π
This can happen when the GEM was previously vmap-ed, mmap-ed, and/or GPU mapped and got unmapped. Because pages are lazily returned to the shmem layer, we want to keep a list of such BOs, because they should be fairly easy to reclaim (no need to wait for GPU to be done, and no need to tear down user mappings either). lowkey the easiest W on the list, ngl β¨
PANTHOR_GEM_MMAPPED
GEM is currently mmap-ed πΊοΈ
When a GEM has pages allocated and the mmap_count is > 0, the GEM is placed in the mmapped list. This comes right after unused because we can relatively easily tear down user mappings. it's giving "slightly more work but still cute" π
PANTHOR_GEM_GPU_MAPPED_SINGLE_VM
GEM is GPU mapped to only one VM π
When a GEM is mapped to a single VM, reclaim requests have more chances to succeed, because we only need to synchronize against a single GPU context. This is more annoying than reclaiming mmap-ed pages still, because we have to wait for in-flight jobs to land, and we might not be able to acquire all necessary locks at reclaim time either. not me having to wait for jobs to land π
PANTHOR_GEM_GPU_MAPPED_MULTI_VM
GEM is GPU mapped to multiple VMs π
Like PANTHOR_GEM_GPU_MAPPED_SINGLE_VM, but the synchronization across VMs makes such BOs harder to reclaim. more VMs = more chaos, fr fr π
PANTHOR_GEM_UNRECLAIMABLE
GEM can't be reclaimed π«
Happens when the GEM memory is pinned. It's also the state all GEM objects start in, because no memory is allocated until explicitly requested by a CPU or GPU map, meaning there's nothing to reclaim until such an allocation happens. iconic default behavior honestly β nothing to reclaim because there's literally nothing there yet π«
π¦ Description π¦
This is defined in descending reclaimability order and some part of the code depends on that.
β οΈ bestie read that again: descending reclaimability order β and some part of the code literally depends on it. do not reorder the enum, i am begging π
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/panthor/panthor_gem.hstructpanthor_gem_debugfs(9) - struct
panthor_gem_backing(9) - struct
panthor_gem_cpu_map(9) - struct
panthor_gem_dev_map(9) - struct
panthor_gem_object(9) - struct
panthor_kernel_bo(9)
aaaand that's the whole page, you ate that π this icon of a manpage lives in ./drivers/gpu/drm/panthor, stamped October 2026, titled enum panthor...eclaim_state(9) β go forth and reclaim responsibly, mwah ππ
π¦ 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