Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-replace-wq-users-and-add-wq_percpu-to-alloc_workqueue-users'

Marco Crivellari says:

====================
net: replace wq users and add WQ_PERCPU to alloc_workqueue() users

Below is a summary of a discussion about the Workqueue API and cpu isolation
considerations. Details and more information are available here:

"workqueue: Always use wq_select_unbound_cpu() for WORK_CPU_UNBOUND."

Link: https://lore.kernel.org/20250221112003.1dSuoGyc@linutronix.de

=== Current situation: problems ===

Let's consider a nohz_full system with isolated CPUs: wq_unbound_cpumask is
set to the housekeeping CPUs, for !WQ_UNBOUND the local CPU is selected.

This leads to different scenarios if a work item is scheduled on an isolated
CPU where "delay" value is 0 or greater then 0:
schedule_delayed_work(, 0);

This will be handled by __queue_work() that will queue the work item on the
current local (isolated) CPU, while:

schedule_delayed_work(, 1);

Will move the timer on an housekeeping CPU, and schedule the work there.

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.

=== Plan and future plans ===

This patchset is the first stone on a refactoring needed in order to
address the points aforementioned; it will have a positive impact also
on the cpu isolation, in the long term, moving away percpu workqueue in
favor to an unbound model.

These are the main steps:
1) API refactoring (that this patch is introducing)
- Make more clear and uniform the system wq names, both per-cpu and
unbound. This to avoid any possible confusion on what should be
used.

- Introduction of WQ_PERCPU: this flag is the complement of WQ_UNBOUND,
introduced in this patchset and used on all the callers that are not
currently using WQ_UNBOUND.

WQ_UNBOUND will be removed in a future release cycle.

Most users don't need to be per-cpu, because they don't have
locality requirements, because of that, a next future step will be
make "unbound" the default behavior.

2) Check who really needs to be per-cpu
- Remove the WQ_PERCPU flag when is not strictly required.

3) Add a new API (prefer local cpu)
- There are users that don't require a local execution, like mentioned
above; despite that, local execution yeld to performance gain.

This new API will prefer the local execution, without requiring it.

=== Introduced Changes by this series ===

1) [P 1-2] Replace use of system_wq and system_unbound_wq

system_wq is a per-CPU workqueue, but his name is not clear.
system_unbound_wq is to be used when locality is not required.

Because of that, system_wq has been renamed in system_percpu_wq, and
system_unbound_wq has been renamed in system_dfl_wq.

2) [P 3] add WQ_PERCPU to remaining alloc_workqueue() users

Every alloc_workqueue() caller should use one among WQ_PERCPU or
WQ_UNBOUND.

WQ_UNBOUND will be removed in a next release cycle.
====================

