mirror of
https://github.com/SCST-project/scst.git
synced 2026-07-19 14:32:30 +00:00
scst: annotate workqueues for WQ_PERCPU / WQ_UNBOUND
Upstream workqueue changes introduce a new WQ_PERCPU flag and plan to switch alloc_workqueue()'s default from per-CPU to unbound To kepp SCST behaviour unchanged across kernels, this patch makes all alloc_workqueue() users explicit about whether they want per-CPU or unbound queues.
This commit is contained in:
@@ -138,7 +138,11 @@ int isert_global_init(void)
|
||||
spin_lock_init(&isert_glob.portal_lock);
|
||||
init_waitqueue_head(&isert_glob.portal_wq);
|
||||
|
||||
isert_glob.conn_wq = alloc_workqueue("isert_conn_wq", 0, 1);
|
||||
isert_glob.conn_wq = alloc_workqueue("isert_conn_wq", 0
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 19, 0)
|
||||
| WQ_PERCPU
|
||||
#endif
|
||||
, 1);
|
||||
if (!isert_glob.conn_wq) {
|
||||
PRINT_ERROR("Failed to alloc iser conn work queue");
|
||||
return -ENOMEM;
|
||||
@@ -164,7 +168,6 @@ free_cmnd_cache:
|
||||
|
||||
free_wq:
|
||||
destroy_workqueue(isert_glob.conn_wq);
|
||||
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
@@ -973,8 +973,11 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)
|
||||
cq_desc->idx = i;
|
||||
INIT_WORK(&cq_desc->cq_comp_work, isert_cq_comp_work_cb);
|
||||
|
||||
cq_desc->cq_workqueue = alloc_workqueue("isert_cq_%p",
|
||||
WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, 1,
|
||||
cq_desc->cq_workqueue = alloc_workqueue("isert_cq_%p", 0
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 19, 0)
|
||||
| WQ_PERCPU
|
||||
#endif
|
||||
| WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, 1,
|
||||
cq_desc);
|
||||
if (unlikely(!cq_desc->cq_workqueue)) {
|
||||
PRINT_ERROR("Failed to alloc iser cq work queue for dev:%s",
|
||||
|
||||
@@ -3508,7 +3508,11 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
"req->req_q_in=%p req->req_q_out=%p rsp->rsp_q_in=%p rsp->rsp_q_out=%p.\n",
|
||||
req->req_q_in, req->req_q_out, rsp->rsp_q_in, rsp->rsp_q_out);
|
||||
|
||||
ha->wq = alloc_workqueue("qla2xxx_wq", WQ_MEM_RECLAIM, 0);
|
||||
ha->wq = alloc_workqueue("qla2xxx_wq", 0
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 19, 0)
|
||||
| WQ_PERCPU
|
||||
#endif
|
||||
| WQ_MEM_RECLAIM, 0);
|
||||
if (unlikely(!ha->wq)) {
|
||||
ret = -ENOMEM;
|
||||
goto probe_failed;
|
||||
|
||||
+5
-1
@@ -468,7 +468,11 @@ static int qla25xx_setup_mode(struct scsi_qla_host *vha)
|
||||
"Failed to create request queue.\n");
|
||||
goto fail;
|
||||
}
|
||||
ha->wq = alloc_workqueue("qla2xxx_wq", WQ_MEM_RECLAIM, 1);
|
||||
ha->wq = alloc_workqueue("qla2xxx_wq", 0
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 19, 0)
|
||||
| WQ_PERCPU
|
||||
#endif
|
||||
| WQ_MEM_RECLAIM, 1);
|
||||
vha->req = ha->req_q_map[req];
|
||||
options |= BIT_1;
|
||||
for (ques = 1; ques < ha->max_rsp_queues; ques++) {
|
||||
|
||||
@@ -1082,7 +1082,9 @@ int scst_event_init(void)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
scst_event_wq = alloc_workqueue("scst_event_wq", 0, 0);
|
||||
scst_event_wq = alloc_workqueue("scst_event_wq", 0
|
||||
| WQ_UNBOUND,
|
||||
0);
|
||||
if (unlikely(!scst_event_wq)) {
|
||||
PRINT_ERROR("Failed to allocate scst_event_wq");
|
||||
res = -ENOMEM;
|
||||
|
||||
+3
-1
@@ -15747,7 +15747,9 @@ int __init scst_lib_init(void)
|
||||
|
||||
scst_scsi_op_list_init();
|
||||
|
||||
scst_release_acg_wq = alloc_workqueue("scst_release_acg", 0, 1);
|
||||
scst_release_acg_wq = alloc_workqueue("scst_release_acg", 0
|
||||
| WQ_UNBOUND,
|
||||
0);
|
||||
if (unlikely(!scst_release_acg_wq)) {
|
||||
PRINT_ERROR("Failed to allocate scst_release_acg_wq");
|
||||
res = -ENOMEM;
|
||||
|
||||
+5
-1
@@ -4562,7 +4562,11 @@ static int __init srpt_init_module(void)
|
||||
goto out;
|
||||
}
|
||||
|
||||
srpt_wq = alloc_workqueue("srpt", WQ_SYSFS, 0);
|
||||
srpt_wq = alloc_workqueue("srpt", 0
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 19, 0)
|
||||
| WQ_PERCPU
|
||||
#endif
|
||||
| WQ_SYSFS, 0);
|
||||
if (!srpt_wq) {
|
||||
pr_err("Couldn't allocate the ib_srpt workqueue\n");
|
||||
ret = -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user