All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch: Make the iscsi lld create a WQ_HIGHPRI workqueue itself
@ 2016-03-28 20:46 Richard Sharpe
  2016-03-28 23:53 ` Mike Christie
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Sharpe @ 2016-03-28 20:46 UTC (permalink / raw)
  To: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 503 bytes --]

Hi folks,

We noticed recently while testing with large numbers of iSCSI
connections that iscsid was going to heroic lengths to change the nice
value of the iSCSI work queue to -20. It becomes very expensive with
hundreds of connections.

This small patch has the LLD do the work,

Feedback welcome.

A small patch will be needed for the user-space tools as well. I will
send one in if someone else does not do so.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)

[-- Attachment #2: 0001-Make-the-iscsi-lld-create-a-WQ_HIGHPRI-workqueue.patch --]
[-- Type: application/octet-stream, Size: 1505 bytes --]

From c0f04a66b29a9190109740c03ee9e65bb62afe28 Mon Sep 17 00:00:00 2001
From: Richard Sharpe <rsharpe@nutanix.com>
Date: Mon, 28 Mar 2016 13:36:18 -0700
Subject: [PATCH] Make the iscsi lld create a WQ_HIGHPRI workqueue.

The open-iscsi tools go to heroic efforts to change the nice value of
the iscsi workqueue to -20. It scans all processes in /proc and
when it finds the one it is interested in calls setpriority.

When you are connecting to a reasonable number of iSCSI targets this
can be costly.

This small patch has the iscsi LLD do the work itself. It seems like
the least intrusive way to acheive the result.

A small patch will be needed in the open-iscsi userspace tools
as well.

Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
---
 drivers/scsi/libiscsi.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 6bffd91..abaefe1 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -2615,9 +2615,11 @@ struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht,
 	ihost = shost_priv(shost);
 
 	if (xmit_can_sleep) {
+		int wq_flags = __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_HIGHPRI;
 		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_ordered_workqueue("%s", wq_flags,
+						ihost->workq_name);
 		if (!ihost->workq)
 			goto free_host;
 	}
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-03-31 16:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-28 20:46 Patch: Make the iscsi lld create a WQ_HIGHPRI workqueue itself Richard Sharpe
2016-03-28 23:53 ` Mike Christie
2016-03-28 23:58   ` Richard Sharpe
2016-03-30 16:04   ` Richard Sharpe
2016-03-31 16:46     ` Richard Sharpe

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.