]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
scsi: iscsi: Register sysfs for iscsi workqueue
authorBob Liu <bob.liu@oracle.com>
Tue, 5 May 2020 01:19:08 +0000 (09:19 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 26 May 2020 19:40:30 +0000 (15:40 -0400)
This patch enables setting cpu affinity through "cpumask" for iscsi
workqueues (iscsi_q_xx and iscsi_eh), so as to get performance isolation.

The max number of active worker was changed form 1 to 2, because "cpumask"
of ordered workqueue isn't allowed to change.

Link: https://lore.kernel.org/r/20200505011908.15538-1-bob.liu@oracle.com
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libiscsi.c
drivers/scsi/scsi_transport_iscsi.c

index 874dd4beed10431f2ab31e45bfeec66f75b88999..e5a64d4f255cacc3d1795e76af47a4d8c4dfe48a 100644 (file)
@@ -2627,7 +2627,9 @@ struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht,
        if (xmit_can_sleep) {
                snprintf(ihost->workq_name, sizeof(ihost->workq_name),
                        "iscsi_q_%d", shost->host_no);
-               ihost->workq = create_singlethread_workqueue(ihost->workq_name);
+               ihost->workq = alloc_workqueue("%s",
+                       WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
+                       2, ihost->workq_name);
                if (!ihost->workq)
                        goto free_host;
        }
index b2a803c512881eaa8fb33863ad01d53c534d48a8..7bbeb563ab8cee67adddf9f807960dde1f6f3065 100644 (file)
@@ -4728,7 +4728,9 @@ static __init int iscsi_transport_init(void)
                goto unregister_flashnode_bus;
        }
 
-       iscsi_eh_timer_workq = create_singlethread_workqueue("iscsi_eh");
+       iscsi_eh_timer_workq = alloc_workqueue("%s",
+                       WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
+                       2, "iscsi_eh");
        if (!iscsi_eh_timer_workq) {
                err = -ENOMEM;
                goto release_nls;