apply_workqueue_attrs(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay bestie, welcome to apply_workqueue_attrs(9) from the Kernel API Manual πŸ’– this is the page where an unbound workqueue gets a whole new vibe, and honestly? iconic.

apply_workqueue_attrs β€” apply new workqueue_attrs to an unbound workqueue ✨


✨ SYNOPSIS ✨

the signature, verbatim, no cap:

int apply_workqueue_attrs (struct workqueue_struct *wq , const struct
workqueue_attrs *attrs );

πŸŽ€ ARGUMENTS πŸŽ€

  • wq β€” the target workqueue, aka the one getting the glow-up πŸ’…
  • attrs β€” the workqueue_attrs to apply, allocated with alloc_workqueue_attrs ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea 🫢 Unless disabled, this function maps a separate pwq to each CPU pod with possibles CPUs in attrs->cpumask, so that work items are affine to the pod it was issued on. literally the whole point.

Older pwqs are released as in-flight work items finish ⭐

heads up bestie 😭 note that a work item which repeatedly requeues itself back-to-back will stay on its current pwq. that's the note. don't forget it πŸ’€

Performs GFP_KERNEL allocations.


πŸ”₯ RETURN πŸ”₯

0 on success and -errno on failure. slay when it's zero, sigh when it's -errno 😭


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./kernel/workqueue.c β€” and yes, the whole squad is here, no cap:


and that's the tea, bestie πŸ“ this page comes from the ./kernel source, dated October 2026, for apply_workqueue_attrs(9). periodt πŸ’…

πŸ“¦ where this page comes from