linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC RESEND PATCH v2] scsi: iscsi: register sysfs for iscsi workqueue
@ 2020-05-05  1:19 Bob Liu
  2020-05-15  0:09 ` Martin K. Petersen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Bob Liu @ 2020-05-05  1:19 UTC (permalink / raw)
  To: open-iscsi; +Cc: lduncan, cleech, jejb, martin.petersen, linux-scsi, Bob Liu

Motivation:
This patch enable setting cpu affinity through "cpumask" for iscsi workqueues
(iscsi_q_xx and iscsi_eh), so as to get performance isolation.

The max number of active worker was changed form 1 to 2, because "cpumask" of
ordered workqueue isn't allowed to change.

Notes:
- Having 2 workers break the current ordering guarantees, please let me know
  if anyone depends on this.

- __WQ_LEGACY have to be left because of
23d11a5(workqueue: skip flush dependency checks for legacy workqueues)

Signed-off-by: Bob Liu <bob.liu@oracle.com>
---
 drivers/scsi/libiscsi.c             | 4 +++-
 drivers/scsi/scsi_transport_iscsi.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 70b99c0..adf9bb4 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -2627,7 +2627,9 @@ struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht,
 	if (xmit_can_sleep) {
 		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_workqueue("%s",
+			WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
+			2, ihost->workq_name);
 		if (!ihost->workq)
 			goto free_host;
 	}
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index dfc726f..bdbc4a2 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -4602,7 +4602,9 @@ static __init int iscsi_transport_init(void)
 		goto unregister_flashnode_bus;
 	}
 
-	iscsi_eh_timer_workq = create_singlethread_workqueue("iscsi_eh");
+	iscsi_eh_timer_workq = alloc_workqueue("%s",
+			WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
+			2, "iscsi_eh");
 	if (!iscsi_eh_timer_workq) {
 		err = -ENOMEM;
 		goto release_nls;
-- 
2.9.5


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

* Re: [RFC RESEND PATCH v2] scsi: iscsi: register sysfs for iscsi workqueue
  2020-05-05  1:19 [RFC RESEND PATCH v2] scsi: iscsi: register sysfs for iscsi workqueue Bob Liu
@ 2020-05-15  0:09 ` Martin K. Petersen
  2020-05-25  9:16 ` Bob Liu
  2020-05-27  2:12 ` Martin K. Petersen
  2 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2020-05-15  0:09 UTC (permalink / raw)
  To: lduncan, cleech; +Cc: open-iscsi, Bob Liu, jejb, martin.petersen, linux-scsi


Chris/Lee: Please review!

