STRUCT WORKQUEUE_ATTRS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct workqueue_attrs(9) πŸ’…

okay bestie, you're in the Kernel API Manual and this is the struct workqueue_attrs(9) page β€” the struct for workqueue attributes, and she's lowkey carrying the whole vibe. ✨

🌸 NAME 🌸

struct workqueue_attrs β€” a struct for workqueue attributes. That's the name, that's the job, and she's iconic for it. πŸŽ€

✨ SYNOPSIS ✨

Here's the exact shape of her, bestie:

struct workqueue_attrs {
    int nice;
    cpumask_var_t cpumask;
    cpumask_var_t __pod_cpumask;
    bool affn_strict;
    enum wq_affn_scope affn_scope;
    bool ordered;
 };

πŸŽ€ Members πŸŽ€

  • nice β€” nice level 😌
  • cpumask β€” allowed CPUs. πŸ–₯️ Work items in this workqueue are affine to these CPUs and not allowed to execute on other CPUs. A pool serving a workqueue must have the same cpumask.
  • __pod_cpumask β€” internal attribute used to create per-pod pools. 🫣 Internal use only. Per-pod unbound worker pools are used to improve locality. Always a subset of ->cpumask. A workqueue can be associated with multiple worker pools with disjoint __pod_cpumask's. Whether the enforcement of a pool's __pod_cpumask is strict depends on affn_strict.
  • affn_strict β€” affinity scope is strict. πŸ”’ If clear, workqueue will make a best-effort attempt at starting the worker inside __pod_cpumask but the scheduler is free to migrate it outside. If set, workers are only allowed to run inside __pod_cpumask.
  • affn_scope β€” unbound CPU affinity scope. 🧚 CPU pods are used to improve execution locality of unbound work items. There are multiple pod types, one for each wq_affn_scope, and every CPU in the system belongs to one pod in every pod type. CPUs that belong to the same pod share the worker pool. For example, selecting WQ_AFFN_NUMA makes the workqueue use a separate worker pool for each NUMA node. 🌈
  • ordered β€” work items must be executed one by one in queueing order. 🚦

πŸ’– Description πŸ’–

This can be used to change attributes of an unbound workqueue. That's the tea. β˜•

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/linux/workqueue.h β€” plus the whole bestie squad: work_pending(9), delayed_work_pending(9), alloc_workqueue(9), devm_alloc_workqueue(9), alloc_workqueue_lockdep_map(9), alloc_ordered_workqueue_lockdep_map(9), alloc_ordered_workqueue(9), queue_work(9), queue_delayed_work(9), mod_delayed_work(9), schedule_work_on(9), schedule_work(9), enable_and_queue_work(9), schedule_delayed_work_on(9), schedule_delayed_work(9).


mwah πŸ’‹ β€” this page is from ./include/linux, October 2026, and it's struct workqueue_attrs(9) signing off. Bye bestie! πŸ’–βœ¨

πŸ“¦ where this page comes from