From patchwork Thu Nov 5 04:46:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 7557291 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 732969F36A for ; Thu, 5 Nov 2015 04:47:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 968262085C for ; Thu, 5 Nov 2015 04:47:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A9F6E2085B for ; Thu, 5 Nov 2015 04:47:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965528AbbKEErK (ORCPT ); Wed, 4 Nov 2015 23:47:10 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:58242 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965700AbbKEEqw (ORCPT ); Wed, 4 Nov 2015 23:46:52 -0500 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 224C613FDA9; Thu, 5 Nov 2015 04:46:52 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 10D3313FDB8; Thu, 5 Nov 2015 04:46:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from drakthul.qualcomm.com (rrcs-67-52-130-30.west.biz.rr.com [67.52.130.30]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id A242213FDEA; Thu, 5 Nov 2015 04:46:50 +0000 (UTC) From: Sinan Kaya To: linux-scsi@vger.kernel.org, timur@codeaurora.org, cov@codeaurora.org, jcm@redhat.com Cc: Sinan Kaya , Nagalakshmi Nandigama , Praveen Krishnamoorthy , Sreekanth Reddy , Abhijit Mahajan , "James E.J. Bottomley" , MPT-FusionLinux.pdl@avagotech.com, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] scsi: mptxsas: offload IRQ execution Date: Wed, 4 Nov 2015 23:46:29 -0500 Message-Id: <1446698789-19308-4-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1446698789-19308-1-git-send-email-okaya@codeaurora.org> References: <1446698789-19308-1-git-send-email-okaya@codeaurora.org> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The mpt2sas and mpt3sas drivers are spinning forever in their IRQ handlers if there is a lot of job queued up by the PCIe card. This handler is causing spikes for the rest of the system and sluggish behavior. Marking all MSI interrupts as non-shared and moving the MSI interrupts to thread context. This relexes the rest of the system execution. Signed-off-by: Sinan Kaya --- drivers/scsi/mpt2sas/mpt2sas_base.c | 13 +++++++++---- drivers/scsi/mpt3sas/mpt3sas_base.c | 14 ++++++++++---- 2 files changed, 19 insertions(+), 8 deletions(-) mode change 100644 => 100755 drivers/scsi/mpt3sas/mpt3sas_base.c diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index c61c82a..ee2aead 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c @@ -1359,14 +1359,19 @@ _base_request_irq(struct MPT2SAS_ADAPTER *ioc, u8 index, u32 vector) cpumask_clear(reply_q->affinity_hint); atomic_set(&reply_q->busy, 0); - if (ioc->msix_enable) + if (ioc->msix_enable) { snprintf(reply_q->name, MPT_NAME_LENGTH, "%s%d-msix%d", MPT2SAS_DRIVER_NAME, ioc->id, index); - else + r = request_threaded_irq(vector, NULL, _base_interrupt, + IRQF_TRIGGER_RISING | IRQF_ONESHOT, + reply_q->name, reply_q); + } + else { snprintf(reply_q->name, MPT_NAME_LENGTH, "%s%d", MPT2SAS_DRIVER_NAME, ioc->id); - r = request_irq(vector, _base_interrupt, IRQF_SHARED, reply_q->name, - reply_q); + r = request_irq(vector, _base_interrupt, IRQF_SHARED, + reply_q->name, reply_q); + } if (r) { printk(MPT2SAS_ERR_FMT "unable to allocate interrupt %d!\n", reply_q->name, vector); diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c old mode 100644 new mode 100755 index 6dc391c..c29f359 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -1661,14 +1661,20 @@ _base_request_irq(struct MPT3SAS_ADAPTER *ioc, u8 index, u32 vector) cpumask_clear(reply_q->affinity_hint); atomic_set(&reply_q->busy, 0); - if (ioc->msix_enable) + if (ioc->msix_enable) { snprintf(reply_q->name, MPT_NAME_LENGTH, "%s%d-msix%d", MPT3SAS_DRIVER_NAME, ioc->id, index); - else + + r = request_threaded_irq(vector, NULL, _base_interrupt, + IRQF_TRIGGER_RISING | IRQF_ONESHOT, + reply_q->name, reply_q); + } + else { snprintf(reply_q->name, MPT_NAME_LENGTH, "%s%d", MPT3SAS_DRIVER_NAME, ioc->id); - r = request_irq(vector, _base_interrupt, IRQF_SHARED, reply_q->name, - reply_q); + r = request_irq(vector, _base_interrupt, IRQF_SHARED, + reply_q->name, reply_q); + } if (r) { pr_err(MPT3SAS_FMT "unable to allocate interrupt %d!\n", reply_q->name, vector);