> Motivation:
> This patch enable setting cpu affinity through "cpumask" for iscsi workqueues
> (iscsi_q_xx and iscsi_eh), so as to get performance isolation.
>
> The max number of active worker was changed form 1 to 2, because "cpumask" of
> ordered workqueue isn't allowed to change.
>
> Notes:
> - Having 2 workers break the current ordering guarantees, please let me know
>   if anyone depends on this.
>
> - __WQ_LEGACY have to be left because of
> 23d11a5(workqueue: skip flush dependency checks for legacy workqueues)
>
> Signed-off-by: Bob Liu <bob.liu@oracle.com>
> ---
>  drivers/scsi/libiscsi.c             | 4 +++-
>  drivers/scsi/scsi_transport_iscsi.c | 4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
> index 70b99c0..adf9bb4 100644
> --- a/drivers/scsi/libiscsi.c
> +++ b/drivers/scsi/libiscsi.c
> @@ -2627,7 +2627,9 @@ struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht,
>  	if (xmit_can_sleep) {
>  		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_workqueue("%s",
> +			WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
> +			2, ihost->workq_name);
>  		if (!ihost->workq)
>  			goto free_host;
>  	}
> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
> index dfc726f..bdbc4a2 100644
> --- a/drivers/scsi/scsi_transport_iscsi.c
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -4602,7 +4602,9 @@ static __init int iscsi_transport_init(void)
>  		goto unregister_flashnode_bus;
>  	}
>  
> -	iscsi_eh_timer_workq = create_singlethread_workqueue("iscsi_eh");
> +	iscsi_eh_timer_workq = alloc_workqueue("%s",
> +			WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
> +			2, "iscsi_eh");
>  	if (!iscsi_eh_timer_workq) {
>  		err = -ENOMEM;
>  		goto release_nls;

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [RFC RESEND PATCH v2] scsi: iscsi: register sysfs for iscsi workqueue
  2020-05-05  1:19 [RFC RESEND PATCH v2] scsi: iscsi: register sysfs for iscsi workqueue Bob Liu
  2020-05-15  0:09 ` Martin K. Petersen
@ 2020-05-25  9:16 ` Bob Liu
  2020-05-25 14:28   ` Lee Duncan
  2020-05-27  2:12 ` Martin K. Petersen
  2 siblings, 1 reply; 5+ messages in thread
From: Bob Liu @ 2020-05-25  9:16 UTC (permalink / raw)
  To: open-iscsi; +Cc: lduncan, cleech, jejb, martin.petersen, linux-scsi

friendly ping.

On 5/5/20 9:19 AM, Bob Liu wrote:
> Motivation:
> This patch enable setting cpu affinity through "cpumask" for iscsi workqueues
> (iscsi_q_xx and iscsi_eh), so as to get performance isolation.
> 
> The max number of active worker was changed form 1 to 2, because "cpumask" of
> ordered workqueue isn't allowed to change.
> 
> Notes:
> - Having 2 workers break the current ordering guarantees, please let me know
>   if anyone depends on this.
> 
> - __WQ_LEGACY have to be left because of
> 23d11a5(workqueue: skip flush dependency checks for legacy workqueues)
> 
> Signed-off-by: Bob Liu <bob.liu@oracle.com>
> ---
>  drivers/scsi/libiscsi.c             | 4 +++-
>  drivers/scsi/scsi_transport_iscsi.c | 4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
> index 70b99c0..adf9bb4 100644
> --- a/drivers/scsi/libiscsi.c
> +++ b/drivers/scsi/libiscsi.c
> @@ -2627,7 +2627,9 @@ struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht,
>  	if (xmit_can_sleep) {
>  		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_workqueue("%s",
> +			WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
> +			2, ihost->workq_name);
>  		if (!ihost->workq)
>  			goto free_host;
>  	}
> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
> index dfc726f..bdbc4a2 100644
> --- a/drivers/scsi/scsi_transport_iscsi.c
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -4602,7 +4602,9 @@ static __init int iscsi_transport_init(void)
>  		goto unregister_flashnode_bus;
>  	}
>  
> -	iscsi_eh_timer_workq = create_singlethread_workqueue("iscsi_eh");
> +	iscsi_eh_timer_workq = alloc_workqueue("%s",
> +			WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
> +			2, "iscsi_eh");
>  	if (!iscsi_eh_timer_workq) {
>  		err = -ENOMEM;
>  		goto release_nls;
> 


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

* Re: [RFC RESEND PATCH v2] scsi: iscsi: register sysfs for iscsi workqueue
  2020-05-25  9:16 ` Bob Liu
@ 2020-05-25 14:28   ` Lee Duncan
  0 siblings, 0 replies; 5+ messages in thread
From: Lee Duncan @ 2020-05-25 14:28 UTC (permalink / raw)
  To: Bob Liu, open-iscsi; +Cc: cleech, jejb, martin.petersen, linux-scsi

On 5/25/20 2:16 AM, Bob Liu wrote:
> friendly ping.
> 
> On 5/5/20 9:19 AM, Bob Liu wrote:
>> Motivation:
>> This patch enable setting cpu affinity through "cpumask" for iscsi workqueues
>> (iscsi_q_xx and iscsi_eh), so as to get performance isolation.
>>
>> The max number of active worker was changed form 1 to 2, because "cpumask" of
>> ordered workqueue isn't allowed to change.
>>
>> Notes:
>> - Having 2 workers break the current ordering guarantees, please let me know
>>   if anyone depends on this.
>>
>> - __WQ_LEGACY have to be left because of
>> 23d11a5(workqueue: skip flush dependency checks for legacy workqueues)
>>
>> Signed-off-by: Bob Liu <bob.liu@oracle.com>
>> ---
>>  drivers/scsi/libiscsi.c             | 4 +++-
>>  drivers/scsi/scsi_transport_iscsi.c | 4 +++-
>>  2 files changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
>> index 70b99c0..adf9bb4 100644
>> --- a/drivers/scsi/libiscsi.c
>> +++ b/drivers/scsi/libiscsi.c
>> @@ -2627,7 +2627,9 @@ struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht,
>>  	if (xmit_can_sleep) {
>>  		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_workqueue("%s",
>> +			WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
>> +			2, ihost->workq_name);
>>  		if (!ihost->workq)
>>  			goto free_host;
>>  	}
>> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
>> index dfc726f..bdbc4a2 100644
>> --- a/drivers/scsi/scsi_transport_iscsi.c
>> +++ b/drivers/scsi/scsi_transport_iscsi.c
>> @@ -4602,7 +4602,9 @@ static __init int iscsi_transport_init(void)
>>  		goto unregister_flashnode_bus;
>>  	}
>>  
>> -	iscsi_eh_timer_workq = create_singlethread_workqueue("iscsi_eh");
>> +	iscsi_eh_timer_workq = alloc_workqueue("%s",
>> +			WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
>> +			2, "iscsi_eh");
>>  	if (!iscsi_eh_timer_workq) {
>>  		err = -ENOMEM;
>>  		goto release_nls;
>>
> 

Reviewed-by: Lee Duncan <lduncan@suse.com>

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

* Re: [RFC RESEND PATCH v2] scsi: iscsi: register sysfs for iscsi workqueue
  2020-05-05  1:19 [RFC RESEND PATCH v2] scsi: iscsi: register sysfs for iscsi workqueue Bob Liu
  2020-05-15  0:09 ` Martin K. Petersen
  2020-05-25  9:16 ` Bob Liu
@ 2020-05-27  2:12 ` Martin K. Petersen
  2 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2020-05-27  2:12 UTC (permalink / raw)
  To: open-iscsi, Bob Liu
  Cc: Martin K . Petersen, linux-scsi, jejb, lduncan, cleech

On Tue, 5 May 2020 09:19:08 +0800, Bob Liu wrote:

> Motivation:
> This patch enable setting cpu affinity through "cpumask" for iscsi workqueues
> (iscsi_q_xx and iscsi_eh), so as to get performance isolation.
> 
> The max number of active worker was changed form 1 to 2, because "cpumask" of
> ordered workqueue isn't allowed to change.
> 
> [...]

Applied to 5.8/scsi-queue, thanks!

[1/1] scsi: iscsi: Register sysfs for iscsi workqueue
      https://git.kernel.org/mkp/scsi/c/3ce419662dd4

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2020-05-27  2:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05  1:19 [RFC RESEND PATCH v2] scsi: iscsi: register sysfs for iscsi workqueue Bob Liu
2020-05-15  0:09 ` Martin K. Petersen
2020-05-25  9:16 ` Bob Liu
2020-05-25 14:28   ` Lee Duncan
2020-05-27  2:12 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).