get_work_pool(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

This little icon lives in the Kernel API Manual, and she is here to help you find the worker_pool a work item was associated with. Periodt. πŸ¦‹


✨ NAME ✨

get_work_pool β€” return the worker_pool a given work was associated with. No cap, that's literally her whole job. πŸ’…

πŸŽ€ SYNOPSIS πŸŽ€

struct worker_pool * get_work_pool (struct work_struct *work );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • work β€” the work item of interest, aka the lil work thing you're curious about. 🫢

🌸 DESCRIPTION 🌸

Okay so pools are created and destroyed under wq_pool_mutex, and read access is allowed under the RCU read lock. Because of that, this function should be called under wq_pool_mutex or inside of a rcu_read_lock region. Locking check, bestie β€” do not skip it. πŸ’€

All fields of the returned pool are accessible as long as the above mentioned locking is in effect. Every field. Fair game. Accessible. But if the returned pool needs to be used beyond the critical section, the caller is responsible for ensuring the returned pool is and stays online. That means you, bestie β€” you gotta keep that pool alive and online if you're taking it past the critical section. πŸ”₯

Locking is the vibe check here: call this under wq_pool_mutex or inside a rcu_read_lock region. If you need the pool after the critical section, keeping it online is on you. πŸŽ€

πŸ”₯ RETURN πŸ”₯

The worker_pool that work was last associated with. NULL if none β€” literally no pool, no vibe. 😭

🌈 SEE ALSO 🌈

Kernel file ./kernel/workqueue.c and the whole extended friend group, copy these exactly bestie:


Source/version: ./kernel Β· date: October 2026 Β· page: get_work_pool(9). That's the whole footer, bestie β€” love u, bye πŸ’–βœ¨

πŸ“¦ where this page comes from