drm_pagemap_..._create_devm(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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: 0 on 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 says 0/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:


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