All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] workqueue: Add warnings and check WQ flags usage
@ 2026-05-29 13:06 Marco Crivellari
  2026-05-29 13:06 ` [PATCH v4 1/2] workqueue: Add warnings and fallback if system_{unbound}_wq is used Marco Crivellari
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Marco Crivellari @ 2026-05-29 13:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
	Breno Leitao

Hi,

Currently system_wq and system_unbound_wq can still be used and no message
is printed. To avoid further use of them, add a warning. The detection of
deprecated workqueue is done using a new internal flag, called __WQ_DEPRECATED.

Similar scenario for WQ_PERCPU and WQ_UNBOUND. Currently there are still
users that use alloc_workqueue(,0,). To avoid such situations, a couple
of checks have been added:

  - if neither of the flag is present, set WQ_PERCPU
  - if both are present, remove WQ_PERCPU

Along with these, WARN_ONCE() is used.

Thanks!


Marco Crivellari (2):
  workqueue: Add warnings and fallback if system_{unbound}_wq is used
  workqueue: Add warnings and ensure one among WQ_PERCPU or WQ_UNBOUND
    is present

 include/linux/workqueue.h |  1 +
 kernel/workqueue.c        | 31 ++++++++++++++++++++++++++++---
 2 files changed, 29 insertions(+), 3 deletions(-)

---
Changes in v4:
- P2: instead of pr_warn_once() use WARN_ONCE()

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

Changes in v3:
- system_wq / system_unbond_wq not routed to the newer. The warnings have been simpliified
  keeping only one of them inside __queue_work() printing the work function.

- the deprecated status is detected using a new internal flag, called __WQ_DEPRECATED.

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

Changes in v2:
- rebased on v7.1-rc5

- fixed typo in the text

- cleared WQ_PERCPU when wq_pwer_efficient flag is set, to avoid triggering a warning

- if statement to route old workqueue to newer also added in queue_rcu_work()

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

-- 
2.54.0


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

end of thread, other threads:[~2026-06-01 17:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-29 13:06 [PATCH v4 0/2] workqueue: Add warnings and check WQ flags usage Marco Crivellari
2026-05-29 13:06 ` [PATCH v4 1/2] workqueue: Add warnings and fallback if system_{unbound}_wq is used Marco Crivellari
2026-05-29 13:06 ` [PATCH v4 2/2] workqueue: Add warnings and ensure one among WQ_PERCPU or WQ_UNBOUND is present Marco Crivellari
2026-05-29 18:07 ` [PATCH v4 0/2] workqueue: Add warnings and check WQ flags usage Tejun Heo
2026-05-30 10:54   ` Tetsuo Handa
2026-05-31 16:48     ` Tejun Heo
2026-05-31 22:12       ` Tetsuo Handa
2026-06-01 14:47         ` Tejun Heo
2026-06-01 17:51           ` Tetsuo Handa
2026-06-01 15:41   ` Marco Crivellari

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.