STRUCT DRM_PAGEMAP_CACHE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct drm_pagemap_cache(9) πŸ’–

Hey bestie!! Welcome to the Kernel API Manual page for struct drm_pagemap_cache(9) β€” yes, the lookup structure for pagemaps. Buckle up, it’s giving kernel-struct realness. πŸŽ€

✨ NAME ✨

struct drm_pagemap_cache β€” lookup structure for pagemaps. πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

       struct drm_pagemap_cache {
           struct mutex lookup_mutex;
           spinlock_t lock;
           struct drm_pagemap_shrinker *shrinker;
           struct drm_pagemap *dpagemap;
           struct completion queued;
        };

🌈 Members 🌈

  • lookup_mutex β€” Mutex making the lookup process atomic. πŸ”’
  • lock β€” Lock protecting the dpagemap pointer. πŸ”
  • shrinker β€” Pointer to the shrinker used for this cache. Immutable. 🧚
  • dpagemap β€” Non-refcounted pointer to the drm_pagemap. 🫢
  • queued β€” Signals when an inactive drm_pagemap has been put on shrinker's list. ⭐

🌸 Description 🌸

Okay so this struct is the whole tracking situation for pagemaps: it keeps tabs on active (refcount > 1) and inactive (refcount == 0) pagemaps. The inactive ones aren’t doomed β€” they can be made active again by waiting for the queued completion. That completion means the pagemap has been put on the shrinker's list of shrinkable pagemaps, and then you successfully remove it from shrinker's list. That removal can fail if the shrinker is already in the process of freeing the pagemap β€” so yeah, that’s the caveat. πŸ’€

And the capacity? A struct drm_pagemap_cache can hold a single struct drm_pagemap. One cache, one pagemap, periodt. πŸ’…

πŸ”₯ SEE ALSO πŸ”₯

Kernel file: ./drivers/gpu/drm/drm_pagemap_util.c β€” that’s where the source lives, iykyk. Then the reference crew:


Catch you later, bestie! Source/version corner: ./drivers/gpu/drm; date stamp: October 2026; page: struct drm_pagemap_cache(9). Mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from