drmm_kmalloc(9)
π 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 π¦
- Kernel file
./drivers/gpu/drm/drm_managed.c managed resources(9)drmm_release_action(9)drmm_kstrdup(9)drmm_kfree(9)
β sending love from ./drivers/gpu/drm, dated October 2026, on the drmm_kmalloc(9) page π«Άπ
π¦ 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