drm_pagemap_..._create_devm(9)
π drm_pagemap_..._create_devm(9) β from the Kernel API Manual, bestie β¨
okay so real talk, this page lives in the Kernel API Manual (section 9, the fun one where all the kernel functions hang out), and the star of the show is a function whose full name got so long the title had to go to the gym: drm_pagemap_shrinker_create_devm. Strap in π
β¨ NAME β¨
drm_pagemap_shrinker_create_devm β literally just create and register a pagemap shrinker. That's the whole assignment, no cap π«Ά
πΈ SYNOPSIS πΈ
struct drm_pagemap_shrinker * drm_pagemap_shrinker_create_devm (struct
drm_device *drm );
yes bestie it returns a pointer to a struct drm_pagemap_shrinker β hold that thought, we're gonna circle back at RETURN π
π¦ ARGUMENTS π¦
drmβ the drm device. that's it. that's the argument. she takes exactly one (1)struct drm_device *and she's thriving π
π₯ DESCRIPTION π₯
so what does she do. She creates and registers a pagemap shrinker β like, both, in one call, main character energy β¨
And what's a pagemap shrinker for? It shrinks unused pagemaps, which reduces memory footprint. iykyk. Less wasted memory = happier system, and honestly we love a memory-footprint glow-up π
The important vibe check here: the shrinker is drm_device managed, and it unregisters itself when the drm device is removed. So you don't have to babysit it or come back later to clean up β she handles her own exit, iconic behaviour fr fr π
π RETURN π
okay the manpage says:0on success, negative error code on failure. Write it exactly like that and don't @ me β yes, the SYNOPSIS shows a pointer return type, and yes, the RETURN section says0/negative error code. That's what the docs say, so that's what I'm telling you. Both facts live here, bestie π
0β success π- negative error code β failure π
π§ SEE ALSO π§
the whole friend group, no one left out π«Ά this all lives in the kernel file ./drivers/gpu/drm/drm_pagemap_util.c:
struct drm_pagemap_cache(9)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)struct drm_pagemap_owner(9)drm_pagemap_release_owner(9)interconnect_fn(9)drm_pagemap_acquire_owner(9)
and that's the page!! π shoutout to the ./drivers/gpu/drm directory for hosting all of this, dated October 2026 β go read the whole drm_pagemap_..._create_devm(9) saga whenever you need it, 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