[PATCH v4 0/3] genirq/vfio: Introduce irq_update_devid() and optimize VFIO irq ops

From: Ben Luo
Date: Thu Aug 22 2019 - 11:35:03 EST


Currently, VFIO takes uses a free-then-request-irq way to do interrupt
affinity setting and masking/unmasking for a VM (with device passthru
via VFIO). Sometimes only change the cookie data of irqaction or even
change nothing. The free-then-request-irq not only adds more latency,
but also increases the risk of losing interrupt, which may lead to a
VM hung forever in waiting for IO completion

This patchset solved the issue by:
Patch 2 introduces irq_update_devid() to only update dev_id of irqaction
Patch 3 make use of this function and optimize irq operations in VFIO

changes from v3:
- rename the new function to irq_update_devid()
- amend commit messages and code comments
- use disbale_irq()/enable_irq() to avoid a twist for threaded interrupt
- add more comments to vfio-pci code

changes from v2:
- reformat to avoid quoted string split across lines and etc.

changes from v1:
- add Patch 1 to enhance error recovery etc. in free irq per tglx's comments
- enhance error recovery code and debugging info in irq_update_devid
- use __must_check in external referencing of this function
- use EXPORT_SYMBOL_GPL for irq_update_devid
- reformat code of patch 3 for better readability

Ben Luo (3):
genirq: enhance error recovery code in free irq
genirq: introduce irq_update_devid()
vfio/pci: make use of irq_update_devid and optimize irq ops

drivers/vfio/pci/vfio_pci_intrs.c | 112 +++++++++++++++++++++++++-------------
include/linux/interrupt.h | 3 +
kernel/irq/manage.c | 105 +++++++++++++++++++++++++++++++----
3 files changed, 170 insertions(+), 50 deletions(-)

--
1.8.3.1