public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1 linux-next] hpsa: remove set but unused variable rc
@ 2014-10-29 15:15 Fabian Frederick
  2014-10-30  5:55 ` Sudip Mukherjee
  2014-10-30 15:21 ` Don Brace
  0 siblings, 2 replies; 6+ messages in thread
From: Fabian Frederick @ 2014-10-29 15:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: Fabian Frederick, Stephen M. Cameron, James E.J. Bottomley,
	iss_storagedev, linux-scsi

Fix -Wunused-but-set-variable warning

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/scsi/hpsa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index cef5d49..34330e1 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -6619,11 +6619,11 @@ static void hpsa_free_cmd_pool(struct ctlr_info *h)
 
 static void hpsa_irq_affinity_hints(struct ctlr_info *h)
 {
-	int i, cpu, rc;
+	int i, cpu;
 
 	cpu = cpumask_first(cpu_online_mask);
 	for (i = 0; i < h->msix_vector; i++) {
-		rc = irq_set_affinity_hint(h->intr[i], get_cpu_mask(cpu));
+		irq_set_affinity_hint(h->intr[i], get_cpu_mask(cpu));
 		cpu = cpumask_next(cpu, cpu_online_mask);
 	}
 }
-- 
1.9.3

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

* Re: [PATCH 1/1 linux-next] hpsa: remove set but unused variable rc
  2014-10-29 15:15 [PATCH 1/1 linux-next] hpsa: remove set but unused variable rc Fabian Frederick
@ 2014-10-30  5:55 ` Sudip Mukherjee
  2014-10-30  6:28   ` Elliott, Robert (Server Storage)
  2014-10-30 15:21 ` Don Brace
  1 sibling, 1 reply; 6+ messages in thread
From: Sudip Mukherjee @ 2014-10-30  5:55 UTC (permalink / raw)
  To: Fabian Frederick
  Cc: linux-kernel, Stephen M. Cameron, James E.J. Bottomley,
	iss_storagedev, linux-scsi

On Wed, Oct 29, 2014 at 04:15:04PM +0100, Fabian Frederick wrote:
> Fix -Wunused-but-set-variable warning

you should also mention why you have left the call to irq_set_affinity_hint().
i am not sure , but it looks like irq_set_affinity_hint() is only checking if
the lock is available or not. It is just locking ,then if lock is successfull then
returning 0 or if lock fails then return -EINVAL, and unlocks before returnig.
not doing anything else.

thanks
sudip

> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  drivers/scsi/hpsa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index cef5d49..34330e1 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -6619,11 +6619,11 @@ static void hpsa_free_cmd_pool(struct ctlr_info *h)
>  
>  static void hpsa_irq_affinity_hints(struct ctlr_info *h)
>  {
> -	int i, cpu, rc;
> +	int i, cpu;
>  
>  	cpu = cpumask_first(cpu_online_mask);
>  	for (i = 0; i < h->msix_vector; i++) {
> -		rc = irq_set_affinity_hint(h->intr[i], get_cpu_mask(cpu));
> +		irq_set_affinity_hint(h->intr[i], get_cpu_mask(cpu));
>  		cpu = cpumask_next(cpu, cpu_online_mask);
>  	}
>  }
> -- 
> 1.9.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* RE: [PATCH 1/1 linux-next] hpsa: remove set but unused variable rc
  2014-10-30  5:55 ` Sudip Mukherjee
@ 2014-10-30  6:28   ` Elliott, Robert (Server Storage)
  2014-10-30  6:40     ` Sudip Mukherjee
  0 siblings, 1 reply; 6+ messages in thread
From: Elliott, Robert (Server Storage) @ 2014-10-30  6:28 UTC (permalink / raw)
  To: Sudip Mukherjee, Fabian Frederick
  Cc: linux-kernel@vger.kernel.org, Stephen M. Cameron,
	James E.J. Bottomley, iss_storagedev@hp.com,
	linux-scsi@vger.kernel.org



> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
> owner@vger.kernel.org] On Behalf Of Sudip Mukherjee
> Sent: Thursday, October 30, 2014 12:55 AM
> To: Fabian Frederick
> Cc: linux-kernel@vger.kernel.org; Stephen M. Cameron; James E.J.
> Bottomley; iss_storagedev@hp.com; linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 1/1 linux-next] hpsa: remove set but unused variable
> rc
> 
> On Wed, Oct 29, 2014 at 04:15:04PM +0100, Fabian Frederick wrote:
> > Fix -Wunused-but-set-variable warning
> 
> you should also mention why you have left the call to
> irq_set_affinity_hint().
> i am not sure , but it looks like irq_set_affinity_hint() is only
> checking if
> the lock is available or not. It is just locking ,then if lock is
> successfull then
> returning 0 or if lock fails then return -EINVAL, and unlocks before
> returnig.
> not doing anything else.
> 
> thanks
> sudip

No, that function sets a mask value that shows up in 
	/proc/irq/nnn/affinity_hint
that a program like irqbalance may use to set the CPU affinity mask
for each irq via 
	/proc/irq/nnn/smp_affinity   (bitmap format)
	/proc/irq/nnn/smp_affinity_list   (range format)

The reason is that in many cases, it is best when all these occur 
on the same CPU that submitted the IO:
* LLD submission queues (if multiple are supported)
* LDD completion queues
* MSI-X interrupt indicating completion
* LLD completion interrupt handler
* block layer completion handler

Benefits include:
* cache efficiency - the data structures for the IO aren't
pulled from CPU to CPU.

* avoid IPI overhead in the block layer to get the completion 
processed on the submitting CPU (which is done if using 
rq_affinity=2 and the interrupt is routed to on another CPU).

* self-throttle the CPUs - avoid swamping one CPU with 
completion processing for IOs submitted by many other CPUs
(which leads to stalls on the victim and timeouts on the
aggressors).

You must run irqbalance with an option to honor the hints;
some versions default to that, others don't.  Or, disable
the irqbalance service and set them up the affinities
manually.

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

* Re: [PATCH 1/1 linux-next] hpsa: remove set but unused variable rc
  2014-10-30  6:28   ` Elliott, Robert (Server Storage)
@ 2014-10-30  6:40     ` Sudip Mukherjee
  0 siblings, 0 replies; 6+ messages in thread
From: Sudip Mukherjee @ 2014-10-30  6:40 UTC (permalink / raw)
  To: Elliott, Robert (Server Storage)
  Cc: Fabian Frederick, linux-kernel@vger.kernel.org,
	Stephen M. Cameron, James E.J. Bottomley, iss_storagedev@hp.com,
	linux-scsi@vger.kernel.org

On Thu, Oct 30, 2014 at 06:28:13AM +0000, Elliott, Robert (Server Storage) wrote:
> 
> 
> > -----Original Message-----
> > From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
> > owner@vger.kernel.org] On Behalf Of Sudip Mukherjee
> > Sent: Thursday, October 30, 2014 12:55 AM
> > To: Fabian Frederick
> > Cc: linux-kernel@vger.kernel.org; Stephen M. Cameron; James E.J.
> > Bottomley; iss_storagedev@hp.com; linux-scsi@vger.kernel.org
> > Subject: Re: [PATCH 1/1 linux-next] hpsa: remove set but unused variable
> > rc
> > 
> > On Wed, Oct 29, 2014 at 04:15:04PM +0100, Fabian Frederick wrote:
> > > Fix -Wunused-but-set-variable warning
> > 
> > you should also mention why you have left the call to
> > irq_set_affinity_hint().
> > i am not sure , but it looks like irq_set_affinity_hint() is only
> > checking if
> > the lock is available or not. It is just locking ,then if lock is
> > successfull then
> > returning 0 or if lock fails then return -EINVAL, and unlocks before
> > returnig.
> > not doing anything else.
> > 
> > thanks
> > sudip
> 
> No, that function sets a mask value that shows up in 
> 	/proc/irq/nnn/affinity_hint
> that a program like irqbalance may use to set the CPU affinity mask
> for each irq via 
> 	/proc/irq/nnn/smp_affinity   (bitmap format)
> 	/proc/irq/nnn/smp_affinity_list   (range format)
> 
> The reason is that in many cases, it is best when all these occur 
> on the same CPU that submitted the IO:
> * LLD submission queues (if multiple are supported)
> * LDD completion queues
> * MSI-X interrupt indicating completion
> * LLD completion interrupt handler
> * block layer completion handler
> 
> Benefits include:
> * cache efficiency - the data structures for the IO aren't
> pulled from CPU to CPU.
> 
> * avoid IPI overhead in the block layer to get the completion 
> processed on the submitting CPU (which is done if using 
> rq_affinity=2 and the interrupt is routed to on another CPU).
> 
> * self-throttle the CPUs - avoid swamping one CPU with 
> completion processing for IOs submitted by many other CPUs
> (which leads to stalls on the victim and timeouts on the
> aggressors).
> 
> You must run irqbalance with an option to honor the hints;
> some versions default to that, others don't.  Or, disable
> the irqbalance service and set them up the affinities
> manually.
> 
thanks , i think this is happening at desc->affinity_hint = m;

