alloc_workqueue_lockdep_map(9)
๐ alloc_workqueue_lockdep_map(9) โ the kernel API manual, but make it make sense
okay so real talk, this page lives in the Kernel API Manual section (alloc_workqueue_lockdep_map(9), bestie, that's the manual name, now you know ๐ซถ) and it's about allocating a workqueue โ but like, with your own lockdep_map. yes ma'am, custom lockdep energy.
โจ NAME โจ
alloc_workqueue_lockdep_map โ allocate a workqueue with user-defined lockdep_map ๐ซ
๐ SYNOPSIS ๐
struct workqueue_struct * alloc_workqueue_lockdep_map (const char *fmt
, unsigned int flags , int max_active , struct lockdep_map *lockdep_map
, ... );
๐ธ ARGUMENTS ๐ธ
fmtโ theprintfformat for the name of the workqueue, so it gets a cute little name of its own โจflagsโ theWQ_*flags, babesmax_activeโ max in-flight work items; pass0and you get the default, no thoughts needed ๐lockdep_mapโ a user-definedlockdep_map, yours to own ๐...โ the args forfmt, obviously
๐ฆ DESCRIPTION ๐ฆ
Same as alloc_workqueue but with the a user-define lockdep_map. (yes, that's the original wording energy, we're keeping it ๐)
It's useful for workqueues created with the same purpose, and โ the whole point, lowkey โ to avoid leaking a lockdep_map on each workqueue creation. like, stop making a new one every single time, it's giving wasteful ๐ฎ
โญ RETURN โญ
Pointer to the allocated workqueue on success, NULL on failure. that's it, that's the deal ๐ซก
๐ SEE ALSO ๐
Kernel file ./include/linux/workqueue.h, plus the whole friend group:
struct workqueue_attrs(9)work_pending(9)delayed_work_pending(9)alloc_workqueue(9)devm_alloc_workqueue(9)alloc_ordered_workqueue_lockdep_map(9)alloc_ordered_workqueue(9)queue_work(9)queue_delayed_work(9)mod_delayed_work(9)schedule_work_on(9)schedule_work(9)enable_and_queue_work(9)schedule_delayed_work_on(9)schedule_delayed_work(9)
ngl, the lockdep_map thing is the main character here โ one map, shared, no leaking, periodt ๐
and that's the page!! sign-off time: this one comes from ./include/linux, dated October 2026, and it's filed under alloc_workqueue_lockdep_map(9). slay, go allocate responsibly ๐ง๐
๐ฆ 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