]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
PCI: vmd: White list for fast interrupt handlers
authorKeith Busch <keith.busch@intel.com>
Tue, 8 May 2018 16:00:22 +0000 (10:00 -0600)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:57:20 +0000 (19:57 -0600)
BugLink: https://bugs.launchpad.net/bugs/1836802
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 <keith.busch@intel.com>
[lorenzo.pieralisi@arm.com: changelog]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Jon Derrick: <jonathan.derrick@intel.com>
Cc: "Heitke, Kenneth" <kenneth.heitke@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/pci/host/vmd.c

index 509893bc3e63e910892ad0b0111c6e7a7fa65abb..2537b022f42d4ab2e262acd0a5bfd92e114ad0c1 100644 (file)
@@ -183,9 +183,20 @@ static struct vmd_irq_list *vmd_next_irq(struct vmd_dev *vmd, struct msi_desc *d
        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)