linux/drivers/infiniband/hw/mlx4
Marco Crivellari 5267feda50 RDMA/mlx4: WQ_PERCPU added to alloc_workqueue users
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 to explicitly request
alloc_workqueue() to be per-cpu when WQ_UNBOUND has not been specified.

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.

Once migration is complete, WQ_UNBOUND can be removed and unbound will
become the implicit default.

CC: Yishai Hadas <yishaih@nvidia.com>
Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
Link: https://patch.msgid.link/20251101163121.78400-5-marco.crivellari@suse.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2025-11-06 02:23:23 -05:00
..
Kconfig
Makefile
ah.c
alias_GUID.c RDMA/mlx4: Simplify an alloc_ordered_workqueue() invocation 2024-08-23 11:37:49 -03:00
cm.c RDMA/mlx4: WQ_PERCPU added to alloc_workqueue users 2025-11-06 02:23:23 -05:00
cq.c RDMA/mlx4: Use ib_umem_find_best_pgsz() to calculate MTT size 2024-12-10 04:08:04 -05:00
doorbell.c
mad.c RDMA: Use %pe format specifier for error pointers 2025-09-21 07:34:49 -04:00
main.c RDMA/mlx4: Support report_port_event() ops 2024-12-25 03:39:46 -05:00
mcg.c RDMA: Replace msecs_to_jiffies with secs_to_jiffies for timeout 2025-04-07 15:03:25 -03:00
mlx4_ib.h IB: Extend UVERBS_METHOD_REG_MR to get DMAH 2025-07-23 01:42:11 -04:00
mr.c IB: Extend UVERBS_METHOD_REG_MR to get DMAH 2025-07-23 01:42:11 -04:00
qp.c RDMA: Use %pe format specifier for error pointers 2025-09-21 07:34:49 -04:00
srq.c RDMA/mlx4: remove redundant assignment to variable nreq 2022-02-01 10:55:43 -04:00
sysfs.c IB/mlx4: Fix the size of a buffer in add_port_entries() 2023-09-23 21:53:24 +03:00