drmm_alloc_o...ed_workqueue(9)
π drmm_alloc_ordered_workqueue (9)
okay so bestie, welcome to the kernel API manual β this one lives in the Kernel API Manual, and the whole vibe is: you want a workqueue, but you want your drm_device to handle the cleanup for you. no cap, it's giving "managed responsibility" and we're obsessed. π
β¨ NAME β¨
drmm_alloc_ordered_workqueue β the &drm_device-managed version of alloc_ordered_workqueue(). literally the same energy, just with automatic cleanup built in π«Ά
πΈ SYNOPSIS πΈ
drmm_alloc_ordered_workqueue (dev , fmt , flags , args... );
π¦ ARGUMENTS π¦
devβ your DRM device. the main character, honestly πfmtβ aprintfformat for the name of the workqueue. yes, it gets a name. slay πflagsβ theWQ_*flags. heads up though: onlyWQ_FREEZABLEandWQ_MEM_RECLAIMare actually meaningful here. the rest are just... there. not me pointing that out πargsβ args forfmt. the lil supporting cast for the name β¨
π DESCRIPTION π
so this is a drm_device-managed version of alloc_ordered_workqueue. and the way it works is chef's kiss β the allocated workqueue is automatically destroyed on the final drm_dev_put. no manual teardown, no "oops i forgot to free it" moment. iconic behavior fr fr π₯
β RETURN β
on success you get the workqueue. on failure, you get a negative ERR_PTR. so check it, bestie β don't just assume it's fine π
π SEE ALSO π
kernel file ./include/drm/drm_managed.h, plus the whole managed-allocation friend group:
drmm_add_action(9)drmm_add_action_or_reset(9)drmm_kzalloc(9)drmm_kmalloc_array(9)drmm_kcalloc(9)drmm_mutex_init(9)
they all understood the assignment π
lowkey reminder: the only flags doing any work areWQ_FREEZABLEandWQ_MEM_RECLAIMβ everything else is just along for the ride π§
and that's the page! brought to you from ./include/drm, dated October 2026, under the title drmm_alloc_o...ed_workqueue(9) β yes the page title itself got truncated and honestly? relatable. bye bestie, go manage some workqueues ππΈ
π¦ 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