for_each_pwq(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– for_each_pwq(9) β€” Kernel API Manual πŸ’–

okay bestie, welcome to the Kernel API Manual page for for_each_pwq β€” it’s giving β€œlittle iterator with big responsibilities” energy, and we’re gonna get through it together πŸ’…βœ¨


πŸ¦‹ SYNOPSIS πŸ¦‹

for_each_pwq (pwq , wq );

πŸŽ€ ARGUMENTS πŸŽ€

  • pwq β€” iteration cursor, aka the little β€œwhere are we now” bestie πŸ’«
  • wq β€” the target workqueue 🎯

✨ DESCRIPTION ✨

okay so this one iterates through all the pool_workqueues of the specified workqueue β€” yes, all of them, no cap πŸ’–

bestie, locking check: this must be called either with wq->mutex held or RCU read locked. like, actually must. πŸ”’

If the pwq needs to be used beyond the locking in effect, the caller is responsible for guaranteeing that the pwq stays online. that part is on you, not the iterator β€” keep your fave pwq alive, please 🫢

The if/else clause exists only for the lockdep assertion and can be ignored. literally just there for the lockdep assertion, so don’t stress about it 🌸


πŸ’… SEE ALSO πŸ’…

Kernel file ./kernel/workqueue.c and the whole extended friend group:


okay bye bestie πŸ’– this page’s footer vibe is source/version ./kernel, date October 2026, and the page is for_each_pwq(9) β€” stay locked, stay online, slay πŸ«ΆπŸŽ€βœ¨

πŸ“¦ where this page comes from