LKML Archive mirror
 help / color / mirror / Atom feed
From: Tomas Henzl <thenzl@redhat.com>
To: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
Cc: Suganath prabu Subaramani 
	<suganath-prabu.subramani@avagotech.com>,
	JBottomley@parallels.com, jejb@kernel.org,
	Christoph Hellwig <hch@infradead.org>,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	Sathya Prakash <Sathya.Prakash@avagotech.com>,
	Kashyap Desai <kashyap.desai@avagotech.com>,
	Krishnaraddi Mankani <krishnaraddi.mankani@avagotech.com>,
	linux-kernel@vger.kernel.org,
	Chaitra Basappa <chaitra.basappa@avagotech.com>,
	Sreekanth Reddy <sreekanth.reddy@avagotech.com>,
	"Elliott, Robert (Server Storage)" <elliott@hp.com>
Subject: Re: [mpt3sas driver 06/10] mpt3sas: Added smp_affinity_enable module parameter.
Date: Mon, 8 Feb 2016 13:38:27 +0100	[thread overview]
Message-ID: <56B88C43.2070904@redhat.com> (raw)
In-Reply-To: <CA+RiK65WEot9z4H6M-9PEuCT0U7uMcwvVFskoQU1XBYLwdev+w@mail.gmail.com>

On 8.2.2016 07:01, Suganath Prabu Subramani wrote:
> Hi Tomas,
> Initially, we posted this patch with "zalloc_cpumassk_var" and Robert
> has suggested to use "alloc_cpumask_var". Please check the below link.
> "http://www.gossamer-threads.com/lists/linux/kernel/2068280?do=post_view_threaded#2068280"

That thread is about allocating more than KMALLOC_MAX_SIZE with a kmalloc,
it doesn't matter if it is a kzalloc or kmalloc.

If that is an issue in mpt3sas, in your code fails already here when !CONFIG_CPUMASK_OFFSTACK

        reply_q =  kzalloc(sizeof(struct adapter_reply_queue), GFP_KERNEL);
....
Good news is that the the size allocated in your case is much smaller than what
the lpfc tried at that time, (it used a struct with struct cpumask  maskbits;
and multiplied it with nr_cpus) -> this is not your case.
You can use that zalloc_cpumask_var.

--tm

