Re: [PATCH 4/4] Workqueue: add WQ_PERCPU to every alloc_workqueue user

From: Michal Hocko
Date: Mon May 05 2025 - 05:22:26 EST


On Sat 03-05-25 10:28:34, Marco Crivellari wrote:
> By default, alloc_workqueue() creates bound workqueues
> (i.e., without WQ_UNBOUND).
>
> With the introduction of the WQ_PERCPU flag (equivalent
> to !WQ_UNBOUND), any alloc_workqueue() caller that
> doesn’t explicitly specify WQ_UNBOUND must now use WQ_PERCPU.
>
> All existing users have been updated accordingly.

I assume that the next step is to drop WQ_PERCPU when it is not strictly
necessary, right?

Looking at the huge list this will be a huge undergoing. Is there any
rule of thumb to tell whether WQ_PERCPU is required or not? Maybe
something as simple as - if the worker doesn't use any per cpu variables
then it is highly likely that it doesn't need WQ_PERCPU? Are there other
useful hints?
--
Michal Hocko
SUSE Labs