From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752691AbcBHGBZ (ORCPT ); Mon, 8 Feb 2016 01:01:25 -0500 Received: from mail-qg0-f41.google.com ([209.85.192.41]:35295 "EHLO mail-qg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751016AbcBHGBX (ORCPT ); Mon, 8 Feb 2016 01:01:23 -0500 MIME-Version: 1.0 In-Reply-To: <56B367B5.5030001@redhat.com> References: <1453963027-19770-1-git-send-email-suganath-prabu.subramani@avagotech.com> <1453963027-19770-7-git-send-email-suganath-prabu.subramani@avagotech.com> <56B367B5.5030001@redhat.com> Date: Mon, 8 Feb 2016 11:31:22 +0530 Message-ID: Subject: Re: [mpt3sas driver 06/10] mpt3sas: Added smp_affinity_enable module parameter. From: Suganath Prabu Subramani To: Tomas Henzl Cc: Suganath prabu Subaramani , JBottomley@parallels.com, jejb@kernel.org, Christoph Hellwig , martin.petersen@oracle.com, linux-scsi@vger.kernel.org, Sathya Prakash , Kashyap Desai , Krishnaraddi Mankani , linux-kernel@vger.kernel.org, Chaitra Basappa , Sreekanth Reddy Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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" 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 wrote: > On 28.1.2016 07:37, Suganath prabu Subaramani wrote: >> From: Suganath prabu Subramani >> >> 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 >> Signed-off-by: Chaitra P B >> --- >> 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 >