drmm_kmalloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– drmm_kmalloc(9) πŸ’–

okay so this is the Kernel API Manual entry for drmm_kmalloc(9), and bestie, it’s giving β€œmanaged memory but make it DRM” energy. no cap.


🌸 NAME 🌸

  • drmm_kmalloc β€” &drm_device managed kmalloc()

✨ SYNOPSIS ✨

void * drmm_kmalloc (struct drm_device *dev , size_t size , gfp_t gfp );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” DRM device. the main character device struct, periodt.
  • size β€” size of the memory allocation. literally how much memory we’re asking for.
  • gfp β€” GFP allocation flags. the flags that tell the allocation how to behave.

πŸ’… DESCRIPTION πŸ’…

This is a drm_device managed version of kmalloc. The allocated memory is automatically freed on the final drm_dev_put. Memory can also be freed before the final drm_dev_put by calling drmm_kfree.

so yeah: it’s the managed-memory vibe, and cleanup is handled for you at the final drm_dev_put β€” but you can also free it early with drmm_kfree if you need to. iconic behavior, honestly. 🫢


πŸ¦‹ SEE ALSO πŸ¦‹


β€” sending love from ./drivers/gpu/drm, dated October 2026, on the drmm_kmalloc(9) page πŸ«ΆπŸ’–

πŸ“¦ where this page comes from