Skip to content

virtio: don't poll masked vectors with irqfd

Michael S. Tsirkin kvm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3msi: add API to get notified about pending bit pollhw/pci/msix.c hw/pci/msix.h hw/pci/pci.h +2 more+21 -40 replies
2/3msix: expose access to masked/pending statehw/pci/msix.c hw/pci/msix.h+6 -30 replies
3/3virtio-pci: don't poll masked vectorshw/virtio-pci.c+40 -123 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] virtio: don't poll masked vectors with irqfd

At the moment when vector is masked virtio will poll it in userspace, even if it is handled by irqfd.
This is done in order to update pending bits, but it's not really required until someone reads the pending bits. On the other hand this read results in extra io thread wakeups.

As we only implement the pending bits as a compatibility feature (read - real drivers don't use it), we can defer the irqfd poll until the read actually happens.

This does not seem to affect vhost-net speed
in simple benchmarks but could help block: both vhost-blk and dataplane when using irqfd,
and I also think this is cleaner than enabling/disabling notifiers all the time.

This will also be the basis for future optimizations.

Michael S. Tsirkin (3):
msi: add API to get notified about pending bit poll
msix: expose access to masked/pending state
virtio-pci: don't poll masked vectors

 hw/pci/msix.c   | 19 +++++++++++++++----
 hw/pci/msix.h   |  6 +++++-
 hw/pci/pci.h    |  4 ++++
 hw/vfio_pci.c   |  2 +-
 hw/virtio-pci.c | 53 +++++++++++++++++++++++++++++++++++++++++------------
 5 files changed, 66 insertions(+), 18 deletions(-)
Signature · 1 line
MST