STRUCT DRM_GEM_SHMEM_OBJECT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 🌈


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