summary refs log tree commit diff stats
path: root/hw/virtio/vhost-backend.c
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2016-08-01 16:07:58 +0800
committerMichael S. Tsirkin <mst@redhat.com>2016-09-09 20:58:34 +0300
commit96a3d98d2cdbd897ff5ab33427aa4cfb94077665 (patch)
treede0ccd907485b084a285fb3ee33494cf25fe270f /hw/virtio/vhost-backend.c
parent3eff376977c457475272a34d243dac6af7cd6a47 (diff)
downloadfocaccia-qemu-96a3d98d2cdbd897ff5ab33427aa4cfb94077665.tar.gz
focaccia-qemu-96a3d98d2cdbd897ff5ab33427aa4cfb94077665.zip
vhost: don't set vring call if no vector
We used to set vring call fd unconditionally even if guest driver does
not use MSIX for this vritqueue at all. This will cause lots of
unnecessary userspace access and other checks for drivers does not use
interrupt at all (e.g virtio-net pmd). So check and clean vring call
fd if guest does not use any vector for this virtqueue at
all.

Perf diffs (on rx) shows lots of cpus wasted on vhost_signal() were saved:

#
    28.12%  -27.82%  [vhost]           [k] vhost_signal
    14.44%   -1.69%  [kernel.vmlinux]  [k] copy_user_generic_string
     7.05%   +1.53%  [kernel.vmlinux]  [k] __free_page_frag
     6.51%   +5.53%  [vhost]           [k] vhost_get_vq_desc
...

Pktgen tests shows 15.8% improvement on rx pps and 6.5% on tx pps.

Before: RX 2.08Mpps TX 1.35Mpps
After:  RX 2.41Mpps TX 1.44Mpps

Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio/vhost-backend.c')
0 files changed, 0 insertions, 0 deletions