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 v4 1/2] workqueue: Make alloc_workqueue() unbound by default
Date: Fri, 16 Oct 2026 08:53:59 -0700 [thread overview]
Message-ID: <atI8hifJ8K4BAIPg@gmail.com> (raw)
In-Reply-To: <20261015140148.231126-2-marco.crivellari@suse.com>
On Thu, Oct 15, 2026 at 04:01:47PM +0200, Marco Crivellari wrote:
> Currently alloc_workqueue() ensure that one among WQ_PERCPU or WQ_UNBOUND
> is present. Now every user has one among these two flags.
>
> In order to achive the future goal of removing WQ_UNBOUND from the code,
> start changing the default behavior making alloc_workqueue() act this way:
>
> - if WQ_PERCPU and WQ_UNBOUND are present: remove WQ_PERCPU (as before)
> - if neither are present: add WQ_UNBOUND
>
> BH workqueues (WQ_BH) are always per-CPU and can't be unbound, so
> WQ_PERCPU is now unconditionally forced for them before the above
> defaulting logic runs.
>
> The WARN_ONCE() when neither flags are present has been removed and it has
> been replaced by pr_warn_once(): from now on, every alloc_users()
> without WQ_PERCPU will be considered unbound.
>
> The pr_warn_once() will be removed along with WQ_UNBOUND in the future.
>
> 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>
Reviewed-by: Breno Leitao <leitao@debian.org>
> @@ -5895,12 +5895,33 @@ static struct workqueue_struct *__alloc_workqueue(const char *fmt,
> struct workqueue_struct *wq;
> size_t wq_size;
> int name_len;
> + bool wq_unbound_by_default = false;
> + bool wq_dropped_percpu = false;
Nit: I think these declarations would look better in reverse xmas tree
order. I know Tejun doesn't feel strongly about it, so it's just a nit.
--breno
next prev parent reply other threads:[~2026-10-16 15:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 14:01 [PATCH v4 0/2] workqueue: Make WQ_UNBOUND the default behavior Marco Crivellari
2026-10-15 14:01 ` [PATCH v4 1/2] workqueue: Make alloc_workqueue() unbound by default Marco Crivellari
2026-10-16 11:45 ` Breno Leitao
2026-10-16 12:57 ` Marco Crivellari
2026-10-16 15:53 ` Breno Leitao [this message]
2026-10-16 16:18 ` Marco Crivellari
2026-10-16 16:19 ` Marco Crivellari
2026-10-15 14:01 ` [PATCH v4 2/2] doc: Update WQ_UNBOUND and WQ_BH documentation Marco Crivellari
2026-10-16 15:16 ` Breno Leitao
2026-10-16 18:03 ` [PATCH v4 0/2] workqueue: Make WQ_UNBOUND the default behavior Tejun Heo
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=atI8hifJ8K4BAIPg@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®