Link: https://patch.msgid.link/20250918142427.309519-1-marco.crivellari@suse.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+88 -73
+2 -1
drivers/net/can/spi/hi311x.c
··· 770 770 goto out_close; 771 771 } 772 772 773 - priv->wq = alloc_workqueue("hi3110_wq", WQ_FREEZABLE | WQ_MEM_RECLAIM, 773 + priv->wq = alloc_workqueue("hi3110_wq", 774 + WQ_FREEZABLE | WQ_MEM_RECLAIM | WQ_PERCPU, 774 775 0); 775 776 if (!priv->wq) { 776 777 ret = -ENOMEM;
+2 -1
drivers/net/can/spi/mcp251x.c
··· 1378 1378 if (ret) 1379 1379 goto out_clk; 1380 1380 1381 - priv->wq = alloc_workqueue("mcp251x_wq", WQ_FREEZABLE | WQ_MEM_RECLAIM, 1381 + priv->wq = alloc_workqueue("mcp251x_wq", 1382 + WQ_FREEZABLE | WQ_MEM_RECLAIM | WQ_PERCPU, 1382 1383 0); 1383 1384 if (!priv->wq) { 1384 1385 ret = -ENOMEM;
+1 -1
drivers/net/ethernet/cavium/liquidio/lio_core.c
··· 472 472 q_no = lio->linfo.rxpciq[q].s.q_no; 473 473 wq = &lio->rxq_status_wq[q_no]; 474 474 wq->wq = alloc_workqueue("rxq-oom-status", 475 - WQ_MEM_RECLAIM, 0); 475 + WQ_MEM_RECLAIM | WQ_PERCPU, 0); 476 476 if (!wq->wq) { 477 477 dev_err(&oct->pci_dev->dev, "unable to create cavium rxq oom status wq\n"); 478 478 return -ENOMEM;
+5 -3
drivers/net/ethernet/cavium/liquidio/lio_main.c
··· 526 526 struct octeon_device *oct = lio->oct_dev; 527 527 528 528 lio->link_status_wq.wq = alloc_workqueue("link-status", 529 - WQ_MEM_RECLAIM, 0); 529 + WQ_MEM_RECLAIM | WQ_PERCPU, 530 + 0); 530 531 if (!lio->link_status_wq.wq) { 531 532 dev_err(&oct->pci_dev->dev, "unable to create cavium link status wq\n"); 532 533 return -1; ··· 660 659 struct octeon_device *oct = lio->oct_dev; 661 660 662 661 lio->sync_octeon_time_wq.wq = 663 - alloc_workqueue("update-octeon-time", WQ_MEM_RECLAIM, 0); 662 + alloc_workqueue("update-octeon-time", 663 + WQ_MEM_RECLAIM | WQ_PERCPU, 0); 664 664 if (!lio->sync_octeon_time_wq.wq) { 665 665 dev_err(&oct->pci_dev->dev, "Unable to create wq to update octeon time\n"); 666 666 return -1; ··· 1736 1734 struct octeon_device *oct = lio->oct_dev; 1737 1735 1738 1736 lio->txq_status_wq.wq = alloc_workqueue("txq-status", 1739 - WQ_MEM_RECLAIM, 0); 1737 + WQ_MEM_RECLAIM | WQ_PERCPU, 0); 1740 1738 if (!lio->txq_status_wq.wq) { 1741 1739 dev_err(&oct->pci_dev->dev, "unable to create cavium txq status wq\n"); 1742 1740 return -1;
+2 -1
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
··· 304 304 struct octeon_device *oct = lio->oct_dev; 305 305 306 306 lio->link_status_wq.wq = alloc_workqueue("link-status", 307 - WQ_MEM_RECLAIM, 0); 307 + WQ_MEM_RECLAIM | WQ_PERCPU, 308 + 0); 308 309 if (!lio->link_status_wq.wq) { 309 310 dev_err(&oct->pci_dev->dev, "unable to create cavium link status wq\n"); 310 311 return -1;
+1 -1
drivers/net/ethernet/cavium/liquidio/request_manager.c
··· 132 132 oct->fn_list.setup_iq_regs(oct, iq_no); 133 133 134 134 oct->check_db_wq[iq_no].wq = alloc_workqueue("check_iq_db", 135 - WQ_MEM_RECLAIM, 135 + WQ_MEM_RECLAIM | WQ_PERCPU, 136 136 0); 137 137 if (!oct->check_db_wq[iq_no].wq) { 138 138 vfree(iq->request_list);
+2 -1
drivers/net/ethernet/cavium/liquidio/response_manager.c
··· 39 39 } 40 40 spin_lock_init(&oct->cmd_resp_wqlock); 41 41 42 - oct->dma_comp_wq.wq = alloc_workqueue("dma-comp", WQ_MEM_RECLAIM, 0); 42 + oct->dma_comp_wq.wq = alloc_workqueue("dma-comp", 43 + WQ_MEM_RECLAIM | WQ_PERCPU, 0); 43 44 if (!oct->dma_comp_wq.wq) { 44 45 dev_err(&oct->pci_dev->dev, "failed to create wq thread\n"); 45 46 return -ENOMEM;
+1 -1
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
··· 4884 4884 priv->tx_tstamp_type = HWTSTAMP_TX_OFF; 4885 4885 priv->rx_tstamp = false; 4886 4886 4887 - priv->dpaa2_ptp_wq = alloc_workqueue("dpaa2_ptp_wq", 0, 0); 4887 + priv->dpaa2_ptp_wq = alloc_workqueue("dpaa2_ptp_wq", WQ_PERCPU, 0); 4888 4888 if (!priv->dpaa2_ptp_wq) { 4889 4889 err = -ENOMEM; 4890 4890 goto err_wq_alloc;
+2 -1
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
··· 12912 12912 { 12913 12913 pr_debug("%s is initializing\n", HCLGE_NAME); 12914 12914 12915 - hclge_wq = alloc_workqueue("%s", WQ_UNBOUND, 0, HCLGE_NAME); 12915 + hclge_wq = alloc_workqueue("%s", WQ_UNBOUND, 0, 12916 + HCLGE_NAME); 12916 12917 if (!hclge_wq) { 12917 12918 pr_err("%s: failed to create workqueue\n", HCLGE_NAME); 12918 12919 return -ENOMEM;
+1 -1
drivers/net/ethernet/intel/fm10k/fm10k_main.c
··· 37 37 pr_info("%s\n", fm10k_copyright); 38 38 39 39 /* create driver workqueue */ 40 - fm10k_workqueue = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, 40 + fm10k_workqueue = alloc_workqueue("%s", WQ_MEM_RECLAIM | WQ_PERCPU, 0, 41 41 fm10k_driver_name); 42 42 if (!fm10k_workqueue) 43 43 return -ENOMEM;
+1 -1
drivers/net/ethernet/intel/i40e/i40e_main.c
··· 16617 16617 * since we need to be able to guarantee forward progress even under 16618 16618 * memory pressure. 16619 16619 */ 16620 - i40e_wq = alloc_workqueue("%s", 0, 0, i40e_driver_name); 16620 + i40e_wq = alloc_workqueue("%s", WQ_PERCPU, 0, i40e_driver_name); 16621 16621 if (!i40e_wq) { 16622 16622 pr_err("%s: Failed to create workqueue\n", i40e_driver_name); 16623 16623 return -ENOMEM;
+1 -1
drivers/net/ethernet/marvell/octeontx2/af/cgx.c
··· 2005 2005 2006 2006 /* init wq for processing linkup requests */ 2007 2007 INIT_WORK(&cgx->cgx_cmd_work, cgx_lmac_linkup_work); 2008 - cgx->cgx_cmd_workq = alloc_workqueue("cgx_cmd_workq", 0, 0); 2008 + cgx->cgx_cmd_workq = alloc_workqueue("cgx_cmd_workq", WQ_PERCPU, 0); 2009 2009 if (!cgx->cgx_cmd_workq) { 2010 2010 dev_err(dev, "alloc workqueue failed for cgx cmd"); 2011 2011 err = -ENOMEM;
+1 -1
drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c
··· 913 913 /* Initialize the wq for handling mcs interrupts */ 914 914 INIT_LIST_HEAD(&rvu->mcs_intrq_head); 915 915 INIT_WORK(&rvu->mcs_intr_work, mcs_intr_handler_task); 916 - rvu->mcs_intr_wq = alloc_workqueue("mcs_intr_wq", 0, 0); 916 + rvu->mcs_intr_wq = alloc_workqueue("mcs_intr_wq", WQ_PERCPU, 0); 917 917 if (!rvu->mcs_intr_wq) { 918 918 dev_err(rvu->dev, "mcs alloc workqueue failed\n"); 919 919 return -ENOMEM;
+1 -1
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
··· 315 315 spin_lock_init(&rvu->cgx_evq_lock); 316 316 INIT_LIST_HEAD(&rvu->cgx_evq_head); 317 317 INIT_WORK(&rvu->cgx_evh_work, cgx_evhandler_task); 318 - rvu->cgx_evh_wq = alloc_workqueue("rvu_evh_wq", 0, 0); 318 + rvu->cgx_evh_wq = alloc_workqueue("rvu_evh_wq", WQ_PERCPU, 0); 319 319 if (!rvu->cgx_evh_wq) { 320 320 dev_err(rvu->dev, "alloc workqueue failed"); 321 321 return -ENOMEM;
+1 -1
drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c
··· 376 376 spin_lock_init(&rvu->rep_evtq_lock); 377 377 INIT_LIST_HEAD(&rvu->rep_evtq_head); 378 378 INIT_WORK(&rvu->rep_evt_work, rvu_rep_wq_handler); 379 - rvu->rep_evt_wq = alloc_workqueue("rep_evt_wq", 0, 0); 379 + rvu->rep_evt_wq = alloc_workqueue("rep_evt_wq", WQ_PERCPU, 0); 380 380 if (!rvu->rep_evt_wq) { 381 381 dev_err(rvu->dev, "REP workqueue allocation failed\n"); 382 382 return -ENOMEM;
+2 -1
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c
··· 798 798 pf->ipsec.sa_size = sa_size; 799 799 800 800 INIT_WORK(&pf->ipsec.sa_work, cn10k_ipsec_sa_wq_handler); 801 - pf->ipsec.sa_workq = alloc_workqueue("cn10k_ipsec_sa_workq", 0, 0); 801 + pf->ipsec.sa_workq = alloc_workqueue("cn10k_ipsec_sa_workq", 802 + WQ_PERCPU, 0); 802 803 if (!pf->ipsec.sa_workq) { 803 804 netdev_err(pf->netdev, "SA alloc workqueue failed\n"); 804 805 return -ENOMEM;
+1 -1
drivers/net/ethernet/marvell/prestera/prestera_main.c
··· 1500 1500 1501 1501 static int __init prestera_module_init(void) 1502 1502 { 1503 - prestera_wq = alloc_workqueue("prestera", 0, 0); 1503 + prestera_wq = alloc_workqueue("prestera", WQ_PERCPU, 0); 1504 1504 if (!prestera_wq) 1505 1505 return -ENOMEM; 1506 1506
+1 -1
drivers/net/ethernet/marvell/prestera/prestera_pci.c
··· 898 898 899 899 dev_info(fw->dev.dev, "Prestera FW is ready\n"); 900 900 901 - fw->wq = alloc_workqueue("prestera_fw_wq", WQ_HIGHPRI, 1); 901 + fw->wq = alloc_workqueue("prestera_fw_wq", WQ_HIGHPRI | WQ_PERCPU, 1); 902 902 if (!fw->wq) { 903 903 err = -ENOMEM; 904 904 goto err_wq_alloc;
+2 -2
drivers/net/ethernet/mellanox/mlxsw/core.c
··· 886 886 if (!(mlxsw_core->bus->features & MLXSW_BUS_F_TXRX)) 887 887 return 0; 888 888 889 - emad_wq = alloc_workqueue("mlxsw_core_emad", 0, 0); 889 + emad_wq = alloc_workqueue("mlxsw_core_emad", WQ_PERCPU, 0); 890 890 if (!emad_wq) 891 891 return -ENOMEM; 892 892 mlxsw_core->emad_wq = emad_wq; ··· 3381 3381 if (err) 3382 3382 return err; 3383 3383 3384 - mlxsw_wq = alloc_workqueue(mlxsw_core_driver_name, 0, 0); 3384 + mlxsw_wq = alloc_workqueue(mlxsw_core_driver_name, WQ_PERCPU, 0); 3385 3385 if (!mlxsw_wq) { 3386 3386 err = -ENOMEM; 3387 3387 goto err_alloc_workqueue;
+1 -1
drivers/net/ethernet/netronome/nfp/nfp_main.c
··· 797 797 pf->pdev = pdev; 798 798 pf->dev_info = dev_info; 799 799 800 - pf->wq = alloc_workqueue("nfp-%s", 0, 2, pci_name(pdev)); 800 + pf->wq = alloc_workqueue("nfp-%s", WQ_PERCPU, 2, pci_name(pdev)); 801 801 if (!pf->wq) { 802 802 err = -ENOMEM; 803 803 goto err_pci_priv_unset;
+2 -1
drivers/net/ethernet/qlogic/qed/qed_main.c
··· 1214 1214 hwfn = &cdev->hwfns[i]; 1215 1215 1216 1216 hwfn->slowpath_wq = alloc_workqueue("slowpath-%02x:%02x.%02x", 1217 - 0, 0, cdev->pdev->bus->number, 1217 + WQ_PERCPU, 0, 1218 + cdev->pdev->bus->number, 1218 1219 PCI_SLOT(cdev->pdev->devfn), 1219 1220 hwfn->abs_pf_id); 1220 1221
+1 -1
drivers/net/ethernet/sfc/efx_channels.c
··· 1281 1281 time = jiffies - channel->rfs_last_expiry; 1282 1282 /* Would our quota be >= 20? */ 1283 1283 if (channel->rfs_filter_count * time >= 600 * HZ) 1284 - mod_delayed_work(system_wq, &channel->filter_work, 0); 1284 + mod_delayed_work(system_percpu_wq, &channel->filter_work, 0); 1285 1285 #endif 1286 1286 1287 1287 /* There is no race here; although napi_disable() will
+1 -1
drivers/net/ethernet/sfc/siena/efx_channels.c
··· 1300 1300 time = jiffies - channel->rfs_last_expiry; 1301 1301 /* Would our quota be >= 20? */ 1302 1302 if (channel->rfs_filter_count * time >= 600 * HZ) 1303 - mod_delayed_work(system_wq, &channel->filter_work, 0); 1303 + mod_delayed_work(system_percpu_wq, &channel->filter_work, 0); 1304 1304 #endif 1305 1305 1306 1306 /* There is no race here; although napi_disable() will
+1 -1
drivers/net/ethernet/wiznet/w5100.c
··· 1142 1142 if (err < 0) 1143 1143 goto err_register; 1144 1144 1145 - priv->xfer_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, 1145 + priv->xfer_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM | WQ_PERCPU, 0, 1146 1146 netdev_name(ndev)); 1147 1147 if (!priv->xfer_wq) { 1148 1148 err = -ENOMEM;
+3 -2
drivers/net/fjes/fjes_main.c
··· 1364 1364 adapter->force_reset = false; 1365 1365 adapter->open_guard = false; 1366 1366 1367 - adapter->txrx_wq = alloc_workqueue(DRV_NAME "/txrx", WQ_MEM_RECLAIM, 0); 1367 + adapter->txrx_wq = alloc_workqueue(DRV_NAME "/txrx", 1368 + WQ_MEM_RECLAIM | WQ_PERCPU, 0); 1368 1369 if (unlikely(!adapter->txrx_wq)) { 1369 1370 err = -ENOMEM; 1370 1371 goto err_free_netdev; 1371 1372 } 1372 1373 1373 1374 adapter->control_wq = alloc_workqueue(DRV_NAME "/control", 1374 - WQ_MEM_RECLAIM, 0); 1375 + WQ_MEM_RECLAIM | WQ_PERCPU, 0); 1375 1376 if (unlikely(!adapter->control_wq)) { 1376 1377 err = -ENOMEM; 1377 1378 goto err_free_txrx_wq;
+1 -1
drivers/net/macvlan.c
··· 369 369 } 370 370 spin_unlock(&port->bc_queue.lock); 371 371 372 - queue_work(system_unbound_wq, &port->bc_work); 372 + queue_work(system_dfl_wq, &port->bc_work); 373 373 374 374 if (err) 375 375 goto free_nskb;
+3 -3
drivers/net/netdevsim/dev.c
··· 851 851 nsim_dev = nsim_trap_data->nsim_dev; 852 852 853 853 if (!devl_trylock(priv_to_devlink(nsim_dev))) { 854 - queue_delayed_work(system_unbound_wq, 854 + queue_delayed_work(system_dfl_wq, 855 855 &nsim_dev->trap_data->trap_report_dw, 1); 856 856 return; 857 857 } ··· 867 867 cond_resched(); 868 868 } 869 869 devl_unlock(priv_to_devlink(nsim_dev)); 870 - queue_delayed_work(system_unbound_wq, 870 + queue_delayed_work(system_dfl_wq, 871 871 &nsim_dev->trap_data->trap_report_dw, 872 872 msecs_to_jiffies(NSIM_TRAP_REPORT_INTERVAL_MS)); 873 873 } ··· 924 924 925 925 INIT_DELAYED_WORK(&nsim_dev->trap_data->trap_report_dw, 926 926 nsim_dev_trap_report_work); 927 - queue_delayed_work(system_unbound_wq, 927 + queue_delayed_work(system_dfl_wq, 928 928 &nsim_dev->trap_data->trap_report_dw, 929 929 msecs_to_jiffies(NSIM_TRAP_REPORT_INTERVAL_MS)); 930 930
+6 -6
drivers/net/phy/sfp.c
··· 911 911 912 912 if (sfp->state_soft_mask & (SFP_F_LOS | SFP_F_TX_FAULT) && 913 913 !sfp->need_poll) 914 - mod_delayed_work(system_wq, &sfp->poll, poll_jiffies); 914 + mod_delayed_work(system_percpu_wq, &sfp->poll, poll_jiffies); 915 915 mutex_unlock(&sfp->st_mutex); 916 916 } 917 917 ··· 1682 1682 err = sfp_read(sfp, true, 0, &sfp->diag, sizeof(sfp->diag)); 1683 1683 if (err < 0) { 1684 1684 if (sfp->hwmon_tries--) { 1685 - mod_delayed_work(system_wq, &sfp->hwmon_probe, 1685 + mod_delayed_work(system_percpu_wq, &sfp->hwmon_probe, 1686 1686 T_PROBE_RETRY_SLOW); 1687 1687 } else { 1688 1688 dev_warn(sfp->dev, "hwmon probe failed: %pe\n", ··· 1709 1709 static int sfp_hwmon_insert(struct sfp *sfp) 1710 1710 { 1711 1711 if (sfp->have_a2 && sfp->id.ext.diagmon & SFP_DIAGMON_DDM) { 1712 - mod_delayed_work(system_wq, &sfp->hwmon_probe, 1); 1712 + mod_delayed_work(system_percpu_wq, &sfp->hwmon_probe, 1); 1713 1713 sfp->hwmon_tries = R_PROBE_RETRY_SLOW; 1714 1714 } 1715 1715 ··· 2563 2563 /* Force a poll to re-read the hardware signal state after 2564 2564 * sfp_sm_mod_probe() changed state_hw_mask. 2565 2565 */ 2566 - mod_delayed_work(system_wq, &sfp->poll, 1); 2566 + mod_delayed_work(system_percpu_wq, &sfp->poll, 1); 2567 2567 2568 2568 err = sfp_hwmon_insert(sfp); 2569 2569 if (err) ··· 3008 3008 // it's unimportant if we race while reading this. 3009 3009 if (sfp->state_soft_mask & (SFP_F_LOS | SFP_F_TX_FAULT) || 3010 3010 sfp->need_poll) 3011 - mod_delayed_work(system_wq, &sfp->poll, poll_jiffies); 3011 + mod_delayed_work(system_percpu_wq, &sfp->poll, poll_jiffies); 3012 3012 } 3013 3013 3014 3014 static struct sfp *sfp_alloc(struct device *dev) ··· 3178 3178 } 3179 3179 3180 3180 if (sfp->need_poll) 3181 - mod_delayed_work(system_wq, &sfp->poll, poll_jiffies); 3181 + mod_delayed_work(system_percpu_wq, &sfp->poll, poll_jiffies); 3182 3182 3183 3183 /* We could have an issue in cases no Tx disable pin is available or 3184 3184 * wired as modules using a laser as their light source will continue to
+4 -2
drivers/net/wireguard/device.c
··· 333 333 goto err_free_peer_hashtable; 334 334 335 335 wg->handshake_receive_wq = alloc_workqueue("wg-kex-%s", 336 - WQ_CPU_INTENSIVE | WQ_FREEZABLE, 0, dev->name); 336 + WQ_CPU_INTENSIVE | WQ_FREEZABLE | WQ_PERCPU, 0, 337 + dev->name); 337 338 if (!wg->handshake_receive_wq) 338 339 goto err_free_index_hashtable; 339 340 ··· 344 343 goto err_destroy_handshake_receive; 345 344 346 345 wg->packet_crypt_wq = alloc_workqueue("wg-crypt-%s", 347 - WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, 0, dev->name); 346 + WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM | WQ_PERCPU, 0, 347 + dev->name); 348 348 if (!wg->packet_crypt_wq) 349 349 goto err_destroy_handshake_send; 350 350
+2 -1
drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c
··· 1085 1085 int t7xx_dpmaif_bat_rel_wq_alloc(struct dpmaif_ctrl *dpmaif_ctrl) 1086 1086 { 1087 1087 dpmaif_ctrl->bat_release_wq = alloc_workqueue("dpmaif_bat_release_work_queue", 1088 - WQ_MEM_RECLAIM, 1); 1088 + WQ_MEM_RECLAIM | WQ_PERCPU, 1089 + 1); 1089 1090 if (!dpmaif_ctrl->bat_release_wq) 1090 1091 return -ENOMEM; 1091 1092
+1 -1
drivers/net/wwan/wwan_hwsim.c
··· 509 509 if (wwan_hwsim_devsnum < 0 || wwan_hwsim_devsnum > 128) 510 510 return -EINVAL; 511 511 512 - wwan_wq = alloc_workqueue("wwan_wq", 0, 0); 512 + wwan_wq = alloc_workqueue("wwan_wq", WQ_PERCPU, 0); 513 513 if (!wwan_wq) 514 514 return -ENOMEM; 515 515
+3 -3
net/bridge/br_cfm.c
··· 134 134 * of the configured CC 'expected_interval' 135 135 * in order to detect CCM defect after 3.25 interval. 136 136 */ 137 - queue_delayed_work(system_wq, &peer_mep->ccm_rx_dwork, 137 + queue_delayed_work(system_percpu_wq, &peer_mep->ccm_rx_dwork, 138 138 usecs_to_jiffies(interval_us / 4)); 139 139 } 140 140 ··· 285 285 ccm_frame_tx(skb); 286 286 287 287 interval_us = interval_to_us(mep->cc_config.exp_interval); 288 - queue_delayed_work(system_wq, &mep->ccm_tx_dwork, 288 + queue_delayed_work(system_percpu_wq, &mep->ccm_tx_dwork, 289 289 usecs_to_jiffies(interval_us)); 290 290 } 291 291 ··· 809 809 * to send first frame immediately 810 810 */ 811 811 mep->ccm_tx_end = jiffies + usecs_to_jiffies(tx_info->period * 1000000); 812 - queue_delayed_work(system_wq, &mep->ccm_tx_dwork, 0); 812 + queue_delayed_work(system_percpu_wq, &mep->ccm_tx_dwork, 0); 813 813 814 814 save: 815 815 mep->cc_ccm_tx_info = *tx_info;
+4 -4
net/bridge/br_mrp.c
··· 341 341 out: 342 342 rcu_read_unlock(); 343 343 344 - queue_delayed_work(system_wq, &mrp->test_work, 344 + queue_delayed_work(system_percpu_wq, &mrp->test_work, 345 345 usecs_to_jiffies(mrp->test_interval)); 346 346 } 347 347 ··· 418 418 out: 419 419 rcu_read_unlock(); 420 420 421 - queue_delayed_work(system_wq, &mrp->in_test_work, 421 + queue_delayed_work(system_percpu_wq, &mrp->in_test_work, 422 422 usecs_to_jiffies(mrp->in_test_interval)); 423 423 } 424 424 ··· 725 725 mrp->test_max_miss = test->max_miss; 726 726 mrp->test_monitor = test->monitor; 727 727 mrp->test_count_miss = 0; 728 - queue_delayed_work(system_wq, &mrp->test_work, 728 + queue_delayed_work(system_percpu_wq, &mrp->test_work, 729 729 usecs_to_jiffies(test->interval)); 730 730 731 731 return 0; ··· 865 865 mrp->in_test_end = jiffies + usecs_to_jiffies(in_test->period); 866 866 mrp->in_test_max_miss = in_test->max_miss; 867 867 mrp->in_test_count_miss = 0; 868 - queue_delayed_work(system_wq, &mrp->in_test_work, 868 + queue_delayed_work(system_percpu_wq, &mrp->in_test_work, 869 869 usecs_to_jiffies(in_test->interval)); 870 870 871 871 return 0;
+2 -1
net/ceph/messenger.c
··· 252 252 * The number of active work items is limited by the number of 253 253 * connections, so leave @max_active at default. 254 254 */ 255 - ceph_msgr_wq = alloc_workqueue("ceph-msgr", WQ_MEM_RECLAIM, 0); 255 + ceph_msgr_wq = alloc_workqueue("ceph-msgr", 256 + WQ_MEM_RECLAIM | WQ_PERCPU, 0); 256 257 if (ceph_msgr_wq) 257 258 return 0; 258 259
+1 -1
net/ceph/mon_client.c
··· 314 314 delay = CEPH_MONC_PING_INTERVAL; 315 315 316 316 dout("__schedule_delayed after %lu\n", delay); 317 - mod_delayed_work(system_wq, &monc->delayed_work, 317 + mod_delayed_work(system_percpu_wq, &monc->delayed_work, 318 318 round_jiffies_relative(delay)); 319 319 } 320 320
+1 -1
net/core/skmsg.c
··· 876 876 sk_psock_stop(psock); 877 877 878 878 INIT_RCU_WORK(&psock->rwork, sk_psock_destroy); 879 - queue_rcu_work(system_wq, &psock->rwork); 879 + queue_rcu_work(system_percpu_wq, &psock->rwork); 880 880 } 881 881 EXPORT_SYMBOL_GPL(sk_psock_drop); 882 882
+1 -1
net/core/sock_diag.c
··· 348 348 349 349 static int __init sock_diag_init(void) 350 350 { 351 - broadcast_wq = alloc_workqueue("sock_diag_events", 0, 0); 351 + broadcast_wq = alloc_workqueue("sock_diag_events", WQ_PERCPU, 0); 352 352 BUG_ON(!broadcast_wq); 353 353 return register_pernet_subsys(&diag_net_ops); 354 354 }
+1 -1
net/devlink/core.c
··· 320 320 void devlink_put(struct devlink *devlink) 321 321 { 322 322 if (refcount_dec_and_test(&devlink->refcount)) 323 - queue_rcu_work(system_wq, &devlink->rwork); 323 + queue_rcu_work(system_percpu_wq, &devlink->rwork); 324 324 } 325 325 326 326 struct devlink *devlinks_xa_find_get(struct net *net, unsigned long *indexp)
+1 -1
net/ipv4/inet_fragment.c
··· 183 183 rhashtable_free_and_destroy(&fqdir->rhashtable, inet_frags_free_cb, NULL); 184 184 185 185 if (llist_add(&fqdir->free_list, &fqdir_free_list)) 186 - queue_delayed_work(system_wq, &fqdir_free_work, HZ); 186 + queue_delayed_work(system_percpu_wq, &fqdir_free_work, HZ); 187 187 } 188 188 189 189 int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, struct net *net)
+1 -1
net/netfilter/nf_conntrack_ecache.c
··· 301 301 net->ct.ecache_dwork_pending = true; 302 302 } else if (state == NFCT_ECACHE_DESTROY_SENT) { 303 303 if (!hlist_nulls_empty(&cnet->ecache.dying_list)) 304 - mod_delayed_work(system_wq, &cnet->ecache.dwork, 0); 304 + mod_delayed_work(system_percpu_wq, &cnet->ecache.dwork, 0); 305 305 else 306 306 net->ct.ecache_dwork_pending = false; 307 307 }
+1 -1
net/openvswitch/dp_notify.c
··· 75 75 76 76 /* schedule vport destroy, dev_put and genl notification */ 77 77 ovs_net = net_generic(dev_net(dev), ovs_net_id); 78 - queue_work(system_wq, &ovs_net->dp_notify_work); 78 + queue_work(system_percpu_wq, &ovs_net->dp_notify_work); 79 79 } 80 80 81 81 return NOTIFY_DONE;
+2 -1
net/rds/ib_rdma.c
··· 672 672 673 673 int rds_ib_mr_init(void) 674 674 { 675 - rds_ib_mr_wq = alloc_workqueue("rds_mr_flushd", WQ_MEM_RECLAIM, 0); 675 + rds_ib_mr_wq = alloc_workqueue("rds_mr_flushd", 676 + WQ_MEM_RECLAIM | WQ_PERCPU, 0); 676 677 if (!rds_ib_mr_wq) 677 678 return -ENOMEM; 678 679 return 0;
+1 -1
net/rfkill/input.c
··· 159 159 rfkill_op_pending = true; 160 160 if (op == RFKILL_GLOBAL_OP_EPO && !rfkill_is_epo_lock_active()) { 161 161 /* bypass the limiter for EPO */ 162 - mod_delayed_work(system_wq, &rfkill_op_work, 0); 162 + mod_delayed_work(system_percpu_wq, &rfkill_op_work, 0); 163 163 rfkill_last_scheduled = jiffies; 164 164 } else 165 165 rfkill_schedule_ratelimited();
+1 -1
net/rxrpc/rxperf.c
··· 630 630 631 631 pr_info("Server registering\n"); 632 632 633 - rxperf_workqueue = alloc_workqueue("rxperf", 0, 0); 633 + rxperf_workqueue = alloc_workqueue("rxperf", WQ_PERCPU, 0); 634 634 if (!rxperf_workqueue) 635 635 goto error_workqueue; 636 636
+3 -3
net/smc/af_smc.c
··· 3535 3535 3536 3536 rc = -ENOMEM; 3537 3537 3538 - smc_tcp_ls_wq = alloc_workqueue("smc_tcp_ls_wq", 0, 0); 3538 + smc_tcp_ls_wq = alloc_workqueue("smc_tcp_ls_wq", WQ_PERCPU, 0); 3539 3539 if (!smc_tcp_ls_wq) 3540 3540 goto out_pnet; 3541 3541 3542 - smc_hs_wq = alloc_workqueue("smc_hs_wq", 0, 0); 3542 + smc_hs_wq = alloc_workqueue("smc_hs_wq", WQ_PERCPU, 0); 3543 3543 if (!smc_hs_wq) 3544 3544 goto out_alloc_tcp_ls_wq; 3545 3545 3546 - smc_close_wq = alloc_workqueue("smc_close_wq", 0, 0); 3546 + smc_close_wq = alloc_workqueue("smc_close_wq", WQ_PERCPU, 0); 3547 3547 if (!smc_close_wq) 3548 3548 goto out_alloc_hs_wq; 3549 3549
+2 -2
net/smc/smc_core.c
··· 85 85 * otherwise there is a risk of out-of-sync link groups. 86 86 */ 87 87 if (!lgr->freeing) { 88 - mod_delayed_work(system_wq, &lgr->free_work, 88 + mod_delayed_work(system_percpu_wq, &lgr->free_work, 89 89 (!lgr->is_smcd && lgr->role == SMC_CLNT) ? 90 90 SMC_LGR_FREE_DELAY_CLNT : 91 91 SMC_LGR_FREE_DELAY_SERV); ··· 896 896 rc = SMC_CLC_DECL_MEM; 897 897 goto ism_put_vlan; 898 898 } 899 - lgr->tx_wq = alloc_workqueue("smc_tx_wq-%*phN", 0, 0, 899 + lgr->tx_wq = alloc_workqueue("smc_tx_wq-%*phN", WQ_PERCPU, 0, 900 900 SMC_LGR_ID_SIZE, &lgr->id); 901 901 if (!lgr->tx_wq) { 902 902 rc = -ENOMEM;
+1 -1
net/tls/tls_device.c
··· 1412 1412 if (!dummy_page) 1413 1413 return -ENOMEM; 1414 1414 1415 - destruct_wq = alloc_workqueue("ktls_device_destruct", 0, 0); 1415 + destruct_wq = alloc_workqueue("ktls_device_destruct", WQ_PERCPU, 0); 1416 1416 if (!destruct_wq) { 1417 1417 err = -ENOMEM; 1418 1418 goto err_free_dummy;
+1 -1
net/unix/garbage.c
··· 592 592 void unix_gc(void) 593 593 { 594 594 WRITE_ONCE(gc_in_progress, true); 595 - queue_work(system_unbound_wq, &unix_gc_work); 595 + queue_work(system_dfl_wq, &unix_gc_work); 596 596 } 597 597 598 598 #define UNIX_INFLIGHT_TRIGGER_GC 16000
+1 -1
net/vmw_vsock/af_vsock.c
··· 1649 1649 * reschedule it, then ungrab the socket refcount to 1650 1650 * keep it balanced. 1651 1651 */ 1652 - if (mod_delayed_work(system_wq, &vsk->connect_work, 1652 + if (mod_delayed_work(system_percpu_wq, &vsk->connect_work, 1653 1653 timeout)) 1654 1654 sock_put(sk); 1655 1655
+1 -1
net/vmw_vsock/virtio_transport.c
··· 926 926 { 927 927 int ret; 928 928 929 - virtio_vsock_workqueue = alloc_workqueue("virtio_vsock", 0, 0); 929 + virtio_vsock_workqueue = alloc_workqueue("virtio_vsock", WQ_PERCPU, 0); 930 930 if (!virtio_vsock_workqueue) 931 931 return -ENOMEM; 932 932
+1 -1
net/vmw_vsock/vsock_loopback.c
··· 139 139 struct vsock_loopback *vsock = &the_vsock_loopback; 140 140 int ret; 141 141 142 - vsock->workqueue = alloc_workqueue("vsock-loopback", 0, 0); 142 + vsock->workqueue = alloc_workqueue("vsock-loopback", WQ_PERCPU, 0); 143 143 if (!vsock->workqueue) 144 144 return -ENOMEM; 145 145