STRUCT DRM_GEM_LRU(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, we're in the Kernel API Manual and this page is struct drm_gem_lru(9) β€” let's get into it πŸ’…βœ¨

πŸ’– NAME πŸ’–

struct drm_gem_lru β€” a simple LRU helper. That's the whole vibe, no cap. πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

Okay so here's the struct, literally:

struct drm_gem_lru {
    long count;
    struct list_head list;
};

🌸 Members 🌸

  • count β€” the total number of backing pages of the GEM objects in this LRU. It's giving page-count main character πŸ”₯
  • list β€” the LRU list. Periodt. πŸ’…

✨ Description ✨

So this little struct is a helper for tracking GEM objects in a given state, and it's here to aid in the driver's shrinker implementation. Lowkey iconic. 🫢

It tracks the count of pages for lockless shrinker.count_objects, and it provides drm_gem_lru_scan for the driver's shrinker.scan_objects implementation. Obsessed. ⭐

⚠️ bestie, important: any access to this kind of object must be done with drm_device::gem_lru_mutex held. Not me stressing this β€” fr fr, don't skip it. πŸ˜­πŸ”’

🌈 SEE ALSO 🌈

Kernel file ./include/drm/drm_gem.h β€” plus all these besties:


and that's the page, bestie β€” sourced from ./include/drm, dated October 2026, struct drm_gem_lru(9) byeee πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from