Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Mike Christie <mchristi@redhat.com>
To: Richard Sharpe <realrichardsharpe@gmail.com>,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: Patch: Make the iscsi lld create a WQ_HIGHPRI workqueue itself
Date: Mon, 28 Mar 2016 18:53:17 -0500	[thread overview]
Message-ID: <56F9C3ED.8080704@redhat.com> (raw)
In-Reply-To: <CACyXjPxwz4znmt7g9ptYdpzkfF1Ok7KKJa2ceyKxg00buSfmcA@mail.gmail.com>

On 03/28/2016 03:46 PM, Richard Sharpe wrote:
> 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 (何以解憂?唯有杜康。--曹操)
> 
> 
> 0001-Make-the-iscsi-lld-create-a-WQ_HIGHPRI-workqueue.patch
> 
> 
> 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;


I do not think we need to or are supposed to be setting __WQ_LEGACY. It
looks like it was only to catch the case here

https://lkml.org/lkml/2016/1/29/179



>  		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;
>  	}
> -- 

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-03-28 23:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2016-03-28 23:58   ` Richard Sharpe
2016-03-30 16:04   ` Richard Sharpe
2016-03-31 16:46     ` Richard Sharpe

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=56F9C3ED.8080704@redhat.com \
    --to=mchristi@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=realrichardsharpe@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox