STRUCT DRM_GEM_SHMEM_OBJECT(9)
π NAME π
okay bestie, this is struct drm_gem_shmem_object from the Kernel API Manual β and it is literally the GEM object backed by shmem. no cap, that's the whole name. π«Ά
β¨ SYNOPSIS β¨
struct drm_gem_shmem_object {
struct drm_gem_object base;
struct page **pages;
refcount_t pages_use_count;
refcount_t pages_pin_count;
int madv;
struct list_head madv_list;
struct sg_table *sgt;
void *vaddr;
refcount_t vmap_use_count;
bool pages_mark_dirty_on_put : 1;
bool pages_mark_accessed_on_put : 1;
bool map_wc : 1;
};
π Members π
here's the member-by-member vibe check, bestie π
baseβ Base GEM object πpagesβ Page table πpages_use_countβ Reference count on the pages table. The pages are put when the count reaches zero. β¨pages_pin_countβ Reference count on the pinned pages table.
Pages are hard-pinned and reside in memory if count greater than zero. Otherwise, when count is zero, the pages are allowed to be evicted and purged by memory shrinker. π
madvβ State for madvise.
0 is active/inuse. A negative value is the object is purged. Positive values are driver specific and not used by the helpers. π
madv_listβ List entry for madvise tracking.
Typically used by drivers to track purgeable objects π§
sgtβ Scatter/gather table for imported PRIME buffers π¦vaddrβ Kernel virtual address of the backing memory πΈvmap_use_countβ Reference count on the virtual address. The address is unmapped when the count reaches zero. βpages_mark_dirty_on_putβ Mark pages as dirty when they are put. πpages_mark_accessed_on_putβ Mark pages as accessed when they are put. πmap_wcβ map object write-combined (instead of using shmem defaults). π₯
π SEE ALSO π
- Kernel file
./include/drm/drm_gem_shmem_helper.h drm_gem_shmem_object_free(9)drm_gem_shmem_object_print_info(9)drm_gem_shmem_object_pin(9)drm_gem_shmem_object_unpin(9)drm_gem_shmem_object_get_sg_table(9)drm_gem_shmem_object_mmap(9)DRM_GEM_SHMEM_DRIVER_OPS(9)
okay that's the whole page, mwah π β source/version ./include/drm, date October 2026, and the title is struct drm_gem_shmem_object(9). bye bestie, slay your shmem π«Άβ¨
π¦ 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