Re: [PATCH v4 0/2] workqueue: Make WQ_UNBOUND the default behavior
From: Tejun Heo
Date: Fri Oct 16 2026 - 14:11:02 EST
Hello, Marco.
The following is a Claude-generated review.
On Thu, Oct 15, 2026 at 04:01:46PM +0200, Marco Crivellari wrote:
> Currently alloc_workqueue() make sure one among WQ_UNBOUND or WQ_PERCPU is
> present. This is enforced warning and setting WQ_PERCPU as default when
> alloc_workqueue() without WQ_PERCPU or WQ_UNBOUND.
- 1/2: The description gives the future removal of WQ_UNBOUND as the only
reason. Can it lead with why unbound should be the default, as
dadb3ebcf395 ("workqueue: WQ_PERCPU added to alloc_workqueue users")
does?
Moving the defaulting above the wq_size computation is the one subtle
point. Maybe add a sentence on it to the description?
The new comment says WQ_UNBOUND is final at that point, but the
WQ_POWER_EFFICIENT block right below can still set it. The first two
paragraphs restate the if/else. Maybe trim it to the ordering
constraint against wq_size?
unlikely() on the neither-flag branch now marks the path that's meant
to become the default. Maybe drop it?
The WQ_POWER_EFFICIENT comment in include/linux/workqueue.h says such
workqueues are per-cpu by default. With this patch, one without
WQ_PERCPU is unbound regardless of workqueue.power_efficient. All
in-tree users pass WQ_PERCPU, so only the text needs updating.
Typos: "achive", "alloc_users()" (alloc_workqueue() users), "ensure" ->
"ensures", "neither flags are" -> "neither flag is".
- 2/2: The description says WQ_PERCPU is set for WQ_BH "regardless of
what the caller passes", but WQ_BH | WQ_UNBOUND is rejected by the
__WQ_BH_ALLOWS check.
"the only permitted flags" dropped "additional", but WQ_BH itself is
in __WQ_BH_ALLOWS too. Also, "workqueueus" typo.
The new WQ_UNBOUND sentence sits after the "useful for the following
cases" bullets and reads as one more case. Maybe move it to the top of
the entry? Also, "Workqueue without" -> "Workqueues without".
The Guidelines section still says "using a bound wq is usually
beneficial", which now contradicts the default. Can that be updated
too?
Nit: doc patches in this tree usually use the "workqueue: doc:" prefix.
Thanks.
--
tejun