create_worker(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ create_worker πŸ’…

okay so you're reading a kernel API manual page, section 9 of the manual set β€” the one for the big-kid internal kernel interfaces. this specific page is create_worker, and honestly? it's giving "small function, massive responsibility." let's get into it 🫢


✨ NAME ✨

create_worker β€” create a new workqueue worker πŸ’–

like. literally that. it makes a worker. a whole little guy whose entire personality is "i run work items." iconic.


✨ SYNOPSIS ✨

struct worker * create_worker (struct worker_pool *pool );

so it hands you back a struct worker * (pointer to a fresh worker, slay) and it takes exactly one thing: a struct worker_pool * named pool. one in, one out. balanced. we love a clean signature ✨


✨ ARGUMENTS ✨

  • pool β€” the pool your new worker is gonna belong to πŸ’« like, this is its home pool, its little found family, the struct worker_pool it gets attached to.

✨ DESCRIPTION ✨

okay so what actually happens: create_worker creates and starts a brand-new worker, and that worker is attached to pool 🌸

read that again bestie β€” it doesn't just allocate a struct and leave it there to vibe in the void. it creates and starts it. the worker gets made and it gets going, and it belongs to the pool you passed in. no cap, that's the whole thing. short function, short description, main character energy πŸ”₯


🌈 CONTEXT 🌈

might sleep. 😴 and it does GFP_KERNEL allocations.

fr fr, pay attention to this part β€” sleeping means don't call this from atomic context, because if you do it's gonna be a whole mess πŸ’€ GFP_KERNEL allocations can sleep too, so like… yeah. keep it in a context where sleeping is legal, bestie. it's not a "whoops, try again" situation, it's a "you should not have done that" situation πŸ™ˆ


πŸ‘‘ RETURN πŸ‘‘

a pointer to the newly created worker ⭐ that's it, that's the return value β€” the shiny new struct worker *. take it, it's yours now πŸ’œ


πŸ¦‹ SEE ALSO πŸ¦‹

bestie. sit down. πŸ“ the original page points at the kernel file ./kernel/workqueue.c and then dumps what is essentially the entire workqueue cinematic universe on you. i'm not skipping a single one β€” here's the full squad, in order:


and that's the whole page, bestie πŸ’… this one ships out of the ./kernel source tree, dated October 2026 β€” so yeah, mark your calendar, that's the version you're reading. go forth and make workers πŸ§šπŸ’–

πŸ“¦ where this page comes from