thanks
sudip
> 

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

* Re: [PATCH 1/1 linux-next] hpsa: remove set but unused variable rc
  2014-10-29 15:15 [PATCH 1/1 linux-next] hpsa: remove set but unused variable rc Fabian Frederick
  2014-10-30  5:55 ` Sudip Mukherjee
@ 2014-10-30 15:21 ` Don Brace
  2014-10-30 15:27   ` Christoph Hellwig
  1 sibling, 1 reply; 6+ messages in thread
From: Don Brace @ 2014-10-30 15:21 UTC (permalink / raw)
  To: Fabian Frederick, linux-kernel
  Cc: James E.J. Bottomley, iss_storagedev, linux-scsi, don.brace, hch

On 10/29/2014 10:15 AM, Fabian Frederick wrote:
> Fix -Wunused-but-set-variable warning
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>   drivers/scsi/hpsa.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index cef5d49..34330e1 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -6619,11 +6619,11 @@ static void hpsa_free_cmd_pool(struct ctlr_info *h)
>
>   static void hpsa_irq_affinity_hints(struct ctlr_info *h)
>   {
> -	int i, cpu, rc;
> +	int i, cpu;
>
>   	cpu = cpumask_first(cpu_online_mask);
>   	for (i = 0; i < h->msix_vector; i++) {
> -		rc = irq_set_affinity_hint(h->intr[i], get_cpu_mask(cpu));
> +		irq_set_affinity_hint(h->intr[i], get_cpu_mask(cpu));
>   		cpu = cpumask_next(cpu, cpu_online_mask);
>   	}
>   }
>

I can add this patch to my current set of patches for 3.19 or ack this 
now, What would you prefer?

---
Don Brace
don.brace@pmcs.com

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

* Re: [PATCH 1/1 linux-next] hpsa: remove set but unused variable rc
  2014-10-30 15:21 ` Don Brace
@ 2014-10-30 15:27   ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2014-10-30 15:27 UTC (permalink / raw)
  To: Don Brace
  Cc: Fabian Frederick, linux-kernel, James E.J. Bottomley,
	iss_storagedev, linux-scsi, don.brace, hch

On Thu, Oct 30, 2014 at 10:21:05AM -0500, Don Brace wrote:
> I can add this patch to my current set of patches for 3.19 or ack this now,
> What would you prefer?

Please queue it up, I'm much more interested in reducing the massive
backlog of real hpsa changes than in litte cleanups at the moment.

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

end of thread, other threads:[~2014-10-30 15:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-29 15:15 [PATCH 1/1 linux-next] hpsa: remove set but unused variable rc Fabian Frederick
2014-10-30  5:55 ` Sudip Mukherjee
2014-10-30  6:28   ` Elliott, Robert (Server Storage)
2014-10-30  6:40     ` Sudip Mukherjee
2014-10-30 15:21 ` Don Brace
2014-10-30 15:27   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox