scsi: core: Register sysfs for SCSI workqueue

Permit scsi_wq_xxx and scsi_tmf_xxx to be bound to different CPUs to get
better isolation.

Use alloc_workqueue with WQ_SYSFS and drop __WQ_ORDERED_EXPLICIT since a
__WQ_ORDERED_EXPLICIT workqueue isn't allowed to change the CPU mask.

Link: https://lore.kernel.org/r/20200701030745.16897-2-bob.liu@oracle.com
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Bob Liu 2020-07-01 11:07:45 +08:00 committed by Martin K. Petersen
parent 3fed58b94e
commit 6292130093

View File

@ -272,8 +272,10 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
if (shost->transportt->create_work_queue) {
snprintf(shost->work_q_name, sizeof(shost->work_q_name),
"scsi_wq_%d", shost->host_no);
shost->work_q = create_singlethread_workqueue(
shost->work_q_name);
shost->work_q = alloc_workqueue("%s",
WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
1, shost->work_q_name);
if (!shost->work_q) {
error = -EINVAL;
goto out_free_shost_data;
@ -487,7 +489,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
}
shost->tmf_work_q = alloc_workqueue("scsi_tmf_%d",
WQ_UNBOUND | WQ_MEM_RECLAIM,
WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS,
1, shost->host_no);
if (!shost->tmf_work_q) {
shost_printk(KERN_WARNING, shost,