mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v5 0/2] workqueue: Make WQ_UNBOUND the default behavior
@ 2026-11-02 11:00 Marco Crivellari
  2026-11-02 11:00 ` [PATCH v5 1/2] workqueue: Make alloc_workqueue() unbound by default Marco Crivellari
  2026-11-02 11:00 ` [PATCH v5 2/2] workqueue: doc: Update WQ_UNBOUND and WQ_BH documentation Marco Crivellari
  0 siblings, 2 replies; 3+ messages in thread
From: Marco Crivellari @ 2026-11-02 11:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
	Breno Leitao

Hi,

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

This default is suboptimal: most workloads benefit from unbound queues,
allowing the scheduler to place worker threads where they're needed and
reducing noise when CPUs are isolated.

This series changes this behavior 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.

[ P2 ]

  Documentation updated accordingly.

Thanks!

---
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/20261015140148.231126-1-marco.crivellari@suse.com/

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

Link to v3: https://lore.kernel.org/all/20260904141421.287647-1-marco.crivellari@suse.com/

Changes in v3:
- WQ_BH require WQ_PERCPU

Link to v2: https://lore.kernel.org/all/20260903165251.481362-1-marco.crivellari@suse.com/

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/20260903152204.401638-1-marco.crivellari@suse.com/


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

 Documentation/core-api/workqueue.rst | 14 +++++++-----
 include/linux/workqueue.h            |  4 ++--
 kernel/workqueue.c                   | 32 ++++++++++++++--------------
 3 files changed, 27 insertions(+), 23 deletions(-)

-- 
2.56.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-02 11:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02 11:00 [PATCH v5 0/2] workqueue: Make WQ_UNBOUND the default behavior Marco Crivellari
2026-11-02 11:00 ` [PATCH v5 1/2] workqueue: Make alloc_workqueue() unbound by default Marco Crivellari
2026-11-02 11:00 ` [PATCH v5 2/2] workqueue: doc: Update WQ_UNBOUND and WQ_BH documentation Marco Crivellari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®