All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 17/20 v1] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API
@ 2015-06-16  5:37 Sreekanth Reddy
  2015-06-18 12:10   ` Joe Lawrence
  2015-06-19 20:46   ` Martin K. Petersen
  0 siblings, 2 replies; 7+ messages in thread
From: Sreekanth Reddy @ 2015-06-16  5:37 UTC (permalink / raw)
  To: jejb, hch, jthumshirn, joe.lawrence
  Cc: martin.petersen, linux-scsi, JBottomley, Sathya.Prakash,
	linux-kernel, Sreekanth Reddy

Created a thread using alloc_ordered_workqueue() API in order to process
the works from firmware Work-queue sequentially instead of
create_singlethread_workqueue() API.

Changes in v1:
    No need to check for backport compatibility in the upstream kernel.
so removing the else section where driver use 
create_singlethread_workqueue() API if alloc_ordered_workqueue() API is
not defined, This else section is not required since in the latest upstream
kernel this alloc_ordered_workqueue() API is always defined.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index b848458..7e5926c 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -8085,8 +8085,8 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	/* event thread */
 	snprintf(ioc->firmware_event_name, sizeof(ioc->firmware_event_name),
 	    "fw_event%d", ioc->id);
-	ioc->firmware_event_thread = create_singlethread_workqueue(
-	    ioc->firmware_event_name);
+	ioc->firmware_event_thread = alloc_ordered_workqueue(
+	    ioc->firmware_event_name, WQ_MEM_RECLAIM);
 	if (!ioc->firmware_event_thread) {
 		pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
 		    ioc->name, __FILE__, __LINE__, __func__);
-- 
2.0.2


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

* Re: [PATCH 17/20 v1] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API
  2015-06-16  5:37 [PATCH 17/20 v1] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API Sreekanth Reddy
@ 2015-06-18 12:10   ` Joe Lawrence
  2015-06-19 20:46   ` Martin K. Petersen
  1 sibling, 0 replies; 7+ messages in thread
From: Joe Lawrence @ 2015-06-18 12:10 UTC (permalink / raw)
  To: Sreekanth Reddy, jejb, hch, jthumshirn
  Cc: martin.petersen, linux-scsi, JBottomley, Sathya.Prakash,
	linux-kernel, Tejun Heo

On 06/16/2015 01:37 AM, Sreekanth Reddy wrote:
> Created a thread using alloc_ordered_workqueue() API in order to process
> the works from firmware Work-queue sequentially instead of
> create_singlethread_workqueue() API.
> 
> Changes in v1:
>     No need to check for backport compatibility in the upstream kernel.
> so removing the else section where driver use 
> create_singlethread_workqueue() API if alloc_ordered_workqueue() API is
> not defined, This else section is not required since in the latest upstream
> kernel this alloc_ordered_workqueue() API is always defined.
> 
> Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
> ---
>  drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> index b848458..7e5926c 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> @@ -8085,8 +8085,8 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  	/* event thread */
>  	snprintf(ioc->firmware_event_name, sizeof(ioc->firmware_event_name),
>  	    "fw_event%d", ioc->id);
> -	ioc->firmware_event_thread = create_singlethread_workqueue(
> -	    ioc->firmware_event_name);
> +	ioc->firmware_event_thread = alloc_ordered_workqueue(
> +	    ioc->firmware_event_name, WQ_MEM_RECLAIM);
>  	if (!ioc->firmware_event_thread) {
>  		pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
>  		    ioc->name, __FILE__, __LINE__, __func__);
> 

Hi Sreekanth,

Is this change still needed after e09c2c2954684 workqueue: apply
__WQ_ORDERED to create_singlethread_workqueue() ?  (3.17+)

In upstream, this change looks cosmetic (unless Tejun has a preference
for one over the other), but maybe converting to alloc_ordered_workqueue
keeps your in house version in closer sync?

Thanks,

-- Joe

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

