]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: WQ_PERCPU added to alloc_workqueue users
authorMarco Crivellari <marco.crivellari@suse.com>
Thu, 18 Sep 2025 14:24:27 +0000 (16:24 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 23 Sep 2025 00:40:30 +0000 (17:40 -0700)
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’re needed and
reducing noise when CPUs are isolated.

This change adds a new WQ_PERCPU flag at the network subsystem, 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’t explicitly specify WQ_UNBOUND
must now use WQ_PERCPU.

All existing users have been updated accordingly.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
Link: https://patch.msgid.link/20250918142427.309519-4-marco.crivellari@suse.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
35 files changed:
drivers/net/can/spi/hi311x.c
drivers/net/can/spi/mcp251x.c
drivers/net/ethernet/cavium/liquidio/lio_core.c
drivers/net/ethernet/cavium/liquidio/lio_main.c
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
drivers/net/ethernet/cavium/liquidio/request_manager.c
drivers/net/ethernet/cavium/liquidio/response_manager.c
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/intel/fm10k/fm10k_main.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/marvell/octeontx2/af/cgx.c
drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_ipsec.c
drivers/net/ethernet/marvell/prestera/prestera_main.c
drivers/net/ethernet/marvell/prestera/prestera_pci.c
drivers/net/ethernet/mellanox/mlxsw/core.c
drivers/net/ethernet/netronome/nfp/nfp_main.c
drivers/net/ethernet/qlogic/qed/qed_main.c
drivers/net/ethernet/wiznet/w5100.c
drivers/net/fjes/fjes_main.c
drivers/net/wireguard/device.c
drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c
drivers/net/wwan/wwan_hwsim.c
net/ceph/messenger.c
net/core/sock_diag.c
net/rds/ib_rdma.c
net/rxrpc/rxperf.c
net/smc/af_smc.c
net/smc/smc_core.c
net/tls/tls_device.c
net/vmw_vsock/virtio_transport.c
net/vmw_vsock/vsock_loopback.c

index 09ae218315d73d49c2ec4280707911966fce1c31..96f23311b4ee35bbb1f0e316a5c838d79d15e087 100644 (file)
@@ -770,7 +770,8 @@ static int hi3110_open(struct net_device *net)
                goto out_close;
        }
 
