Skip to content

workqueue: Make WQ_UNBOUND the default behavior

Marco Crivellari lkml 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest2 patches 3 repliesIn review
  2. v52 patches 2 repliesSuperseded
  3. v42 patches 8 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v32 patches2 repliesSuperseded
v22 patches2 repliesSuperseded
v12 patches1 replySuperseded

Changes in v6 from the cover letter

- rephrase cover letter

- change comments in workqueue.c, workqueue.h, power/Kconfig, kernel parameters so that they now reflect what has been done.

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2workqueue: Make alloc_workqueue() unbound by defaultDocumentation/admin-guide/kernel-parameters.txt include/linux/workqueue.h kernel/power/Kconfig +1 more+39 -430 replies
2/2workqueue: doc: Update WQ_UNBOUND and WQ_BH documentationDocumentation/core-api/workqueue.rst+7 -40 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchBreno Leitao
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/2] workqueue: Make WQ_UNBOUND the default behavior

Hi,

Currently alloc_workqueue() make sure one among WQ_UNBOUND or WQ_PERCPU is present with the current default being WQ_PERCPU.

Per-CPU workqueues provide strict CPU affinity and concurrency management. Some users rely on these properties, but many don't need them, and for those users per-CPU workqueues significantly restrict what the scheduler can do with their work items.

Unbound workqueues now use non-strict (soft) affinity scopes, so they keep part of the locality benefits while giving the scheduler more flexibility. This helps system-level concerns such as power management and CPU isolation.

This series therefore transitions alloc_workqueue() to unbound as the default. Users that need per-CPU behavior can still request it explicitly with WQ_PERCPU.

The behavior changes as follows:

[ P1 ]

- keep WARN_ON() if WQ_PERCPU and WQ_UNBOUND are present and drop WQ_PERCPU.

- defaults to WQ_UNBOUND except for WQ_BH, that it is always per-CPU.

- WQ_POWER_EFFICIENT description, kernel parameters and konfig description changed to reflect what this patch introduces.

[ P2 ]

Documentation updated accordingly.

Thanks!

---
Changes in v6:
- rephrase cover letter

- change comments in workqueue.c, workqueue.h, power/Kconfig, kernel parameters so that they now reflect what has been done.

Link to v5: https://lore.kernel.org/all/[email protected]/

Changes in v5:
From Tejun / Breno:

- Dropped the pr_warn_once() when neither among WQ_PERCPU | WQ_UNBOUND is present and add WQ_UNBOUND.

- move wq_dropped_percpu declaration on top

- improve comments and commit log, so that it better describe also the reasons of this change.

- prefix "workqueue: doc:" on documentation improving descriptions about the flags.

Link to v4: https://lore.kernel.org/all/[email protected]/

Changes in v4:
- WQ_BH: add documentation about BH workqueue implying WQ_PERCPU

Link to v3: https://lore.kernel.org/all/[email protected]/

Changes in v3:
- WQ_BH require WQ_PERCPU

Link to v2: https://lore.kernel.org/all/[email protected]/

Changes in v2:
- if/else to add/drop WQ_UNBOUND/WQ_PERCPU moved before wq_size assignment

Link to v1: https://lore.kernel.org/all/[email protected]/

Marco Crivellari (2):
workqueue: Make alloc_workqueue() unbound by default
workqueue: doc: Update WQ_UNBOUND and WQ_BH documentation

 .../admin-guide/kernel-parameters.txt         | 15 +++-----
 Documentation/core-api/workqueue.rst          | 11 ++++--
 include/linux/workqueue.h                     | 23 +++++-------
 kernel/power/Kconfig                          |  7 ++--
 kernel/workqueue.c                            | 37 +++++++++++--------
 5 files changed, 46 insertions(+), 47 deletions(-)
Signature · 1 line
2.56.0