>
> We incorporated other review comments for freeing reply_q and
> cpumask_var in this patch and sending it soon.
>
> Thanks,
> Suganath prabu S
>
> On Thu, Feb 4, 2016 at 8:31 PM, Tomas Henzl <thenzl@redhat.com> wrote:
>> On 28.1.2016 07:37, Suganath prabu Subaramani wrote:
>>> From: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
>>>
>>> Module parameter to enable/disable configuring
>>> affinity hint for msix vector.
>>> SMP affinity feature can be enabled/disabled by setting
>>> module parameter "smp_affinity_enable" to 1/0.
>>> By default this feature is enabled. (smp_affinity_enable = 1 enabled).
>>>
>>> Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
>>> Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
>>> ---
>>>  drivers/scsi/mpt3sas/mpt3sas_base.c | 34 +++++++++++++++++++++++-----------
>>>  1 file changed, 23 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
>>> index 31838d9a..a1a3b39 100644
>>> --- a/drivers/scsi/mpt3sas/mpt3sas_base.c
>>> +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
>>> @@ -83,6 +83,10 @@ static int msix_disable = -1;
>>>  module_param(msix_disable, int, 0);
>>>  MODULE_PARM_DESC(msix_disable, " disable msix routed interrupts (default=0)");
>>>
>>> +static 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)");
>>> +
>>>  static int max_msix_vectors = -1;
>>>  module_param(max_msix_vectors, int, 0);
>>>  MODULE_PARM_DESC(max_msix_vectors,
>>> @@ -1812,8 +1816,10 @@ _base_free_irq(struct MPT3SAS_ADAPTER *ioc)
>>>
>>>       list_for_each_entry_safe(reply_q, next, &ioc->reply_queue_list, list) {
>>>               list_del(&reply_q->list);
>>> -             irq_set_affinity_hint(reply_q->vector, NULL);
>>> -             free_cpumask_var(reply_q->affinity_hint);
>>> +             if (smp_affinity_enable) {
>>> +                     irq_set_affinity_hint(reply_q->vector, NULL);
>>> +                     free_cpumask_var(reply_q->affinity_hint);
>>> +             }
>>>               synchronize_irq(reply_q->vector);
>>>               free_irq(reply_q->vector, reply_q);
>>>               kfree(reply_q);
>>> @@ -1844,9 +1850,11 @@ _base_request_irq(struct MPT3SAS_ADAPTER *ioc, u8 index, u32 vector)
>>>       reply_q->msix_index = index;
>>>       reply_q->vector = vector;
>>>
>>> -     if (!alloc_cpumask_var(&reply_q->affinity_hint, GFP_KERNEL))
>>> -             return -ENOMEM;
>>> -     cpumask_clear(reply_q->affinity_hint);
>>> +     if (smp_affinity_enable) {
>>> +             if (!alloc_cpumask_var(&reply_q->affinity_hint, GFP_KERNEL))
>> a kfree(reply_q); should go here
>>
>>> +                     return -ENOMEM;
>>> +             cpumask_clear(reply_q->affinity_hint);
>> maybe zalloc_cpumask_var ?
>>
>>> +     }
>>         if (r) {
>>                 pr_err(MPT3SAS_FMT "unable to allocate interrupt %d!\n",
>>                     reply_q->name, vector);
>>                 kfree(reply_q);
>> and a  free_cpumask_var (..)  here ?
>>                 return -EBUSY;
>>
>>
>> cheers,
>> tomash
>>
> --
> 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-02-08 12:38 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28  6:36 [mpt3sas driver patches 00/10] mpt3sas driver enhancements and Suganath prabu Subaramani
2016-01-28  6:36 ` [mpt3sas driver 01/10] mpt3sas: Added support for high port count HBA variants Suganath prabu Subaramani
2016-02-04 14:14   ` Tomas Henzl
2016-01-28  6:36 ` [mpt3sas driver 02/10] mpt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP Passthrough request message Suganath prabu Subaramani
2016-01-28  9:16   ` Christoph Hellwig
2016-02-04 14:18   ` Tomas Henzl
2016-01-28  6:37 ` [mpt3sas driver 03/10] mpt3sas: Fix static analyzer(coverity) tool identified defects Suganath prabu Subaramani
2016-02-04 14:18   ` Tomas Henzl
2016-01-28  6:37 ` [mpt3sas driver 04/10] mpt3sas: Never block the Enclosure device Suganath prabu Subaramani
2016-02-04 14:19   ` Tomas Henzl
2016-01-28  6:37 ` [mpt3sas driver 05/10] mpt3sas: Make use of additional HighPriority credit message frames for sending SCSI IO's Suganath prabu Subaramani
2016-02-04 14:24   ` Tomas Henzl
2016-01-28  6:37 ` [mpt3sas driver 06/10] mpt3sas: Added smp_affinity_enable module parameter Suganath prabu Subaramani
2016-02-04 15:01   ` Tomas Henzl
2016-02-08  6:01     ` Suganath Prabu Subramani
2016-02-08 12:38       ` Tomas Henzl [this message]
2016-01-28  6:37 ` [mpt3sas driver 07/10] mpt3sas: Add support for configurable Chain Frame Size Suganath prabu Subaramani
2016-02-04 15:05   ` Tomas Henzl
2016-02-05  7:56     ` Sreekanth Reddy
2016-02-08 13:55       ` Tomas Henzl
2016-01-28  6:37 ` [mpt3sas driver 08/10] mpt3sas: Updated MPI Header to 2.00.42 Suganath prabu Subaramani
2016-02-04 15:06   ` Tomas Henzl
2016-01-28  6:37 ` [mpt3sas driver 09/10] mpt3sas: Fix for Asynchronous completion of timedout IO and task abort of timedout IO Suganath prabu Subaramani
2016-02-04 15:07   ` Tomas Henzl
2016-01-28  6:37 ` [mpt3sas driver 10/10] mpt3sas: Updating mpt3sas driver version to 12.100.00.00 Suganath prabu Subaramani
2016-02-04 15:08   ` Tomas Henzl
2016-02-05  2:04 ` [mpt3sas driver patches 00/10] mpt3sas driver enhancements and Martin K. Petersen
2016-02-10 17:20 ` Martin K. Petersen

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=56B88C43.2070904@redhat.com \
    --to=thenzl@redhat.com \
    --cc=JBottomley@parallels.com \
    --cc=Sathya.Prakash@avagotech.com \
    --cc=chaitra.basappa@avagotech.com \
    --cc=elliott@hp.com \
    --cc=hch@infradead.org \
    --cc=jejb@kernel.org \
    --cc=kashyap.desai@avagotech.com \
    --cc=krishnaraddi.mankani@avagotech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sreekanth.reddy@avagotech.com \
    --cc=suganath-prabu.subramani@avagotech.com \
    --cc=suganath-prabu.subramani@broadcom.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).