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

On Wed, May 27, 2026 at 8:32 PM Tejun Heo <tj@kernel.org> wrote:
>
> Hello,
>
> On Tue, May 26, 2026 at 05:00:40PM +0200, 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 and redirecting them old used workqueue with the appropriate
> > new one.
> >
> > 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>
> > ---
> >  kernel/workqueue.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 72 insertions(+)
> >
> > diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> > index 33b721a9af02..e17617e205b1 100644
> > --- a/kernel/workqueue.c
> > +++ b/kernel/workqueue.c
> > @@ -2437,6 +2437,24 @@ bool queue_work_on(int cpu, struct workqueue_struct *wq,
> >       bool ret = false;
> >       unsigned long irq_flags;
> >
> > +     /*
> > +      * NOTE: These checks are here to assure that no users will still
> > +      * rely on system_wq and system_unbound_wq.
> > +      * They can be removed along with those workqueue when the
> > +      * time comes.
> > +      */
> > +     if (unlikely(wq == system_wq)) {
>
> Can you add an internal flag to mark the workqueues and use a helper so that
> the warning messages aren't replicated in multiple places? Also, do we need
> to have the warning on delayed_queue? Just put it in a single spot where
> they'll all converge.

Hello Tejun,

That's maybe a silly observation on my side.

If I remove the checks from where I placed them and move them deeper
(__queue_work() for example), I won't know how to print the "caller,"
making it harder for people to understand which code is using the
deprecated workqueue.

Printing the stack with dump_stack() is not doable.

Do you have suggestions?

Thanks!
-- 

Marco Crivellari

SUSE Labs

  parent reply	other threads:[~2026-05-28 14:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 15:00 [RFC PATCH v2 0/2] workqueue: Add warnings and check WQ flags usage Marco Crivellari
2026-05-26 15:00 ` [RFC PATCH v2 1/2] workqueue: Add warnings and fallback if system_{unbound}_wq is used Marco Crivellari
2026-05-27 18:32   ` Tejun Heo
2026-05-28  8:45     ` Marco Crivellari
2026-05-28 14:22       ` Tejun Heo
2026-05-28 14:14     ` Marco Crivellari [this message]
2026-05-28 14:23       ` Tejun Heo
2026-05-28 14:57         ` Marco Crivellari
2026-05-26 15:00 ` [RFC PATCH v2 2/2] workqueue: Add warnings and ensure one among WQ_PERCPU or WQ_UNBOUND is present 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=CAAofZF7OYHiVbrtePHgcmOns14O75fqNUzDYu2-CExj3Yc+xaA@mail.gmail.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®