Re: [PATCH v3 3/3] vfio_pci: make use of update_irq_devid and optimize irq ops

2019-08-22 Thread luoben
在 2019/8/20 下午11:27, Liu, Jiang 写道: On Aug 20, 2019, at 11:24 PM, luoben wrote: 在 2019/8/16 上午12:45, Thomas Gleixner 写道: On Thu, 15 Aug 2019, Ben Luo wrote: if (vdev->ctx[vector].trigger) { - free_irq(irq, vdev->ctx[vector].t

Re: [PATCH v3 0/3] genirq/vfio: Introduce update_irq_devid and optimize VFIO irq ops

2019-08-20 Thread luoben
在 2019/8/20 下午11:22, Alex Williamson 写道: On Tue, 20 Aug 2019 12:03:50 +0800 luoben wrote: 在 2019/8/20 上午4:51, Alex Williamson 写道: On Thu, 15 Aug 2019 21:02:58 +0800 Ben Luo wrote: Currently, VFIO takes a lot of free-then-request-irq actions whenever a VM (with device passthru via VFIO

Re: [PATCH v3 0/3] genirq/vfio: Introduce update_irq_devid and optimize VFIO irq ops

2019-08-19 Thread luoben
在 2019/8/20 上午4:51, Alex Williamson 写道: On Thu, 15 Aug 2019 21:02:58 +0800 Ben Luo wrote: Currently, VFIO takes a lot of free-then-request-irq actions whenever a VM (with device passthru via VFIO) sets irq affinity or mask/unmask irq. Those actions only change the cookie data of irqaction

Re: [PATCH v3 2/3] genirq: introduce update_irq_devid()

2019-08-18 Thread luoben
在 2019/8/15 下午10:58, Thomas Gleixner 写道: Ben, On Thu, 15 Aug 2019, Ben Luo wrote: Sometimes, only the dev_id field of irqaction need to be changed. E.g. KVM VM with device passthru via VFIO may switch irq injection path between KVM irqfd and userspace eventfd. These two paths share the same

Re: [PATCH 2/2] vfio_pci: make use of update_irq_devid and optimize irq ops

2019-08-12 Thread luoben
在 2019/8/12 下午1:44, Yunsheng Lin 写道: On 2019/8/8 20:07, Ben Luo wrote: When userspace (e.g. qemu) triggers a switch between KVM irqfd and userspace eventfd, only dev_id of irq action (i.e. the "trigger" in this patch's context) will be changed, but a free-then-request-irq action is taken in

Re: [PATCH 1/2] genirq: introduce update_irq_devid()

2019-08-11 Thread luoben
在 2019/8/9 上午3:56, Thomas Gleixner 写道: On Thu, 8 Aug 2019, Ben Luo wrote: +int update_irq_devid(unsigned int irq, void *dev_id, void *new_dev_id) +{ + struct irq_desc *desc = irq_to_desc(irq); + struct irqaction *action, **action_ptr; + unsigned long flags; + +