All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Liu <bob.liu@oracle.com>
To: linux-scsi@vger.kernel.org
Cc: martin.petersen@oracle.com, open-iscsi@googlegroups.com,
	lduncan@suse.com, michael.christie@oracle.com,
	Bob Liu <bob.liu@oracle.com>
Subject: [PATCH 2/2] scsi: register sysfs for scsi workqueue
Date: Wed,  1 Jul 2020 11:07:45 +0800	[thread overview]
Message-ID: <20200701030745.16897-2-bob.liu@oracle.com> (raw)
In-Reply-To: <20200701030745.16897-1-bob.liu@oracle.com>

So that scsi_wq_xxx and scsi_tmf_xxx can be bind to different cpu to get better
isolation.

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

Signed-off-by: Bob Liu <bob.liu@oracle.com>
---
 drivers/scsi/hosts.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 7ec91c3..37d1c55 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -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,
-- 
2.9.5


  reply	other threads:[~2020-07-01  3:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01  3:07 [PATCH 1/2] scsi: iscsi: change back iscsi workqueue max_active argu to 1 Bob Liu
2020-07-01  3:07 ` Bob Liu [this message]
2020-07-01 15:39   ` [PATCH 2/2] scsi: register sysfs for scsi workqueue Mike Christie
2020-07-01 15:28 ` [PATCH 1/2] scsi: iscsi: change back iscsi workqueue max_active argu to 1 Mike Christie
2020-07-03  4:02 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200701030745.16897-2-bob.liu@oracle.com \
    --to=bob.liu@oracle.com \
    --cc=lduncan@suse.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --cc=open-iscsi@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.