From nobody Tue Sep 9 21:32:24 2025 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 250CF2F744B for ; Fri, 5 Sep 2025 08:58:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757062702; cv=none; b=MnBo9t2VEGHbaiZyWrEz9Ztj6p7oeXtV5JpNzPgQbZKrJpNPA9WMDF084AU9Kg3h3AyzKerGCojI10ChtCXiZgRDJW/lIlw11UwRsMsrAHF+ZYkxLVPSw9q6GozOAYsiw8Ukrj4L3s34eyDiBaysoEjGMxxqdujG0OlUuxQNhVs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757062702; c=relaxed/simple; bh=tF242wQiq0s2VjfBhaD6BuhbNUTYvFfKOIZhpWcLxfk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JobBdCiYBtpR9u/eobWOR3oSodntYgsb+OBOkCWgY1IYSADPt5rNEs3e6sDx4tYXYLpFG49BhWm//NS22djb1EvTGWOIvz5GbSp+yXRbEiBVY6atpW6Bgdv69b0rzhEo6u4cuC1rhDGKaoc2XKuXEtfNluKEnMvV2VhJ3maY3es= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=RLPiPT6J; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="RLPiPT6J" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-45b7c01a708so7163345e9.3 for ; Fri, 05 Sep 2025 01:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1757062696; x=1757667496; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6Qf/wKXybwj4KBwf4y1z4rbclrACQum4L0J8eR2SCtk=; b=RLPiPT6JzlX2QF1DlpWRdhCpC42WnA8Iv21zqTKRxsHf+8l8cwYXfVSs11aVw4uVfl N0ocBWDNbF/+lGMOJsY7WKXSdwUYO+HZg0nINKZQpEsYQhMC7Hij+1rJso9l/fCdv69M +6SJyNZP31yF6CLjKTbPu/6HBt3k7EZn4nNmGss7PvM3XaFnikjJY/FrsHmY6Btip/GW loy7pHwJZJKdINdfpk5V0pIxlU64e2lZornFDMrBupGnzzVK+9H9pOI/0YkFm6xGJgFR 7AavGWz2BfA+WPIj3uSkP0v3AIRNohReGMKBlQQCK8SPBX+v0fdANvr9M4bcTjGf1/AW VUeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757062696; x=1757667496; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6Qf/wKXybwj4KBwf4y1z4rbclrACQum4L0J8eR2SCtk=; b=FUJb3CCRq9eq0muLuLo4b8tIxZw3KjDfFwDScqqsC7gIkI3KhWwZBmbPRBbAiOTI47 6xnZC2E+l1aLdwpk7sRQ/2IFmOOiCicrW/DuEtdZkE5NlYnFlZA5TaPKMfYav/iwfFGs EpIizFMyDKvNZcXhFa/ySONUe1YZcNeQmXzanUsIFBMFrXDE2nthGvW/kO62iS0znxy1 QRDXxNaFgx78stLDqPQr1qBDN1/fbxCN6ikfhgpahUslnC2F1Qov8Uy6gO7wMpynHu7+ Xm3Vfdn1x5CXjOfpOK+X7+5+d94Eh4uauK/7DGkeaXY5wgUjZhxNSxhImQ1VKj718pHG aMEA== X-Gm-Message-State: AOJu0YwhUwb1/MF7emNXZBoqb0CyE8ryc6hQSm7aRgHqLuWKYS5nE+YS m0eFbxRcgCdGSuF1b+pWrvpGE4kStCAQvBNVLC35uRi8BAb8wwO3BRbLuCq+mTc9dJidhXE3Qke rNINe X-Gm-Gg: ASbGnctHRMFB65CQygTfuciyQXG/lpWuZym/gNxXq8mvUxJ9x40dvjl7Jcunl36HxzY zcfdc69v2z4g9DK8oqketDtm1xwW+A2x3zTBkueuJXB2Me16ZVWDm2O0zbLU/BORH8JnBlXI9JR /QFcBTrNoThQ6djs/lAdrPkz/cVqXh6JN0vT15vaysZQM1sq7TtbO7R+B4GEt1m/blrFZoPHN+z OIg0HVUzs3XFg+YrS324PyIQ14sh65qc7ZUVY4HEpSs7edaPILRYSSSFw1e+O1s4JmVBbJtqaqW 6RmeySXNkGjg0PJvLAbNoO89MbZlmlwfACylm+ndMZNX10RFLap8g54Z8RMURnKLLta74XMKQrs nGRkjhBU/dWnKkL5MYsmciZdvT6aXMdzrvEYKAiMI8EDgISzxCrJ3UQPTFw== X-Google-Smtp-Source: AGHT+IEGRegOu2yPFo7rH87XVO1sN+JByvnCkG0k+rirq75sl8++4jV0FHt6f6aJW9W0I/ZBaMV+hg== X-Received: by 2002:a05:600c:4513:b0:45b:7eb4:cee4 with SMTP id 5b1f17b1804b1-45b8557b769mr158819535e9.32.1757062695754; Fri, 05 Sep 2025 01:58:15 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b81a9e971sm334698915e9.18.2025.09.05.01.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Sep 2025 01:58:15 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Greg Kroah-Hartman , Jakub Kicinski , Alex Deucher Subject: [PATCH 1/3] drivers: replace use of system_unbound_wq with system_dfl_wq Date: Fri, 5 Sep 2025 10:57:59 +0200 Message-ID: <20250905085801.98754-2-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250905085801.98754-1-marco.crivellari@suse.com> References: <20250905085801.98754-1-marco.crivellari@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Marco Crivellari --- drivers/accel/ivpu/ivpu_pm.c | 2 +- drivers/acpi/scan.c | 2 +- drivers/base/dd.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/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 ++++---- 36 files changed, 61 insertions(+), 61 deletions(-) diff --git a/drivers/accel/ivpu/ivpu_pm.c b/drivers/accel/ivpu/ivpu_pm.c index b5891e91f7ab..118e6ca9a3de 100644 --- a/drivers/accel/ivpu/ivpu_pm.c +++ b/drivers/accel/ivpu/ivpu_pm.c @@ -181,7 +181,7 @@ void ivpu_pm_trigger_recovery(struct ivpu_device *vdev,= const char *reason) if (atomic_cmpxchg(&vdev->pm->reset_pending, 0, 1) =3D=3D 0) { ivpu_hw_diagnose_failure(vdev); ivpu_hw_irq_disable(vdev); /* Disable IRQ early to protect from IRQ stor= m */ - queue_work(system_unbound_wq, &vdev->pm->recovery_work); + queue_work(system_dfl_wq, &vdev->pm->recovery_work); } } =20 diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index fb1fe9f3b1a3..14fbac0b65c8 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2389,7 +2389,7 @@ static bool acpi_scan_clear_dep_queue(struct acpi_dev= ice *adev) * initial enumeration of devices is complete, put it into the unbound * workqueue. */ - queue_work(system_unbound_wq, &cdw->work); + queue_work(system_dfl_wq, &cdw->work); =20 return true; } diff --git a/drivers/base/dd.c b/drivers/base/dd.c index f0e4b4aba885..fc778ed5552d 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -192,7 +192,7 @@ void driver_deferred_probe_trigger(void) * Kick the re-probe thread. It may already be scheduled, but it is * safe to kick it again. */ - queue_work(system_unbound_wq, &deferred_probe_work); + queue_work(system_dfl_wq, &deferred_probe_work); } =20 /** diff --git a/drivers/char/random.c b/drivers/char/random.c index 38f2fab29c56..97435cd6b819 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -259,8 +259,8 @@ static void crng_reseed(struct work_struct *work) u8 key[CHACHA_KEY_SIZE]; =20 /* Immediately schedule the next reseeding, so that it fires sooner rathe= r than later. */ - if (likely(system_unbound_wq)) - queue_delayed_work(system_unbound_wq, &next_reseed, crng_reseed_interval= ()); + if (likely(system_dfl_wq)) + queue_delayed_work(system_dfl_wq, &next_reseed, crng_reseed_interval()); =20 extract_entropy(key, sizeof(key)); =20 @@ -739,8 +739,8 @@ static void __cold _credit_init_bits(size_t bits) =20 if (orig < POOL_READY_BITS && new >=3D POOL_READY_BITS) { crng_reseed(NULL); /* Sets crng_init to CRNG_READY under base_crng.lock.= */ - if (static_key_initialized && system_unbound_wq) - queue_work(system_unbound_wq, &set_ready); + if (static_key_initialized && system_dfl_wq) + queue_work(system_dfl_wq, &set_ready); atomic_notifier_call_chain(&random_ready_notifier, 0, NULL); #ifdef CONFIG_VDSO_GETRANDOM WRITE_ONCE(vdso_k_rng_data->is_ready, true); diff --git a/drivers/gpu/drm/amd/amdgpu/aldebaran.c b/drivers/gpu/drm/amd/a= mdgpu/aldebaran.c index e13fbd974141..d6acacfb6f91 100644 --- a/drivers/gpu/drm/amd/amdgpu/aldebaran.c +++ b/drivers/gpu/drm/amd/amdgpu/aldebaran.c @@ -164,7 +164,7 @@ aldebaran_mode2_perform_reset(struct amdgpu_reset_contr= ol *reset_ctl, list_for_each_entry(tmp_adev, reset_device_list, reset_list) { /* For XGMI run all resets in parallel to speed up the process */ if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) { - if (!queue_work(system_unbound_wq, + if (!queue_work(system_dfl_wq, &tmp_adev->reset_cntl->reset_work)) r =3D -EALREADY; } else diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/a= md/amdgpu/amdgpu_device.c index a30111d2c3ea..d4a2886d8c58 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -5762,7 +5762,7 @@ int amdgpu_do_asic_reset(struct list_head *device_lis= t_handle, list_for_each_entry(tmp_adev, device_list_handle, reset_list) { /* For XGMI run all resets in parallel to speed up the process */ if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) { - if (!queue_work(system_unbound_wq, + if (!queue_work(system_dfl_wq, &tmp_adev->xgmi_reset_work)) r =3D -EALREADY; } else diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c b/drivers/gpu/drm/am= d/amdgpu/amdgpu_reset.c index dabfbdf6f1ce..1596b94b110d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c @@ -116,7 +116,7 @@ static int amdgpu_reset_xgmi_reset_on_init_perform_rese= t( /* Mode1 reset needs to be triggered on all devices together */ list_for_each_entry(tmp_adev, reset_device_list, reset_list) { /* For XGMI run all resets in parallel to speed up the process */ - if (!queue_work(system_unbound_wq, &tmp_adev->xgmi_reset_work)) + if (!queue_work(system_dfl_wq, &tmp_adev->xgmi_reset_work)) r =3D -EALREADY; if (r) { dev_err(tmp_adev->dev, diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atom= ic_helper.c index 5302ab324898..aa539f316bf8 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -2100,13 +2100,13 @@ int drm_atomic_helper_commit(struct drm_device *dev, * current layout. * * NOTE: Commit work has multiple phases, first hardware commit, then - * cleanup. We want them to overlap, hence need system_unbound_wq to + * cleanup. We want them to overlap, hence need system_dfl_wq to * make sure work items don't artificially stall on each another. */ =20 drm_atomic_state_get(state); if (nonblock) - queue_work(system_unbound_wq, &state->commit_work); + queue_work(system_dfl_wq, &state->commit_work); else commit_tail(state); =20 @@ -2139,7 +2139,7 @@ EXPORT_SYMBOL(drm_atomic_helper_commit); * * Asynchronous workers need to have sufficient parallelism to be able to = run * different atomic commits on different CRTCs in parallel. The simplest w= ay to - * achieve this is by running them on the &system_unbound_wq work queue. N= ote + * achieve this is by running them on the &system_dfl_wq work queue. Note * that drivers are not required to split up atomic commits and run an * individual commit in parallel - userspace is supposed to do that if it = cares. * But it might be beneficial to do that for modesets, since those necessa= rily diff --git a/drivers/gpu/drm/i915/display/intel_display_power.c b/drivers/g= pu/drm/i915/display/intel_display_power.c index f7171e6932dc..ff5166037ab5 100644 --- a/drivers/gpu/drm/i915/display/intel_display_power.c +++ b/drivers/gpu/drm/i915/display/intel_display_power.c @@ -611,7 +611,7 @@ queue_async_put_domains_work(struct i915_power_domains = *power_domains, power.domains); drm_WARN_ON(display->drm, power_domains->async_put_wakeref); power_domains->async_put_wakeref =3D wakeref; - drm_WARN_ON(display->drm, !queue_delayed_work(system_unbound_wq, + drm_WARN_ON(display->drm, !queue_delayed_work(system_dfl_wq, &power_domains->async_put_work, msecs_to_jiffies(delay_ms))); } diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915= /display/intel_tc.c index b8d14ed8a56e..7de1006f844d 100644 --- a/drivers/gpu/drm/i915/display/intel_tc.c +++ b/drivers/gpu/drm/i915/display/intel_tc.c @@ -1760,7 +1760,7 @@ bool intel_tc_port_link_reset(struct intel_digital_po= rt *dig_port) if (!intel_tc_port_link_needs_reset(dig_port)) return false; =20 - queue_delayed_work(system_unbound_wq, + queue_delayed_work(system_dfl_wq, &to_tc_port(dig_port)->link_reset_work, msecs_to_jiffies(2000)); =20 @@ -1842,7 +1842,7 @@ void intel_tc_port_unlock(struct intel_digital_port *= dig_port) struct intel_tc_port *tc =3D to_tc_port(dig_port); =20 if (!tc->link_refcount && tc->mode !=3D TC_PORT_DISCONNECTED) - queue_delayed_work(system_unbound_wq, &tc->disconnect_phy_work, + queue_delayed_work(system_dfl_wq, &tc->disconnect_phy_work, msecs_to_jiffies(1000)); =20 mutex_unlock(&tc->lock); diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c b/drivers/gpu/drm= /i915/gem/i915_gem_ttm_move.c index 2f6b33edb9c9..008d5909a010 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c @@ -408,7 +408,7 @@ static void __memcpy_cb(struct dma_fence *fence, struct= dma_fence_cb *cb) =20 if (unlikely(fence->error || I915_SELFTEST_ONLY(fail_gpu_migration))) { INIT_WORK(©_work->work, __memcpy_work); - queue_work(system_unbound_wq, ©_work->work); + queue_work(system_dfl_wq, ©_work->work); } else { init_irq_work(©_work->irq_work, __memcpy_irq_work); irq_work_queue(©_work->irq_work); diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c b/drivers/gpu/drm/i915/= gt/uc/intel_guc.c index 9df80c325fc1..8dbf6c82e241 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c @@ -617,7 +617,7 @@ int intel_guc_crash_process_msg(struct intel_guc *guc, = u32 action) else guc_err(guc, "Unknown crash notification: 0x%04X\n", action); =20 - queue_work(system_unbound_wq, &guc->dead_guc_worker); + queue_work(system_dfl_wq, &guc->dead_guc_worker); =20 return 0; } @@ -639,7 +639,7 @@ int intel_guc_to_host_process_recv_msg(struct intel_guc= *guc, guc_err(guc, "Received early exception notification!\n"); =20 if (msg & (INTEL_GUC_RECV_MSG_CRASH_DUMP_POSTED | INTEL_GUC_RECV_MSG_EXCE= PTION)) - queue_work(system_unbound_wq, &guc->dead_guc_worker); + queue_work(system_dfl_wq, &guc->dead_guc_worker); =20 return 0; } diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c b/drivers/gpu/drm/i9= 15/gt/uc/intel_guc_ct.c index 0d5197c0824a..2575f380d17d 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c @@ -30,7 +30,7 @@ static void ct_dead_ct_worker_func(struct work_struct *w); do { \ if (!(ct)->dead_ct_reported) { \ (ct)->dead_ct_reason |=3D 1 << CT_DEAD_##reason; \ - queue_work(system_unbound_wq, &(ct)->dead_ct_worker); \ + queue_work(system_dfl_wq, &(ct)->dead_ct_worker); \ } \ } while (0) #else @@ -1240,7 +1240,7 @@ static int ct_handle_event(struct intel_guc_ct *ct, s= truct ct_incoming_msg *requ list_add_tail(&request->link, &ct->requests.incoming); spin_unlock_irqrestore(&ct->requests.lock, flags); =20 - queue_work(system_unbound_wq, &ct->requests.worker); + queue_work(system_dfl_wq, &ct->requests.worker); return 0; } =20 diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gp= u/drm/i915/gt/uc/intel_guc_submission.c index f8cb7c630d5b..54d17548d4aa 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -3385,7 +3385,7 @@ static void guc_context_sched_disable(struct intel_co= ntext *ce) } else if (!intel_context_is_closed(ce) && !guc_id_pressure(guc, ce) && delay) { spin_unlock_irqrestore(&ce->guc_state.lock, flags); - mod_delayed_work(system_unbound_wq, + mod_delayed_work(system_dfl_wq, &ce->guc_state.sched_disable_delay_work, msecs_to_jiffies(delay)); } else { @@ -3600,7 +3600,7 @@ static void guc_context_destroy(struct kref *kref) * take the GT PM for the first time which isn't allowed from an atomic * context. */ - queue_work(system_unbound_wq, &guc->submission_state.destroyed_worker); + queue_work(system_dfl_wq, &guc->submission_state.destroyed_worker); } =20 static int guc_context_alloc(struct intel_context *ce) @@ -5371,7 +5371,7 @@ int intel_guc_engine_failure_process_msg(struct intel= _guc *guc, * A GT reset flushes this worker queue (G2H handler) so we must use * another worker to trigger a GT reset. */ - queue_work(system_unbound_wq, &guc->submission_state.reset_fail_worker); + queue_work(system_dfl_wq, &guc->submission_state.reset_fail_worker); =20 return 0; } diff --git a/drivers/gpu/drm/i915/i915_active.c b/drivers/gpu/drm/i915/i915= _active.c index 0dbc4e289300..4b7238db08c4 100644 --- a/drivers/gpu/drm/i915/i915_active.c +++ b/drivers/gpu/drm/i915/i915_active.c @@ -193,7 +193,7 @@ active_retire(struct i915_active *ref) return; =20 if (ref->flags & I915_ACTIVE_RETIRE_SLEEPS) { - queue_work(system_unbound_wq, &ref->work); + queue_work(system_dfl_wq, &ref->work); return; } =20 diff --git a/drivers/gpu/drm/i915/i915_sw_fence_work.c b/drivers/gpu/drm/i9= 15/i915_sw_fence_work.c index d2e56b387993..366418108f78 100644 --- a/drivers/gpu/drm/i915/i915_sw_fence_work.c +++ b/drivers/gpu/drm/i915/i915_sw_fence_work.c @@ -38,7 +38,7 @@ fence_notify(struct i915_sw_fence *fence, enum i915_sw_fe= nce_notify state) if (test_bit(DMA_FENCE_WORK_IMM, &f->dma.flags)) fence_work(&f->work); else - queue_work(system_unbound_wq, &f->work); + queue_work(system_dfl_wq, &f->work); } else { fence_complete(f); } diff --git a/drivers/gpu/drm/i915/i915_vma_resource.c b/drivers/gpu/drm/i91= 5/i915_vma_resource.c index 53d619ef0c3d..a8f2112ce81f 100644 --- a/drivers/gpu/drm/i915/i915_vma_resource.c +++ b/drivers/gpu/drm/i915/i915_vma_resource.c @@ -202,7 +202,7 @@ i915_vma_resource_fence_notify(struct i915_sw_fence *fe= nce, i915_vma_resource_unbind_work(&vma_res->work); } else { INIT_WORK(&vma_res->work, i915_vma_resource_unbind_work); - queue_work(system_unbound_wq, &vma_res->work); + queue_work(system_dfl_wq, &vma_res->work); } break; case FENCE_FREE: diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.c b/drivers/gpu/drm/i915/px= p/intel_pxp.c index f8da693ad3ce..df854c961c6e 100644 --- a/drivers/gpu/drm/i915/pxp/intel_pxp.c +++ b/drivers/gpu/drm/i915/pxp/intel_pxp.c @@ -276,7 +276,7 @@ static void pxp_queue_termination(struct intel_pxp *pxp) spin_lock_irq(gt->irq_lock); intel_pxp_mark_termination_in_progress(pxp); pxp->session_events |=3D PXP_TERMINATION_REQUEST; - queue_work(system_unbound_wq, &pxp->session_work); + queue_work(system_dfl_wq, &pxp->session_work); spin_unlock_irq(gt->irq_lock); } =20 diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_irq.c b/drivers/gpu/drm/i91= 5/pxp/intel_pxp_irq.c index d81750b9bdda..735325e828bc 100644 --- a/drivers/gpu/drm/i915/pxp/intel_pxp_irq.c +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_irq.c @@ -48,7 +48,7 @@ void intel_pxp_irq_handler(struct intel_pxp *pxp, u16 iir) pxp->session_events |=3D PXP_TERMINATION_COMPLETE | PXP_EVENT_TYPE_IRQ; =20 if (pxp->session_events) - queue_work(system_unbound_wq, &pxp->session_work); + queue_work(system_dfl_wq, &pxp->session_work); } =20 static inline void __pxp_set_interrupts(struct intel_gt *gt, u32 interrupt= s) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouv= eau/dispnv50/disp.c index 504cb3f2054b..d179c81d8306 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -2466,7 +2466,7 @@ nv50_disp_atomic_commit(struct drm_device *dev, pm_runtime_get_noresume(dev->dev); =20 if (nonblock) - queue_work(system_unbound_wq, &state->commit_work); + queue_work(system_dfl_wq, &state->commit_work); else nv50_disp_atomic_commit_tail(state); =20 diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/= rockchip/rockchip_drm_vop.c index e3596e2b557d..a13098ec5df0 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1771,7 +1771,7 @@ static void vop_handle_vblank(struct vop *vop) spin_unlock(&drm->event_lock); =20 if (test_and_clear_bit(VOP_PENDING_FB_UNREF, &vop->pending)) - drm_flip_work_commit(&vop->fb_unref_work, system_unbound_wq); + drm_flip_work_commit(&vop->fb_unref_work, system_dfl_wq); } =20 static irqreturn_t vop_isr(int irq, void *data) diff --git a/drivers/gpu/drm/xe/xe_devcoredump.c b/drivers/gpu/drm/xe/xe_de= vcoredump.c index 81b9d9bb3f57..02ca9abd9e76 100644 --- a/drivers/gpu/drm/xe/xe_devcoredump.c +++ b/drivers/gpu/drm/xe/xe_devcoredump.c @@ -316,7 +316,7 @@ static void devcoredump_snapshot(struct xe_devcoredump = *coredump, =20 xe_engine_snapshot_capture_for_queue(q); =20 - queue_work(system_unbound_wq, &ss->work); + queue_work(system_dfl_wq, &ss->work); =20 xe_force_wake_put(gt_to_fw(q->gt), fw_ref); dma_fence_end_signalling(cookie); diff --git a/drivers/gpu/drm/xe/xe_execlist.c b/drivers/gpu/drm/xe/xe_execl= ist.c index 788f56b066b6..171a5796e0fb 100644 --- a/drivers/gpu/drm/xe/xe_execlist.c +++ b/drivers/gpu/drm/xe/xe_execlist.c @@ -416,7 +416,7 @@ static void execlist_exec_queue_kill(struct xe_exec_que= ue *q) static void execlist_exec_queue_fini(struct xe_exec_queue *q) { INIT_WORK(&q->execlist->fini_async, execlist_exec_queue_fini_async); - queue_work(system_unbound_wq, &q->execlist->fini_async); + queue_work(system_dfl_wq, &q->execlist->fini_async); } =20 static int execlist_exec_queue_set_priority(struct xe_exec_queue *q, diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c index 72ad576fc18e..4e239d8195cd 100644 --- a/drivers/gpu/drm/xe/xe_guc_ct.c +++ b/drivers/gpu/drm/xe/xe_guc_ct.c @@ -472,7 +472,7 @@ int xe_guc_ct_enable(struct xe_guc_ct *ct) spin_lock_irq(&ct->dead.lock); if (ct->dead.reason) { ct->dead.reason |=3D (1 << CT_DEAD_STATE_REARM); - queue_work(system_unbound_wq, &ct->dead.worker); + queue_work(system_dfl_wq, &ct->dead.worker); } spin_unlock_irq(&ct->dead.lock); #endif @@ -1811,7 +1811,7 @@ static void ct_dead_capture(struct xe_guc_ct *ct, str= uct guc_ctb *ctb, u32 reaso =20 spin_unlock_irqrestore(&ct->dead.lock, flags); =20 - queue_work(system_unbound_wq, &(ct)->dead.worker); + queue_work(system_dfl_wq, &(ct)->dead.worker); } =20 static void ct_dead_print(struct xe_dead_ct *dead) diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c index 7ffc98f67e69..1878e50eb687 100644 --- a/drivers/gpu/drm/xe/xe_oa.c +++ b/drivers/gpu/drm/xe/xe_oa.c @@ -956,7 +956,7 @@ static void xe_oa_config_cb(struct dma_fence *fence, st= ruct dma_fence_cb *cb) struct xe_oa_fence *ofence =3D container_of(cb, typeof(*ofence), cb); =20 INIT_DELAYED_WORK(&ofence->work, xe_oa_fence_work_fn); - queue_delayed_work(system_unbound_wq, &ofence->work, + queue_delayed_work(system_dfl_wq, &ofence->work, usecs_to_jiffies(NOA_PROGRAM_ADDITIONAL_DELAY_US)); dma_fence_put(fence); } diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index 60303998bd61..3e25b71749d4 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -1289,7 +1289,7 @@ static void vma_destroy_cb(struct dma_fence *fence, struct xe_vma *vma =3D container_of(cb, struct xe_vma, destroy_cb); =20 INIT_WORK(&vma->destroy_work, vma_destroy_work_func); - queue_work(system_unbound_wq, &vma->destroy_work); + queue_work(system_dfl_wq, &vma->destroy_work); } =20 static void xe_vma_destroy(struct xe_vma *vma, struct dma_fence *fence) @@ -1973,7 +1973,7 @@ static void xe_vm_free(struct drm_gpuvm *gpuvm) struct xe_vm *vm =3D container_of(gpuvm, struct xe_vm, gpuvm); =20 /* To destroy the VM we need to be able to sleep */ - queue_work(system_unbound_wq, &vm->destroy_work); + queue_work(system_dfl_wq, &vm->destroy_work); } =20 struct xe_vm *xe_vm_lookup(struct xe_file *xef, u32 id) diff --git a/drivers/hte/hte.c b/drivers/hte/hte.c index 23a6eeb8c506..e2804636f2bd 100644 --- a/drivers/hte/hte.c +++ b/drivers/hte/hte.c @@ -826,7 +826,7 @@ int hte_push_ts_ns(const struct hte_chip *chip, u32 xla= ted_id, =20 ret =3D ei->cb(data, ei->cl_data); if (ret =3D=3D HTE_RUN_SECOND_CB && ei->tcb) { - queue_work(system_unbound_wq, &ei->cb_work); + queue_work(system_dfl_wq, &ei->cb_work); set_bit(HTE_TS_QUEUE_WK, &ei->flags); } =20 diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index 6e700b974033..ccfcf8e4b712 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c @@ -361,7 +361,7 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id, if (event->event =3D=3D RDMA_CM_EVENT_DEVICE_REMOVAL) { xa_lock(&ctx_table); if (xa_load(&ctx_table, ctx->id) =3D=3D ctx) - queue_work(system_unbound_wq, &ctx->close_work); + queue_work(system_dfl_wq, &ctx->close_work); xa_unlock(&ctx_table); } return 0; diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/= odp.c index 86d8fa63bf69..24efd9a2d82b 100644 --- a/drivers/infiniband/hw/mlx5/odp.c +++ b/drivers/infiniband/hw/mlx5/odp.c @@ -253,7 +253,7 @@ static void destroy_unused_implicit_child_mr(struct mlx= 5_ib_mr *mr) =20 /* Freeing a MR is a sleeping operation, so bounce to a work queue */ INIT_WORK(&mr->odp_destroy.work, free_implicit_child_mr_work); - queue_work(system_unbound_wq, &mr->odp_destroy.work); + queue_work(system_dfl_wq, &mr->odp_destroy.work); } =20 static bool mlx5_ib_invalidate_range(struct mmu_interval_notifier *mni, @@ -2062,6 +2062,6 @@ int mlx5_ib_advise_mr_prefetch(struct ib_pd *pd, destroy_prefetch_work(work); return rc; } - queue_work(system_unbound_wq, &work->work); + queue_work(system_dfl_wq, &work->work); return 0; } diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers= /media/platform/synopsys/hdmirx/snps_hdmirx.c index 3d2913de9a86..8c5142fc80ef 100644 --- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c +++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c @@ -1735,7 +1735,7 @@ static void process_signal_change(struct snps_hdmirx_= dev *hdmirx_dev) FIFO_UNDERFLOW_INT_EN | HDMIRX_AXI_ERROR_INT_EN, 0); hdmirx_reset_dma(hdmirx_dev); - queue_delayed_work(system_unbound_wq, + queue_delayed_work(system_dfl_wq, &hdmirx_dev->delayed_work_res_change, msecs_to_jiffies(50)); } @@ -2190,7 +2190,7 @@ static void hdmirx_delayed_work_res_change(struct wor= k_struct *work) =20 if (hdmirx_wait_signal_lock(hdmirx_dev)) { hdmirx_plugout(hdmirx_dev); - queue_delayed_work(system_unbound_wq, + queue_delayed_work(system_dfl_wq, &hdmirx_dev->delayed_work_hotplug, msecs_to_jiffies(200)); } else { @@ -2209,7 +2209,7 @@ static irqreturn_t hdmirx_5v_det_irq_handler(int irq,= void *dev_id) val =3D gpiod_get_value(hdmirx_dev->detect_5v_gpio); v4l2_dbg(3, debug, &hdmirx_dev->v4l2_dev, "%s: 5v:%d\n", __func__, val); =20 - queue_delayed_work(system_unbound_wq, + queue_delayed_work(system_dfl_wq, &hdmirx_dev->delayed_work_hotplug, msecs_to_jiffies(10)); =20 @@ -2441,7 +2441,7 @@ static void hdmirx_enable_irq(struct device *dev) enable_irq(hdmirx_dev->dma_irq); enable_irq(hdmirx_dev->det_irq); =20 - queue_delayed_work(system_unbound_wq, + queue_delayed_work(system_dfl_wq, &hdmirx_dev->delayed_work_hotplug, msecs_to_jiffies(110)); } diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index b44d134e7105..87eeb8607b60 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -5292,7 +5292,7 @@ void qla24xx_sched_upd_fcport(fc_port_t *fcport) qla2x00_set_fcport_disc_state(fcport, DSC_UPD_FCPORT); spin_unlock_irqrestore(&fcport->vha->work_lock, flags); =20 - queue_work(system_unbound_wq, &fcport->reg_work); + queue_work(system_dfl_wq, &fcport->reg_work); } =20 static diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transp= ort_iscsi.c index 9c347c64c315..e2754c1cb0a5 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -3957,7 +3957,7 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghd= r *nlh, uint32_t *group) list_del_init(&session->sess_list); spin_unlock_irqrestore(&sesslock, flags); =20 - queue_work(system_unbound_wq, &session->destroy_work); + queue_work(system_dfl_wq, &session->destroy_work); } break; case ISCSI_UEVENT_UNBIND_SESSION: diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_= power.c index ae59bf16659a..6145c4fe192e 100644 --- a/drivers/soc/xilinx/zynqmp_power.c +++ b/drivers/soc/xilinx/zynqmp_power.c @@ -82,7 +82,7 @@ static void subsystem_restart_event_callback(const u32 *p= ayload, void *data) memcpy(zynqmp_pm_init_restart_work->args, &payload[0], sizeof(zynqmp_pm_init_restart_work->args)); =20 - queue_work(system_unbound_wq, &zynqmp_pm_init_restart_work->callback_work= ); + queue_work(system_dfl_wq, &zynqmp_pm_init_restart_work->callback_work); } =20 static void suspend_event_callback(const u32 *payload, void *data) @@ -95,7 +95,7 @@ static void suspend_event_callback(const u32 *payload, vo= id *data) memcpy(zynqmp_pm_init_suspend_work->args, &payload[1], sizeof(zynqmp_pm_init_suspend_work->args)); =20 - queue_work(system_unbound_wq, &zynqmp_pm_init_suspend_work->callback_work= ); + queue_work(system_dfl_wq, &zynqmp_pm_init_suspend_work->callback_work); } =20 static irqreturn_t zynqmp_pm_isr(int irq, void *data) @@ -140,7 +140,7 @@ static void ipi_receive_callback(struct mbox_client *cl= , void *data) memcpy(zynqmp_pm_init_suspend_work->args, &payload[1], sizeof(zynqmp_pm_init_suspend_work->args)); =20 - queue_work(system_unbound_wq, + queue_work(system_dfl_wq, &zynqmp_pm_init_suspend_work->callback_work); =20 /* Send NULL message to mbox controller to ack the message */ diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_targe= t.c index 3b89b5a70331..b8457477cee9 100644 --- a/drivers/target/sbp/sbp_target.c +++ b/drivers/target/sbp/sbp_target.c @@ -730,7 +730,7 @@ static int tgt_agent_rw_orb_pointer(struct fw_card *car= d, int tcode, void *data, pr_debug("tgt_agent ORB_POINTER write: 0x%llx\n", agent->orb_pointer); =20 - queue_work(system_unbound_wq, &agent->work); + queue_work(system_dfl_wq, &agent->work); =20 return RCODE_COMPLETE; =20 @@ -764,7 +764,7 @@ static int tgt_agent_rw_doorbell(struct fw_card *card, = int tcode, void *data, =20 pr_debug("tgt_agent DOORBELL\n"); =20 - queue_work(system_unbound_wq, &agent->work); + queue_work(system_dfl_wq, &agent->work); =20 return RCODE_COMPLETE; =20 @@ -990,7 +990,7 @@ static void tgt_agent_fetch_work(struct work_struct *wo= rk) =20 if (tgt_agent_check_active(agent) && !doorbell) { INIT_WORK(&req->work, tgt_agent_process_work); - queue_work(system_unbound_wq, &req->work); + queue_work(system_dfl_wq, &req->work); } else { /* don't process this request, just check next_ORB */ sbp_free_request(req); @@ -1618,7 +1618,7 @@ static void sbp_mgt_agent_rw(struct fw_card *card, agent->orb_offset =3D sbp2_pointer_to_addr(ptr); agent->request =3D req; =20 - queue_work(system_unbound_wq, &agent->work); + queue_work(system_dfl_wq, &agent->work); rcode =3D RCODE_COMPLETE; } else if (tcode =3D=3D TCODE_READ_BLOCK_REQUEST) { addr_to_sbp2_pointer(agent->orb_offset, ptr); diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/82= 50_dw.c index 1902f29444a1..50a5ee546373 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -361,7 +361,7 @@ static int dw8250_clk_notifier_cb(struct notifier_block= *nb, * deferred event handling complication. */ if (event =3D=3D POST_RATE_CHANGE) { - queue_work(system_unbound_wq, &d->clk_work); + queue_work(system_dfl_wq, &d->clk_work); return NOTIFY_OK; } =20 @@ -678,7 +678,7 @@ static int dw8250_probe(struct platform_device *pdev) err =3D clk_notifier_register(data->clk, &data->clk_notifier); if (err) return dev_err_probe(dev, err, "Failed to set the clock notifier\n"); - queue_work(system_unbound_wq, &data->clk_work); + queue_work(system_dfl_wq, &data->clk_work); } =20 platform_set_drvdata(pdev, data); diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 79f0ff94ce00..60066ece9d96 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -76,7 +76,7 @@ void tty_buffer_unlock_exclusive(struct tty_port *port) mutex_unlock(&buf->lock); =20 if (restart) - queue_work(system_unbound_wq, &buf->work); + queue_work(system_dfl_wq, &buf->work); } EXPORT_SYMBOL_GPL(tty_buffer_unlock_exclusive); =20 @@ -531,7 +531,7 @@ void tty_flip_buffer_push(struct tty_port *port) struct tty_bufhead *buf =3D &port->buf; =20 tty_flip_buffer_commit(buf->tail); - queue_work(system_unbound_wq, &buf->work); + queue_work(system_dfl_wq, &buf->work); } EXPORT_SYMBOL(tty_flip_buffer_push); =20 @@ -561,7 +561,7 @@ int tty_insert_flip_string_and_push_buffer(struct tty_p= ort *port, tty_flip_buffer_commit(buf->tail); spin_unlock_irqrestore(&port->lock, flags); =20 - queue_work(system_unbound_wq, &buf->work); + queue_work(system_dfl_wq, &buf->work); =20 return size; } @@ -614,7 +614,7 @@ void tty_buffer_set_lock_subclass(struct tty_port *port) =20 bool tty_buffer_restart_work(struct tty_port *port) { - return queue_work(system_unbound_wq, &port->buf.work); + return queue_work(system_dfl_wq, &port->buf.work); } =20 bool tty_buffer_cancel_work(struct tty_port *port) --=20 2.51.0 From nobody Tue Sep 9 21:32:24 2025 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 028DC3002D1 for ; Fri, 5 Sep 2025 08:58:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757062702; cv=none; b=WB80MoJjLD9sPP683H6COyd36FFS15mUZgupLHWu/dNLmp/nwFYxAMRjCt2hY4FcvXDLuhce6NOB2TDcTtoDrTyU701R6xVsiDFU1epjra6zBbMhpeWBttnD3A2uNgfqHLOF3xmHO/XMSKK9USAlsRsdYoT5QKd3SO8c1/bjsB4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757062702; c=relaxed/simple; bh=05DpSF4B+rc9ubuOBVlAebm08IRjTQQ20n3nYqYF0hI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U9PAPPRoBtXzIR92vjRO2gp1n9YltNAEmoaamQZkTK3O+yz/zXS6JE/zgSjXCMKxHcM13HqHWlsJAnuLkBZIyqC9DuMI2fGkOaLXeANIbMhQp6OXD6TgYixh7h9rvkLN8WA1+HMLncvdLj96Jv482pywKqTuTbz3FHyMBITFRg4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=QRXhuNiu; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="QRXhuNiu" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-45a1b065d59so11868015e9.1 for ; Fri, 05 Sep 2025 01:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1757062697; x=1757667497; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w5oC5dcNIZcHUh4bYRNlUj/eufsmsR52FROMjZBL1CI=; b=QRXhuNiuzDg6a5vCTYzPgrri6xmM58aF/Do/FcNMxHJ4ry+ne68sFoyl4X11LlmECH 6SdrHNtul2/67iadN+uhRxEiVdPmcSnHokAk7kNdY7YvL3A7P6bCK7XF+BMpfW4N3V+6 OjLQnPcnMV32w5od+X6Oae6mFXH3DsIB8amSAnzheaYwEdk1WRJfkZ2rQVMq77foqx7u BXzUITmh25eZy6cirAaGTrvb9yMm3Z7XcY5dFrThjUCudb7Kps8S7rBZ3f0Dm4DoWp1B NOs7VMRYN5JLmIO/r+k8CY1z5mzjct0xjuVBVBubSnzJHnotPN00ttSZBuMw06/lzjxA F0/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757062697; x=1757667497; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w5oC5dcNIZcHUh4bYRNlUj/eufsmsR52FROMjZBL1CI=; b=Ut/fCxMPi6VF+1DeHw1Ykjv9NVAz3bmhbBmkSm3OXTAjZg9/TpNchWqWD9nDffoykb MMJQg4xoiCCW7HmQ9o22nN3QmcDQcjUuIEkcbPPTV1Z7ykffpFVQXiYfarknKfKFlxvl fucxbwusH7OPsdjHkp7ynXNIAR3QeD3no5aLyyeZabh/s+ruse37Bore4/2Jc6B5oyTt v1yHj2CbA7Yd/f5p4xEnKw3isOnzHS+aq5wzrGkmeyE/p6WcFl5rwk7QdRCjC8p7oXex cyP9DwCARnb0dhij7O86pjJd91mIYOcrbWa2Pfw2HyvIwWyxyVZ7fuESej69L48y3318 1IOQ== X-Gm-Message-State: AOJu0YxHDwUJcId/8ezHsI+jrI/VGb9nkrQcwMOFPhAMfuR4dqowSICo YPP9rFtGhxDbu2IoOojkb3Kz8GenFNvUClP5bQlRAha2YYTPM6SxVzfN9CRMcnF5jLEsjDhYbmc 30V6v X-Gm-Gg: ASbGncvefRqrLYOFasmVAd3tdPY22BHa9R4lMifnLbR+qdHBKzBGer7pCxBIGLqQ5ws glY1ogo9XY6d9NQJO92wO2mPQZkxSARCAatkPlVFMkmQrokk5OAXxm0dfgo9ehLPGJTncPSnxrj WgV0dlyPasUzfV4PAuuT9KpzIyO/LVmupbwhrQ/HU2lh0n7rFAyMsl0hfg+QgDrVvHYwwSAWxtg oG/i1vdT8JqyvuSZlbwnrSqHRlTTZ4BJ596nwmj9NNpVBmjetpVVguOhMlBUUCP7BcA0czQK7iL uNviKnOWF7T1o4szJNW6gFHlimzrlC5L1L1vnJ56MFZfOcUvjGc8Gkdllza8KzdEhKIjc/iEN8u 9l46Bx7nz7dgCHbR67p/y0Vq6vQ4QlyJWCAvRughKug9v4vs= X-Google-Smtp-Source: AGHT+IEFaHcxDKLZFgnVPd/F/uLddBeL8VLtZ1ONDt2J+6nCxN9Bq8OR50Xs/TPBQzuVZPOiwxa8fA== X-Received: by 2002:a05:600c:3587:b0:45b:804a:a65e with SMTP id 5b1f17b1804b1-45b8559a928mr170975025e9.28.1757062696696; Fri, 05 Sep 2025 01:58:16 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b81a9e971sm334698915e9.18.2025.09.05.01.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Sep 2025 01:58:16 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Greg Kroah-Hartman , Jakub Kicinski , Alex Deucher Subject: [PATCH 2/3] drivers: replace use of system_wq with system_percpu_wq Date: Fri, 5 Sep 2025 10:58:00 +0200 Message-ID: <20250905085801.98754-3-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250905085801.98754-1-marco.crivellari@suse.com> References: <20250905085801.98754-1-marco.crivellari@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Marco Crivellari --- drivers/accel/ivpu/ivpu_hw_btrs.c | 2 +- drivers/accel/ivpu/ivpu_ipc.c | 2 +- drivers/accel/ivpu/ivpu_job.c | 2 +- drivers/accel/ivpu/ivpu_mmu.c | 2 +- drivers/accel/ivpu/ivpu_pm.c | 2 +- drivers/acpi/osl.c | 2 +- drivers/base/devcoredump.c | 2 +- drivers/cxl/pci.c | 2 +- drivers/extcon/extcon-intel-int3496.c | 4 ++-- drivers/gpio/gpiolib-cdev.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- drivers/gpu/drm/bridge/ite-it6505.c | 2 +- drivers/gpu/drm/bridge/ti-tfp410.c | 2 +- drivers/gpu/drm/drm_probe_helper.c | 2 +- drivers/gpu/drm/drm_self_refresh_helper.c | 2 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- drivers/gpu/drm/i915/i915_driver.c | 2 +- drivers/gpu/drm/i915/i915_drv.h | 2 +- .../gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 4 ++-- drivers/gpu/drm/scheduler/sched_main.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 2 +- drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++-- drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 6 +++--- drivers/gpu/drm/xe/xe_pt.c | 2 +- drivers/iio/adc/pac1934.c | 2 +- drivers/input/keyboard/gpio_keys.c | 2 +- drivers/input/misc/palmas-pwrbutton.c | 2 +- drivers/input/mouse/synaptics_i2c.c | 8 ++++---- drivers/leds/trigger/ledtrig-input-events.c | 2 +- drivers/md/bcache/super.c | 20 +++++++++---------- drivers/mmc/host/mtk-sd.c | 4 ++-- drivers/nvdimm/security.c | 4 ++-- drivers/nvme/target/admin-cmd.c | 2 +- drivers/nvme/target/fabrics-cmd-auth.c | 2 +- drivers/pci/endpoint/pci-ep-cfs.c | 2 +- drivers/phy/allwinner/phy-sun4i-usb.c | 14 ++++++------- .../platform/cznic/turris-omnia-mcu-gpio.c | 2 +- .../surface/aggregator/ssh_packet_layer.c | 2 +- .../surface/aggregator/ssh_request_layer.c | 2 +- drivers/platform/x86/gpd-pocket-fan.c | 4 ++-- .../x86/x86-android-tablets/vexia_atla10_ec.c | 2 +- drivers/ras/cec.c | 2 +- drivers/regulator/irq_helpers.c | 2 +- drivers/regulator/qcom-labibb-regulator.c | 4 ++-- drivers/thunderbolt/tb.c | 2 +- drivers/usb/dwc3/gadget.c | 2 +- drivers/usb/host/xhci-dbgcap.c | 8 ++++---- drivers/usb/host/xhci-ring.c | 2 +- drivers/xen/events/events_base.c | 6 +++--- 49 files changed, 83 insertions(+), 83 deletions(-) diff --git a/drivers/accel/ivpu/ivpu_hw_btrs.c b/drivers/accel/ivpu/ivpu_hw= _btrs.c index 56c56012b980..62f9dd7dceed 100644 --- a/drivers/accel/ivpu/ivpu_hw_btrs.c +++ b/drivers/accel/ivpu/ivpu_hw_btrs.c @@ -630,7 +630,7 @@ bool ivpu_hw_btrs_irq_handler_lnl(struct ivpu_device *v= dev, int irq) =20 if (REG_TEST_FLD(VPU_HW_BTRS_LNL_INTERRUPT_STAT, SURV_ERR, status)) { ivpu_dbg(vdev, IRQ, "Survivability IRQ\n"); - queue_work(system_wq, &vdev->irq_dct_work); + queue_work(system_percpu_wq, &vdev->irq_dct_work); } =20 if (REG_TEST_FLD(VPU_HW_BTRS_LNL_INTERRUPT_STAT, FREQ_CHANGE, status)) diff --git a/drivers/accel/ivpu/ivpu_ipc.c b/drivers/accel/ivpu/ivpu_ipc.c index 0e096fd9b95d..247dbb64b4d5 100644 --- a/drivers/accel/ivpu/ivpu_ipc.c +++ b/drivers/accel/ivpu/ivpu_ipc.c @@ -459,7 +459,7 @@ void ivpu_ipc_irq_handler(struct ivpu_device *vdev) } } =20 - queue_work(system_wq, &vdev->irq_ipc_work); + queue_work(system_percpu_wq, &vdev->irq_ipc_work); } =20 void ivpu_ipc_irq_work_fn(struct work_struct *work) diff --git a/drivers/accel/ivpu/ivpu_job.c b/drivers/accel/ivpu/ivpu_job.c index 004059e4f1e8..f63eba4c9d9f 100644 --- a/drivers/accel/ivpu/ivpu_job.c +++ b/drivers/accel/ivpu/ivpu_job.c @@ -549,7 +549,7 @@ static int ivpu_job_signal_and_destroy(struct ivpu_devi= ce *vdev, u32 job_id, u32 * status and ensure both are handled in the same way */ job->file_priv->has_mmu_faults =3D true; - queue_work(system_wq, &vdev->context_abort_work); + queue_work(system_percpu_wq, &vdev->context_abort_work); return 0; } =20 diff --git a/drivers/accel/ivpu/ivpu_mmu.c b/drivers/accel/ivpu/ivpu_mmu.c index 5ea010568faa..e1baf6b64935 100644 --- a/drivers/accel/ivpu/ivpu_mmu.c +++ b/drivers/accel/ivpu/ivpu_mmu.c @@ -970,7 +970,7 @@ void ivpu_mmu_irq_evtq_handler(struct ivpu_device *vdev) } } =20 - queue_work(system_wq, &vdev->context_abort_work); + queue_work(system_percpu_wq, &vdev->context_abort_work); } =20 void ivpu_mmu_evtq_dump(struct ivpu_device *vdev) diff --git a/drivers/accel/ivpu/ivpu_pm.c b/drivers/accel/ivpu/ivpu_pm.c index 118e6ca9a3de..f6a5c494621e 100644 --- a/drivers/accel/ivpu/ivpu_pm.c +++ b/drivers/accel/ivpu/ivpu_pm.c @@ -198,7 +198,7 @@ void ivpu_start_job_timeout_detection(struct ivpu_devic= e *vdev) unsigned long timeout_ms =3D ivpu_tdr_timeout_ms ? ivpu_tdr_timeout_ms : = vdev->timeout.tdr; =20 /* No-op if already queued */ - queue_delayed_work(system_wq, &vdev->pm->job_timeout_work, msecs_to_jiffi= es(timeout_ms)); + queue_delayed_work(system_percpu_wq, &vdev->pm->job_timeout_work, msecs_t= o_jiffies(timeout_ms)); } =20 void ivpu_stop_job_timeout_detection(struct ivpu_device *vdev) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 5ff343096ece..a79a5d47bdb8 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -398,7 +398,7 @@ static void acpi_os_drop_map_ref(struct acpi_ioremap *m= ap) list_del_rcu(&map->list); =20 INIT_RCU_WORK(&map->track.rwork, acpi_os_map_remove); - queue_rcu_work(system_wq, &map->track.rwork); + queue_rcu_work(system_percpu_wq, &map->track.rwork); } =20 /** diff --git a/drivers/base/devcoredump.c b/drivers/base/devcoredump.c index 03a39c417dc4..8c4844ad7c6b 100644 --- a/drivers/base/devcoredump.c +++ b/drivers/base/devcoredump.c @@ -125,7 +125,7 @@ static ssize_t devcd_data_write(struct file *filp, stru= ct kobject *kobj, mutex_lock(&devcd->mutex); if (!devcd->delete_work) { devcd->delete_work =3D true; - mod_delayed_work(system_wq, &devcd->del_wk, 0); + mod_delayed_work(system_percpu_wq, &devcd->del_wk, 0); } mutex_unlock(&devcd->mutex); =20 diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c index 7b14a154463c..c610551b41bf 100644 --- a/drivers/cxl/pci.c +++ b/drivers/cxl/pci.c @@ -136,7 +136,7 @@ static irqreturn_t cxl_pci_mbox_irq(int irq, void *id) if (opcode =3D=3D CXL_MBOX_OP_SANITIZE) { mutex_lock(&cxl_mbox->mbox_mutex); if (mds->security.sanitize_node) - mod_delayed_work(system_wq, &mds->security.poll_dwork, 0); + mod_delayed_work(system_percpu_wq, &mds->security.poll_dwork, 0); mutex_unlock(&cxl_mbox->mbox_mutex); } else { /* short-circuit the wait in __cxl_pci_mbox_send_cmd() */ diff --git a/drivers/extcon/extcon-intel-int3496.c b/drivers/extcon/extcon-= intel-int3496.c index ded1a85a5549..7d16d5b7d58f 100644 --- a/drivers/extcon/extcon-intel-int3496.c +++ b/drivers/extcon/extcon-intel-int3496.c @@ -106,7 +106,7 @@ static irqreturn_t int3496_thread_isr(int irq, void *pr= iv) struct int3496_data *data =3D priv; =20 /* Let the pin settle before processing it */ - mod_delayed_work(system_wq, &data->work, DEBOUNCE_TIME); + mod_delayed_work(system_percpu_wq, &data->work, DEBOUNCE_TIME); =20 return IRQ_HANDLED; } @@ -181,7 +181,7 @@ static int int3496_probe(struct platform_device *pdev) } =20 /* process id-pin so that we start with the right status */ - queue_delayed_work(system_wq, &data->work, 0); + queue_delayed_work(system_percpu_wq, &data->work, 0); flush_delayed_work(&data->work); =20 platform_set_drvdata(pdev, data); diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c index 107d75558b5a..3e9c037ff4cd 100644 --- a/drivers/gpio/gpiolib-cdev.c +++ b/drivers/gpio/gpiolib-cdev.c @@ -700,7 +700,7 @@ static enum hte_return process_hw_ts(struct hte_ts_data= *ts, void *p) if (READ_ONCE(line->sw_debounced)) { line->total_discard_seq++; line->last_seqno =3D ts->seq; - mod_delayed_work(system_wq, &line->work, + mod_delayed_work(system_percpu_wq, &line->work, usecs_to_jiffies(READ_ONCE(line->desc->debounce_period_us))); } else { if (unlikely(ts->seq < line->line_seqno)) @@ -841,7 +841,7 @@ static irqreturn_t debounce_irq_handler(int irq, void *= p) { struct line *line =3D p; =20 - mod_delayed_work(system_wq, &line->work, + mod_delayed_work(system_percpu_wq, &line->work, usecs_to_jiffies(READ_ONCE(line->desc->debounce_period_us))); =20 return IRQ_HANDLED; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/a= md/amdgpu/amdgpu_device.c index d4a2886d8c58..14ebfcd1636a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -4610,7 +4610,7 @@ int amdgpu_device_init(struct amdgpu_device *adev, } /* must succeed. */ amdgpu_ras_resume(adev); - queue_delayed_work(system_wq, &adev->delayed_init_work, + queue_delayed_work(system_percpu_wq, &adev->delayed_init_work, msecs_to_jiffies(AMDGPU_RESUME_MS)); } =20 @@ -5085,7 +5085,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool= notify_clients) if (r) goto exit; =20 - queue_delayed_work(system_wq, &adev->delayed_init_work, + queue_delayed_work(system_percpu_wq, &adev->delayed_init_work, msecs_to_jiffies(AMDGPU_RESUME_MS)); exit: if (amdgpu_sriov_vf(adev)) { diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/i= te-it6505.c index 8a607558ac89..433e6620dad8 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2082,7 +2082,7 @@ static void it6505_start_hdcp(struct it6505 *it6505) =20 DRM_DEV_DEBUG_DRIVER(dev, "start"); it6505_reset_hdcp(it6505); - queue_delayed_work(system_wq, &it6505->hdcp_work, + queue_delayed_work(system_percpu_wq, &it6505->hdcp_work, msecs_to_jiffies(2400)); } =20 diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti= -tfp410.c index 79ab5da827e1..d798c951ddcc 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -115,7 +115,7 @@ static void tfp410_hpd_callback(void *arg, enum drm_con= nector_status status) { struct tfp410 *dvi =3D arg; =20 - mod_delayed_work(system_wq, &dvi->hpd_work, + mod_delayed_work(system_percpu_wq, &dvi->hpd_work, msecs_to_jiffies(HOTPLUG_DEBOUNCE_MS)); } =20 diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe= _helper.c index 7ba16323e7c2..30e8d3467c83 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -625,7 +625,7 @@ int drm_helper_probe_single_connector_modes(struct drm_= connector *connector, */ dev->mode_config.delayed_event =3D true; if (dev->mode_config.poll_enabled) - mod_delayed_work(system_wq, + mod_delayed_work(system_percpu_wq, &dev->mode_config.output_poll_work, 0); } diff --git a/drivers/gpu/drm/drm_self_refresh_helper.c b/drivers/gpu/drm/dr= m_self_refresh_helper.c index dd33fec5aabd..12f5af633da3 100644 --- a/drivers/gpu/drm/drm_self_refresh_helper.c +++ b/drivers/gpu/drm/drm_self_refresh_helper.c @@ -217,7 +217,7 @@ void drm_self_refresh_helper_alter_state(struct drm_ato= mic_state *state) ewma_psr_time_read(&sr_data->exit_avg_ms)) * 2; mutex_unlock(&sr_data->avg_mutex); =20 - mod_delayed_work(system_wq, &sr_data->entry_work, + mod_delayed_work(system_percpu_wq, &sr_data->entry_work, msecs_to_jiffies(delay)); } } diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/= exynos_hdmi.c index 01813e11e6c6..8e76ac8ee4e2 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -1692,7 +1692,7 @@ static irqreturn_t hdmi_irq_thread(int irq, void *arg) { struct hdmi_context *hdata =3D arg; =20 - mod_delayed_work(system_wq, &hdata->hotplug_work, + mod_delayed_work(system_percpu_wq, &hdata->hotplug_work, msecs_to_jiffies(HOTPLUG_DEBOUNCE_MS)); =20 return IRQ_HANDLED; diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915= _driver.c index ce3cc93ea211..79b98ba4104e 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -141,7 +141,7 @@ static int i915_workqueues_init(struct drm_i915_private= *dev_priv) /* * The unordered i915 workqueue should be used for all work * scheduling that do not require running in order, which used - * to be scheduled on the system_wq before moving to a driver + * to be scheduled on the system_percpu_wq before moving to a driver * instance due deprecation of flush_scheduled_work(). */ dev_priv->unordered_wq =3D alloc_workqueue("i915-unordered", 0, 0); diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_dr= v.h index ffc346379cc2..b2c194b17eae 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -264,7 +264,7 @@ struct drm_i915_private { * * This workqueue should be used for all unordered work * scheduling within i915, which used to be scheduled on the - * system_wq before moving to a driver instance due + * system_percpu_wq before moving to a driver instance due * deprecation of flush_scheduled_work(). */ struct workqueue_struct *unordered_wq; diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/d= rm/rockchip/dw_hdmi_qp-rockchip.c index 3d1dddb34603..b115fe655a4b 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c @@ -274,7 +274,7 @@ static irqreturn_t dw_hdmi_qp_rk3576_irq(int irq, void = *dev_id) =20 val =3D HIWORD_UPDATE(RK3576_HDMI_HPD_INT_CLR, RK3576_HDMI_HPD_INT_CLR); regmap_write(hdmi->regmap, RK3576_IOC_MISC_CON0, val); - mod_delayed_work(system_wq, &hdmi->hpd_work, + mod_delayed_work(system_percpu_wq, &hdmi->hpd_work, msecs_to_jiffies(HOTPLUG_DEBOUNCE_MS)); =20 val =3D HIWORD_UPDATE(0, RK3576_HDMI_HPD_INT_MSK); @@ -321,7 +321,7 @@ static irqreturn_t dw_hdmi_qp_rk3588_irq(int irq, void = *dev_id) RK3588_HDMI0_HPD_INT_CLR); regmap_write(hdmi->regmap, RK3588_GRF_SOC_CON2, val); =20 - mod_delayed_work(system_wq, &hdmi->hpd_work, + mod_delayed_work(system_percpu_wq, &hdmi->hpd_work, msecs_to_jiffies(HOTPLUG_DEBOUNCE_MS)); =20 if (hdmi->port_id) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/sched= uler/sched_main.c index bfea608a7106..d3c0a1ca0b2c 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -1260,7 +1260,7 @@ int drm_sched_init(struct drm_gpu_scheduler *sched, c= onst struct drm_sched_init_ sched->name =3D args->name; sched->timeout =3D args->timeout; sched->hang_limit =3D args->hang_limit; - sched->timeout_wq =3D args->timeout_wq ? args->timeout_wq : system_wq; + sched->timeout_wq =3D args->timeout_wq ? args->timeout_wq : system_percpu= _wq; sched->score =3D args->score ? args->score : &sched->_score; sched->dev =3D args->dev; =20 diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/= tilcdc_crtc.c index b5f60b2b2d0e..57518a4ab4e1 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c @@ -985,7 +985,7 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc) dev_err(dev->dev, "%s(0x%08x): Sync lost flood detected, recovering", __func__, stat); - queue_work(system_wq, + queue_work(system_percpu_wq, &tilcdc_crtc->recover_work); tilcdc_write(dev, LCDC_INT_ENABLE_CLR_REG, LCDC_SYNC_LOST); diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 37238a12baa5..4ee5f4d6371e 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -744,7 +744,7 @@ static void vc4_hdmi_enable_scrambling(struct drm_encod= er *encoder) =20 vc4_hdmi->scdc_enabled =3D true; =20 - queue_delayed_work(system_wq, &vc4_hdmi->scrambling_work, + queue_delayed_work(system_percpu_wq, &vc4_hdmi->scrambling_work, msecs_to_jiffies(SCRAMBLING_POLLING_DELAY_MS)); } =20 @@ -793,7 +793,7 @@ static void vc4_hdmi_scrambling_wq(struct work_struct *= work) drm_scdc_set_high_tmds_clock_ratio(connector, true); drm_scdc_set_scrambling(connector, true); =20 - queue_delayed_work(system_wq, &vc4_hdmi->scrambling_work, + queue_delayed_work(system_percpu_wq, &vc4_hdmi->scrambling_work, msecs_to_jiffies(SCRAMBLING_POLLING_DELAY_MS)); } =20 diff --git a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c b/drivers/gpu/drm/= xe/xe_gt_tlb_invalidation.c index 03072e094991..2b27621a36e5 100644 --- a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +++ b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c @@ -99,7 +99,7 @@ static void xe_gt_tlb_fence_timeout(struct work_struct *w= ork) invalidation_fence_signal(xe, fence); } if (!list_empty(>->tlb_invalidation.pending_fences)) - queue_delayed_work(system_wq, + queue_delayed_work(system_percpu_wq, >->tlb_invalidation.fence_tdr, tlb_timeout_jiffies(gt)); spin_unlock_irq(>->tlb_invalidation.pending_lock); @@ -218,7 +218,7 @@ static int send_tlb_invalidation(struct xe_guc *guc, >->tlb_invalidation.pending_fences); =20 if (list_is_singular(>->tlb_invalidation.pending_fences)) - queue_delayed_work(system_wq, + queue_delayed_work(system_percpu_wq, >->tlb_invalidation.fence_tdr, tlb_timeout_jiffies(gt)); } @@ -512,7 +512,7 @@ int xe_guc_tlb_invalidation_done_handler(struct xe_guc = *guc, u32 *msg, u32 len) } =20 if (!list_empty(>->tlb_invalidation.pending_fences)) - mod_delayed_work(system_wq, + mod_delayed_work(system_percpu_wq, >->tlb_invalidation.fence_tdr, tlb_timeout_jiffies(gt)); else diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c index ffaf0d02dc7d..228e25e98be1 100644 --- a/drivers/gpu/drm/xe/xe_pt.c +++ b/drivers/gpu/drm/xe/xe_pt.c @@ -1474,7 +1474,7 @@ static void invalidation_fence_cb(struct dma_fence *f= ence, =20 trace_xe_gt_tlb_invalidation_fence_cb(xe, &ifence->base); if (!ifence->fence->error) { - queue_work(system_wq, &ifence->work); + queue_work(system_percpu_wq, &ifence->work); } else { ifence->base.base.error =3D ifence->fence->error; xe_gt_tlb_invalidation_fence_signal(&ifence->base); diff --git a/drivers/iio/adc/pac1934.c b/drivers/iio/adc/pac1934.c index 20802b7f49ea..77f4679aadbd 100644 --- a/drivers/iio/adc/pac1934.c +++ b/drivers/iio/adc/pac1934.c @@ -767,7 +767,7 @@ static int pac1934_retrieve_data(struct pac1934_chip_in= fo *info, * Re-schedule the work for the read registers on timeout * (to prevent chip registers saturation) */ - mod_delayed_work(system_wq, &info->work_chip_rfsh, + mod_delayed_work(system_percpu_wq, &info->work_chip_rfsh, msecs_to_jiffies(PAC1934_MAX_RFSH_LIMIT_MS)); } =20 diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gp= io_keys.c index 5c39a217b94c..815f58e70671 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -434,7 +434,7 @@ static irqreturn_t gpio_keys_gpio_isr(int irq, void *de= v_id) ms_to_ktime(bdata->software_debounce), HRTIMER_MODE_REL); } else { - mod_delayed_work(system_wq, + mod_delayed_work(system_percpu_wq, &bdata->work, msecs_to_jiffies(bdata->software_debounce)); } diff --git a/drivers/input/misc/palmas-pwrbutton.c b/drivers/input/misc/pal= mas-pwrbutton.c index 39fc451c56e9..2d471165334a 100644 --- a/drivers/input/misc/palmas-pwrbutton.c +++ b/drivers/input/misc/palmas-pwrbutton.c @@ -91,7 +91,7 @@ static irqreturn_t pwron_irq(int irq, void *palmas_pwron) pm_wakeup_event(input_dev->dev.parent, 0); input_sync(input_dev); =20 - mod_delayed_work(system_wq, &pwron->input_work, + mod_delayed_work(system_percpu_wq, &pwron->input_work, msecs_to_jiffies(PALMAS_PWR_KEY_Q_TIME_MS)); =20 return IRQ_HANDLED; diff --git a/drivers/input/mouse/synaptics_i2c.c b/drivers/input/mouse/syna= ptics_i2c.c index a0d707e47d93..d42c562c05e3 100644 --- a/drivers/input/mouse/synaptics_i2c.c +++ b/drivers/input/mouse/synaptics_i2c.c @@ -372,7 +372,7 @@ static irqreturn_t synaptics_i2c_irq(int irq, void *dev= _id) { struct synaptics_i2c *touch =3D dev_id; =20 - mod_delayed_work(system_wq, &touch->dwork, 0); + mod_delayed_work(system_percpu_wq, &touch->dwork, 0); =20 return IRQ_HANDLED; } @@ -448,7 +448,7 @@ static void synaptics_i2c_work_handler(struct work_stru= ct *work) * We poll the device once in THREAD_IRQ_SLEEP_SECS and * if error is detected, we try to reset and reconfigure the touchpad. */ - mod_delayed_work(system_wq, &touch->dwork, delay); + mod_delayed_work(system_percpu_wq, &touch->dwork, delay); } =20 static int synaptics_i2c_open(struct input_dev *input) @@ -461,7 +461,7 @@ static int synaptics_i2c_open(struct input_dev *input) return ret; =20 if (polling_req) - mod_delayed_work(system_wq, &touch->dwork, + mod_delayed_work(system_percpu_wq, &touch->dwork, msecs_to_jiffies(NO_DATA_SLEEP_MSECS)); =20 return 0; @@ -620,7 +620,7 @@ static int synaptics_i2c_resume(struct device *dev) if (ret) return ret; =20 - mod_delayed_work(system_wq, &touch->dwork, + mod_delayed_work(system_percpu_wq, &touch->dwork, msecs_to_jiffies(NO_DATA_SLEEP_MSECS)); =20 return 0; diff --git a/drivers/leds/trigger/ledtrig-input-events.c b/drivers/leds/tri= gger/ledtrig-input-events.c index 1c79731562c2..3c6414259c27 100644 --- a/drivers/leds/trigger/ledtrig-input-events.c +++ b/drivers/leds/trigger/ledtrig-input-events.c @@ -66,7 +66,7 @@ static void input_events_event(struct input_handle *handl= e, unsigned int type, =20 spin_unlock_irqrestore(&data->lock, flags); =20 - mod_delayed_work(system_wq, &data->work, led_off_delay); + mod_delayed_work(system_percpu_wq, &data->work, led_off_delay); } =20 static int input_events_connect(struct input_handler *handler, struct inpu= t_dev *dev, diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index e42f1400cea9..de0a8e5f5c49 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1388,7 +1388,7 @@ static CLOSURE_CALLBACK(cached_dev_flush) bch_cache_accounting_destroy(&dc->accounting); kobject_del(&d->kobj); =20 - continue_at(cl, cached_dev_free, system_wq); + continue_at(cl, cached_dev_free, system_percpu_wq); } =20 static int cached_dev_init(struct cached_dev *dc, unsigned int block_size) @@ -1400,7 +1400,7 @@ static int cached_dev_init(struct cached_dev *dc, uns= igned int block_size) __module_get(THIS_MODULE); INIT_LIST_HEAD(&dc->list); closure_init(&dc->disk.cl, NULL); - set_closure_fn(&dc->disk.cl, cached_dev_flush, system_wq); + set_closure_fn(&dc->disk.cl, cached_dev_flush, system_percpu_wq); kobject_init(&dc->disk.kobj, &bch_cached_dev_ktype); INIT_WORK(&dc->detach, cached_dev_detach_finish); sema_init(&dc->sb_write_mutex, 1); @@ -1513,7 +1513,7 @@ static CLOSURE_CALLBACK(flash_dev_flush) bcache_device_unlink(d); mutex_unlock(&bch_register_lock); kobject_del(&d->kobj); - continue_at(cl, flash_dev_free, system_wq); + continue_at(cl, flash_dev_free, system_percpu_wq); } =20 static int flash_dev_run(struct cache_set *c, struct uuid_entry *u) @@ -1525,7 +1525,7 @@ static int flash_dev_run(struct cache_set *c, struct = uuid_entry *u) goto err_ret; =20 closure_init(&d->cl, NULL); - set_closure_fn(&d->cl, flash_dev_flush, system_wq); + set_closure_fn(&d->cl, flash_dev_flush, system_percpu_wq); =20 kobject_init(&d->kobj, &bch_flash_dev_ktype); =20 @@ -1828,7 +1828,7 @@ static CLOSURE_CALLBACK(__cache_set_unregister) =20 mutex_unlock(&bch_register_lock); =20 - continue_at(cl, cache_set_flush, system_wq); + continue_at(cl, cache_set_flush, system_percpu_wq); } =20 void bch_cache_set_stop(struct cache_set *c) @@ -1858,10 +1858,10 @@ struct cache_set *bch_cache_set_alloc(struct cache_= sb *sb) =20 __module_get(THIS_MODULE); closure_init(&c->cl, NULL); - set_closure_fn(&c->cl, cache_set_free, system_wq); + set_closure_fn(&c->cl, cache_set_free, system_percpu_wq); =20 closure_init(&c->caching, &c->cl); - set_closure_fn(&c->caching, __cache_set_unregister, system_wq); + set_closure_fn(&c->caching, __cache_set_unregister, system_percpu_wq); =20 /* Maybe create continue_at_noreturn() and use it here? */ closure_set_stopped(&c->cl); @@ -2493,7 +2493,7 @@ static void register_device_async(struct async_reg_ar= gs *args) INIT_DELAYED_WORK(&args->reg_work, register_cache_worker); =20 /* 10 jiffies is enough for a delay */ - queue_delayed_work(system_wq, &args->reg_work, 10); + queue_delayed_work(system_percpu_wq, &args->reg_work, 10); } =20 static void *alloc_holder_object(struct cache_sb *sb) @@ -2874,11 +2874,11 @@ static int __init bcache_init(void) /* * Let's not make this `WQ_MEM_RECLAIM` for the following reasons: * - * 1. It used `system_wq` before which also does no memory reclaim. + * 1. It used `system_percpu_wq` before which also does no memory reclaim. * 2. With `WQ_MEM_RECLAIM` desktop stalls, increased boot times, and * reduced throughput can be observed. * - * We still want to user our own queue to not congest the `system_wq`. + * We still want to user our own queue to not congest the `system_percpu_= wq`. */ bch_flush_wq =3D alloc_workqueue("bch_flush", 0, 0); if (!bch_flush_wq) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 345ea91629e0..f99fdef0253d 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -1190,7 +1190,7 @@ static void msdc_start_data(struct msdc_host *host, s= truct mmc_command *cmd, host->data =3D data; read =3D data->flags & MMC_DATA_READ; =20 - mod_delayed_work(system_wq, &host->req_timeout, DAT_TIMEOUT); + mod_delayed_work(system_percpu_wq, &host->req_timeout, DAT_TIMEOUT); msdc_dma_setup(host, &host->dma, data); sdr_set_bits(host->base + MSDC_INTEN, data_ints_mask); sdr_set_field(host->base + MSDC_DMA_CTRL, MSDC_DMA_CTRL_START, 1); @@ -1420,7 +1420,7 @@ static void msdc_start_command(struct msdc_host *host, WARN_ON(host->cmd); host->cmd =3D cmd; =20 - mod_delayed_work(system_wq, &host->req_timeout, DAT_TIMEOUT); + mod_delayed_work(system_percpu_wq, &host->req_timeout, DAT_TIMEOUT); if (!msdc_cmd_is_ready(host, mrq, cmd)) return; =20 diff --git a/drivers/nvdimm/security.c b/drivers/nvdimm/security.c index a03e3c45f297..c8095cd1cf1c 100644 --- a/drivers/nvdimm/security.c +++ b/drivers/nvdimm/security.c @@ -427,7 +427,7 @@ static int security_overwrite(struct nvdimm *nvdimm, un= signed int keyid) * query. */ get_device(dev); - queue_delayed_work(system_wq, &nvdimm->dwork, 0); + queue_delayed_work(system_percpu_wq, &nvdimm->dwork, 0); } =20 return rc; @@ -460,7 +460,7 @@ static void __nvdimm_security_overwrite_query(struct nv= dimm *nvdimm) =20 /* setup delayed work again */ tmo +=3D 10; - queue_delayed_work(system_wq, &nvdimm->dwork, tmo * HZ); + queue_delayed_work(system_percpu_wq, &nvdimm->dwork, tmo * HZ); nvdimm->sec.overwrite_tmo =3D min(15U * 60U, tmo); return; } diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cm= d.c index acc138bbf8f2..af3ec44a6490 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c @@ -1613,7 +1613,7 @@ void nvmet_execute_keep_alive(struct nvmet_req *req) =20 pr_debug("ctrl %d update keep-alive timer for %d secs\n", ctrl->cntlid, ctrl->kato); - mod_delayed_work(system_wq, &ctrl->ka_work, ctrl->kato * HZ); + mod_delayed_work(system_percpu_wq, &ctrl->ka_work, ctrl->kato * HZ); out: nvmet_req_complete(req, status); } diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/f= abrics-cmd-auth.c index bf01ec414c55..8f504bf891de 100644 --- a/drivers/nvme/target/fabrics-cmd-auth.c +++ b/drivers/nvme/target/fabrics-cmd-auth.c @@ -390,7 +390,7 @@ void nvmet_execute_auth_send(struct nvmet_req *req) req->sq->dhchap_step !=3D NVME_AUTH_DHCHAP_MESSAGE_FAILURE2) { unsigned long auth_expire_secs =3D ctrl->kato ? ctrl->kato : 120; =20 - mod_delayed_work(system_wq, &req->sq->auth_expired_work, + mod_delayed_work(system_percpu_wq, &req->sq->auth_expired_work, auth_expire_secs * HZ); goto complete; } diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-e= p-cfs.c index d712c7a866d2..45462af6100d 100644 --- a/drivers/pci/endpoint/pci-ep-cfs.c +++ b/drivers/pci/endpoint/pci-ep-cfs.c @@ -638,7 +638,7 @@ static struct config_group *pci_epf_make(struct config_= group *group, kfree(epf_name); =20 INIT_DELAYED_WORK(&epf_group->cfs_work, pci_epf_cfs_work); - queue_delayed_work(system_wq, &epf_group->cfs_work, + queue_delayed_work(system_percpu_wq, &epf_group->cfs_work, msecs_to_jiffies(1)); =20 return &epf_group->group; diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/= phy-sun4i-usb.c index 29b8fd4b9351..0f9887fda584 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -359,7 +359,7 @@ static int sun4i_usb_phy_init(struct phy *_phy) /* Force ISCR and cable state updates */ data->id_det =3D -1; data->vbus_det =3D -1; - queue_delayed_work(system_wq, &data->detect, 0); + queue_delayed_work(system_percpu_wq, &data->detect, 0); } =20 return 0; @@ -482,7 +482,7 @@ static int sun4i_usb_phy_power_on(struct phy *_phy) =20 /* We must report Vbus high within OTG_TIME_A_WAIT_VRISE msec. */ if (phy->index =3D=3D 0 && sun4i_usb_phy0_poll(data)) - mod_delayed_work(system_wq, &data->detect, DEBOUNCE_TIME); + mod_delayed_work(system_percpu_wq, &data->detect, DEBOUNCE_TIME); =20 return 0; } @@ -503,7 +503,7 @@ static int sun4i_usb_phy_power_off(struct phy *_phy) * Vbus gpio to not trigger an edge irq on Vbus off, so force a rescan. */ if (phy->index =3D=3D 0 && !sun4i_usb_phy0_poll(data)) - mod_delayed_work(system_wq, &data->detect, POLL_TIME); + mod_delayed_work(system_percpu_wq, &data->detect, POLL_TIME); =20 return 0; } @@ -542,7 +542,7 @@ static int sun4i_usb_phy_set_mode(struct phy *_phy, =20 data->id_det =3D -1; /* Force reprocessing of id */ data->force_session_end =3D true; - queue_delayed_work(system_wq, &data->detect, 0); + queue_delayed_work(system_percpu_wq, &data->detect, 0); =20 return 0; } @@ -654,7 +654,7 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct work= _struct *work) extcon_set_state_sync(data->extcon, EXTCON_USB, vbus_det); =20 if (sun4i_usb_phy0_poll(data)) - queue_delayed_work(system_wq, &data->detect, POLL_TIME); + queue_delayed_work(system_percpu_wq, &data->detect, POLL_TIME); } =20 static irqreturn_t sun4i_usb_phy0_id_vbus_det_irq(int irq, void *dev_id) @@ -662,7 +662,7 @@ static irqreturn_t sun4i_usb_phy0_id_vbus_det_irq(int i= rq, void *dev_id) struct sun4i_usb_phy_data *data =3D dev_id; =20 /* vbus or id changed, let the pins settle and then scan them */ - mod_delayed_work(system_wq, &data->detect, DEBOUNCE_TIME); + mod_delayed_work(system_percpu_wq, &data->detect, DEBOUNCE_TIME); =20 return IRQ_HANDLED; } @@ -676,7 +676,7 @@ static int sun4i_usb_phy0_vbus_notify(struct notifier_b= lock *nb, =20 /* Properties on the vbus_power_supply changed, scan vbus_det */ if (val =3D=3D PSY_EVENT_PROP_CHANGED && psy =3D=3D data->vbus_power_supp= ly) - mod_delayed_work(system_wq, &data->detect, DEBOUNCE_TIME); + mod_delayed_work(system_percpu_wq, &data->detect, DEBOUNCE_TIME); =20 return NOTIFY_OK; } diff --git a/drivers/platform/cznic/turris-omnia-mcu-gpio.c b/drivers/platf= orm/cznic/turris-omnia-mcu-gpio.c index 5f35f7c5d5d7..18f7e1c41a86 100644 --- a/drivers/platform/cznic/turris-omnia-mcu-gpio.c +++ b/drivers/platform/cznic/turris-omnia-mcu-gpio.c @@ -883,7 +883,7 @@ static bool omnia_irq_read_pending_old(struct omnia_mcu= *mcu, =20 if (status & OMNIA_STS_BUTTON_PRESSED) { mcu->button_pressed_emul =3D true; - mod_delayed_work(system_wq, &mcu->button_release_emul_work, + mod_delayed_work(system_percpu_wq, &mcu->button_release_emul_work, msecs_to_jiffies(FRONT_BUTTON_RELEASE_DELAY_MS)); } else if (mcu->button_pressed_emul) { status |=3D OMNIA_STS_BUTTON_PRESSED; diff --git a/drivers/platform/surface/aggregator/ssh_packet_layer.c b/drive= rs/platform/surface/aggregator/ssh_packet_layer.c index 6081b0146d5f..3dd22856570f 100644 --- a/drivers/platform/surface/aggregator/ssh_packet_layer.c +++ b/drivers/platform/surface/aggregator/ssh_packet_layer.c @@ -671,7 +671,7 @@ static void ssh_ptl_timeout_reaper_mod(struct ssh_ptl *= ptl, ktime_t now, /* Re-adjust / schedule reaper only if it is above resolution delta. */ if (ktime_before(aexp, ptl->rtx_timeout.expires)) { ptl->rtx_timeout.expires =3D expires; - mod_delayed_work(system_wq, &ptl->rtx_timeout.reaper, delta); + mod_delayed_work(system_percpu_wq, &ptl->rtx_timeout.reaper, delta); } =20 spin_unlock(&ptl->rtx_timeout.lock); diff --git a/drivers/platform/surface/aggregator/ssh_request_layer.c b/driv= ers/platform/surface/aggregator/ssh_request_layer.c index 879ca9ee7ff6..a356e4956562 100644 --- a/drivers/platform/surface/aggregator/ssh_request_layer.c +++ b/drivers/platform/surface/aggregator/ssh_request_layer.c @@ -434,7 +434,7 @@ static void ssh_rtl_timeout_reaper_mod(struct ssh_rtl *= rtl, ktime_t now, /* Re-adjust / schedule reaper only if it is above resolution delta. */ if (ktime_before(aexp, rtl->rtx_timeout.expires)) { rtl->rtx_timeout.expires =3D expires; - mod_delayed_work(system_wq, &rtl->rtx_timeout.reaper, delta); + mod_delayed_work(system_percpu_wq, &rtl->rtx_timeout.reaper, delta); } =20 spin_unlock(&rtl->rtx_timeout.lock); diff --git a/drivers/platform/x86/gpd-pocket-fan.c b/drivers/platform/x86/g= pd-pocket-fan.c index 7a20f68ae206..c9236738f896 100644 --- a/drivers/platform/x86/gpd-pocket-fan.c +++ b/drivers/platform/x86/gpd-pocket-fan.c @@ -112,14 +112,14 @@ static void gpd_pocket_fan_worker(struct work_struct = *work) gpd_pocket_fan_set_speed(fan, speed); =20 /* When mostly idle (low temp/speed), slow down the poll interval. */ - queue_delayed_work(system_wq, &fan->work, + queue_delayed_work(system_percpu_wq, &fan->work, msecs_to_jiffies(4000 / (speed + 1))); } =20 static void gpd_pocket_fan_force_update(struct gpd_pocket_fan_data *fan) { fan->last_speed =3D -1; - mod_delayed_work(system_wq, &fan->work, 0); + mod_delayed_work(system_percpu_wq, &fan->work, 0); } =20 static int gpd_pocket_fan_probe(struct platform_device *pdev) diff --git a/drivers/platform/x86/x86-android-tablets/vexia_atla10_ec.c b/d= rivers/platform/x86/x86-android-tablets/vexia_atla10_ec.c index 5d02af1c5aaa..94465a62f7e7 100644 --- a/drivers/platform/x86/x86-android-tablets/vexia_atla10_ec.c +++ b/drivers/platform/x86/x86-android-tablets/vexia_atla10_ec.c @@ -183,7 +183,7 @@ static void atla10_ec_external_power_changed(struct pow= er_supply *psy) struct atla10_ec_data *data =3D power_supply_get_drvdata(psy); =20 /* After charger plug in/out wait 0.5s for things to stabilize */ - mod_delayed_work(system_wq, &data->work, HZ / 2); + mod_delayed_work(system_percpu_wq, &data->work, HZ / 2); } =20 static const enum power_supply_property atla10_ec_psy_props[] =3D { diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c index e440b15fbabc..15f7f043c8ef 100644 --- a/drivers/ras/cec.c +++ b/drivers/ras/cec.c @@ -166,7 +166,7 @@ static void cec_mod_work(unsigned long interval) unsigned long iv; =20 iv =3D interval * HZ; - mod_delayed_work(system_wq, &cec_work, round_jiffies(iv)); + mod_delayed_work(system_percpu_wq, &cec_work, round_jiffies(iv)); } =20 static void cec_work_fn(struct work_struct *work) diff --git a/drivers/regulator/irq_helpers.c b/drivers/regulator/irq_helper= s.c index 5742faee8071..54dd19e1e94c 100644 --- a/drivers/regulator/irq_helpers.c +++ b/drivers/regulator/irq_helpers.c @@ -146,7 +146,7 @@ static void regulator_notifier_isr_work(struct work_str= uct *work) =20 reschedule: if (!d->high_prio) - mod_delayed_work(system_wq, &h->isr_work, + mod_delayed_work(system_percpu_wq, &h->isr_work, msecs_to_jiffies(tmo)); else mod_delayed_work(system_highpri_wq, &h->isr_work, diff --git a/drivers/regulator/qcom-labibb-regulator.c b/drivers/regulator/= qcom-labibb-regulator.c index ba3f9391565f..ad65d264cfe0 100644 --- a/drivers/regulator/qcom-labibb-regulator.c +++ b/drivers/regulator/qcom-labibb-regulator.c @@ -230,7 +230,7 @@ static void qcom_labibb_ocp_recovery_worker(struct work= _struct *work) return; =20 reschedule: - mod_delayed_work(system_wq, &vreg->ocp_recovery_work, + mod_delayed_work(system_percpu_wq, &vreg->ocp_recovery_work, msecs_to_jiffies(OCP_RECOVERY_INTERVAL_MS)); } =20 @@ -510,7 +510,7 @@ static void qcom_labibb_sc_recovery_worker(struct work_= struct *work) * taking action is not truly urgent anymore. */ vreg->sc_count++; - mod_delayed_work(system_wq, &vreg->sc_recovery_work, + mod_delayed_work(system_percpu_wq, &vreg->sc_recovery_work, msecs_to_jiffies(SC_RECOVERY_INTERVAL_MS)); } =20 diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index 8c527af98927..e842dda55f71 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -2617,7 +2617,7 @@ static int tb_alloc_dp_bandwidth(struct tb_tunnel *tu= nnel, int *requested_up, * the 10s already expired and we should * give the reserved back to others). */ - mod_delayed_work(system_wq, &group->release_work, + mod_delayed_work(system_percpu_wq, &group->release_work, msecs_to_jiffies(TB_RELEASE_BW_TIMEOUT)); } } diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 47e73c4ed62d..17c6fb417231 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -3888,7 +3888,7 @@ static void dwc3_gadget_endpoint_stream_event(struct = dwc3_ep *dep, case DEPEVT_STREAM_NOSTREAM: dep->flags &=3D ~DWC3_EP_STREAM_PRIMED; if (dep->flags & DWC3_EP_FORCE_RESTART_STREAM) - queue_delayed_work(system_wq, &dep->nostream_work, + queue_delayed_work(system_percpu_wq, &dep->nostream_work, msecs_to_jiffies(100)); break; } diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c index fd7895b24367..8b3052954530 100644 --- a/drivers/usb/host/xhci-dbgcap.c +++ b/drivers/usb/host/xhci-dbgcap.c @@ -365,7 +365,7 @@ int dbc_ep_queue(struct dbc_request *req) ret =3D dbc_ep_do_queue(req); spin_unlock_irqrestore(&dbc->lock, flags); =20 - mod_delayed_work(system_wq, &dbc->event_work, 0); + mod_delayed_work(system_percpu_wq, &dbc->event_work, 0); =20 trace_xhci_dbc_queue_request(req); =20 @@ -637,7 +637,7 @@ static int xhci_dbc_start(struct xhci_dbc *dbc) return ret; } =20 - return mod_delayed_work(system_wq, &dbc->event_work, + return mod_delayed_work(system_percpu_wq, &dbc->event_work, msecs_to_jiffies(dbc->poll_interval)); } =20 @@ -964,7 +964,7 @@ static void xhci_dbc_handle_events(struct work_struct *= work) return; } =20 - mod_delayed_work(system_wq, &dbc->event_work, + mod_delayed_work(system_percpu_wq, &dbc->event_work, msecs_to_jiffies(poll_interval)); } =20 @@ -1215,7 +1215,7 @@ static ssize_t dbc_poll_interval_ms_store(struct devi= ce *dev, =20 dbc->poll_interval =3D value; =20 - mod_delayed_work(system_wq, &dbc->event_work, 0); + mod_delayed_work(system_percpu_wq, &dbc->event_work, 0); =20 return size; } diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 5d64c297721c..79704fbbba50 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -434,7 +434,7 @@ void xhci_ring_cmd_db(struct xhci_hcd *xhci) =20 static bool xhci_mod_cmd_timer(struct xhci_hcd *xhci) { - return mod_delayed_work(system_wq, &xhci->cmd_timer, + return mod_delayed_work(system_percpu_wq, &xhci->cmd_timer, msecs_to_jiffies(xhci->current_cmd->timeout_ms)); } =20 diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_b= ase.c index 41309d38f78c..114c2af0857a 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -581,7 +581,7 @@ static void lateeoi_list_add(struct irq_info *info) eoi_list); if (!elem || info->eoi_time < elem->eoi_time) { list_add(&info->eoi_list, &eoi->eoi_list); - mod_delayed_work_on(info->eoi_cpu, system_wq, + mod_delayed_work_on(info->eoi_cpu, system_percpu_wq, &eoi->delayed, delay); } else { list_for_each_entry_reverse(elem, &eoi->eoi_list, eoi_list) { @@ -666,7 +666,7 @@ static void xen_irq_lateeoi_worker(struct work_struct *= work) break; =20 if (now < info->eoi_time) { - mod_delayed_work_on(info->eoi_cpu, system_wq, + mod_delayed_work_on(info->eoi_cpu, system_percpu_wq, &eoi->delayed, info->eoi_time - now); break; @@ -782,7 +782,7 @@ static void xen_free_irq(struct irq_info *info) =20 WARN_ON(info->refcnt > 0); =20 - queue_rcu_work(system_wq, &info->rwork); + queue_rcu_work(system_percpu_wq, &info->rwork); } =20 /* Not called for lateeoi events. */ --=20 2.51.0 From nobody Tue Sep 9 21:32:24 2025 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8D8C2D0636 for ; Fri, 5 Sep 2025 08:58:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757062705; cv=none; b=GRYlrumzkElyng9ia3O95GLsca55LmnDkhKr0R505ZDuJd9n8DPrab+hKmzJbQjFpPArh5C0R2tj4LANcOvVP0H6ejDrCNwzXt1BL0KgXQQfsNES8lsjU9zM9FIw2nGwW0AbQyWSUoI0JOhgXXZNDAkS6J9jgKRfisnS1KWMIGg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757062705; c=relaxed/simple; bh=kwxwTQopDZyd22zQXb/+ONV321BD4wKHuOMq2qJ6hlQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=R7Mr+2q8/DzbTCxnTnwQuvHK21JSo0kCkHK28BdZSnL7zgiCFVprs+n+6pfefR8Kg6D7yWk7kj3uKZgavN1pbqAKw+jYKCtqSxQX8Dy/BUntf6G32jS1ANadj6tlbUrtmFAuRyCw2O1EcDbLP1z3VEDs3EuiN+gc6fEKkdKP4IM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=JgiH6TM/; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="JgiH6TM/" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-45dcff2f313so11542985e9.0 for ; Fri, 05 Sep 2025 01:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1757062699; x=1757667499; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UEeRWxYsii+GV1FCq7CYE3AYmEKzR5vLIE4WElR9f4s=; b=JgiH6TM/sTQV5SDaKe3Oe1pTHgbKT0UNNGlHchh90VmZwNoobGkoWHhF+mtF6Ty8Qp g22k2jqgKzCRRYgDq86FulyvLvL/QXmzu1cA/og1h33hs1H6/xIrMoEnZ0HGbgEcB3xR N2BKGCO3P/H9DmLPiDVR7fV23dcUPeaI/3fv2fgr7p6nUipm5BvgKha/bmnkDAI3y74R CD0vDUpntrVj9kNOX8in4F7RTKiFsaMTX9d+3a0kK3EJfmiukjM8R77tFiBfFANkxuxS D1xbdBsryCYUkPe3gAUi+EsKwak5Ym8P103EVkxdGRXVavMrUGE7Kd+Zz5hQ43Btsc2X TSvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757062699; x=1757667499; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UEeRWxYsii+GV1FCq7CYE3AYmEKzR5vLIE4WElR9f4s=; b=UOe5EXGR3FFTtMEkk+NBBxCv0o75Q8ThU967omb8jOF3pKgWem8Mv0r/p2+iRmmK7i ecOgVburMm36Ep52htNTb/H9UrzgDU+FCBCvPzyfx87i7WD8DEkKU/yIjn+E2fhJMDc8 gfPSLfm58e44GX1tCvqmpqqNSfcxwZX9Ewwpo9OFiTZmlb7pauTB9gOOMjmgcT7ACuww Dtq0tmA9k6Cipwj9TH7q/XFNPUcov+DWZmyB8Zjc4zUOVqw8p/c0lsrLrNwljTHVsYcK YElZoVomqYIUJ5KYAD65nleML8ro1Ou2iKcC5I9y98wylApA0qMkrc2CQrAvxVJJGHK8 Q7mA== X-Gm-Message-State: AOJu0YyrtswztmHVPabLC150VkzTuR9+oxXpz0hV412dtQ3zE6JpxDbf mAJouzHQpayX7BYP2M3ZTyd5IUzeqDa+Xv1pGml2BSOs1qdKoAjU0/YGsMoAkI9Fg1wh+g9z+97 3zfjp X-Gm-Gg: ASbGnct2YLWm8aJjRGOFnRzhOb0yENswyiSZaanNhhO40zxUGjunQ3iNZPHT7IlV7El YUlFeDhPonUxTpiyxE6Jmale6KKRMXbPYbjOe1drEdx6uEk9U6WvQyynurxA86+Kj3h13D+9QJ0 tG9bU0VMPuNqBcjzpxjz2oCSUH7xrQqs5xX2D1UJklooTW8YRQ4xyu/tE8zXHtte4cF+CzhTwwA pLTDB2FFHi7Pt+DYeB5nOKyD2iahPOoWqwLzIJoNomwYxlEiSjTbyE+5kWcuaaKGmKukdYsKt1s 51kL5K/mtMsrjvjSsiEcmePr9P8BeAhEHXztSxHDTjLS3fnus2tx9Pv/fjFatCzon1Q0RjBOfd0 Kjn3iUdxRMa5pGtZEfGgJSfUUvSlBvq4jjlIi6IUN0XeqAMV4csR2K14spQ== X-Google-Smtp-Source: AGHT+IGdVFliDv8G2mO9XuHv1ey3018lgF5zLqIq4JwMwcVZP6OAcxN0NuxOg77wJZcwDevemQCULw== X-Received: by 2002:a05:600c:4452:b0:455:f187:6203 with SMTP id 5b1f17b1804b1-45b855983cfmr164254165e9.27.1757062698017; Fri, 05 Sep 2025 01:58:18 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b81a9e971sm334698915e9.18.2025.09.05.01.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Sep 2025 01:58:17 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Greg Kroah-Hartman , Jakub Kicinski , Alex Deucher Subject: [PATCH 3/3] drivers: WQ_PERCPU added to alloc_workqueue users Date: Fri, 5 Sep 2025 10:58:01 +0200 Message-ID: <20250905085801.98754-4-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250905085801.98754-1-marco.crivellari@suse.com> References: <20250905085801.98754-1-marco.crivellari@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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. alloc_workqueue() treats all queues as per-CPU by default, while unbound workqueues must opt-in via WQ_UNBOUND. This default is suboptimal: most workloads benefit from unbound queues, allowing the scheduler to place worker threads where they=E2=80=99re needed= and reducing noise when CPUs are isolated. This default is suboptimal: most workloads benefit from unbound queues, allowing the scheduler to place worker threads where they=E2=80=99re needed= and reducing noise when CPUs are isolated. This patch adds a new WQ_PERCPU flag to explicitly request the use of the per-CPU behavior. Both flags coexist for one release cycle to allow callers to transition their calls. Once migration is complete, WQ_UNBOUND can be removed and unbound will become the implicit default. With the introduction of the WQ_PERCPU flag (equivalent to !WQ_UNBOUND), any alloc_workqueue() caller that doesn=E2=80=99t explicitly specify WQ_UNB= OUND must now use WQ_PERCPU. All existing users have been updated accordingly. Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- drivers/acpi/ec.c | 3 ++- drivers/acpi/osl.c | 4 ++-- drivers/acpi/thermal.c | 3 ++- drivers/ata/libata-sff.c | 3 ++- drivers/base/core.c | 2 +- drivers/bus/mhi/ep/main.c | 2 +- drivers/char/tpm/tpm-dev-common.c | 3 ++- drivers/char/xillybus/xillybus_core.c | 2 +- drivers/char/xillybus/xillyusb.c | 4 ++-- drivers/cpufreq/tegra194-cpufreq.c | 3 ++- drivers/crypto/atmel-i2c.c | 2 +- drivers/crypto/cavium/nitrox/nitrox_mbx.c | 2 +- drivers/crypto/intel/qat/qat_common/adf_aer.c | 4 ++-- drivers/crypto/intel/qat/qat_common/adf_isr.c | 3 ++- drivers/crypto/intel/qat/qat_common/adf_sriov.c | 3 ++- drivers/crypto/intel/qat/qat_common/adf_vf_isr.c | 3 ++- drivers/firewire/core-transaction.c | 3 ++- drivers/firewire/ohci.c | 3 ++- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 3 ++- drivers/gpu/drm/bridge/analogix/anx7625.c | 3 ++- .../gpu/drm/i915/display/intel_display_driver.c | 3 ++- drivers/gpu/drm/i915/i915_driver.c | 3 ++- drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 2 +- drivers/gpu/drm/i915/selftests/mock_gem_device.c | 2 +- drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- drivers/gpu/drm/nouveau/nouveau_sched.c | 3 ++- drivers/gpu/drm/radeon/radeon_display.c | 3 ++- drivers/gpu/drm/xe/xe_device.c | 4 ++-- drivers/gpu/drm/xe/xe_ggtt.c | 2 +- drivers/gpu/drm/xe/xe_hw_engine_group.c | 3 ++- drivers/gpu/drm/xe/xe_sriov.c | 2 +- drivers/greybus/operation.c | 2 +- drivers/hid/hid-nintendo.c | 3 ++- drivers/hv/mshv_eventfd.c | 2 +- drivers/i3c/master.c | 2 +- drivers/infiniband/core/cm.c | 2 +- drivers/infiniband/core/device.c | 4 ++-- drivers/infiniband/hw/hfi1/init.c | 3 +-- drivers/infiniband/hw/hfi1/opfn.c | 3 +-- drivers/infiniband/hw/mlx4/cm.c | 2 +- drivers/infiniband/sw/rdmavt/cq.c | 3 ++- drivers/infiniband/ulp/iser/iscsi_iser.c | 2 +- drivers/infiniband/ulp/isert/ib_isert.c | 2 +- drivers/infiniband/ulp/rtrs/rtrs-clt.c | 2 +- drivers/infiniband/ulp/rtrs/rtrs-srv.c | 2 +- drivers/input/mouse/psmouse-smbus.c | 2 +- drivers/isdn/capi/kcapi.c | 2 +- drivers/md/bcache/btree.c | 3 ++- drivers/md/bcache/super.c | 10 ++++++---- drivers/md/bcache/writeback.c | 2 +- drivers/md/dm-bufio.c | 3 ++- drivers/md/dm-cache-target.c | 3 ++- drivers/md/dm-clone-target.c | 3 ++- drivers/md/dm-crypt.c | 6 ++++-- drivers/md/dm-delay.c | 4 +++- drivers/md/dm-integrity.c | 15 ++++++++++----- drivers/md/dm-kcopyd.c | 3 ++- drivers/md/dm-log-userspace-base.c | 3 ++- drivers/md/dm-mpath.c | 5 +++-- drivers/md/dm-raid1.c | 5 +++-- drivers/md/dm-snap-persistent.c | 3 ++- drivers/md/dm-stripe.c | 2 +- drivers/md/dm-verity-target.c | 4 +++- drivers/md/dm-writecache.c | 3 ++- drivers/md/dm.c | 3 ++- drivers/md/md.c | 4 ++-- drivers/media/pci/ddbridge/ddbridge-core.c | 2 +- .../media/platform/mediatek/mdp3/mtk-mdp3-core.c | 6 ++++-- drivers/message/fusion/mptbase.c | 7 +++++-- drivers/mmc/core/block.c | 3 ++- drivers/mmc/host/omap.c | 2 +- drivers/nvme/host/tcp.c | 2 ++ drivers/nvme/target/core.c | 5 +++-- drivers/nvme/target/fc.c | 6 +++--- drivers/nvme/target/tcp.c | 2 +- drivers/pci/endpoint/functions/pci-epf-mhi.c | 2 +- drivers/pci/endpoint/functions/pci-epf-ntb.c | 5 +++-- drivers/pci/endpoint/functions/pci-epf-test.c | 3 ++- drivers/pci/endpoint/functions/pci-epf-vntb.c | 5 +++-- drivers/pci/hotplug/pnv_php.c | 3 ++- drivers/pci/hotplug/shpchp_core.c | 3 ++- drivers/platform/surface/surface_acpi_notify.c | 2 +- drivers/rapidio/rio.c | 2 +- drivers/scsi/be2iscsi/be_main.c | 3 ++- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 2 +- drivers/scsi/device_handler/scsi_dh_alua.c | 2 +- drivers/scsi/fcoe/fcoe.c | 2 +- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 3 ++- drivers/scsi/lpfc/lpfc_init.c | 2 +- drivers/scsi/pm8001/pm8001_init.c | 2 +- drivers/scsi/qedf/qedf_main.c | 15 ++++++++++----- drivers/scsi/qedi/qedi_main.c | 2 +- drivers/scsi/qla2xxx/qla_os.c | 2 +- drivers/scsi/qla2xxx/qla_target.c | 2 +- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 2 +- drivers/scsi/qla4xxx/ql4_os.c | 3 ++- drivers/scsi/scsi_transport_fc.c | 7 ++++--- drivers/soc/fsl/qbman/qman.c | 2 +- drivers/staging/greybus/sdio.c | 2 +- drivers/target/target_core_transport.c | 4 ++-- drivers/target/target_core_xcopy.c | 2 +- drivers/target/tcm_fc/tfc_conf.c | 2 +- drivers/usb/core/hub.c | 2 +- drivers/usb/gadget/function/f_hid.c | 3 +-- drivers/usb/storage/uas.c | 2 +- drivers/usb/typec/anx7411.c | 3 +-- drivers/vdpa/vdpa_user/vduse_dev.c | 3 ++- drivers/virtio/virtio_balloon.c | 3 ++- drivers/xen/privcmd.c | 3 ++- 109 files changed, 207 insertions(+), 142 deletions(-) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 8db09d81918f..f2b72bf8fa65 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -2273,7 +2273,8 @@ static int acpi_ec_init_workqueues(void) ec_wq =3D alloc_ordered_workqueue("kec", 0); =20 if (!ec_query_wq) - ec_query_wq =3D alloc_workqueue("kec_query", 0, ec_max_queries); + ec_query_wq =3D alloc_workqueue("kec_query", WQ_PERCPU, + ec_max_queries); =20 if (!ec_wq || !ec_query_wq) { acpi_ec_destroy_workqueues(); diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index a79a5d47bdb8..05393a7315fe 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -1694,8 +1694,8 @@ acpi_status __init acpi_os_initialize(void) =20 acpi_status __init acpi_os_initialize1(void) { - kacpid_wq =3D alloc_workqueue("kacpid", 0, 1); - kacpi_notify_wq =3D alloc_workqueue("kacpi_notify", 0, 0); + kacpid_wq =3D alloc_workqueue("kacpid", WQ_PERCPU, 1); + kacpi_notify_wq =3D alloc_workqueue("kacpi_notify", WQ_PERCPU, 0); kacpi_hotplug_wq =3D alloc_ordered_workqueue("kacpi_hotplug", 0); BUG_ON(!kacpid_wq); BUG_ON(!kacpi_notify_wq); diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 0c874186f8ae..9f5a2f288d32 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -1060,7 +1060,8 @@ static int __init acpi_thermal_init(void) } =20 acpi_thermal_pm_queue =3D alloc_workqueue("acpi_thermal_pm", - WQ_HIGHPRI | WQ_MEM_RECLAIM, 0); + WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_PERCPU, + 0); if (!acpi_thermal_pm_queue) return -ENODEV; =20 diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 5a46c066abc3..ae6879fa868d 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c @@ -3199,7 +3199,8 @@ void ata_sff_port_init(struct ata_port *ap) =20 int __init ata_sff_init(void) { - ata_sff_wq =3D alloc_workqueue("ata_sff", WQ_MEM_RECLAIM, WQ_MAX_ACTIVE); + ata_sff_wq =3D alloc_workqueue("ata_sff", WQ_MEM_RECLAIM | WQ_PERCPU, + WQ_MAX_ACTIVE); if (!ata_sff_wq) return -ENOMEM; =20 diff --git a/drivers/base/core.c b/drivers/base/core.c index d2f9d3a59d6b..fa43d02c56c1 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -4115,7 +4115,7 @@ int __init devices_init(void) sysfs_dev_char_kobj =3D kobject_create_and_add("char", dev_kobj); if (!sysfs_dev_char_kobj) goto char_kobj_err; - device_link_wq =3D alloc_workqueue("device_link_wq", 0, 0); + device_link_wq =3D alloc_workqueue("device_link_wq", WQ_PERCPU, 0); if (!device_link_wq) goto wq_err; =20 diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c index b3eafcf2a2c5..bee0b794c3e3 100644 --- a/drivers/bus/mhi/ep/main.c +++ b/drivers/bus/mhi/ep/main.c @@ -1507,7 +1507,7 @@ int mhi_ep_register_controller(struct mhi_ep_cntrl *m= hi_cntrl, INIT_WORK(&mhi_cntrl->cmd_ring_work, mhi_ep_cmd_ring_worker); INIT_WORK(&mhi_cntrl->ch_ring_work, mhi_ep_ch_ring_worker); =20 - mhi_cntrl->wq =3D alloc_workqueue("mhi_ep_wq", 0, 0); + mhi_cntrl->wq =3D alloc_workqueue("mhi_ep_wq", WQ_PERCPU, 0); if (!mhi_cntrl->wq) { ret =3D -ENOMEM; goto err_destroy_ring_item_cache; diff --git a/drivers/char/tpm/tpm-dev-common.c b/drivers/char/tpm/tpm-dev-c= ommon.c index 11deaf538e87..2b46db0fd4b3 100644 --- a/drivers/char/tpm/tpm-dev-common.c +++ b/drivers/char/tpm/tpm-dev-common.c @@ -275,7 +275,8 @@ void tpm_common_release(struct file *file, struct file_= priv *priv) =20 int __init tpm_dev_common_init(void) { - tpm_dev_wq =3D alloc_workqueue("tpm_dev_wq", WQ_MEM_RECLAIM, 0); + tpm_dev_wq =3D alloc_workqueue("tpm_dev_wq", WQ_MEM_RECLAIM | WQ_PERCPU, + 0); =20 return !tpm_dev_wq ? -ENOMEM : 0; } diff --git a/drivers/char/xillybus/xillybus_core.c b/drivers/char/xillybus/= xillybus_core.c index 11b7c4749274..3ecd589a22b1 100644 --- a/drivers/char/xillybus/xillybus_core.c +++ b/drivers/char/xillybus/xillybus_core.c @@ -1974,7 +1974,7 @@ EXPORT_SYMBOL(xillybus_endpoint_remove); =20 static int __init xillybus_init(void) { - xillybus_wq =3D alloc_workqueue(xillyname, 0, 0); + xillybus_wq =3D alloc_workqueue(xillyname, WQ_PERCPU, 0); if (!xillybus_wq) return -ENOMEM; =20 diff --git a/drivers/char/xillybus/xillyusb.c b/drivers/char/xillybus/xilly= usb.c index 45771b1a3716..2a29e2be0296 100644 --- a/drivers/char/xillybus/xillyusb.c +++ b/drivers/char/xillybus/xillyusb.c @@ -2163,7 +2163,7 @@ static int xillyusb_probe(struct usb_interface *inter= face, spin_lock_init(&xdev->error_lock); xdev->in_counter =3D 0; xdev->in_bytes_left =3D 0; - xdev->workq =3D alloc_workqueue(xillyname, WQ_HIGHPRI, 0); + xdev->workq =3D alloc_workqueue(xillyname, WQ_HIGHPRI | WQ_PERCPU, 0); =20 if (!xdev->workq) { dev_err(&interface->dev, "Failed to allocate work queue\n"); @@ -2275,7 +2275,7 @@ static int __init xillyusb_init(void) { int rc =3D 0; =20 - wakeup_wq =3D alloc_workqueue(xillyname, 0, 0); + wakeup_wq =3D alloc_workqueue(xillyname, WQ_PERCPU, 0); if (!wakeup_wq) return -ENOMEM; =20 diff --git a/drivers/cpufreq/tegra194-cpufreq.c b/drivers/cpufreq/tegra194-= cpufreq.c index 9b4f516f313e..695599e1001f 100644 --- a/drivers/cpufreq/tegra194-cpufreq.c +++ b/drivers/cpufreq/tegra194-cpufreq.c @@ -750,7 +750,8 @@ static int tegra194_cpufreq_probe(struct platform_devic= e *pdev) if (IS_ERR(bpmp)) return PTR_ERR(bpmp); =20 - read_counters_wq =3D alloc_workqueue("read_counters_wq", __WQ_LEGACY, 1); + read_counters_wq =3D alloc_workqueue("read_counters_wq", + __WQ_LEGACY | WQ_PERCPU, 1); if (!read_counters_wq) { dev_err(&pdev->dev, "fail to create_workqueue\n"); err =3D -EINVAL; diff --git a/drivers/crypto/atmel-i2c.c b/drivers/crypto/atmel-i2c.c index a895e4289efa..9688d116d07e 100644 --- a/drivers/crypto/atmel-i2c.c +++ b/drivers/crypto/atmel-i2c.c @@ -402,7 +402,7 @@ EXPORT_SYMBOL(atmel_i2c_probe); =20 static int __init atmel_i2c_init(void) { - atmel_wq =3D alloc_workqueue("atmel_wq", 0, 0); + atmel_wq =3D alloc_workqueue("atmel_wq", WQ_PERCPU, 0); return atmel_wq ? 0 : -ENOMEM; } =20 diff --git a/drivers/crypto/cavium/nitrox/nitrox_mbx.c b/drivers/crypto/cav= ium/nitrox/nitrox_mbx.c index d4e06999af9b..a6a76e50ba84 100644 --- a/drivers/crypto/cavium/nitrox/nitrox_mbx.c +++ b/drivers/crypto/cavium/nitrox/nitrox_mbx.c @@ -192,7 +192,7 @@ int nitrox_mbox_init(struct nitrox_device *ndev) } =20 /* allocate pf2vf response workqueue */ - ndev->iov.pf2vf_wq =3D alloc_workqueue("nitrox_pf2vf", 0, 0); + ndev->iov.pf2vf_wq =3D alloc_workqueue("nitrox_pf2vf", WQ_PERCPU, 0); if (!ndev->iov.pf2vf_wq) { kfree(ndev->iov.vfdev); ndev->iov.vfdev =3D NULL; diff --git a/drivers/crypto/intel/qat/qat_common/adf_aer.c b/drivers/crypto= /intel/qat/qat_common/adf_aer.c index 4cb8bd83f570..fabd852f1708 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_aer.c +++ b/drivers/crypto/intel/qat/qat_common/adf_aer.c @@ -276,11 +276,11 @@ int adf_notify_fatal_error(struct adf_accel_dev *acce= l_dev) int adf_init_aer(void) { device_reset_wq =3D alloc_workqueue("qat_device_reset_wq", - WQ_MEM_RECLAIM, 0); + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!device_reset_wq) return -EFAULT; =20 - device_sriov_wq =3D alloc_workqueue("qat_device_sriov_wq", 0, 0); + device_sriov_wq =3D alloc_workqueue("qat_device_sriov_wq", WQ_PERCPU, 0); if (!device_sriov_wq) { destroy_workqueue(device_reset_wq); device_reset_wq =3D NULL; diff --git a/drivers/crypto/intel/qat/qat_common/adf_isr.c b/drivers/crypto= /intel/qat/qat_common/adf_isr.c index cae1aee5479a..7381e0570540 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_isr.c +++ b/drivers/crypto/intel/qat/qat_common/adf_isr.c @@ -384,7 +384,8 @@ EXPORT_SYMBOL_GPL(adf_isr_resource_alloc); */ int __init adf_init_misc_wq(void) { - adf_misc_wq =3D alloc_workqueue("qat_misc_wq", WQ_MEM_RECLAIM, 0); + adf_misc_wq =3D alloc_workqueue("qat_misc_wq", + WQ_MEM_RECLAIM | WQ_PERCPU, 0); =20 return !adf_misc_wq ? -ENOMEM : 0; } diff --git a/drivers/crypto/intel/qat/qat_common/adf_sriov.c b/drivers/cryp= to/intel/qat/qat_common/adf_sriov.c index c75d0b6cb0ad..0afa8d42c220 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_sriov.c +++ b/drivers/crypto/intel/qat/qat_common/adf_sriov.c @@ -300,7 +300,8 @@ EXPORT_SYMBOL_GPL(adf_sriov_configure); int __init adf_init_pf_wq(void) { /* Workqueue for PF2VF responses */ - pf2vf_resp_wq =3D alloc_workqueue("qat_pf2vf_resp_wq", WQ_MEM_RECLAIM, 0); + pf2vf_resp_wq =3D alloc_workqueue("qat_pf2vf_resp_wq", + WQ_MEM_RECLAIM | WQ_PERCPU, 0); =20 return !pf2vf_resp_wq ? -ENOMEM : 0; } diff --git a/drivers/crypto/intel/qat/qat_common/adf_vf_isr.c b/drivers/cry= pto/intel/qat/qat_common/adf_vf_isr.c index a4636ec9f9ca..d0fef20a3df4 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_vf_isr.c +++ b/drivers/crypto/intel/qat/qat_common/adf_vf_isr.c @@ -299,7 +299,8 @@ EXPORT_SYMBOL_GPL(adf_flush_vf_wq); */ int __init adf_init_vf_wq(void) { - adf_vf_stop_wq =3D alloc_workqueue("adf_vf_stop_wq", WQ_MEM_RECLAIM, 0); + adf_vf_stop_wq =3D alloc_workqueue("adf_vf_stop_wq", + WQ_MEM_RECLAIM | WQ_PERCPU, 0); =20 return !adf_vf_stop_wq ? -EFAULT : 0; } diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-tr= ansaction.c index b0f9ef6ac6df..f07b8a13a201 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -1327,7 +1327,8 @@ static int __init fw_core_init(void) { int ret; =20 - fw_workqueue =3D alloc_workqueue("firewire", WQ_MEM_RECLAIM, 0); + fw_workqueue =3D alloc_workqueue("firewire", WQ_MEM_RECLAIM | WQ_PERCPU, + 0); if (!fw_workqueue) return -ENOMEM; =20 diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index edaedd156a6d..2b721cca366c 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -3941,7 +3941,8 @@ static struct pci_driver fw_ohci_pci_driver =3D { =20 static int __init fw_ohci_init(void) { - selfid_workqueue =3D alloc_workqueue(KBUILD_MODNAME, WQ_MEM_RECLAIM, 0); + selfid_workqueue =3D alloc_workqueue(KBUILD_MODNAME, + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!selfid_workqueue) return -ENOMEM; =20 diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd= /amdkfd/kfd_process.c index 7c0c24732481..2cb9088f67cc 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c @@ -690,7 +690,8 @@ void kfd_procfs_del_queue(struct queue *q) int kfd_process_create_wq(void) { if (!kfd_process_wq) - kfd_process_wq =3D alloc_workqueue("kfd_process_wq", 0, 0); + kfd_process_wq =3D alloc_workqueue("kfd_process_wq", WQ_PERCPU, + 0); if (!kfd_restore_wq) kfd_restore_wq =3D alloc_ordered_workqueue("kfd_restore_wq", WQ_FREEZABLE); diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/br= idge/analogix/anx7625.c index 0b97b66de577..bc06ea7c4eb1 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -2659,7 +2659,8 @@ static int anx7625_i2c_probe(struct i2c_client *clien= t) if (platform->pdata.intp_irq) { INIT_WORK(&platform->work, anx7625_work_func); platform->workqueue =3D alloc_workqueue("anx7625_work", - WQ_FREEZABLE | WQ_MEM_RECLAIM, 1); + WQ_FREEZABLE | WQ_MEM_RECLAIM | WQ_PERCPU, + 1); if (!platform->workqueue) { DRM_DEV_ERROR(dev, "fail to create work queue\n"); ret =3D -ENOMEM; diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c b/drivers/= gpu/drm/i915/display/intel_display_driver.c index 31740a677dd8..ccfdbe26232c 100644 --- a/drivers/gpu/drm/i915/display/intel_display_driver.c +++ b/drivers/gpu/drm/i915/display/intel_display_driver.c @@ -243,7 +243,8 @@ int intel_display_driver_probe_noirq(struct intel_displ= ay *display) display->wq.modeset =3D alloc_ordered_workqueue("i915_modeset", 0); display->wq.flip =3D alloc_workqueue("i915_flip", WQ_HIGHPRI | WQ_UNBOUND, WQ_UNBOUND_MAX_ACTIVE); - display->wq.cleanup =3D alloc_workqueue("i915_cleanup", WQ_HIGHPRI, 0); + display->wq.cleanup =3D alloc_workqueue("i915_cleanup", WQ_HIGHPRI | + WQ_PERCPU, 0); =20 intel_mode_config_init(display); =20 diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915= _driver.c index 79b98ba4104e..32edb27f6af6 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -144,7 +144,8 @@ static int i915_workqueues_init(struct drm_i915_private= *dev_priv) * to be scheduled on the system_percpu_wq before moving to a driver * instance due deprecation of flush_scheduled_work(). */ - dev_priv->unordered_wq =3D alloc_workqueue("i915-unordered", 0, 0); + dev_priv->unordered_wq =3D alloc_workqueue("i915-unordered", WQ_PERCPU, + 0); if (dev_priv->unordered_wq =3D=3D NULL) goto out_free_dp_wq; =20 diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/d= rm/i915/selftests/i915_sw_fence.c index 8f5ce71fa453..b81d65c77458 100644 --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c @@ -526,7 +526,7 @@ static int test_ipc(void *arg) struct workqueue_struct *wq; int ret =3D 0; =20 - wq =3D alloc_workqueue("i1915-selftest", 0, 0); + wq =3D alloc_workqueue("i1915-selftest", WQ_PERCPU, 0); if (wq =3D=3D NULL) return -ENOMEM; =20 diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu= /drm/i915/selftests/mock_gem_device.c index a77e5b26542c..a55f24240fe0 100644 --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c @@ -214,7 +214,7 @@ struct drm_i915_private *mock_gem_device(void) if (!i915->wq) goto err_drv; =20 - i915->unordered_wq =3D alloc_workqueue("mock-unordered", 0, 0); + i915->unordered_wq =3D alloc_workqueue("mock-unordered", WQ_PERCPU, 0); if (!i915->unordered_wq) goto err_wq; =20 diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouvea= u/nouveau_drm.c index e154d08857c5..6fefe051993c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -626,7 +626,7 @@ nouveau_drm_device_init(struct nouveau_drm *drm) struct drm_device *dev =3D drm->dev; int ret; =20 - drm->sched_wq =3D alloc_workqueue("nouveau_sched_wq_shared", 0, + drm->sched_wq =3D alloc_workqueue("nouveau_sched_wq_shared", WQ_PERCPU, WQ_MAX_ACTIVE); if (!drm->sched_wq) return -ENOMEM; diff --git a/drivers/gpu/drm/nouveau/nouveau_sched.c b/drivers/gpu/drm/nouv= eau/nouveau_sched.c index d326e55d2d24..85b25bffefd8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_sched.c +++ b/drivers/gpu/drm/nouveau/nouveau_sched.c @@ -415,7 +415,8 @@ nouveau_sched_init(struct nouveau_sched *sched, struct = nouveau_drm *drm, int ret; =20 if (!wq) { - wq =3D alloc_workqueue("nouveau_sched_wq_%d", 0, WQ_MAX_ACTIVE, + wq =3D alloc_workqueue("nouveau_sched_wq_%d", WQ_PERCPU, + WQ_MAX_ACTIVE, current->pid); if (!wq) return -ENOMEM; diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/rade= on/radeon_display.c index 8f5f8abcb1b4..d18aeeb38085 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -687,7 +687,8 @@ static void radeon_crtc_init(struct drm_device *dev, in= t index) if (radeon_crtc =3D=3D NULL) return; =20 - radeon_crtc->flip_queue =3D alloc_workqueue("radeon-crtc", WQ_HIGHPRI, 0); + radeon_crtc->flip_queue =3D alloc_workqueue("radeon-crtc", + WQ_HIGHPRI | WQ_PERCPU, 0); if (!radeon_crtc->flip_queue) { kfree(radeon_crtc); return; diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c index 00191227bc95..52b4f0dd827c 100644 --- a/drivers/gpu/drm/xe/xe_device.c +++ b/drivers/gpu/drm/xe/xe_device.c @@ -475,8 +475,8 @@ struct xe_device *xe_device_create(struct pci_dev *pdev, xe->preempt_fence_wq =3D alloc_ordered_workqueue("xe-preempt-fence-wq", WQ_MEM_RECLAIM); xe->ordered_wq =3D alloc_ordered_workqueue("xe-ordered-wq", 0); - xe->unordered_wq =3D alloc_workqueue("xe-unordered-wq", 0, 0); - xe->destroy_wq =3D alloc_workqueue("xe-destroy-wq", 0, 0); + xe->unordered_wq =3D alloc_workqueue("xe-unordered-wq", WQ_PERCPU, 0); + xe->destroy_wq =3D alloc_workqueue("xe-destroy-wq", WQ_PERCPU, 0); if (!xe->ordered_wq || !xe->unordered_wq || !xe->preempt_fence_wq || !xe->destroy_wq) { /* diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c index 5fcb2b4c2c13..9c625c191be2 100644 --- a/drivers/gpu/drm/xe/xe_ggtt.c +++ b/drivers/gpu/drm/xe/xe_ggtt.c @@ -246,7 +246,7 @@ int xe_ggtt_init_early(struct xe_ggtt *ggtt) else ggtt->pt_ops =3D &xelp_pt_ops; =20 - ggtt->wq =3D alloc_workqueue("xe-ggtt-wq", 0, WQ_MEM_RECLAIM); + ggtt->wq =3D alloc_workqueue("xe-ggtt-wq", WQ_PERCPU, WQ_MEM_RECLAIM); =20 drm_mm_init(&ggtt->mm, xe_wopcm_size(xe), ggtt->size - xe_wopcm_size(xe)); diff --git a/drivers/gpu/drm/xe/xe_hw_engine_group.c b/drivers/gpu/drm/xe/x= e_hw_engine_group.c index 2d68c5b5262a..fae2bab4c25e 100644 --- a/drivers/gpu/drm/xe/xe_hw_engine_group.c +++ b/drivers/gpu/drm/xe/xe_hw_engine_group.c @@ -57,7 +57,8 @@ hw_engine_group_alloc(struct xe_device *xe) if (!group) return ERR_PTR(-ENOMEM); =20 - group->resume_wq =3D alloc_workqueue("xe-resume-lr-jobs-wq", 0, 0); + group->resume_wq =3D alloc_workqueue("xe-resume-lr-jobs-wq", WQ_PERCPU, + 0); if (!group->resume_wq) return ERR_PTR(-ENOMEM); =20 diff --git a/drivers/gpu/drm/xe/xe_sriov.c b/drivers/gpu/drm/xe/xe_sriov.c index a0eab44c0e76..6e6eb437a802 100644 --- a/drivers/gpu/drm/xe/xe_sriov.c +++ b/drivers/gpu/drm/xe/xe_sriov.c @@ -119,7 +119,7 @@ int xe_sriov_init(struct xe_device *xe) xe_sriov_vf_init_early(xe); =20 xe_assert(xe, !xe->sriov.wq); - xe->sriov.wq =3D alloc_workqueue("xe-sriov-wq", 0, 0); + xe->sriov.wq =3D alloc_workqueue("xe-sriov-wq", WQ_PERCPU, 0); if (!xe->sriov.wq) return -ENOMEM; =20 diff --git a/drivers/greybus/operation.c b/drivers/greybus/operation.c index f6beeebf974c..3f3c07fb62aa 100644 --- a/drivers/greybus/operation.c +++ b/drivers/greybus/operation.c @@ -1237,7 +1237,7 @@ int __init gb_operation_init(void) goto err_destroy_message_cache; =20 gb_operation_completion_wq =3D alloc_workqueue("greybus_completion", - 0, 0); + WQ_PERCPU, 0); if (!gb_operation_completion_wq) goto err_destroy_operation_cache; =20 diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c index 839d5bcd72b1..b7b981fce6a1 100644 --- a/drivers/hid/hid-nintendo.c +++ b/drivers/hid/hid-nintendo.c @@ -2647,7 +2647,8 @@ static int nintendo_hid_probe(struct hid_device *hdev, init_waitqueue_head(&ctlr->wait); spin_lock_init(&ctlr->lock); ctlr->rumble_queue =3D alloc_workqueue("hid-nintendo-rumble_wq", - WQ_FREEZABLE | WQ_MEM_RECLAIM, 0); + WQ_FREEZABLE | WQ_MEM_RECLAIM | WQ_PERCPU, + 0); if (!ctlr->rumble_queue) { ret =3D -ENOMEM; goto err; diff --git a/drivers/hv/mshv_eventfd.c b/drivers/hv/mshv_eventfd.c index 8dd22be2ca0b..91386f236e25 100644 --- a/drivers/hv/mshv_eventfd.c +++ b/drivers/hv/mshv_eventfd.c @@ -592,7 +592,7 @@ static void mshv_irqfd_release(struct mshv_partition *p= t) =20 int mshv_irqfd_wq_init(void) { - irqfd_cleanup_wq =3D alloc_workqueue("mshv-irqfd-cleanup", 0, 0); + irqfd_cleanup_wq =3D alloc_workqueue("mshv-irqfd-cleanup", WQ_PERCPU, 0); if (!irqfd_cleanup_wq) return -ENOMEM; =20 diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index fd81871609d9..58c8713f0040 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -2851,7 +2851,7 @@ int i3c_master_register(struct i3c_master_controller = *master, if (ret) goto err_put_dev; =20 - master->wq =3D alloc_workqueue("%s", 0, 0, dev_name(parent)); + master->wq =3D alloc_workqueue("%s", WQ_PERCPU, 0, dev_name(parent)); if (!master->wq) { ret =3D -ENOMEM; goto err_put_dev; diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 142170473e75..5956cd8291a1 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -4521,7 +4521,7 @@ static int __init ib_cm_init(void) get_random_bytes(&cm.random_id_operand, sizeof cm.random_id_operand); INIT_LIST_HEAD(&cm.timewait_list); =20 - cm.wq =3D alloc_workqueue("ib_cm", 0, 1); + cm.wq =3D alloc_workqueue("ib_cm", WQ_PERCPU, 1); if (!cm.wq) { ret =3D -ENOMEM; goto error2; diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/dev= ice.c index b4e3e4beb7f4..e9b536983b3b 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -2976,7 +2976,7 @@ static int __init ib_core_init(void) { int ret =3D -ENOMEM; =20 - ib_wq =3D alloc_workqueue("infiniband", 0, 0); + ib_wq =3D alloc_workqueue("infiniband", WQ_PERCPU, 0); if (!ib_wq) return -ENOMEM; =20 @@ -2986,7 +2986,7 @@ static int __init ib_core_init(void) goto err; =20 ib_comp_wq =3D alloc_workqueue("ib-comp-wq", - WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_SYSFS, 0); + WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_SYSFS | WQ_PERCPU, 0); if (!ib_comp_wq) goto err_unbound; =20 diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1= /init.c index b35f92e7d865..0d7797495ddf 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c @@ -745,8 +745,7 @@ static int create_workqueues(struct hfi1_devdata *dd) ppd->hfi1_wq =3D alloc_workqueue( "hfi%d_%d", - WQ_SYSFS | WQ_HIGHPRI | WQ_CPU_INTENSIVE | - WQ_MEM_RECLAIM, + WQ_SYSFS | WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM | WQ_PER= CPU, HFI1_MAX_ACTIVE_WORKQUEUE_ENTRIES, dd->unit, pidx); if (!ppd->hfi1_wq) diff --git a/drivers/infiniband/hw/hfi1/opfn.c b/drivers/infiniband/hw/hfi1= /opfn.c index 370a5a8eaa71..68c1cdbc90c1 100644 --- a/drivers/infiniband/hw/hfi1/opfn.c +++ b/drivers/infiniband/hw/hfi1/opfn.c @@ -305,8 +305,7 @@ void opfn_trigger_conn_request(struct rvt_qp *qp, u32 b= th1) int opfn_init(void) { opfn_wq =3D alloc_workqueue("hfi_opfn", - WQ_SYSFS | WQ_HIGHPRI | WQ_CPU_INTENSIVE | - WQ_MEM_RECLAIM, + WQ_SYSFS | WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM | WQ_PERCP= U, HFI1_MAX_ACTIVE_WORKQUEUE_ENTRIES); if (!opfn_wq) return -ENOMEM; diff --git a/drivers/infiniband/hw/mlx4/cm.c b/drivers/infiniband/hw/mlx4/c= m.c index 12b481d138cf..03aacd526860 100644 --- a/drivers/infiniband/hw/mlx4/cm.c +++ b/drivers/infiniband/hw/mlx4/cm.c @@ -591,7 +591,7 @@ void mlx4_ib_cm_paravirt_clean(struct mlx4_ib_dev *dev,= int slave) =20 int mlx4_ib_cm_init(void) { - cm_wq =3D alloc_workqueue("mlx4_ib_cm", 0, 0); + cm_wq =3D alloc_workqueue("mlx4_ib_cm", WQ_PERCPU, 0); if (!cm_wq) return -ENOMEM; =20 diff --git a/drivers/infiniband/sw/rdmavt/cq.c b/drivers/infiniband/sw/rdma= vt/cq.c index 0ca2743f1075..e7835ca70e2b 100644 --- a/drivers/infiniband/sw/rdmavt/cq.c +++ b/drivers/infiniband/sw/rdmavt/cq.c @@ -518,7 +518,8 @@ int rvt_poll_cq(struct ib_cq *ibcq, int num_entries, st= ruct ib_wc *entry) */ int rvt_driver_cq_init(void) { - comp_vector_wq =3D alloc_workqueue("%s", WQ_HIGHPRI | WQ_CPU_INTENSIVE, + comp_vector_wq =3D alloc_workqueue("%s", + WQ_HIGHPRI | WQ_CPU_INTENSIVE | WQ_PERCPU, 0, "rdmavt_cq"); if (!comp_vector_wq) return -ENOMEM; diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/= ulp/iser/iscsi_iser.c index a5be6f1ba12b..eb99c0f65ca9 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c @@ -1033,7 +1033,7 @@ static int __init iser_init(void) mutex_init(&ig.connlist_mutex); INIT_LIST_HEAD(&ig.connlist); =20 - release_wq =3D alloc_workqueue("release workqueue", 0, 0); + release_wq =3D alloc_workqueue("release workqueue", WQ_PERCPU, 0); if (!release_wq) { iser_err("failed to allocate release workqueue\n"); err =3D -ENOMEM; diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/u= lp/isert/ib_isert.c index 42977a5326ee..af811d060cc8 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -2613,7 +2613,7 @@ static struct iscsit_transport iser_target_transport = =3D { =20 static int __init isert_init(void) { - isert_login_wq =3D alloc_workqueue("isert_login_wq", 0, 0); + isert_login_wq =3D alloc_workqueue("isert_login_wq", WQ_PERCPU, 0); if (!isert_login_wq) { isert_err("Unable to allocate isert_login_wq\n"); return -ENOMEM; diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ul= p/rtrs/rtrs-clt.c index 71387811b281..40fd2b695160 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c @@ -3187,7 +3187,7 @@ static int __init rtrs_client_init(void) pr_err("Failed to create rtrs-client dev class\n"); return ret; } - rtrs_wq =3D alloc_workqueue("rtrs_client_wq", 0, 0); + rtrs_wq =3D alloc_workqueue("rtrs_client_wq", WQ_PERCPU, 0); if (!rtrs_wq) { class_unregister(&rtrs_clt_dev_class); return -ENOMEM; diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ul= p/rtrs/rtrs-srv.c index ef4abdea3c2d..780a98b2ded9 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c @@ -2321,7 +2321,7 @@ static int __init rtrs_server_init(void) if (err) goto out_err; =20 - rtrs_wq =3D alloc_workqueue("rtrs_server_wq", 0, 0); + rtrs_wq =3D alloc_workqueue("rtrs_server_wq", WQ_PERCPU, 0); if (!rtrs_wq) { err =3D -ENOMEM; goto out_dev_class; diff --git a/drivers/input/mouse/psmouse-smbus.c b/drivers/input/mouse/psmo= use-smbus.c index 93420f07b7d0..5d6a4909ccbf 100644 --- a/drivers/input/mouse/psmouse-smbus.c +++ b/drivers/input/mouse/psmouse-smbus.c @@ -299,7 +299,7 @@ int __init psmouse_smbus_module_init(void) { int error; =20 - psmouse_smbus_wq =3D alloc_workqueue("psmouse-smbus", 0, 0); + psmouse_smbus_wq =3D alloc_workqueue("psmouse-smbus", WQ_PERCPU, 0); if (!psmouse_smbus_wq) return -ENOMEM; =20 diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c index c5d13bdc239b..e8f7e52354bc 100644 --- a/drivers/isdn/capi/kcapi.c +++ b/drivers/isdn/capi/kcapi.c @@ -907,7 +907,7 @@ int __init kcapi_init(void) { int err; =20 - kcapi_wq =3D alloc_workqueue("kcapi", 0, 0); + kcapi_wq =3D alloc_workqueue("kcapi", WQ_PERCPU, 0); if (!kcapi_wq) return -ENOMEM; =20 diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index ed40d8600656..1d2213944441 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -2836,7 +2836,8 @@ void bch_btree_exit(void) =20 int __init bch_btree_init(void) { - btree_io_wq =3D alloc_workqueue("bch_btree_io", WQ_MEM_RECLAIM, 0); + btree_io_wq =3D alloc_workqueue("bch_btree_io", + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!btree_io_wq) return -ENOMEM; =20 diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index de0a8e5f5c49..481d61a67032 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1933,7 +1933,8 @@ struct cache_set *bch_cache_set_alloc(struct cache_sb= *sb) if (!c->uuids) goto err; =20 - c->moving_gc_wq =3D alloc_workqueue("bcache_gc", WQ_MEM_RECLAIM, 0); + c->moving_gc_wq =3D alloc_workqueue("bcache_gc", + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!c->moving_gc_wq) goto err; =20 @@ -2867,7 +2868,7 @@ static int __init bcache_init(void) if (bch_btree_init()) goto err; =20 - bcache_wq =3D alloc_workqueue("bcache", WQ_MEM_RECLAIM, 0); + bcache_wq =3D alloc_workqueue("bcache", WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!bcache_wq) goto err; =20 @@ -2880,11 +2881,12 @@ static int __init bcache_init(void) * * We still want to user our own queue to not congest the `system_percpu_= wq`. */ - bch_flush_wq =3D alloc_workqueue("bch_flush", 0, 0); + bch_flush_wq =3D alloc_workqueue("bch_flush", WQ_PERCPU, 0); if (!bch_flush_wq) goto err; =20 - bch_journal_wq =3D alloc_workqueue("bch_journal", WQ_MEM_RECLAIM, 0); + bch_journal_wq =3D alloc_workqueue("bch_journal", + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!bch_journal_wq) goto err; =20 diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c index 453efbbdc8ee..01969ec07c1a 100644 --- a/drivers/md/bcache/writeback.c +++ b/drivers/md/bcache/writeback.c @@ -1079,7 +1079,7 @@ void bch_cached_dev_writeback_init(struct cached_dev = *dc) int bch_cached_dev_writeback_start(struct cached_dev *dc) { dc->writeback_write_wq =3D alloc_workqueue("bcache_writeback_wq", - WQ_MEM_RECLAIM, 0); + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!dc->writeback_write_wq) return -ENOMEM; =20 diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index 9c8ed65cd87e..6c6ee8d62485 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c @@ -2933,7 +2933,8 @@ static int __init dm_bufio_init(void) __cache_size_refresh(); mutex_unlock(&dm_bufio_clients_lock); =20 - dm_bufio_wq =3D alloc_workqueue("dm_bufio_cache", WQ_MEM_RECLAIM, 0); + dm_bufio_wq =3D alloc_workqueue("dm_bufio_cache", + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!dm_bufio_wq) return -ENOMEM; =20 diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index a10d75a562db..7bad7cc87d37 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -2533,7 +2533,8 @@ static int cache_create(struct cache_args *ca, struct= cache **result) goto bad; } =20 - cache->wq =3D alloc_workqueue("dm-" DM_MSG_PREFIX, WQ_MEM_RECLAIM, 0); + cache->wq =3D alloc_workqueue("dm-" DM_MSG_PREFIX, + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!cache->wq) { *error =3D "could not create workqueue for metadata object"; goto bad; diff --git a/drivers/md/dm-clone-target.c b/drivers/md/dm-clone-target.c index e956d980672c..b25845e36274 100644 --- a/drivers/md/dm-clone-target.c +++ b/drivers/md/dm-clone-target.c @@ -1877,7 +1877,8 @@ static int clone_ctr(struct dm_target *ti, unsigned i= nt argc, char **argv) clone->hydration_offset =3D 0; atomic_set(&clone->hydrations_in_flight, 0); =20 - clone->wq =3D alloc_workqueue("dm-" DM_MSG_PREFIX, WQ_MEM_RECLAIM, 0); + clone->wq =3D alloc_workqueue("dm-" DM_MSG_PREFIX, + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!clone->wq) { ti->error =3D "Failed to allocate workqueue"; r =3D -ENOMEM; diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 9dfdb63220d7..518a8ba49a76 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -3420,7 +3420,9 @@ static int crypt_ctr(struct dm_target *ti, unsigned i= nt argc, char **argv) if (test_bit(DM_CRYPT_HIGH_PRIORITY, &cc->flags)) common_wq_flags |=3D WQ_HIGHPRI; =20 - cc->io_queue =3D alloc_workqueue("kcryptd_io-%s-%d", common_wq_flags, 1, = devname, wq_id); + cc->io_queue =3D alloc_workqueue("kcryptd_io-%s-%d", + common_wq_flags | WQ_PERCPU, 1, + devname, wq_id); if (!cc->io_queue) { ti->error =3D "Couldn't create kcryptd io queue"; goto bad; @@ -3428,7 +3430,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned i= nt argc, char **argv) =20 if (test_bit(DM_CRYPT_SAME_CPU, &cc->flags)) { cc->crypt_queue =3D alloc_workqueue("kcryptd-%s-%d", - common_wq_flags | WQ_CPU_INTENSIVE, + common_wq_flags | WQ_CPU_INTENSIVE | WQ_PERCPU, 1, devname, wq_id); } else { /* diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c index d4cf0ac2a7aa..a6e6c485f01f 100644 --- a/drivers/md/dm-delay.c +++ b/drivers/md/dm-delay.c @@ -279,7 +279,9 @@ static int delay_ctr(struct dm_target *ti, unsigned int= argc, char **argv) } else { timer_setup(&dc->delay_timer, handle_delayed_timer, 0); INIT_WORK(&dc->flush_expired_bios, flush_expired_bios); - dc->kdelayd_wq =3D alloc_workqueue("kdelayd", WQ_MEM_RECLAIM, 0); + dc->kdelayd_wq =3D alloc_workqueue("kdelayd", + WQ_MEM_RECLAIM | WQ_PERCPU, + 0); if (!dc->kdelayd_wq) { ret =3D -EINVAL; DMERR("Couldn't start kdelayd"); diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 2a283feb3319..3420a5a06d02 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -4818,7 +4818,8 @@ static int dm_integrity_ctr(struct dm_target *ti, uns= igned int argc, char **argv } =20 ic->metadata_wq =3D alloc_workqueue("dm-integrity-metadata", - WQ_MEM_RECLAIM, METADATA_WORKQUEUE_MAX_ACTIVE); + WQ_MEM_RECLAIM | WQ_PERCPU, + METADATA_WORKQUEUE_MAX_ACTIVE); if (!ic->metadata_wq) { ti->error =3D "Cannot allocate workqueue"; r =3D -ENOMEM; @@ -4836,7 +4837,8 @@ static int dm_integrity_ctr(struct dm_target *ti, uns= igned int argc, char **argv goto bad; } =20 - ic->offload_wq =3D alloc_workqueue("dm-integrity-offload", WQ_MEM_RECLAIM, + ic->offload_wq =3D alloc_workqueue("dm-integrity-offload", + WQ_MEM_RECLAIM | WQ_PERCPU, METADATA_WORKQUEUE_MAX_ACTIVE); if (!ic->offload_wq) { ti->error =3D "Cannot allocate workqueue"; @@ -4844,7 +4846,8 @@ static int dm_integrity_ctr(struct dm_target *ti, uns= igned int argc, char **argv goto bad; } =20 - ic->commit_wq =3D alloc_workqueue("dm-integrity-commit", WQ_MEM_RECLAIM, = 1); + ic->commit_wq =3D alloc_workqueue("dm-integrity-commit", + WQ_MEM_RECLAIM | WQ_PERCPU, 1); if (!ic->commit_wq) { ti->error =3D "Cannot allocate workqueue"; r =3D -ENOMEM; @@ -4853,7 +4856,8 @@ static int dm_integrity_ctr(struct dm_target *ti, uns= igned int argc, char **argv INIT_WORK(&ic->commit_work, integrity_commit); =20 if (ic->mode =3D=3D 'J' || ic->mode =3D=3D 'B') { - ic->writer_wq =3D alloc_workqueue("dm-integrity-writer", WQ_MEM_RECLAIM,= 1); + ic->writer_wq =3D alloc_workqueue("dm-integrity-writer", + WQ_MEM_RECLAIM | WQ_PERCPU, 1); if (!ic->writer_wq) { ti->error =3D "Cannot allocate workqueue"; r =3D -ENOMEM; @@ -5025,7 +5029,8 @@ static int dm_integrity_ctr(struct dm_target *ti, uns= igned int argc, char **argv } =20 if (ic->internal_hash) { - ic->recalc_wq =3D alloc_workqueue("dm-integrity-recalc", WQ_MEM_RECLAIM,= 1); + ic->recalc_wq =3D alloc_workqueue("dm-integrity-recalc", + WQ_MEM_RECLAIM | WQ_PERCPU, 1); if (!ic->recalc_wq) { ti->error =3D "Cannot allocate workqueue"; r =3D -ENOMEM; diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c index 6ea75436a433..cec9a60227b6 100644 --- a/drivers/md/dm-kcopyd.c +++ b/drivers/md/dm-kcopyd.c @@ -934,7 +934,8 @@ struct dm_kcopyd_client *dm_kcopyd_client_create(struct= dm_kcopyd_throttle *thro goto bad_slab; =20 INIT_WORK(&kc->kcopyd_work, do_work); - kc->kcopyd_wq =3D alloc_workqueue("kcopyd", WQ_MEM_RECLAIM, 0); + kc->kcopyd_wq =3D alloc_workqueue("kcopyd", WQ_MEM_RECLAIM | WQ_PERCPU, + 0); if (!kc->kcopyd_wq) { r =3D -ENOMEM; goto bad_workqueue; diff --git a/drivers/md/dm-log-userspace-base.c b/drivers/md/dm-log-userspa= ce-base.c index 9fbb4b48fb2b..607436804a8b 100644 --- a/drivers/md/dm-log-userspace-base.c +++ b/drivers/md/dm-log-userspace-base.c @@ -299,7 +299,8 @@ static int userspace_ctr(struct dm_dirty_log *log, stru= ct dm_target *ti, } =20 if (lc->integrated_flush) { - lc->dmlog_wq =3D alloc_workqueue("dmlogd", WQ_MEM_RECLAIM, 0); + lc->dmlog_wq =3D alloc_workqueue("dmlogd", + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!lc->dmlog_wq) { DMERR("couldn't start dmlogd"); r =3D -ENOMEM; diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 6c98f4ae5ea9..a0f6de8040c5 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -2205,7 +2205,8 @@ static int __init dm_multipath_init(void) { int r =3D -ENOMEM; =20 - kmultipathd =3D alloc_workqueue("kmpathd", WQ_MEM_RECLAIM, 0); + kmultipathd =3D alloc_workqueue("kmpathd", WQ_MEM_RECLAIM | WQ_PERCPU, + 0); if (!kmultipathd) { DMERR("failed to create workqueue kmpathd"); goto bad_alloc_kmultipathd; @@ -2224,7 +2225,7 @@ static int __init dm_multipath_init(void) goto bad_alloc_kmpath_handlerd; } =20 - dm_mpath_wq =3D alloc_workqueue("dm_mpath_wq", 0, 0); + dm_mpath_wq =3D alloc_workqueue("dm_mpath_wq", WQ_PERCPU, 0); if (!dm_mpath_wq) { DMERR("failed to create workqueue dm_mpath_wq"); goto bad_alloc_dm_mpath_wq; diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index 9e615b4f1f5e..3e773591d1c6 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c @@ -1129,7 +1129,8 @@ static int mirror_ctr(struct dm_target *ti, unsigned = int argc, char **argv) ti->num_discard_bios =3D 1; ti->per_io_data_size =3D sizeof(struct dm_raid1_bio_record); =20 - ms->kmirrord_wq =3D alloc_workqueue("kmirrord", WQ_MEM_RECLAIM, 0); + ms->kmirrord_wq =3D alloc_workqueue("kmirrord", + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!ms->kmirrord_wq) { DMERR("couldn't start kmirrord"); r =3D -ENOMEM; @@ -1501,7 +1502,7 @@ static int __init dm_mirror_init(void) { int r; =20 - dm_raid1_wq =3D alloc_workqueue("dm_raid1_wq", 0, 0); + dm_raid1_wq =3D alloc_workqueue("dm_raid1_wq", WQ_PERCPU, 0); if (!dm_raid1_wq) { DMERR("Failed to alloc workqueue"); return -ENOMEM; diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persisten= t.c index 568d10842b1f..0e13d60bfdd1 100644 --- a/drivers/md/dm-snap-persistent.c +++ b/drivers/md/dm-snap-persistent.c @@ -871,7 +871,8 @@ static int persistent_ctr(struct dm_exception_store *st= ore, char *options) atomic_set(&ps->pending_count, 0); ps->callbacks =3D NULL; =20 - ps->metadata_wq =3D alloc_workqueue("ksnaphd", WQ_MEM_RECLAIM, 0); + ps->metadata_wq =3D alloc_workqueue("ksnaphd", + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!ps->metadata_wq) { DMERR("couldn't start header metadata update thread"); r =3D -ENOMEM; diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c index a1b7535c508a..4241992228a6 100644 --- a/drivers/md/dm-stripe.c +++ b/drivers/md/dm-stripe.c @@ -485,7 +485,7 @@ int __init dm_stripe_init(void) { int r; =20 - dm_stripe_wq =3D alloc_workqueue("dm_stripe_wq", 0, 0); + dm_stripe_wq =3D alloc_workqueue("dm_stripe_wq", WQ_PERCPU, 0); if (!dm_stripe_wq) return -ENOMEM; r =3D dm_register_target(&stripe_target); diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c index 3c427f18a04b..50e59a161486 100644 --- a/drivers/md/dm-verity-target.c +++ b/drivers/md/dm-verity-target.c @@ -1665,7 +1665,9 @@ static int verity_ctr(struct dm_target *ti, unsigned = int argc, char **argv) * will fall-back to using it for error handling (or if the bufio cache * doesn't have required hashes). */ - v->verify_wq =3D alloc_workqueue("kverityd", WQ_MEM_RECLAIM | WQ_HIGHPRI,= 0); + v->verify_wq =3D alloc_workqueue("kverityd", + WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_PERCPU, + 0); if (!v->verify_wq) { ti->error =3D "Cannot allocate workqueue"; r =3D -ENOMEM; diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index d6a04a57472d..8a50e7e88f2e 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -2276,7 +2276,8 @@ static int writecache_ctr(struct dm_target *ti, unsig= ned int argc, char **argv) goto bad; } =20 - wc->writeback_wq =3D alloc_workqueue("writecache-writeback", WQ_MEM_RECLA= IM, 1); + wc->writeback_wq =3D alloc_workqueue("writecache-writeback", + WQ_MEM_RECLAIM | WQ_PERCPU, 1); if (!wc->writeback_wq) { r =3D -ENOMEM; ti->error =3D "Could not allocate writeback workqueue"; diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 5ab7574c0c76..84b2746d7672 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2344,7 +2344,8 @@ static struct mapped_device *alloc_dev(int minor) =20 format_dev_t(md->name, MKDEV(_major, minor)); =20 - md->wq =3D alloc_workqueue("kdmflush/%s", WQ_MEM_RECLAIM, 0, md->name); + md->wq =3D alloc_workqueue("kdmflush/%s", WQ_MEM_RECLAIM | WQ_PERCPU, 0, + md->name); if (!md->wq) goto bad; =20 diff --git a/drivers/md/md.c b/drivers/md/md.c index 9daa78c5fe33..1f0b047618f7 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -9929,11 +9929,11 @@ static int __init md_init(void) { int ret =3D -ENOMEM; =20 - md_wq =3D alloc_workqueue("md", WQ_MEM_RECLAIM, 0); + md_wq =3D alloc_workqueue("md", WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!md_wq) goto err_wq; =20 - md_misc_wq =3D alloc_workqueue("md_misc", 0, 0); + md_misc_wq =3D alloc_workqueue("md_misc", WQ_PERCPU, 0); if (!md_misc_wq) goto err_misc_wq; =20 diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci= /ddbridge/ddbridge-core.c index 40e6c873c36d..d240e291ba4f 100644 --- a/drivers/media/pci/ddbridge/ddbridge-core.c +++ b/drivers/media/pci/ddbridge/ddbridge-core.c @@ -3430,7 +3430,7 @@ int ddb_init_ddbridge(void) =20 if (ddb_class_create() < 0) return -1; - ddb_wq =3D alloc_workqueue("ddbridge", 0, 0); + ddb_wq =3D alloc_workqueue("ddbridge", WQ_PERCPU, 0); if (!ddb_wq) return ddb_exit_ddbridge(1, -1); =20 diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c b/drivers= /media/platform/mediatek/mdp3/mtk-mdp3-core.c index f571f561f070..fa6af1cc5eba 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c @@ -274,14 +274,16 @@ static int mdp_probe(struct platform_device *pdev) goto err_free_mutex; } =20 - mdp->job_wq =3D alloc_workqueue(MDP_MODULE_NAME, WQ_FREEZABLE, 0); + mdp->job_wq =3D alloc_workqueue(MDP_MODULE_NAME, + WQ_FREEZABLE | WQ_PERCPU, 0); if (!mdp->job_wq) { dev_err(dev, "Unable to create job workqueue\n"); ret =3D -ENOMEM; goto err_deinit_comp; } =20 - mdp->clock_wq =3D alloc_workqueue(MDP_MODULE_NAME "-clock", WQ_FREEZABLE, + mdp->clock_wq =3D alloc_workqueue(MDP_MODULE_NAME "-clock", + WQ_FREEZABLE | WQ_PERCPU, 0); if (!mdp->clock_wq) { dev_err(dev, "Unable to create clock workqueue\n"); diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptb= ase.c index 738bc4e60a18..e60a8d3947c9 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -1857,7 +1857,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_dev= ice_id *id) INIT_DELAYED_WORK(&ioc->fault_reset_work, mpt_fault_reset_work); =20 ioc->reset_work_q =3D - alloc_workqueue("mpt_poll_%d", WQ_MEM_RECLAIM, 0, ioc->id); + alloc_workqueue("mpt_poll_%d", WQ_MEM_RECLAIM | WQ_PERCPU, 0, + ioc->id); if (!ioc->reset_work_q) { printk(MYIOC_s_ERR_FMT "Insufficient memory to add adapter!\n", ioc->name); @@ -1984,7 +1985,9 @@ mpt_attach(struct pci_dev *pdev, const struct pci_dev= ice_id *id) =20 INIT_LIST_HEAD(&ioc->fw_event_list); spin_lock_init(&ioc->fw_event_lock); - ioc->fw_event_q =3D alloc_workqueue("mpt/%d", WQ_MEM_RECLAIM, 0, ioc->id); + ioc->fw_event_q =3D alloc_workqueue("mpt/%d", + WQ_MEM_RECLAIM | WQ_PERCPU, 0, + ioc->id); if (!ioc->fw_event_q) { printk(MYIOC_s_ERR_FMT "Insufficient memory to add adapter!\n", ioc->name); diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 4830628510e6..744444fc26db 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -3325,7 +3325,8 @@ static int mmc_blk_probe(struct mmc_card *card) mmc_fixup_device(card, mmc_blk_fixups); =20 card->complete_wq =3D alloc_workqueue("mmc_complete", - WQ_MEM_RECLAIM | WQ_HIGHPRI, 0); + WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_PERCPU, + 0); if (!card->complete_wq) { pr_err("Failed to create mmc completion workqueue"); return -ENOMEM; diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index c50617d03709..ec890aa0c7b2 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -1483,7 +1483,7 @@ static int mmc_omap_probe(struct platform_device *pde= v) host->nr_slots =3D pdata->nr_slots; host->reg_shift =3D (mmc_omap7xx() ? 1 : 2); =20 - host->mmc_omap_wq =3D alloc_workqueue("mmc_omap", 0, 0); + host->mmc_omap_wq =3D alloc_workqueue("mmc_omap", WQ_PERCPU, 0); if (!host->mmc_omap_wq) { ret =3D -ENOMEM; goto err_plat_cleanup; diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 26c459f0198d..4cfdb56ed930 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -3022,6 +3022,8 @@ static int __init nvme_tcp_init_module(void) =20 if (wq_unbound) wq_flags |=3D WQ_UNBOUND; + else + wq_flags |=3D WQ_PERCPU; =20 nvme_tcp_wq =3D alloc_workqueue("nvme_tcp_wq", wq_flags, 0); if (!nvme_tcp_wq) diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 71f8d06998d6..9b0ea6b98a3d 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -1896,12 +1896,13 @@ static int __init nvmet_init(void) if (!nvmet_bvec_cache) return -ENOMEM; =20 - zbd_wq =3D alloc_workqueue("nvmet-zbd-wq", WQ_MEM_RECLAIM, 0); + zbd_wq =3D alloc_workqueue("nvmet-zbd-wq", WQ_MEM_RECLAIM | WQ_PERCPU, + 0); if (!zbd_wq) goto out_destroy_bvec_cache; =20 buffered_io_wq =3D alloc_workqueue("nvmet-buffered-io-wq", - WQ_MEM_RECLAIM, 0); + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!buffered_io_wq) goto out_free_zbd_work_queue; =20 diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index 7318b736d414..29462766773a 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -795,9 +795,9 @@ nvmet_fc_alloc_target_queue(struct nvmet_fc_tgt_assoc *= assoc, if (!queue) return NULL; =20 - queue->work_q =3D alloc_workqueue("ntfc%d.%d.%d", 0, 0, - assoc->tgtport->fc_target_port.port_num, - assoc->a_id, qid); + queue->work_q =3D alloc_workqueue("ntfc%d.%d.%d", WQ_PERCPU, 0, + assoc->tgtport->fc_target_port.port_num, + assoc->a_id, qid); if (!queue->work_q) goto out_free_queue; =20 diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c index f2d0c920269b..cf9435c5fa6c 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -2233,7 +2233,7 @@ static int __init nvmet_tcp_init(void) int ret; =20 nvmet_tcp_wq =3D alloc_workqueue("nvmet_tcp_wq", - WQ_MEM_RECLAIM | WQ_HIGHPRI, 0); + WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_PERCPU, 0); if (!nvmet_tcp_wq) return -ENOMEM; =20 diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/end= point/functions/pci-epf-mhi.c index 6643a88c7a0c..27de533f0571 100644 --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c @@ -686,7 +686,7 @@ static int pci_epf_mhi_dma_init(struct pci_epf_mhi *epf= _mhi) goto err_release_tx; } =20 - epf_mhi->dma_wq =3D alloc_workqueue("pci_epf_mhi_dma_wq", 0, 0); + epf_mhi->dma_wq =3D alloc_workqueue("pci_epf_mhi_dma_wq", WQ_PERCPU, 0); if (!epf_mhi->dma_wq) { ret =3D -ENOMEM; goto err_release_rx; diff --git a/drivers/pci/endpoint/functions/pci-epf-ntb.c b/drivers/pci/end= point/functions/pci-epf-ntb.c index e01a98e74d21..5e4ae7ef6f05 100644 --- a/drivers/pci/endpoint/functions/pci-epf-ntb.c +++ b/drivers/pci/endpoint/functions/pci-epf-ntb.c @@ -2124,8 +2124,9 @@ static int __init epf_ntb_init(void) { int ret; =20 - kpcintb_workqueue =3D alloc_workqueue("kpcintb", WQ_MEM_RECLAIM | - WQ_HIGHPRI, 0); + kpcintb_workqueue =3D alloc_workqueue("kpcintb", + WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_PERCPU, + 0); ret =3D pci_epf_register_driver(&epf_ntb_driver); if (ret) { destroy_workqueue(kpcintb_workqueue); diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/en= dpoint/functions/pci-epf-test.c index 50eb4106369f..416d792c03b2 100644 --- a/drivers/pci/endpoint/functions/pci-epf-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-test.c @@ -1036,7 +1036,8 @@ static int __init pci_epf_test_init(void) int ret; =20 kpcitest_workqueue =3D alloc_workqueue("kpcitest", - WQ_MEM_RECLAIM | WQ_HIGHPRI, 0); + WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_PERCPU, + 0); if (!kpcitest_workqueue) { pr_err("Failed to allocate the kpcitest work queue\n"); return -ENOMEM; diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/en= dpoint/functions/pci-epf-vntb.c index 874cb097b093..7ef693f38c30 100644 --- a/drivers/pci/endpoint/functions/pci-epf-vntb.c +++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c @@ -1434,8 +1434,9 @@ static int __init epf_ntb_init(void) { int ret; =20 - kpcintb_workqueue =3D alloc_workqueue("kpcintb", WQ_MEM_RECLAIM | - WQ_HIGHPRI, 0); + kpcintb_workqueue =3D alloc_workqueue("kpcintb", + WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_PERCPU, + 0); ret =3D pci_epf_register_driver(&epf_ntb_driver); if (ret) { destroy_workqueue(kpcintb_workqueue); diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 573a41869c15..4fe2bb1b7768 100644 --- a/drivers/pci/hotplug/pnv_php.c +++ b/drivers/pci/hotplug/pnv_php.c @@ -844,7 +844,8 @@ static void pnv_php_init_irq(struct pnv_php_slot *php_s= lot, int irq) int ret; =20 /* Allocate workqueue */ - php_slot->wq =3D alloc_workqueue("pciehp-%s", 0, 0, php_slot->name); + php_slot->wq =3D alloc_workqueue("pciehp-%s", WQ_PERCPU, 0, + php_slot->name); if (!php_slot->wq) { SLOT_WARN(php_slot, "Cannot alloc workqueue\n"); pnv_php_disable_irq(php_slot, true); diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp= _core.c index 0c341453afc6..56308515ecba 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c @@ -80,7 +80,8 @@ static int init_slots(struct controller *ctrl) slot->device =3D ctrl->slot_device_offset + i; slot->number =3D ctrl->first_slot + (ctrl->slot_num_inc * i); =20 - slot->wq =3D alloc_workqueue("shpchp-%d", 0, 0, slot->number); + slot->wq =3D alloc_workqueue("shpchp-%d", WQ_PERCPU, 0, + slot->number); if (!slot->wq) { retval =3D -ENOMEM; goto error_slot; diff --git a/drivers/platform/surface/surface_acpi_notify.c b/drivers/platf= orm/surface/surface_acpi_notify.c index 3b30cfe3466b..a9dcb0bbe90e 100644 --- a/drivers/platform/surface/surface_acpi_notify.c +++ b/drivers/platform/surface/surface_acpi_notify.c @@ -862,7 +862,7 @@ static int __init san_init(void) { int ret; =20 - san_wq =3D alloc_workqueue("san_wq", 0, 0); + san_wq =3D alloc_workqueue("san_wq", WQ_PERCPU, 0); if (!san_wq) return -ENOMEM; ret =3D platform_driver_register(&surface_acpi_notify); diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c index 9544b8ee0c96..8b7fbfbbe70e 100644 --- a/drivers/rapidio/rio.c +++ b/drivers/rapidio/rio.c @@ -2097,7 +2097,7 @@ int rio_init_mports(void) * TODO: Implement restart of discovery process for all or * individual discovering mports. */ - rio_wq =3D alloc_workqueue("riodisc", 0, 0); + rio_wq =3D alloc_workqueue("riodisc", WQ_PERCPU, 0); if (!rio_wq) { pr_err("RIO: unable allocate rio_wq\n"); goto no_disc; diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_mai= n.c index 7d1b767d87fb..1a3ba0293716 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -5633,7 +5633,8 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev, =20 phba->ctrl.mcc_alloc_index =3D phba->ctrl.mcc_free_index =3D 0; =20 - phba->wq =3D alloc_workqueue("beiscsi_%02x_wq", WQ_MEM_RECLAIM, 1, + phba->wq =3D alloc_workqueue("beiscsi_%02x_wq", + WQ_MEM_RECLAIM | WQ_PERCPU, 1, phba->shost->host_no); if (!phba->wq) { beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc= _fcoe.c index de6574cccf58..3a9c429d1eb6 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c @@ -2695,7 +2695,7 @@ static int __init bnx2fc_mod_init(void) if (rc) goto detach_ft; =20 - bnx2fc_wq =3D alloc_workqueue("bnx2fc", 0, 0); + bnx2fc_wq =3D alloc_workqueue("bnx2fc", WQ_PERCPU, 0); if (!bnx2fc_wq) { rc =3D -ENOMEM; goto release_bt; diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/devi= ce_handler/scsi_dh_alua.c index 1bf5948d1188..6fd89ae33059 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -1300,7 +1300,7 @@ static int __init alua_init(void) { int r; =20 - kaluad_wq =3D alloc_workqueue("kaluad", WQ_MEM_RECLAIM, 0); + kaluad_wq =3D alloc_workqueue("kaluad", WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!kaluad_wq) return -ENOMEM; =20 diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index b911fdb387f3..0f749ae781d6 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -2458,7 +2458,7 @@ static int __init fcoe_init(void) unsigned int cpu; int rc =3D 0; =20 - fcoe_wq =3D alloc_workqueue("fcoe", 0, 0); + fcoe_wq =3D alloc_workqueue("fcoe", WQ_PERCPU, 0); if (!fcoe_wq) return -ENOMEM; =20 diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvsc= si_tgt/ibmvscsi_tgt.c index 9e42230e42b8..cde265752e0d 100644 --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c @@ -3533,7 +3533,8 @@ static int ibmvscsis_probe(struct vio_dev *vdev, init_completion(&vscsi->wait_idle); init_completion(&vscsi->unconfig); =20 - vscsi->work_q =3D alloc_workqueue("ibmvscsis%s", WQ_MEM_RECLAIM, 1, + vscsi->work_q =3D alloc_workqueue("ibmvscsis%s", + WQ_MEM_RECLAIM | WQ_PERCPU, 1, dev_name(&vdev->dev)); if (!vscsi->work_q) { rc =3D -ENOMEM; diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 90021653e59e..becd7f081e5f 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -7938,7 +7938,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) /* Allocate all driver workqueues here */ =20 /* The lpfc_wq workqueue for deferred irq use */ - phba->wq =3D alloc_workqueue("lpfc_wq", WQ_MEM_RECLAIM, 0); + phba->wq =3D alloc_workqueue("lpfc_wq", WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!phba->wq) return -ENOMEM; =20 diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001= _init.c index 599410bcdfea..9f00fc10dbaf 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c @@ -1533,7 +1533,7 @@ static int __init pm8001_init(void) if (pm8001_use_tasklet && !pm8001_use_msix) pm8001_use_tasklet =3D false; =20 - pm8001_wq =3D alloc_workqueue("pm80xx", 0, 0); + pm8001_wq =3D alloc_workqueue("pm80xx", WQ_PERCPU, 0); if (!pm8001_wq) goto err; =20 diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 436bd29d5eba..df016beaa789 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -3374,7 +3374,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mod= e) QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_INFO, "qedf->io_mempool=3D%p.\n", qedf->io_mempool); =20 - qedf->link_update_wq =3D alloc_workqueue("qedf_%u_link", WQ_MEM_RECLAIM, + qedf->link_update_wq =3D alloc_workqueue("qedf_%u_link", + WQ_MEM_RECLAIM | WQ_PERCPU, 1, qedf->lport->host->host_no); INIT_DELAYED_WORK(&qedf->link_update, qedf_handle_link_update); INIT_DELAYED_WORK(&qedf->link_recovery, qedf_link_recovery); @@ -3585,7 +3586,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mod= e) ether_addr_copy(params.ll2_mac_address, qedf->mac); =20 /* Start LL2 processing thread */ - qedf->ll2_recv_wq =3D alloc_workqueue("qedf_%d_ll2", WQ_MEM_RECLAIM, 1, + qedf->ll2_recv_wq =3D alloc_workqueue("qedf_%d_ll2", + WQ_MEM_RECLAIM | WQ_PERCPU, 1, host->host_no); if (!qedf->ll2_recv_wq) { QEDF_ERR(&(qedf->dbg_ctx), "Failed to LL2 workqueue.\n"); @@ -3628,7 +3630,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mod= e) } =20 qedf->timer_work_queue =3D alloc_workqueue("qedf_%u_timer", - WQ_MEM_RECLAIM, 1, qedf->lport->host->host_no); + WQ_MEM_RECLAIM | WQ_PERCPU, 1, + qedf->lport->host->host_no); if (!qedf->timer_work_queue) { QEDF_ERR(&(qedf->dbg_ctx), "Failed to start timer " "workqueue.\n"); @@ -3641,7 +3644,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mod= e) sprintf(host_buf, "qedf_%u_dpc", qedf->lport->host->host_no); qedf->dpc_wq =3D - alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf); + alloc_workqueue("%s", WQ_MEM_RECLAIM | WQ_PERCPU, 1, + host_buf); } INIT_DELAYED_WORK(&qedf->recovery_work, qedf_recovery_handler); =20 @@ -4177,7 +4181,8 @@ static int __init qedf_init(void) goto err3; } =20 - qedf_io_wq =3D alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, "qedf_io_wq"); + qedf_io_wq =3D alloc_workqueue("%s", WQ_MEM_RECLAIM | WQ_PERCPU, 1, + "qedf_io_wq"); if (!qedf_io_wq) { QEDF_ERR(NULL, "Could not create qedf_io_wq.\n"); goto err4; diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index e87885cc701c..4cccb62639e0 100644 --- a/drivers/scsi/qedi/qedi_main.c +++ b/drivers/scsi/qedi/qedi_main.c @@ -2776,7 +2776,7 @@ static int __qedi_probe(struct pci_dev *pdev, int mod= e) } =20 qedi->offload_thread =3D alloc_workqueue("qedi_ofld%d", - WQ_MEM_RECLAIM, + WQ_MEM_RECLAIM | WQ_PERCPU, 1, qedi->shost->host_no); if (!qedi->offload_thread) { QEDI_ERR(&qedi->dbg_ctx, diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 87eeb8607b60..cecbeb16f54e 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -3409,7 +3409,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct = pci_device_id *id) "req->req_q_in=3D%p req->req_q_out=3D%p rsp->rsp_q_in=3D%p rsp->rsp_q= _out=3D%p.\n", req->req_q_in, req->req_q_out, rsp->rsp_q_in, rsp->rsp_q_out); =20 - ha->wq =3D alloc_workqueue("qla2xxx_wq", WQ_MEM_RECLAIM, 0); + ha->wq =3D alloc_workqueue("qla2xxx_wq", WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (unlikely(!ha->wq)) { ret =3D -ENOMEM; goto probe_failed; diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_t= arget.c index 11eadb3bd36e..5ebe89d548a8 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -7300,7 +7300,7 @@ int __init qlt_init(void) goto out_plogi_cachep; } =20 - qla_tgt_wq =3D alloc_workqueue("qla_tgt_wq", 0, 0); + qla_tgt_wq =3D alloc_workqueue("qla_tgt_wq", WQ_PERCPU, 0); if (!qla_tgt_wq) { ql_log(ql_log_fatal, NULL, 0xe06f, "alloc_workqueue for qla_tgt_wq failed\n"); diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_= qla2xxx.c index ceaf1c7b1d17..79374bf5548d 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -1884,7 +1884,7 @@ static int tcm_qla2xxx_register_configfs(void) goto out_fabric; =20 tcm_qla2xxx_free_wq =3D alloc_workqueue("tcm_qla2xxx_free", - WQ_MEM_RECLAIM, 0); + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!tcm_qla2xxx_free_wq) { ret =3D -ENOMEM; goto out_fabric_npiv; diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index d540d66e6ffc..7ab3b27c8793 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -8815,7 +8815,8 @@ static int qla4xxx_probe_adapter(struct pci_dev *pdev, } INIT_WORK(&ha->dpc_work, qla4xxx_do_dpc); =20 - ha->task_wq =3D alloc_workqueue("qla4xxx_%lu_task", WQ_MEM_RECLAIM, 1, + ha->task_wq =3D alloc_workqueue("qla4xxx_%lu_task", + WQ_MEM_RECLAIM | WQ_PERCPU, 1, ha->host_no); if (!ha->task_wq) { ql4_printk(KERN_WARNING, ha, "Unable to start task thread!\n"); diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport= _fc.c index 082f76e76721..e750682893b6 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -441,13 +441,14 @@ static int fc_host_setup(struct transport_container *= tc, struct device *dev, fc_host->next_vport_number =3D 0; fc_host->npiv_vports_inuse =3D 0; =20 - fc_host->work_q =3D alloc_workqueue("fc_wq_%d", 0, 0, shost->host_no); + fc_host->work_q =3D alloc_workqueue("fc_wq_%d", WQ_PERCPU, 0, + shost->host_no); if (!fc_host->work_q) return -ENOMEM; =20 fc_host->dev_loss_tmo =3D fc_dev_loss_tmo; - fc_host->devloss_work_q =3D alloc_workqueue("fc_dl_%d", 0, 0, - shost->host_no); + fc_host->devloss_work_q =3D alloc_workqueue("fc_dl_%d", WQ_PERCPU, 0, + shost->host_no); if (!fc_host->devloss_work_q) { destroy_workqueue(fc_host->work_q); fc_host->work_q =3D NULL; diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index 4dc8aba33d9b..a4890542b933 100644 --- a/drivers/soc/fsl/qbman/qman.c +++ b/drivers/soc/fsl/qbman/qman.c @@ -1073,7 +1073,7 @@ EXPORT_SYMBOL(qman_portal_set_iperiod); =20 int qman_wq_alloc(void) { - qm_portal_wq =3D alloc_workqueue("qman_portal_wq", 0, 1); + qm_portal_wq =3D alloc_workqueue("qman_portal_wq", WQ_PERCPU, 1); if (!qm_portal_wq) return -ENOMEM; return 0; diff --git a/drivers/staging/greybus/sdio.c b/drivers/staging/greybus/sdio.c index 5326ea372b24..12c36a5e1d8c 100644 --- a/drivers/staging/greybus/sdio.c +++ b/drivers/staging/greybus/sdio.c @@ -806,7 +806,7 @@ static int gb_sdio_probe(struct gbphy_device *gbphy_dev, =20 mutex_init(&host->lock); spin_lock_init(&host->xfer); - host->mrq_workqueue =3D alloc_workqueue("mmc-%s", 0, 1, + host->mrq_workqueue =3D alloc_workqueue("mmc-%s", WQ_PERCPU, 1, dev_name(&gbphy_dev->dev)); if (!host->mrq_workqueue) { ret =3D -ENOMEM; diff --git a/drivers/target/target_core_transport.c b/drivers/target/target= _core_transport.c index 05d29201b730..cb0758a19973 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -126,12 +126,12 @@ int init_se_kmem_caches(void) } =20 target_completion_wq =3D alloc_workqueue("target_completion", - WQ_MEM_RECLAIM, 0); + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!target_completion_wq) goto out_free_lba_map_mem_cache; =20 target_submission_wq =3D alloc_workqueue("target_submission", - WQ_MEM_RECLAIM, 0); + WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!target_submission_wq) goto out_free_completion_wq; =20 diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_cor= e_xcopy.c index 877ce58c0a70..93534a6e14b7 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c @@ -462,7 +462,7 @@ static const struct target_core_fabric_ops xcopy_pt_tfo= =3D { =20 int target_xcopy_setup_pt(void) { - xcopy_wq =3D alloc_workqueue("xcopy_wq", WQ_MEM_RECLAIM, 0); + xcopy_wq =3D alloc_workqueue("xcopy_wq", WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!xcopy_wq) { pr_err("Unable to allocate xcopy_wq\n"); return -ENOMEM; diff --git a/drivers/target/tcm_fc/tfc_conf.c b/drivers/target/tcm_fc/tfc_c= onf.c index 639fc358ed0f..f686d95d3273 100644 --- a/drivers/target/tcm_fc/tfc_conf.c +++ b/drivers/target/tcm_fc/tfc_conf.c @@ -250,7 +250,7 @@ static struct se_portal_group *ft_add_tpg(struct se_wwn= *wwn, const char *name) tpg->lport_wwn =3D ft_wwn; INIT_LIST_HEAD(&tpg->lun_list); =20 - wq =3D alloc_workqueue("tcm_fc", 0, 1); + wq =3D alloc_workqueue("tcm_fc", WQ_PERCPU, 1); if (!wq) { kfree(tpg); return NULL; diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 0e1dd6ef60a7..c06357d31ce7 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -6038,7 +6038,7 @@ int usb_hub_init(void) * device was gone before the EHCI controller had handed its port * over to the companion full-speed controller. */ - hub_wq =3D alloc_workqueue("usb_hub_wq", WQ_FREEZABLE, 0); + hub_wq =3D alloc_workqueue("usb_hub_wq", WQ_FREEZABLE | WQ_PERCPU, 0); if (hub_wq) return 0; =20 diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/funct= ion/f_hid.c index 740311c4fa24..637ee8de8c00 100644 --- a/drivers/usb/gadget/function/f_hid.c +++ b/drivers/usb/gadget/function/f_hid.c @@ -1254,8 +1254,7 @@ static int hidg_bind(struct usb_configuration *c, str= uct usb_function *f) =20 INIT_WORK(&hidg->work, get_report_workqueue_handler); hidg->workqueue =3D alloc_workqueue("report_work", - WQ_FREEZABLE | - WQ_MEM_RECLAIM, + WQ_FREEZABLE | WQ_MEM_RECLAIM | WQ_PERCPU, 1); =20 if (!hidg->workqueue) { diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 4ed0dc19afe0..0657f5f7a51f 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c @@ -1265,7 +1265,7 @@ static int __init uas_init(void) { int rv; =20 - workqueue =3D alloc_workqueue("uas", WQ_MEM_RECLAIM, 0); + workqueue =3D alloc_workqueue("uas", WQ_MEM_RECLAIM | WQ_PERCPU, 0); if (!workqueue) return -ENOMEM; =20 diff --git a/drivers/usb/typec/anx7411.c b/drivers/usb/typec/anx7411.c index 0ae0a5ee3fae..2e8ae1d2faf9 100644 --- a/drivers/usb/typec/anx7411.c +++ b/drivers/usb/typec/anx7411.c @@ -1516,8 +1516,7 @@ static int anx7411_i2c_probe(struct i2c_client *clien= t) =20 INIT_WORK(&plat->work, anx7411_work_func); plat->workqueue =3D alloc_workqueue("anx7411_work", - WQ_FREEZABLE | - WQ_MEM_RECLAIM, + WQ_FREEZABLE | WQ_MEM_RECLAIM | WQ_PERCPU, 1); if (!plat->workqueue) { dev_err(dev, "fail to create work queue\n"); diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vd= use_dev.c index 6a9a37351310..958a1454de2c 100644 --- a/drivers/vdpa/vdpa_user/vduse_dev.c +++ b/drivers/vdpa/vdpa_user/vduse_dev.c @@ -2172,7 +2172,8 @@ static int vduse_init(void) if (!vduse_irq_wq) goto err_wq; =20 - vduse_irq_bound_wq =3D alloc_workqueue("vduse-irq-bound", WQ_HIGHPRI, 0); + vduse_irq_bound_wq =3D alloc_workqueue("vduse-irq-bound", + WQ_HIGHPRI | WQ_PERCPU, 0); if (!vduse_irq_bound_wq) goto err_bound_wq; =20 diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloo= n.c index 89da052f4f68..d26fd2d910ac 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -987,7 +987,8 @@ static int virtballoon_probe(struct virtio_device *vdev) goto out_del_vqs; } vb->balloon_wq =3D alloc_workqueue("balloon-wq", - WQ_FREEZABLE | WQ_CPU_INTENSIVE, 0); + WQ_FREEZABLE | WQ_CPU_INTENSIVE | WQ_PERCPU, + 0); if (!vb->balloon_wq) { err =3D -ENOMEM; goto out_del_vqs; diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index 13a10f3294a8..db29356cb92e 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c @@ -1093,7 +1093,8 @@ static long privcmd_ioctl_irqfd(struct file *file, vo= id __user *udata) =20 static int privcmd_irqfd_init(void) { - irqfd_cleanup_wq =3D alloc_workqueue("privcmd-irqfd-cleanup", 0, 0); + irqfd_cleanup_wq =3D alloc_workqueue("privcmd-irqfd-cleanup", WQ_PERCPU, + 0); if (!irqfd_cleanup_wq) return -ENOMEM; =20 --=20 2.51.0