* Re: [PATCH 17/20 v1] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API
@ 2015-06-18 12:10   ` Joe Lawrence
  0 siblings, 0 replies; 7+ messages in thread
From: Joe Lawrence @ 2015-06-18 12:10 UTC (permalink / raw)
  To: Sreekanth Reddy, jejb, hch, jthumshirn
  Cc: martin.petersen, linux-scsi, JBottomley, Sathya.Prakash,
	linux-kernel, Tejun Heo

On 06/16/2015 01:37 AM, Sreekanth Reddy wrote:
> Created a thread using alloc_ordered_workqueue() API in order to process
> the works from firmware Work-queue sequentially instead of
> create_singlethread_workqueue() API.
> 
> Changes in v1:
>     No need to check for backport compatibility in the upstream kernel.
> so removing the else section where driver use 
> create_singlethread_workqueue() API if alloc_ordered_workqueue() API is
> not defined, This else section is not required since in the latest upstream
> kernel this alloc_ordered_workqueue() API is always defined.
> 
> Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
> ---
>  drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> index b848458..7e5926c 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> @@ -8085,8 +8085,8 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  	/* event thread */
>  	snprintf(ioc->firmware_event_name, sizeof(ioc->firmware_event_name),
>  	    "fw_event%d", ioc->id);
> -	ioc->firmware_event_thread = create_singlethread_workqueue(
> -	    ioc->firmware_event_name);
> +	ioc->firmware_event_thread = alloc_ordered_workqueue(
> +	    ioc->firmware_event_name, WQ_MEM_RECLAIM);
>  	if (!ioc->firmware_event_thread) {
>  		pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
>  		    ioc->name, __FILE__, __LINE__, __func__);
> 

Hi Sreekanth,

Is this change still needed after e09c2c2954684 workqueue: apply
__WQ_ORDERED to create_singlethread_workqueue() ?  (3.17+)

In upstream, this change looks cosmetic (unless Tejun has a preference
for one over the other), but maybe converting to alloc_ordered_workqueue
keeps your in house version in closer sync?

Thanks,

-- Joe

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

* Re: [PATCH 17/20 v1] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API
  2015-06-18 12:10   ` Joe Lawrence
  (?)
@ 2015-06-18 13:06   ` Sreekanth Reddy
  2015-06-18 21:36     ` Joe Lawrence
  -1 siblings, 1 reply; 7+ messages in thread
From: Sreekanth Reddy @ 2015-06-18 13:06 UTC (permalink / raw)
  To: Joe Lawrence
  Cc: jejb, Christoph Hellwig, Johannes Thumshirn, Martin K. Petersen,
	linux-scsi, James E.J. Bottomley, Sathya Prakash, linux-kernel,
	Tejun Heo

On Thu, Jun 18, 2015 at 5:40 PM, Joe Lawrence <joe.lawrence@stratus.com> wrote:
> On 06/16/2015 01:37 AM, Sreekanth Reddy wrote:
>> Created a thread using alloc_ordered_workqueue() API in order to process
>> the works from firmware Work-queue sequentially instead of
>> create_singlethread_workqueue() API.
>>
>> Changes in v1:
>>     No need to check for backport compatibility in the upstream kernel.
>> so removing the else section where driver use
>> create_singlethread_workqueue() API if alloc_ordered_workqueue() API is
>> not defined, This else section is not required since in the latest upstream
>> kernel this alloc_ordered_workqueue() API is always defined.
>>
>> Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
>> ---
>>  drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
>> index b848458..7e5926c 100644
>> --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
>> +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
>> @@ -8085,8 +8085,8 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>>       /* event thread */
>>       snprintf(ioc->firmware_event_name, sizeof(ioc->firmware_event_name),
>>           "fw_event%d", ioc->id);
>> -     ioc->firmware_event_thread = create_singlethread_workqueue(
>> -         ioc->firmware_event_name);
>> +     ioc->firmware_event_thread = alloc_ordered_workqueue(
>> +         ioc->firmware_event_name, WQ_MEM_RECLAIM);
>>       if (!ioc->firmware_event_thread) {
>>               pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
>>                   ioc->name, __FILE__, __LINE__, __func__);
>>
>
> Hi Sreekanth,
>
> Is this change still needed after e09c2c2954684 workqueue: apply
> __WQ_ORDERED to create_singlethread_workqueue() ?  (3.17+)

I won't say that it is compulsory required, but I feel it is better if
these changes are included. since initially we thought that thread
created by using create_singlethread_workqueue() will process the
works sequentially but in-between  it has broken and then it is fixed
by Tejun.  So I thought it is better to directly use the
alloc_ordered_workqueue() as create_singlethead_workqueue() API also
invoked the same API.

>
> In upstream, this change looks cosmetic (unless Tejun has a preference
> for one over the other), but maybe converting to alloc_ordered_workqueue
> keeps your in house version in closer sync?
>
> Thanks,
>
> -- Joe



-- 

Regards,
Sreekanth

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

* Re: [PATCH 17/20 v1] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API
  2015-06-18 13:06   ` Sreekanth Reddy
@ 2015-06-18 21:36     ` Joe Lawrence
  0 siblings, 0 replies; 7+ messages in thread
