Re: [PATCH v2 2/4] Workqueue: replace use of system_unbound_wq with system_dfl_wq

From: Frederic Weisbecker
Date: Mon Aug 25 2025 - 09:56:26 EST


Le Mon, Aug 25, 2025 at 03:29:04PM +0200, Marco Crivellari a écrit :
> Currently if a user enqueue a work item using schedule_delayed_work() the
> used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use
> WORK_CPU_UNBOUND (used when a cpu is not specified). The same applies to
> schedule_work() that is using system_wq and queue_work(), that makes use
> again of WORK_CPU_UNBOUND.
>
> This lack of consistentcy cannot be addressed without refactoring the API.
>
> system_unbound_wq should be the default workqueue so as not to enforce
> locality constraints for random work whenever it's not required.
>
> Adding system_dfl_wq to encourage its use when unbound work should be used.
>
> queue_work() / queue_delayed_work() / mod_delayed_work() will now use the
> new unbound wq: whether the user still use the old wq a warn will be
> printed along with a wq redirect to the new one.
>
> The old system_unbound_wq will be kept for a few release cycles.
>
> Suggested-by: Tejun Heo <tj@xxxxxxxxxx>
> Signed-off-by: Marco Crivellari <marco.crivellari@xxxxxxxx>

This should be one patch per subsystem. Here is how you can divide that
into a patchset:

> ---
> drivers/accel/ivpu/ivpu_pm.c | 2 +-
> drivers/acpi/scan.c | 2 +-
> drivers/base/dd.c | 2 +-
> drivers/block/zram/zram_drv.c | 2 +-
> drivers/char/random.c | 8 ++++----
> drivers/gpu/drm/amd/amdgpu/aldebaran.c | 2 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 2 +-
> drivers/gpu/drm/drm_atomic_helper.c | 6 +++---
> drivers/gpu/drm/i915/display/intel_display_power.c | 2 +-
> drivers/gpu/drm/i915/display/intel_tc.c | 4 ++--
> drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 2 +-
> drivers/gpu/drm/i915/gt/uc/intel_guc.c | 4 ++--
> drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c | 4 ++--
> drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 6 +++---
> drivers/gpu/drm/i915/i915_active.c | 2 +-
> drivers/gpu/drm/i915/i915_sw_fence_work.c | 2 +-
> drivers/gpu/drm/i915/i915_vma_resource.c | 2 +-
> drivers/gpu/drm/i915/pxp/intel_pxp.c | 2 +-
> drivers/gpu/drm/i915/pxp/intel_pxp_irq.c | 2 +-
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +-
> drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +-
> drivers/gpu/drm/xe/xe_devcoredump.c | 2 +-
> drivers/gpu/drm/xe/xe_execlist.c | 2 +-
> drivers/gpu/drm/xe/xe_guc_ct.c | 4 ++--
> drivers/gpu/drm/xe/xe_oa.c | 2 +-
> drivers/gpu/drm/xe/xe_vm.c | 4 ++--
> drivers/hte/hte.c | 2 +-
> drivers/infiniband/core/ucma.c | 2 +-
> drivers/infiniband/hw/mlx5/odp.c | 4 ++--
> drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c | 8 ++++----
> drivers/net/macvlan.c | 2 +-
> drivers/net/netdevsim/dev.c | 6 +++---
> drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 4 ++--
> drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 2 +-
> drivers/scsi/qla2xxx/qla_os.c | 2 +-
> drivers/scsi/scsi_transport_iscsi.c | 2 +-
> drivers/soc/xilinx/zynqmp_power.c | 6 +++---
> drivers/target/sbp/sbp_target.c | 8 ++++----
> drivers/tty/serial/8250/8250_dw.c | 4 ++--
> drivers/tty/tty_buffer.c | 8 ++++----

One patch for drivers.

> fs/afs/callback.c | 4 ++--
> fs/afs/write.c | 2 +-
> fs/bcachefs/btree_write_buffer.c | 2 +-
> fs/bcachefs/io_read.c | 12 ++++++------
> fs/bcachefs/journal_io.c | 2 +-
> fs/btrfs/block-group.c | 2 +-
> fs/btrfs/extent_map.c | 2 +-
> fs/btrfs/space-info.c | 4 ++--
> fs/btrfs/zoned.c | 2 +-
> fs/ext4/mballoc.c | 2 +-
> fs/netfs/objects.c | 2 +-
> fs/netfs/read_collect.c | 2 +-
> fs/netfs/write_collect.c | 2 +-
> fs/nfsd/filecache.c | 2 +-
> fs/notify/mark.c | 4 ++--
> fs/quota/dquot.c | 2 +-

One for fs.

> include/linux/workqueue.h | 4 ++--

One for workqueue.

> io_uring/io_uring.c | 2 +-

One for io_uring.

> kernel/bpf/helpers.c | 4 ++--
> kernel/bpf/memalloc.c | 2 +-
> kernel/bpf/syscall.c | 2 +-

One for bpf.

> kernel/padata.c | 4 ++--

One for padata.

> kernel/sched/core.c | 4 ++--
> kernel/sched/ext.c | 4 ++--

One for scheduler.

> kernel/umh.c | 2 +-

One for umh.

> kernel/workqueue.c | 2 +-

Should join the workqueue change above.

> mm/backing-dev.c | 2 +-
> mm/kfence/core.c | 6 +++---
> mm/memcontrol.c | 4 ++--

One for mm.

> net/core/link_watch.c | 4 ++--
> net/unix/garbage.c | 2 +-
> net/wireless/core.c | 4 ++--
> net/wireless/sysfs.c | 2 +-

One for net.

> rust/kernel/workqueue.rs | 6 +++---

This can join the workqueue changes above.

> sound/soc/codecs/wm_adsp.c | 2 +-

And finally one for sound.

Thanks!

--
Frederic Weisbecker
SUSE Labs