mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] workqueue: Add warnings and check WQ flags usage
@ 2026-05-28 16:01 Marco Crivellari
  2026-05-28 16:01 ` [PATCH v3 1/2] workqueue: Add warnings and fallback if system_{unbound}_wq is used Marco Crivellari
  2026-05-28 16:01 ` [PATCH v3 2/2] workqueue: Add warnings and ensure one among WQ_PERCPU or WQ_UNBOUND is present Marco Crivellari
  0 siblings, 2 replies; 7+ messages in thread
From: Marco Crivellari @ 2026-05-28 16:01 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, a warning will be printed.

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 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] 7+ messages in thread

end of thread, other threads:[~2026-05-29  8:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-28 16:01 [PATCH v3 0/2] workqueue: Add warnings and check WQ flags usage Marco Crivellari
2026-05-28 16:01 ` [PATCH v3 1/2] workqueue: Add warnings and fallback if system_{unbound}_wq is used Marco Crivellari
2026-05-28 16:18   ` Breno Leitao
2026-05-29  8:30     ` Marco Crivellari
2026-05-28 16:01 ` [PATCH v3 2/2] workqueue: Add warnings and ensure one among WQ_PERCPU or WQ_UNBOUND is present Marco Crivellari
2026-05-28 16:25   ` Tejun Heo
2026-05-29  8:48     ` 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®