From patchwork Mon Nov 9 01:57:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 7579961 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 8C8929F1C2 for ; Mon, 9 Nov 2015 01:58:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A334B20606 for ; Mon, 9 Nov 2015 01:58:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B66882066F for ; Mon, 9 Nov 2015 01:58:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752560AbbKIB6n (ORCPT ); Sun, 8 Nov 2015 20:58:43 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:34488 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752401AbbKIB6I (ORCPT ); Sun, 8 Nov 2015 20:58:08 -0500 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 79B7413FF0F; Mon, 9 Nov 2015 01:58:07 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 66925140209; Mon, 9 Nov 2015 01:58:07 +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 59CC013FF0F; Mon, 9 Nov 2015 01:58:05 +0000 (UTC) From: Sinan Kaya To: linux-scsi@vger.kernel.org, timur@codeaurora.org, cov@codeaurora.org, jcm@redhat.com Cc: agross@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 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 V2 3/3] scsi: mptxsas: offload IRQ execution Date: Sun, 8 Nov 2015 20:57:46 -0500 Message-Id: <1447034266-28003-4-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1447034266-28003-1-git-send-email-okaya@codeaurora.org> References: <1447034266-28003-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 are a lot of jobs 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 | 12 ++++++++---- drivers/scsi/mpt3sas/mpt3sas_base.c | 13 +++++++++---- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index c61c82a..b619a0e 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c @@ -1359,14 +1359,18 @@ _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 index 6dc391c..62bee43 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -1661,14 +1661,19 @@ _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);