-       priv->wq = alloc_workqueue("hi3110_wq", WQ_FREEZABLE | WQ_MEM_RECLAIM,
+       priv->wq = alloc_workqueue("hi3110_wq",
+                                  WQ_FREEZABLE | WQ_MEM_RECLAIM | WQ_PERCPU,
                                   0);
        if (!priv->wq) {
                ret = -ENOMEM;
index 313e1d241f0110ccee900c3f17e479ff1a4a1919..b797e08499d70dce44732f98f8878867cecb2b36 100644 (file)
@@ -1378,7 +1378,8 @@ static int mcp251x_can_probe(struct spi_device *spi)
        if (ret)
                goto out_clk;
 
-       priv->wq = alloc_workqueue("mcp251x_wq", WQ_FREEZABLE | WQ_MEM_RECLAIM,
+       priv->wq = alloc_workqueue("mcp251x_wq",
+                                  WQ_FREEZABLE | WQ_MEM_RECLAIM | WQ_PERCPU,
                                   0);
        if (!priv->wq) {
                ret = -ENOMEM;
index 674c548318750e50f2b95f78c6d52556c4bc54ed..215dac201b4a8fb0e9ed7ba5c1844f4f69b3f797 100644 (file)
@@ -472,7 +472,7 @@ int setup_rx_oom_poll_fn(struct net_device *netdev)
                q_no = lio->linfo.rxpciq[q].s.q_no;
                wq = &lio->rxq_status_wq[q_no];
                wq->wq = alloc_workqueue("rxq-oom-status",
-                                        WQ_MEM_RECLAIM, 0);
+                                        WQ_MEM_RECLAIM | WQ_PERCPU, 0);
                if (!wq->wq) {
                        dev_err(&oct->pci_dev->dev, "unable to create cavium rxq oom status wq\n");
                        return -ENOMEM;
index 1d79f6eaa41f6cbfc64d57ab44252e94f24a8345..8e2fcec26ea13c38d4226ca3a2bfce14801efc60 100644 (file)
@@ -526,7 +526,8 @@ static inline int setup_link_status_change_wq(struct net_device *netdev)
        struct octeon_device *oct = lio->oct_dev;
 
        lio->link_status_wq.wq = alloc_workqueue("link-status",
-                                                WQ_MEM_RECLAIM, 0);
+                                                WQ_MEM_RECLAIM | WQ_PERCPU,
+                                                0);
        if (!lio->link_status_wq.wq) {
                dev_err(&oct->pci_dev->dev, "unable to create cavium link status wq\n");
                return -1;
@@ -659,7 +660,8 @@ static inline int setup_sync_octeon_time_wq(struct net_device *netdev)
        struct octeon_device *oct = lio->oct_dev;
 
        lio->sync_octeon_time_wq.wq =
-               alloc_workqueue("update-octeon-time", WQ_MEM_RECLAIM, 0);
+               alloc_workqueue("update-octeon-time",
+                               WQ_MEM_RECLAIM | WQ_PERCPU, 0);
        if (!lio->sync_octeon_time_wq.wq) {
                dev_err(&oct->pci_dev->dev, "Unable to create wq to update octeon time\n");
                return -1;
@@ -1734,7 +1736,7 @@ static inline int setup_tx_poll_fn(struct net_device *netdev)
        struct octeon_device *oct = lio->oct_dev;
 
        lio->txq_status_wq.wq = alloc_workqueue("txq-status",
-                                               WQ_MEM_RECLAIM, 0);
+                                               WQ_MEM_RECLAIM | WQ_PERCPU, 0);
        if (!lio->txq_status_wq.wq) {
                dev_err(&oct->pci_dev->dev, "unable to create cavium txq status wq\n");
                return -1;
index 62c2eadc33e35a0f99630f6cd0e7c1a3ff39472c..3230dff5ba056c20e5f6e11acdff481f4bf27027 100644 (file)
@@ -304,7 +304,8 @@ static int setup_link_status_change_wq(struct net_device *netdev)
        struct octeon_device *oct = lio->oct_dev;
 
        lio->link_status_wq.wq = alloc_workqueue("link-status",
-                                                WQ_MEM_RECLAIM, 0);
+                                                WQ_MEM_RECLAIM | WQ_PERCPU,
+                                                0);
        if (!lio->link_status_wq.wq) {
                dev_err(&oct->pci_dev->dev, "unable to create cavium link status wq\n");
                return -1;
index 12105ffb5dac6dfb5579fa54c5c0f53c2eea4859..d7cfb20eea00ca3b51ff0e724911a61483854ba9 100644 (file)
@@ -132,7 +132,7 @@ int octeon_init_instr_queue(struct octeon_device *oct,
        oct->fn_list.setup_iq_regs(oct, iq_no);
 
        oct->check_db_wq[iq_no].wq = alloc_workqueue("check_iq_db",
-                                                    WQ_MEM_RECLAIM,
+                                                    WQ_MEM_RECLAIM | WQ_PERCPU,
                                                     0);
        if (!oct->check_db_wq[iq_no].wq) {
                vfree(iq->request_list);
index 861050966e180749feab9342a018377be269606d..de1a8335b5450893b53fa2c3bf9373becf6004f7 100644 (file)
@@ -39,7 +39,8 @@ int octeon_setup_response_list(struct octeon_device *oct)
        }
        spin_lock_init(&oct->cmd_resp_wqlock);
 
-       oct->dma_comp_wq.wq = alloc_workqueue("dma-comp", WQ_MEM_RECLAIM, 0);
+       oct->dma_comp_wq.wq = alloc_workqueue("dma-comp",
+                                             WQ_MEM_RECLAIM | WQ_PERCPU, 0);
        if (!oct->dma_comp_wq.wq) {
                dev_err(&oct->pci_dev->dev, "failed to create wq thread\n");
                return -ENOMEM;
index 0f4efd5053320992efb836a0310ed265bfa34d07..c96d1d6ba8fe97d58dce77d27b1563da6b5c25c3 100644 (file)
@@ -4884,7 +4884,7 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
        priv->tx_tstamp_type = HWTSTAMP_TX_OFF;
        priv->rx_tstamp = false;
 
-       priv->dpaa2_ptp_wq = alloc_workqueue("dpaa2_ptp_wq", 0, 0);
+       priv->dpaa2_ptp_wq = alloc_workqueue("dpaa2_ptp_wq", WQ_PERCPU, 0);
        if (!priv->dpaa2_ptp_wq) {
                err = -ENOMEM;
                goto err_wq_alloc;
index f5457ae0b64f1cc247469af3a54214b8557637c0..9d34d28ff168a21f6be8164f9c8ae90a859c3142 100644 (file)
@@ -12912,7 +12912,8 @@ static int __init hclge_init(void)
 {
        pr_debug("%s is initializing\n", HCLGE_NAME);
 
-       hclge_wq = alloc_workqueue("%s", WQ_UNBOUND, 0, HCLGE_NAME);
+       hclge_wq = alloc_workqueue("%s", WQ_UNBOUND, 0,
+                                  HCLGE_NAME);
        if (!hclge_wq) {
                pr_err("%s: failed to create workqueue\n", HCLGE_NAME);
                return -ENOMEM;
index 142f07ca8bc08c5e8ee00e7ab502f7b235e3446e..b8c15b837fda36494fa8daa8b8a220e781b23c1e 100644 (file)
@@ -37,7 +37,7 @@ static int __init fm10k_init_module(void)
        pr_info("%s\n", fm10k_copyright);
 
        /* create driver workqueue */
-       fm10k_workqueue = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0,
+       fm10k_workqueue = alloc_workqueue("%s", WQ_MEM_RECLAIM | WQ_PERCPU, 0,
                                          fm10k_driver_name);
        if (!fm10k_workqueue)
                return -ENOMEM;
index b14019d44b58118fa69ce191b7d3c0fb2b6b2598..02fccdbbc288c31ddab7c4bde74360b61d484287 100644 (file)
@@ -16617,7 +16617,7 @@ static int __init i40e_init_module(void)
         * since we need to be able to guarantee forward progress even under
         * memory pressure.
         */
-       i40e_wq = alloc_workqueue("%s", 0, 0, i40e_driver_name);
+       i40e_wq = alloc_workqueue("%s", WQ_PERCPU, 0, i40e_driver_name);
        if (!i40e_wq) {
                pr_err("%s: Failed to create workqueue\n", i40e_driver_name);
                return -ENOMEM;
index 0c46ba8a5adc8f5e7feab056d01dc9d2b3c9e251..ca1343f43379394ff6afaddee24c5f5fb76c6229 100644 (file)
@@ -2005,7 +2005,7 @@ static int cgx_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
        /* init wq for processing linkup requests */
        INIT_WORK(&cgx->cgx_cmd_work, cgx_lmac_linkup_work);
-       cgx->cgx_cmd_workq = alloc_workqueue("cgx_cmd_workq", 0, 0);
+       cgx->cgx_cmd_workq = alloc_workqueue("cgx_cmd_workq", WQ_PERCPU, 0);
        if (!cgx->cgx_cmd_workq) {
                dev_err(dev, "alloc workqueue failed for cgx cmd");
                err = -ENOMEM;
index d7030dfa5dad242e797c0e4fdeacd79da5ec588c..a80c8e7c94f28b48bd94c6abe1eeeca84a465349 100644 (file)
@@ -913,7 +913,7 @@ int rvu_mcs_init(struct rvu *rvu)
        /* Initialize the wq for handling mcs interrupts */
        INIT_LIST_HEAD(&rvu->mcs_intrq_head);
        INIT_WORK(&rvu->mcs_intr_work, mcs_intr_handler_task);
-       rvu->mcs_intr_wq = alloc_workqueue("mcs_intr_wq", 0, 0);
+       rvu->mcs_intr_wq = alloc_workqueue("mcs_intr_wq", WQ_PERCPU, 0);
        if (!rvu->mcs_intr_wq) {
                dev_err(rvu->dev, "mcs alloc workqueue failed\n");
                return -ENOMEM;
index 3303c475414a609e232ff3e2e1a8d555eaeeff70..3abd750a4bd741fe97b044d45b100eba6debf163 100644 (file)
@@ -315,7 +315,7 @@ static int cgx_lmac_event_handler_init(struct rvu *rvu)
        spin_lock_init(&rvu->cgx_evq_lock);
        INIT_LIST_HEAD(&rvu->cgx_evq_head);
        INIT_WORK(&rvu->cgx_evh_work, cgx_evhandler_task);
-       rvu->cgx_evh_wq = alloc_workqueue("rvu_evh_wq", 0, 0);
+       rvu->cgx_evh_wq = alloc_workqueue("rvu_evh_wq", WQ_PERCPU, 0);
        if (!rvu->cgx_evh_wq) {
                dev_err(rvu->dev, "alloc workqueue failed");
                return -ENOMEM;
index 03099bc570bd502f499fb9fd8b070b18a7d29c70..4415d0ce9aef4ead1c5aa35f563c02dcff255299 100644 (file)
@@ -376,7 +376,7 @@ int rvu_rep_install_mcam_rules(struct rvu *rvu)
        spin_lock_init(&rvu->rep_evtq_lock);
        INIT_LIST_HEAD(&rvu->rep_evtq_head);
        INIT_WORK(&rvu->rep_evt_work, rvu_rep_wq_handler);
-       rvu->rep_evt_wq = alloc_workqueue("rep_evt_wq", 0, 0);
+       rvu->rep_evt_wq = alloc_workqueue("rep_evt_wq", WQ_PERCPU, 0);
        if (!rvu->rep_evt_wq) {
                dev_err(rvu->dev, "REP workqueue allocation failed\n");
                return -ENOMEM;
index c691f072215400067d52aff0fdca97534f633c0c..77543d472345e44d6efc9db02745bf7d11152ba3 100644 (file)
@@ -798,7 +798,8 @@ int cn10k_ipsec_init(struct net_device *netdev)
        pf->ipsec.sa_size = sa_size;
 
        INIT_WORK(&pf->ipsec.sa_work, cn10k_ipsec_sa_wq_handler);
-       pf->ipsec.sa_workq = alloc_workqueue("cn10k_ipsec_sa_workq", 0, 0);
+       pf->ipsec.sa_workq = alloc_workqueue("cn10k_ipsec_sa_workq",
+                                            WQ_PERCPU, 0);
        if (!pf->ipsec.sa_workq) {
                netdev_err(pf->netdev, "SA alloc workqueue failed\n");
                return -ENOMEM;
index 71ffb55d1fc4871d06cd08c5424a45d8a1df79cb..65e7ef033bde5a7422d7ce8dcf4889214473872a 100644 (file)
@@ -1500,7 +1500,7 @@ EXPORT_SYMBOL(prestera_device_unregister);
 
 static int __init prestera_module_init(void)
 {
-       prestera_wq = alloc_workqueue("prestera", 0, 0);
+       prestera_wq = alloc_workqueue("prestera", WQ_PERCPU, 0);
        if (!prestera_wq)
                return -ENOMEM;
 
index c45d108b2f6da808dc7de2964b9d581cf862bb47..3e13322470da60a7cde18fbbcee7bca8f8874ee4 100644 (file)
@@ -898,7 +898,7 @@ static int prestera_pci_probe(struct pci_dev *pdev,
 
        dev_info(fw->dev.dev, "Prestera FW is ready\n");
 
-       fw->wq = alloc_workqueue("prestera_fw_wq", WQ_HIGHPRI, 1);
+       fw->wq = alloc_workqueue("prestera_fw_wq", WQ_HIGHPRI | WQ_PERCPU, 1);
        if (!fw->wq) {
                err = -ENOMEM;
                goto err_wq_alloc;
index 980f3223f124b3578167fd229f04148a76a71cc6..83c7cf3bbea3a97ad6c2a973be50e40ee70712b9 100644 (file)
@@ -886,7 +886,7 @@ static int mlxsw_emad_init(struct mlxsw_core *mlxsw_core)
        if (!(mlxsw_core->bus->features & MLXSW_BUS_F_TXRX))
                return 0;
 
-       emad_wq = alloc_workqueue("mlxsw_core_emad", 0, 0);
+       emad_wq = alloc_workqueue("mlxsw_core_emad", WQ_PERCPU, 0);
        if (!emad_wq)
                return -ENOMEM;
        mlxsw_core->emad_wq = emad_wq;
@@ -3381,7 +3381,7 @@ static int __init mlxsw_core_module_init(void)
        if (err)
                return err;
 
-       mlxsw_wq = alloc_workqueue(mlxsw_core_driver_name, 0, 0);
+       mlxsw_wq = alloc_workqueue(mlxsw_core_driver_name, WQ_PERCPU, 0);
        if (!mlxsw_wq) {
                err = -ENOMEM;
                goto err_alloc_workqueue;
index 71301dbd8fb5ee462a29c04ac215f91712816b16..48390b2fd44db8e07cd5804e7bed2b03b36f7379 100644 (file)
@@ -797,7 +797,7 @@ static int nfp_pci_probe(struct pci_dev *pdev,
        pf->pdev = pdev;
        pf->dev_info = dev_info;
 
-       pf->wq = alloc_workqueue("nfp-%s", 0, 2, pci_name(pdev));
+       pf->wq = alloc_workqueue("nfp-%s", WQ_PERCPU, 2, pci_name(pdev));
        if (!pf->wq) {
                err = -ENOMEM;
                goto err_pci_priv_unset;
index 886061d7351a1fd47d03ff972ff496069fd7c9aa..d4685ad4b16914112888cfce1a9aa8cfdbf64222 100644 (file)
@@ -1214,7 +1214,8 @@ static int qed_slowpath_wq_start(struct qed_dev *cdev)
                hwfn = &cdev->hwfns[i];
 
                hwfn->slowpath_wq = alloc_workqueue("slowpath-%02x:%02x.%02x",
-                                        0, 0, cdev->pdev->bus->number,
+                                        WQ_PERCPU, 0,
+                                        cdev->pdev->bus->number,
                                         PCI_SLOT(cdev->pdev->devfn),
                                         hwfn->abs_pf_id);
 
index b77f096eaf99512624b1d471495eb8dc7e0f8bbf..c5424d8821359a465e030ab9c592a42770308bc7 100644 (file)
@@ -1142,7 +1142,7 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,
        if (err < 0)
                goto err_register;
 
-       priv->xfer_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0,
+       priv->xfer_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM | WQ_PERCPU, 0,
                                        netdev_name(ndev));
        if (!priv->xfer_wq) {
                err = -ENOMEM;
index 4a4ed2ccf72ff2f13359e53fa176496237451a44..b63965d9a1bab80ea0560e78f7cbf815f9f6d401 100644 (file)
@@ -1364,14 +1364,15 @@ static int fjes_probe(struct platform_device *plat_dev)
        adapter->force_reset = false;
        adapter->open_guard = false;
 
-       adapter->txrx_wq = alloc_workqueue(DRV_NAME "/txrx", WQ_MEM_RECLAIM, 0);
+       adapter->txrx_wq = alloc_workqueue(DRV_NAME "/txrx",
+                                          WQ_MEM_RECLAIM | WQ_PERCPU, 0);
        if (unlikely(!adapter->txrx_wq)) {
                err = -ENOMEM;
                goto err_free_netdev;
        }
 
        adapter->control_wq = alloc_workqueue(DRV_NAME "/control",
-                                             WQ_MEM_RECLAIM, 0);
+                                             WQ_MEM_RECLAIM | WQ_PERCPU, 0);
        if (unlikely(!adapter->control_wq)) {
                err = -ENOMEM;
                goto err_free_txrx_wq;
index 813bd10d3dc7858b84088e81712c6e2f0ed5cf53..46a71ec36af870cc02a4f3d66fcb60a46f12e53e 100644 (file)
@@ -333,7 +333,8 @@ static int wg_newlink(struct net_device *dev,
                goto err_free_peer_hashtable;
 
        wg->handshake_receive_wq = alloc_workqueue("wg-kex-%s",
-                       WQ_CPU_INTENSIVE | WQ_FREEZABLE, 0, dev->name);
+                       WQ_CPU_INTENSIVE | WQ_FREEZABLE | WQ_PERCPU, 0,
+                       dev->name);
        if (!wg->handshake_receive_wq)
                goto err_free_index_hashtable;
 
@@ -343,7 +344,8 @@ static int wg_newlink(struct net_device *dev,
                goto err_destroy_handshake_receive;
 
        wg->packet_crypt_wq = alloc_workqueue("wg-crypt-%s",
-                       WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, 0, dev->name);
+                       WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM | WQ_PERCPU, 0,
+                       dev->name);
        if (!wg->packet_crypt_wq)
                goto err_destroy_handshake_send;
 
index 6a7a26085fc704bd32a4d4e03e24771b3e291131..2310493203d3c7e34f03d58f67951798a394b024 100644 (file)
@@ -1085,7 +1085,8 @@ static void t7xx_dpmaif_bat_release_work(struct work_struct *work)
 int t7xx_dpmaif_bat_rel_wq_alloc(struct dpmaif_ctrl *dpmaif_ctrl)
 {
        dpmaif_ctrl->bat_release_wq = alloc_workqueue("dpmaif_bat_release_work_queue",
-                                                     WQ_MEM_RECLAIM, 1);
+                                                     WQ_MEM_RECLAIM | WQ_PERCPU,
+                                                     1);
        if (!dpmaif_ctrl->bat_release_wq)
                return -ENOMEM;
 
index b02befd1b6fb86e515e08e476f2b58eb6e5afb6a..733688cd4607c245b1943996af506d81883ccd8a 100644 (file)
@@ -509,7 +509,7 @@ static int __init wwan_hwsim_init(void)
        if (wwan_hwsim_devsnum < 0 || wwan_hwsim_devsnum > 128)
                return -EINVAL;
 
-       wwan_wq = alloc_workqueue("wwan_wq", 0, 0);
+       wwan_wq = alloc_workqueue("wwan_wq", WQ_PERCPU, 0);
        if (!wwan_wq)
                return -ENOMEM;
 
index 9f6d860411cbd114c26332e78fb7e46bfedb6add..1fbec4853f001d85cea4da868d52b824d457cc3e 100644 (file)
@@ -252,7 +252,8 @@ int __init ceph_msgr_init(void)
         * The number of active work items is limited by the number of
         * connections, so leave @max_active at default.
         */
-       ceph_msgr_wq = alloc_workqueue("ceph-msgr", WQ_MEM_RECLAIM, 0);
+       ceph_msgr_wq = alloc_workqueue("ceph-msgr",
+                                      WQ_MEM_RECLAIM | WQ_PERCPU, 0);
        if (ceph_msgr_wq)
                return 0;
 
index b23594c767f2eaba8f006560231ac9f0d72ce3fe..026ce9bd9e5e63efd98a8303df53c6fb443044d8 100644 (file)
@@ -348,7 +348,7 @@ static struct pernet_operations diag_net_ops = {
 
 static int __init sock_diag_init(void)
 {
-       broadcast_wq = alloc_workqueue("sock_diag_events", 0, 0);
+       broadcast_wq = alloc_workqueue("sock_diag_events", WQ_PERCPU, 0);
        BUG_ON(!broadcast_wq);
        return register_pernet_subsys(&diag_net_ops);
 }
index d1cfceeff133e2b909db74f8bcd79f4e9e15959c..6585164c705953fb55d3e2eee80ce71d759e02e4 100644 (file)
@@ -672,7 +672,8 @@ struct rds_ib_mr_pool *rds_ib_create_mr_pool(struct rds_ib_device *rds_ibdev,
 
 int rds_ib_mr_init(void)
 {
-       rds_ib_mr_wq = alloc_workqueue("rds_mr_flushd", WQ_MEM_RECLAIM, 0);
+       rds_ib_mr_wq = alloc_workqueue("rds_mr_flushd",
+                                      WQ_MEM_RECLAIM | WQ_PERCPU, 0);
        if (!rds_ib_mr_wq)
                return -ENOMEM;
        return 0;
index 0377301156b093dad288f87d3c57dedbf1c09aa6..2ea71e3831f75d588b9071103c8fa863c4ed7c51 100644 (file)
@@ -630,7 +630,7 @@ static int __init rxperf_init(void)
 
        pr_info("Server registering\n");
 
-       rxperf_workqueue = alloc_workqueue("rxperf", 0, 0);
+       rxperf_workqueue = alloc_workqueue("rxperf", WQ_PERCPU, 0);
        if (!rxperf_workqueue)
                goto error_workqueue;
 
index a7187e5873ec6d8eb9a8540b61e01313fcdcab82..9097e4f24d2b314bb86ebf6b5280595371a8a7f2 100644 (file)
@@ -3535,15 +3535,15 @@ static int __init smc_init(void)
 
        rc = -ENOMEM;
 
-       smc_tcp_ls_wq = alloc_workqueue("smc_tcp_ls_wq", 0, 0);
+       smc_tcp_ls_wq = alloc_workqueue("smc_tcp_ls_wq", WQ_PERCPU, 0);
        if (!smc_tcp_ls_wq)
                goto out_pnet;
 
-       smc_hs_wq = alloc_workqueue("smc_hs_wq", 0, 0);
+       smc_hs_wq = alloc_workqueue("smc_hs_wq", WQ_PERCPU, 0);
        if (!smc_hs_wq)
                goto out_alloc_tcp_ls_wq;
 
-       smc_close_wq = alloc_workqueue("smc_close_wq", 0, 0);
+       smc_close_wq = alloc_workqueue("smc_close_wq", WQ_PERCPU, 0);
        if (!smc_close_wq)
                goto out_alloc_hs_wq;
 
index e216d237865b036fef7314e95883ab000e65c8de..a9e80f44307d63e0aa296128c6bded7f45c6ac92 100644 (file)
@@ -896,7 +896,7 @@ static int smc_lgr_create(struct smc_sock *smc, struct smc_init_info *ini)
                rc = SMC_CLC_DECL_MEM;
                goto ism_put_vlan;
        }
-       lgr->tx_wq = alloc_workqueue("smc_tx_wq-%*phN", 0, 0,
+       lgr->tx_wq = alloc_workqueue("smc_tx_wq-%*phN", WQ_PERCPU, 0,
                                     SMC_LGR_ID_SIZE, &lgr->id);
        if (!lgr->tx_wq) {
                rc = -ENOMEM;
index a82fdcf199690fae5dc63cb100fa5e43c04271dd..a64ae15b1a60d4065cd2b4def9e28839e759445a 100644 (file)
@@ -1412,7 +1412,7 @@ int __init tls_device_init(void)
        if (!dummy_page)
                return -ENOMEM;
 
-       destruct_wq = alloc_workqueue("ktls_device_destruct", 0, 0);
+       destruct_wq = alloc_workqueue("ktls_device_destruct", WQ_PERCPU, 0);
        if (!destruct_wq) {
                err = -ENOMEM;
                goto err_free_dummy;
index b6569b0ca2bb765446b57767ebb7371e3e83d80d..8c867023a2e523b4a788a311e1fd8b6b2e33588b 100644 (file)
@@ -926,7 +926,7 @@ static int __init virtio_vsock_init(void)
 {
        int ret;
 
-       virtio_vsock_workqueue = alloc_workqueue("virtio_vsock", 0, 0);
+       virtio_vsock_workqueue = alloc_workqueue("virtio_vsock", WQ_PERCPU, 0);
        if (!virtio_vsock_workqueue)
                return -ENOMEM;
 
index 6e78927a598e07cf77386a420b9d05d3f491dc7c..bc2ff918b315e0faef86ec4a11dc20cfa40ee4f9 100644 (file)
@@ -139,7 +139,7 @@ static int __init vsock_loopback_init(void)
        struct vsock_loopback *vsock = &the_vsock_loopback;
        int ret;
 
-       vsock->workqueue = alloc_workqueue("vsock-loopback", 0, 0);
+       vsock->workqueue = alloc_workqueue("vsock-loopback", WQ_PERCPU, 0);
        if (!vsock->workqueue)
                return -ENOMEM;