set_worker_dying(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… set_worker_dying β€” a Kernel API Manual moment (section 9, bestie)

okay so real talk: this is set_worker_dying(9) from the Kernel API Manual, section 9, and it's honestly one of those tiny little functions that does so much behind the scenes. it's giving "quiet kid in the back of the class who actually runs the whole group project." 🫢


✨ NAME ✨

set_worker_dying β€” Tag a worker for destruction πŸ”₯πŸ’€

like yes, that's the whole pitch. we're marking a worker so it gets yeeted. no cap.


🌸 SYNOPSIS 🌸

void set_worker_dying (struct worker *worker , struct list_head *list );

that's it. two args. in, out, done. ate and left no crumbs. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • worker β€” the worker to be destroyed πŸ’€ this is the main character and honestly its arc is ending.
  • list β€” transfer worker away from its pool->idle_list and into list ✨ so we're not just deleting them, we're moving them first. very "moving out of the group chat before leaving the group chat" of us.

πŸ¦‹ DESCRIPTION πŸ¦‹

Tag worker for destruction and adjust pool stats accordingly. πŸ”₯

that's the whole flow, bestie: you mark it dying, and the pool's stats get updated so nothing's lying to you later. and here's the thing β€”

The worker should be idle. πŸ™ˆ like, please don't call this on a worker that's mid-task. it's tagged dying, not tagged "wrap up what you're doing." vibe check first, then call.

πŸ‘‘ CONTEXT πŸ‘‘

raw_spin_lock_irq(pool->lock).

periodt. you must be holding pool->lock as a raw spinlock with IRQs off when you call this. that's the context, that's the requirement, no exceptions, iykyk. πŸ”’βš‘


🌈 SEE ALSO 🌈

okay bestie, buckle up, because this list is long β€” it's the entire workqueue extended universe and i'm obsessed. the kernel file to go read is ./kernel/workqueue.c, and here's every single cross-reference, all 108 of them, no skips, no shortcuts: 🧚✨

literally the whole friend group. go say hi to all of them. πŸŒΈπŸ’œ


and that's the page, bestie!! this one shipped out of ./kernel in October 2026 β€” so when you see that date stamp, you'll know exactly which era of workqueue lore you're reading. mwah πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from