All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomas Henzl <thenzl@redhat.com>
To: Sumit.Saxena@avagotech.com, linux-scsi@vger.kernel.org
Cc: martin.petersen@oracle.com, hch@infradead.org,
	jbottomley@parallels.com, kashyap.desai@avagotech.com,
	aradford@gmail.com
Subject: Re: [PATCH 08/11] megaraid_sas : Add module parameter to disable IRQ-CPU affinity hint
Date: Wed, 10 Sep 2014 16:16:48 +0200	[thread overview]
Message-ID: <54105D50.1070309@redhat.com> (raw)
In-Reply-To: <201409061328.s86DSAsY013235@palmhbs0.lsi.com>

On 09/06/2014 03:25 PM, Sumit.Saxena@avagotech.com wrote:
> For certain deployment, we may need to disable irq cpu affinity hint.
> This module parameter provides option for use to disable irq cpu affinity hint
> and allow irqbalancer to handle the rest.

Only curious , in which environments causes this which issues?

Thanks,
Tomas

>
> Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
> ---
>  drivers/scsi/megaraid/megaraid_sas_base.c | 60 +++++++++++++++++++------------
>  1 file changed, 38 insertions(+), 22 deletions(-) 
>
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
> index 07255c1..086beee 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -89,6 +89,10 @@ module_param(resetwaittime, int, S_IRUGO);
>  MODULE_PARM_DESC(resetwaittime, "Wait time in seconds after I/O timeout "
>  		 "before resetting adapter. Default: 180");
>  
> +int smp_affinity_enable = 1;
> +module_param(smp_affinity_enable, int, S_IRUGO);
> +MODULE_PARM_DESC(smp_affinity_enable, "SMP affinity feature enable/disbale Default: enable(1)");
> +
>  MODULE_LICENSE("GPL");
>  MODULE_VERSION(MEGASAS_VERSION);
>  MODULE_AUTHOR("megaraidlinux@lsi.com");
> @@ -5160,8 +5164,9 @@ retry_irq_register:
>  				printk(KERN_DEBUG "megasas: Failed to "
>  				       "register IRQ for vector %d.\n", i);
>  				for (j = 0; j < i; j++) {
> -					irq_set_affinity_hint(
> -						instance->msixentry[j].vector, NULL);
> +					if (smp_affinity_enable)
> +						irq_set_affinity_hint(
> +							instance->msixentry[j].vector, NULL);
>  					free_irq(
>  						instance->msixentry[j].vector,
>  						&instance->irq_context[j]);
> @@ -5170,11 +5175,14 @@ retry_irq_register:
>  				instance->msix_vectors = 0;
>  				goto retry_irq_register;
>  			}
> -			if (irq_set_affinity_hint(instance->msixentry[i].vector,
> -				get_cpu_mask(cpu)))
> -				dev_err(&instance->pdev->dev, "Error setting"
> -					"affinity hint for cpu %d\n", cpu);
> -			cpu = cpumask_next(cpu, cpu_online_mask);
> +			if (smp_affinity_enable) {
> +				if (irq_set_affinity_hint(instance->msixentry[i].vector,
> +					get_cpu_mask(cpu)))
> +					dev_err(&instance->pdev->dev,
> +						"Error setting affinity hint "
> +						"for cpu %d\n", cpu);
> +				cpu = cpumask_next(cpu, cpu_online_mask);
> +			}
>  		}
>  	} else {
>  		instance->irq_context[0].instance = instance;
> @@ -5233,8 +5241,9 @@ retry_irq_register:
>  	instance->instancet->disable_intr(instance);
>  	if (instance->msix_vectors)
>  		for (i = 0; i < instance->msix_vectors; i++) {
> -			irq_set_affinity_hint(
> -				instance->msixentry[i].vector, NULL);
> +			if (smp_affinity_enable)
> +				irq_set_affinity_hint(
> +					instance->msixentry[i].vector, NULL);
>  			free_irq(instance->msixentry[i].vector,
>  				 &instance->irq_context[i]);
>  		}
> @@ -5397,8 +5406,9 @@ megasas_suspend(struct pci_dev *pdev, pm_message_t state)
>  
>  	if (instance->msix_vectors)
>  		for (i = 0; i < instance->msix_vectors; i++) {
> -			irq_set_affinity_hint(
> -				instance->msixentry[i].vector, NULL);
> +			if (smp_affinity_enable)
> +				irq_set_affinity_hint(
> +					instance->msixentry[i].vector, NULL);
>  			free_irq(instance->msixentry[i].vector,
>  				 &instance->irq_context[i]);
>  		}
> @@ -5507,8 +5517,9 @@ megasas_resume(struct pci_dev *pdev)
>  				printk(KERN_DEBUG "megasas: Failed to "
>  				       "register IRQ for vector %d.\n", i);
>  				for (j = 0; j < i; j++) {
> -					irq_set_affinity_hint(
> -						instance->msixentry[j].vector, NULL);
> +					if (smp_affinity_enable)
> +						irq_set_affinity_hint(
> +							instance->msixentry[j].vector, NULL);
>  					free_irq(
>  						instance->msixentry[j].vector,
>  						&instance->irq_context[j]);
> @@ -5516,11 +5527,14 @@ megasas_resume(struct pci_dev *pdev)
>  				goto fail_irq;
>  			}
>  
> -			if (irq_set_affinity_hint(instance->msixentry[i].vector,
> -				get_cpu_mask(cpu)))
> -				dev_err(&instance->pdev->dev, "Error setting"
> -					"affinity hint for cpu %d\n", cpu);
> -			cpu = cpumask_next(cpu, cpu_online_mask);
> +			if (smp_affinity_enable) {
> +				if (irq_set_affinity_hint(instance->msixentry[i].vector,
> +					get_cpu_mask(cpu)))
> +					dev_err(&instance->pdev->dev, "Error "
> +						"setting affinity hint for cpu "
> +						"%d\n", cpu);
> +				cpu = cpumask_next(cpu, cpu_online_mask);
> +			}
>  		}
>  	} else {
>  		instance->irq_context[0].instance = instance;
> @@ -5638,8 +5652,9 @@ static void megasas_detach_one(struct pci_dev *pdev)
>  
>  	if (instance->msix_vectors)
>  		for (i = 0; i < instance->msix_vectors; i++) {
> -			irq_set_affinity_hint(
> -				instance->msixentry[i].vector, NULL);
> +			if (smp_affinity_enable)
> +				irq_set_affinity_hint(
> +					instance->msixentry[i].vector, NULL);
>  			free_irq(instance->msixentry[i].vector,
>  				 &instance->irq_context[i]);
>  		}
> @@ -5727,8 +5742,9 @@ static void megasas_shutdown(struct pci_dev *pdev)
>  	instance->instancet->disable_intr(instance);
>  	if (instance->msix_vectors)
>  		for (i = 0; i < instance->msix_vectors; i++) {
> -			irq_set_affinity_hint(
> -				instance->msixentry[i].vector, NULL);
> +			if (smp_affinity_enable)
> +				irq_set_affinity_hint(
> +					instance->msixentry[i].vector, NULL);
>  			free_irq(instance->msixentry[i].vector,
>  				 &instance->irq_context[i]);
>  		}


  reply	other threads:[~2014-09-10 14:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-06 13:25 [PATCH 08/11] megaraid_sas : Add module parameter to disable IRQ-CPU affinity hint Sumit.Saxena
2014-09-10 14:16 ` Tomas Henzl [this message]
2014-09-10 14:59   ` Kashyap Desai

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=54105D50.1070309@redhat.com \
    --to=thenzl@redhat.com \
    --cc=Sumit.Saxena@avagotech.com \
    --cc=aradford@gmail.com \
    --cc=hch@infradead.org \
    --cc=jbottomley@parallels.com \
    --cc=kashyap.desai@avagotech.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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 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.