Skip to contentSkip to conversation

scsi: iscsi: register sysfs for workqueue iscsi_destroy

PATCH Applied Bob Liu 4 participants 5 messages Jul 3, 2020 – Jul 8, 2020

Subsystems (2)
lore
Share & tools
lore

Bob Liu

author
#0 lore raw

PATCH 1/1 scsi: iscsi: register sysfs for workqueue iscsi_destroy

Register sysfs for workqueue iscsi_destroy, so that users can set cpu affinity through "cpumask" for this workqueue to get better isolation in cloud multi-tenant scenario.

This patch unfolded create_singlethread_workqueue(), added WQ_SYSFS and drop __WQ_ORDERED_EXPLICIT since __WQ_ORDERED_EXPLICIT workqueue isn't allowed to change "cpumask".

---
 drivers/scsi/scsi_transport_iscsi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/scsi_transport_iscsi.c +3 -1
index 7ae5024..aa8d4a3 100644
@@ -4766,7 +4766,9 @@ static __init int iscsi_transport_init(void)
 		goto release_nls;
 	}
 
-	iscsi_destroy_workq = create_singlethread_workqueue("iscsi_destroy");
+	iscsi_destroy_workq = alloc_workqueue("%s",
+			WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
+			1, "iscsi_destroy");
 	if (!iscsi_destroy_workq) {
 		err = -ENOMEM;
 		goto destroy_wq;
Signature · 1 line
2.9.5
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 20 lines · Bob Liu

Register sysfs for workqueue iscsi_destroy, so that users can set cpu affinity through "cpumask" for this workqueue to get better isolation in cloud multi-tenant scenario.

This patch unfolded create_singlethread_workqueue(), added WQ_SYSFS and drop __WQ_ORDERED_EXPLICIT since __WQ_ORDERED_EXPLICIT workqueue isn't allowed to change "cpumask".

---
 drivers/scsi/scsi_transport_iscsi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/scsi_transport_iscsi.c +0 -0
index 7ae5024..aa8d4a3 100644

drivers/scsi/scsi_transport_iscsi.c static __init int iscsi_transport_init(void) · line 4774

Quoted 10 lines
drivers/scsi/scsi_transport_iscsi.c +3 -1
@@ -4766,7 +4766,9 @@ static __init int iscsi_transport_init(void)
 		goto release_nls;
 	}
 
-	iscsi_destroy_workq = create_singlethread_workqueue("iscsi_destroy");
+	iscsi_destroy_workq = alloc_workqueue("%s",
+			WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
+			1, "iscsi_destroy");
 	if (!iscsi_destroy_workq) {
 		err = -ENOMEM;
 		goto destroy_wq;
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Bob Liu
Quoted 20 lines · Bob Liu

Register sysfs for workqueue iscsi_destroy, so that users can set cpu affinity through "cpumask" for this workqueue to get better isolation in cloud multi-tenant scenario.

This patch unfolded create_singlethread_workqueue(), added WQ_SYSFS and drop __WQ_ORDERED_EXPLICIT since __WQ_ORDERED_EXPLICIT workqueue isn't allowed to change "cpumask".

---
  drivers/scsi/scsi_transport_iscsi.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/scsi_transport_iscsi.c +0 -0
index 7ae5024..aa8d4a3 100644

drivers/scsi/scsi_transport_iscsi.c static __init int iscsi_transport_init(void) · line 4774

Quoted 10 lines
drivers/scsi/scsi_transport_iscsi.c +3 -1
@@ -4766,7 +4766,9 @@ static __init int iscsi_transport_init(void)
  		goto release_nls;
  	}
 
-	iscsi_destroy_workq = create_singlethread_workqueue("iscsi_destroy");
+	iscsi_destroy_workq = alloc_workqueue("%s",
+			WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
+			1, "iscsi_destroy");
  	if (!iscsi_destroy_workq) {
  		err = -ENOMEM;
  		goto destroy_wq;
maintainer Reviewed-by
#3 lore raw
Quoted 29 lines · Mike Christie
Quoted 28 lines · Bob Liu

Register sysfs for workqueue iscsi_destroy, so that users can set cpu affinity
through "cpumask" for this workqueue to get better isolation in cloud multi-tenant scenario.

This patch unfolded create_singlethread_workqueue(), added WQ_SYSFS and drop
__WQ_ORDERED_EXPLICIT since __WQ_ORDERED_EXPLICIT workqueue isn't allowed to
change "cpumask".

---
  drivers/scsi/scsi_transport_iscsi.c | 4 +++-

  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/scsi_transport_iscsi.c +0 -0
index 7ae5024..aa8d4a3 100644
@@ -4766,7 +4766,9 @@ static __init int iscsi_transport_init(void)
           goto release_nls;
       }

  -    iscsi_destroy_workq =
create_singlethread_workqueue("iscsi_destroy");
+    iscsi_destroy_workq = alloc_workqueue("%s",

Quoted 9 lines
Quoted 6 lines

+            WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND, +            1, "iscsi_destroy");
      if (!iscsi_destroy_workq) {
          err = -ENOMEM;
          goto destroy_wq;

#4 lore raw
In reply to Bob Liu
Quoted 7 lines · Bob Liu

Register sysfs for workqueue iscsi_destroy, so that users can set cpu affinity through "cpumask" for this workqueue to get better isolation in cloud multi-tenant scenario.

This patch unfolded create_singlethread_workqueue(), added WQ_SYSFS and drop __WQ_ORDERED_EXPLICIT since __WQ_ORDERED_EXPLICIT workqueue isn't allowed to change "cpumask".

Applied to 5.9/scsi-queue, thanks!

[1/1] scsi: iscsi: Register sysfs for workqueue iscsi_destroy

      https://git.kernel.org/mkp/scsi/c/919a295abf96
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering