From: Gleb C. <lna...@ya...> - 2024-11-07 11:02:35
|
Commit: 61f365f GitHub URL: https://github.com/SCST-project/scst/commit/61f365f96ea36c891a630f045f45c42caf897f58 Author: Gleb Chesnokov Date: 2024-11-07T14:02:05+03:00 Log Message: ----------- scst: Expand all create*_workqueue() invocations The workqueue maintainer wants to remove the create*_workqueue() macros because these macros always set the WQ_MEM_RECLAIM flag and because these only support literal workqueue names. Hence this patch that replaces the create*_workqueue() invocations with the definition of this macro. The WQ_MEM_RECLAIM flag has been retained because I think that flag is necessary for workqueues created by storage drivers. Modified Paths: -------------- iscsi-scst/kernel/isert-scst/iser_rdma.c | 3 +-- qla2x00t-32gbit/qla_os.c | 6 ++++-- scst/src/scst_dlm.c | 2 +- scst_local/scst_local.c | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) =================================================================== diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index c5e30b1..08a7bbe 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -979,8 +979,7 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev) snprintf(wq_name, sizeof(wq_name), "isert_cq_%p", cq_desc); cq_desc->cq_workqueue = alloc_workqueue(wq_name, - WQ_CPU_INTENSIVE| - WQ_MEM_RECLAIM, 1); + WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, 1); if (unlikely(!cq_desc->cq_workqueue)) { PRINT_ERROR("Failed to alloc iser cq work queue for dev:%s", ib_dev->name); diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index 31dc333..5d882ef 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -3568,11 +3568,13 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) if (IS_QLA8031(ha) || IS_MCTP_CAPABLE(ha)) { sprintf(wq_name, "qla2xxx_%lu_dpc_lp_wq", base_vha->host_no); - ha->dpc_lp_wq = create_singlethread_workqueue(wq_name); + ha->dpc_lp_wq = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, wq_name); INIT_WORK(&ha->idc_aen, qla83xx_service_idc_aen); sprintf(wq_name, "qla2xxx_%lu_dpc_hp_wq", base_vha->host_no); - ha->dpc_hp_wq = create_singlethread_workqueue(wq_name); + ha->dpc_hp_wq = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, wq_name); INIT_WORK(&ha->nic_core_reset, qla83xx_nic_core_reset_work); INIT_WORK(&ha->idc_state_handler, qla83xx_idc_state_handler_work); diff --git a/scst/src/scst_dlm.c b/scst/src/scst_dlm.c index 7e634af..4895df4 100644 --- a/scst/src/scst_dlm.c +++ b/scst/src/scst_dlm.c @@ -1480,7 +1480,7 @@ create_st_wq(const char *fmt, ...) name = kvasprintf(GFP_KERNEL, fmt, ap); va_end(ap); if (name) - wq = create_singlethread_workqueue(name); + wq = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, name); kfree(name); return wq; } diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 9021532..0a48c9b 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1791,7 +1791,7 @@ static int __init scst_local_init(void) * We don't expect much work on this queue, so only create a * single thread workqueue rather than one on each core. */ - aen_workqueue = create_singlethread_workqueue("scstlclaen"); + aen_workqueue = alloc_ordered_workqueue("scstlclaen", WQ_MEM_RECLAIM); if (!aen_workqueue) { PRINT_ERROR("%s", "Unable to create scst_local workqueue"); goto tgt_templ_unreg; |