From: Joe Lawrence @ 2015-06-18 21:36 UTC (permalink / raw)
  To: Sreekanth Reddy
  Cc: jejb, Christoph Hellwig, Johannes Thumshirn, Martin K. Petersen,
	linux-scsi, James E.J. Bottomley, Sathya Prakash, linux-kernel,
	Tejun Heo

On 06/18/2015 09:06 AM, Sreekanth Reddy wrote:
> On Thu, Jun 18, 2015 at 5:40 PM, Joe Lawrence <joe.lawrence@stratus.com> wrote:
>> On 06/16/2015 01:37 AM, Sreekanth Reddy wrote:
>>> Created a thread using alloc_ordered_workqueue() API in order to process
>>> the works from firmware Work-queue sequentially instead of
>>> create_singlethread_workqueue() API.
>>>
>>> Changes in v1:
>>>     No need to check for backport compatibility in the upstream kernel.
>>> so removing the else section where driver use
>>> create_singlethread_workqueue() API if alloc_ordered_workqueue() API is
>>> not defined, This else section is not required since in the latest upstream
>>> kernel this alloc_ordered_workqueue() API is always defined.
>>>
>>> Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
>>> ---
>>>  drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
>>> index b848458..7e5926c 100644
>>> --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
>>> +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
>>> @@ -8085,8 +8085,8 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>>>       /* event thread */
>>>       snprintf(ioc->firmware_event_name, sizeof(ioc->firmware_event_name),
>>>           "fw_event%d", ioc->id);
>>> -     ioc->firmware_event_thread = create_singlethread_workqueue(
>>> -         ioc->firmware_event_name);
>>> +     ioc->firmware_event_thread = alloc_ordered_workqueue(
>>> +         ioc->firmware_event_name, WQ_MEM_RECLAIM);
>>>       if (!ioc->firmware_event_thread) {
>>>               pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n",
>>>                   ioc->name, __FILE__, __LINE__, __func__);
>>>
>>
>> Hi Sreekanth,
>>
>> Is this change still needed after e09c2c2954684 workqueue: apply
>> __WQ_ORDERED to create_singlethread_workqueue() ?  (3.17+)
> 
> I won't say that it is compulsory required, but I feel it is better if
> these changes are included. since initially we thought that thread
> created by using create_singlethread_workqueue() will process the
> works sequentially but in-between  it has broken and then it is fixed
> by Tejun.  So I thought it is better to directly use the
> alloc_ordered_workqueue() as create_singlethead_workqueue() API also
> invoked the same API.

Ok, I was just wondering if maybe create_singlethread_workqueue was
fixed after this patch was initially written.  Since it's effectively
the same...

Reviewed-by: Joe Lawrence <joe.lawrence@stratus.com>

Regards,

-- Joe

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

* Re: [PATCH 17/20 v1] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API
  2015-06-16  5:37 [PATCH 17/20 v1] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API Sreekanth Reddy
@ 2015-06-19 20:46   ` Martin K. Petersen
  2015-06-19 20:46   ` Martin K. Petersen
  1 sibling, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2015-06-19 20:46 UTC (permalink / raw)
  To: Sreekanth Reddy
  Cc: jejb, hch, jthumshirn, joe.lawrence, martin.petersen, linux-scsi,
	JBottomley, Sathya.Prakash, linux-kernel

>>>>> Sreekanth Reddy <sreekanth.reddy@avagotech.com> writes:

> Created a thread using alloc_ordered_workqueue() API in order to
> process the works from firmware Work-queue sequentially instead of
> create_singlethread_workqueue() API.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH 17/20 v1] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API
@ 2015-06-19 20:46   ` Martin K. Petersen
  0 siblings, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2015-06-19 20:46 UTC (permalink / raw)
  To: Sreekanth Reddy
  Cc: jejb, hch, jthumshirn, joe.lawrence, martin.petersen, linux-scsi,
	JBottomley, Sathya.Prakash, linux-kernel

>>>>> Sreekanth Reddy <sreekanth.reddy@avagotech.com> writes:

> Created a thread using alloc_ordered_workqueue() API in order to
> process the works from firmware Work-queue sequentially instead of
> create_singlethread_workqueue() API.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in

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

end of thread, other threads:[~2015-06-19 20:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-16  5:37 [PATCH 17/20 v1] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API Sreekanth Reddy
2015-06-18 12:10 ` Joe Lawrence
2015-06-18 12:10   ` Joe Lawrence
2015-06-18 13:06   ` Sreekanth Reddy
2015-06-18 21:36     ` Joe Lawrence
2015-06-19 20:46 ` Martin K. Petersen
2015-06-19 20:46   ` Martin K. Petersen

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.