From: Marco Crivellari <marco.crivellari@suse.com>
To: linux-kernel@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>, Lai Jiangshan <jiangshanlai@gmail.com>,
Frederic Weisbecker <frederic@kernel.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Marco Crivellari <marco.crivellari@suse.com>,
Michal Hocko <mhocko@suse.com>, Breno Leitao <leitao@debian.org>
Subject: [PATCH v4 0/2] workqueue: Add warnings and check WQ flags usage
Date: Fri, 29 May 2026 15:06:38 +0200 [thread overview]
Message-ID: <20260529130640.220328-1-marco.crivellari@suse.com> (raw)
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
next reply other threads:[~2026-05-29 13:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 13:06 Marco Crivellari [this message]
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-10 12:48 ` Tetsuo Handa
2026-06-10 15:22 ` Mark Brown
2026-06-10 17:28 ` Nathan Chancellor
2026-06-11 10:28 ` Mark Brown
2026-06-12 13:12 ` Tetsuo Handa
2026-06-01 15:41 ` Marco Crivellari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260529130640.220328-1-marco.crivellari@suse.com \
--to=marco.crivellari@suse.com \
--cc=bigeasy@linutronix.de \
--cc=frederic@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®