mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Marco Crivellari <marco.crivellari@suse.com>
Cc: linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>,
	 Lai Jiangshan <jiangshanlai@gmail.com>,
	Frederic Weisbecker <frederic@kernel.org>,
	 Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Michal Hocko <mhocko@suse.com>
Subject: Re: [PATCH v3 1/2] workqueue: Add warnings and fallback if system_{unbound}_wq is used
Date: Thu, 28 May 2026 17:18:45 +0100	[thread overview]
Message-ID: <ahhq0XEygZBvEw3t@gmail.com> (raw)
In-Reply-To: <20260528160159.471265-2-marco.crivellari@suse.com>

On Thu, May 28, 2026 at 06:01:58PM +0000, Marco Crivellari wrote:
> Currently many users transitioned already to the new introduced workqueue
> (system_percpu_wq, system_dfl_wq), but there are new users who still use the
> older system_wq and system_unbound_wq.
> 
> This change try to push this transition forward, by warning whether the old
> workqueus are used.
> 
> Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/
> Suggested-by: Tejun Heo <tj@kernel.org>
> Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
> ---
>  include/linux/workqueue.h |  1 +
>  kernel/workqueue.c        | 12 ++++++++++--
>  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
> index 6177624539b3..a283766a192a 100644
> --- a/include/linux/workqueue.h
> +++ b/include/linux/workqueue.h
> @@ -409,6 +409,7 @@ enum wq_flags {
>  	__WQ_DRAINING		= 1 << 16, /* internal: workqueue is draining */
>  	__WQ_ORDERED		= 1 << 17, /* internal: workqueue is ordered */
>  	__WQ_LEGACY		= 1 << 18, /* internal: create*_workqueue() */
> +	__WQ_DEPRECATED		= 1 << 19, /* internal: workqueue is deprecated */
>  
>  	/* BH wq only allows the following flags */
>  	__WQ_BH_ALLOWS		= WQ_BH | WQ_HIGHPRI | WQ_PERCPU,
> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> index 33b721a9af02..0b55f8009eed 100644
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -2280,6 +2280,14 @@ static void __queue_work(int cpu, struct workqueue_struct *wq,
>  	unsigned int work_flags;
>  	unsigned int req_cpu = cpu;
>  
> +	/*
> +	 * NOTE: Check whether the used workqueue is deprecated and warn
> +	 */
> +	if (unlikely(wq->flags & __WQ_DEPRECATED))
> +		pr_warn_once("workqueue: work func %ps enqueued on deprecated workqueue. "
> +			"Use system_{percpu|dfl}_wq instead.\n",
> +			work->func);

Silly question, can we make this a build warning?

  reply	other threads:[~2026-05-28 16:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=ahhq0XEygZBvEw3t@gmail.com \
    --to=leitao@debian.org \
    --cc=bigeasy@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marco.crivellari@suse.com \
    --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®