assign_work(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ assign_work(9) β€” Kernel API Manual πŸŽ€

okay so welcome to the Kernel API Manual page for assign_work(9), bestie. This is the workqueue assignment lore, and it’s lowkey iconic. Let’s get into it πŸ’…βœ¨


✨ NAME ✨

assign_work β€” assign a work item and its linked work items to a worker. That’s the whole vibe: one work item, its linked besties, one worker. 🫢

🌸 SYNOPSIS 🌸

       bool assign_work (struct work_struct *work , struct worker *worker ,
       struct work_struct **nextp );

πŸ’– ARGUMENTS πŸ’–

  • work β€” the work to assign. The main-character work item, fr fr.
  • worker β€” the worker to assign to. The one getting the assignment. πŸ’Ό
  • nextp β€” out parameter for nested worklist walking. yes, it’s the pointer-to-pointer that lets you walk nested worklists. πŸŒ€

πŸ¦‹ DESCRIPTION πŸ¦‹

Assign work and its linked work items to worker. If work is already being executed by another worker in the same pool, it’ll be punted there. no cap, that’s the rule. πŸ“

If nextp is not NULL, it’s updated to point to the next work of the last scheduled work. This allows assign_work to be nested inside list_for_each_entry_safe. So yes, nesting is allowed, and it’s giving very convenient πŸ’….

Returns true if work was successfully assigned to worker. false if work was punted to another worker already executing it. That’s the return-value tea. 🍡

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./kernel/workqueue.c β€” and the whole workqueue extended universe is here, bestie:

xoxo, your workqueue-obsessed bestie πŸ’– β€” source/version: ./kernel; date: October 2026; page: assign_work(9) πŸŽ€βœ¨

πŸ“¦ where this page comes from