STRUCT DRM_PAGEMAP_CACHE(9)
π 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 thedpagemappointer. πshrinkerβ Pointer to the shrinker used for this cache. Immutable. π§dpagemapβ Non-refcounted pointer to thedrm_pagemap. π«Άqueuedβ Signals when an inactivedrm_pagemaphas 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:
struct drm_pagemap_shrinker(9)drm_pagemap_cache_create_devm(9)Cache lookup(9)drm_pagemap_cache_lock_lookup(9)drm_pagemap_cache_unlock_lookup(9)drm_pagemap_get_from_cache(9)drm_pagemap_cache_set_pagemap(9)drm_pagemap_get_from_cache_if_active(9)drm_pagemap_shrinker_might_lock(9)drm_pagemap_shrinker_add(9)drm_pagemap_shrinker_create_devm(9)struct drm_pagemap_owner(9)drm_pagemap_release_owner(9)interconnect_fn(9)drm_pagemap_acquire_owner(9)
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
- 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