Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3431549imu; Sun, 11 Nov 2018 14:58:33 -0800 (PST) X-Google-Smtp-Source: AJdET5df6n4w/n8aY/mgXz+6/OQyba/pz/DLq4yZBo18WUDG5GX3f/Lsz2hUSU6ciuq8UI2OA1RQ X-Received: by 2002:a63:e055:: with SMTP id n21mr15536480pgj.397.1541977113758; Sun, 11 Nov 2018 14:58:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977113; cv=none; d=google.com; s=arc-20160816; b=we8tstvlACNFEb6glLHZYVySN16pOr8ews1N7jVe7c/TYETffRAuJ1/mgjJBStDHtM B+R3fPh+c9WUCBqzf4J1EJmZJlxeBA9+cb8NhwoNFN97vWupGhrysBuCy6E5U+yNY0Rw 41msvxnoG6404+yNrgo3ZBWRxebDD9OYmI5Nt0bBBPkKBx6KXDfp41/aVcAAnsH5sAXI 4Y6NjrrKnlDzmNF3DMJy8BBnLl9jgK5OwAkSle6W99ydGkNxIcqDXRnuyt+QydqB58UK 1rjnThh4accTHfGSib3Ho/rQCHkqGHvuv0uF1Lh91BtHgpP+uSRn2TWuk+P7lSzn4eMf kvng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LPy0dGudUsDa5r4w/5alsmXan7xYnwSMVCukTi1M83o=; b=XmuPSEe05NMjlmmL19nzyH2oBTW95Axp10uGQyTBuczCxvgV0bJpPSOiROliv2bc5Y Eac/p/Uhkm6ja4Yd4NkWvqPm8mRm9uyOvH2L17f60WxjhvQCfKYzyDZQh9ntNO3vWk+/ RIl4YDGt81g7HGcivnB2pRG2uX0Xagts/2JQqsnCD8WT1WtqR9rauE+1Yu/dtMXzcgSF ckqOT50s8aXPAumsVWSmpB7jrG6TamC8q2nxNKIRVmE9jYCYgGub02U4RCg3VX/SJ2zN K4UTh8Mwb1vuj+1Wuv2tEuepVL3hqWmuh37UJoZh73iDv49LUSUbgYs41PcILXnYi3TH W/Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="XFV/4jKw"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cc8-v6si17859366plb.377.2018.11.11.14.58.18; Sun, 11 Nov 2018 14:58:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="XFV/4jKw"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403861AbeKLIWu (ORCPT + 99 others); Mon, 12 Nov 2018 03:22:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:54556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390859AbeKLIWu (ORCPT ); Mon, 12 Nov 2018 03:22:50 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 07B3D21582; Sun, 11 Nov 2018 22:32:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975573; bh=F0JZicURmuAXopggUdOW2X23I5Ov6rVNLoidYsapcP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XFV/4jKwyzgCIl7ODQyw0c8q3DcaVeiN0esM7nRCeZvnRhetv0rOtEhy7AlsS8Cus l8G9alA8z5BQgRT7/25SxO6HyIZkfF/z0ROy35509kd+k11vZAUiSLJ/uVyVSEsA28 /aV58zCmW5j4cgYYmsxXgDbNx625RtqLe8hbGszo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Keith Busch , Lorenzo Pieralisi , "Jon Derrick:" , "Heitke, Kenneth" Subject: [PATCH 4.14 148/222] PCI: vmd: White list for fast interrupt handlers Date: Sun, 11 Nov 2018 14:24:05 -0800 Message-Id: <20181111221700.645578642@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Keith Busch commit a7f58b9ecfd3c0f63703ec10f4a592cc38dbd1b8 upstream. Devices with slow interrupt handlers are significantly harming performance when their interrupt vector is shared with a fast device. Create a class code white list for devices with known fast interrupt handlers and let all other devices share a single vector so that they don't interfere with performance. At the moment, only the NVM Express class code is on the list, but more may be added if VMD users desire to use other low-latency devices in these domains. Signed-off-by: Keith Busch [lorenzo.pieralisi@arm.com: changelog] Signed-off-by: Lorenzo Pieralisi Acked-by: Jon Derrick: Cc: "Heitke, Kenneth" Signed-off-by: Greg Kroah-Hartman --- drivers/pci/host/vmd.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) --- a/drivers/pci/host/vmd.c +++ b/drivers/pci/host/vmd.c @@ -183,9 +183,20 @@ static struct vmd_irq_list *vmd_next_irq int i, best = 1; unsigned long flags; - if (pci_is_bridge(msi_desc_to_pci_dev(desc)) || vmd->msix_count == 1) + if (vmd->msix_count == 1) return &vmd->irqs[0]; + /* + * White list for fast-interrupt handlers. All others will share the + * "slow" interrupt vector. + */ + switch (msi_desc_to_pci_dev(desc)->class) { + case PCI_CLASS_STORAGE_EXPRESS: + break; + default: + return &vmd->irqs[0]; + } + raw_spin_lock_irqsave(&list_lock, flags); for (i = 1; i < vmd->msix_count; i++) if (vmd->irqs[i].count < vmd->irqs[best].count)