linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/9] workqueue: base pwq pool release and nr_active on the backing pool
@ 2026-08-05 14:52 Breno Leitao
  2026-08-05 14:52 ` [PATCH v2 1/9] workqueue: factor out get_percpu_pool() Breno Leitao
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Breno Leitao @ 2026-08-05 14:52 UTC (permalink / raw)
  To: Tejun Heo, Lai Jiangshan
  Cc: linux-kernel, marco.crivellari, Breno Leitao, kernel-team

The goal is to unify per-cpu and unbound workqueues onto one backend, so
an unbound workqueue can run on the concurrency-managed per-cpu pools and
WQ_PERCPU just requests that backend [1]. This series is preparation and
changes no behaviour on its own.

These changes also is a reasonable readability cleanup.

Design principles, as discussed in [2].

 a) There is one workqueue implementation -- what is today the unbound one --
    and percpu becomes one of its affinity settings rather than a separate
    type. The unbound_* helper names get renamed/removed once they stop
    being unbound-specific. So, `alloc_unbound_pwq()` becomes
    `alloc_pwq` and handle both cases.

 b) There is one pwq path, and alloc_and_link_percpu_pwqs() goes away.

 c) Which pool backs a pwq becomes a property of the attrs, resolved in
    alloc_unbound_pwq(), which hands out either the static percpu pool for
    that CPU or a hashed unbound one.

 d) Both pool types stay -- concurrency management only exists on the percpu
    ones -- so what gets merged is the machinery, not the pools.

 e) This is the prep phase for the changes that will come once we are
    happy with these changes.

What will come later:

  * Introduce a concurrency-managed per-cpu affinity scope
    (WQ_AFFN_PERCPU) — percpu as an affinity setting

  * Direct pool selection (fold the create-then-convert),

  * Dynamic switching between per-cpu and unbound backing for CPU isolation.

[1] https://lore.kernel.org/all/ak569WYSm3ygKl1-@slm.duckdns.org
[2] https://lore.kernel.org/all/anDImojbi6lq0zUg@slm.duckdns.org/

Signed-off-by: Breno Leitao <leitao@debian.org>
---
Changes in v2:
- Removed the ugly __WQ_PERCPU_POOLS
- Renamed some helpers here and there
- additional patches, removing the "unbound" from function names
- Link to v1: https://patch.msgid.link/20260731-wq-pool-refactor-v1-0-8eaf71cdab5f@debian.org

---
Breno Leitao (9):
      workqueue: factor out get_percpu_pool()
      workqueue: factor out alloc_and_link_percpu_pwqs()
      workqueue: release pwq pools by pool type
      workqueue: account nr_active by the backing pool
      workqueue: test WQ_UNBOUND explicitly in the hotplug loops
      workqueue: rename wq->unbound_attrs to wq->attrs
      workqueue: allocate attrs for all workqueues
      workqueue: rename alloc_unbound_pwq() to alloc_pwq()
      workqueue: skip the node_nr_active update for non-unbound workqueues

 kernel/workqueue.c         | 166 +++++++++++++++++++++++++--------------------
 tools/workqueue/wq_dump.py |   6 +-
 2 files changed, 96 insertions(+), 76 deletions(-)
---
base-commit: dbff1ec23f68640a743512e8ada125795d1b72c7
change-id: 20260729-wq-pool-refactor-0fb28721f83f

Best regards,
--  
Breno Leitao <leitao@debian.org>


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

end of thread, other threads:[~2026-08-11 10:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-05 14:52 [PATCH v2 0/9] workqueue: base pwq pool release and nr_active on the backing pool Breno Leitao
2026-08-05 14:52 ` [PATCH v2 1/9] workqueue: factor out get_percpu_pool() Breno Leitao
2026-08-05 14:52 ` [PATCH v2 2/9] workqueue: factor out alloc_and_link_percpu_pwqs() Breno Leitao
2026-08-05 14:52 ` [PATCH v2 3/9] workqueue: release pwq pools by pool type Breno Leitao
2026-08-05 14:52 ` [PATCH v2 4/9] workqueue: account nr_active by the backing pool Breno Leitao
2026-08-10 21:41   ` Tejun Heo
2026-08-11 10:15     ` Breno Leitao
2026-08-05 14:52 ` [PATCH v2 5/9] workqueue: test WQ_UNBOUND explicitly in the hotplug loops Breno Leitao
2026-08-05 14:52 ` [PATCH v2 6/9] workqueue: rename wq->unbound_attrs to wq->attrs Breno Leitao
2026-08-05 14:52 ` [PATCH v2 7/9] workqueue: allocate attrs for all workqueues Breno Leitao
2026-08-05 14:52 ` [PATCH v2 8/9] workqueue: rename alloc_unbound_pwq() to alloc_pwq() Breno Leitao
2026-08-05 14:52 ` [PATCH v2 9/9] workqueue: skip the node_nr_active update for non-unbound workqueues Breno Leitao
2026-08-10 22:10 ` [PATCH v2 0/9] workqueue: base pwq pool release and nr_active on the backing pool Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).