qemu-patch-raspberry4/hw/virtio
Jason Wang 309750fad5 vhost: logs sharing
Currently we allocate one vhost log per vhost device. This is sub
optimal when:

- Guest has several device with vhost as backend
- Guest has multiqueue devices

In the above cases, we can avoid the memory allocation by sharing a
single vhost log among all the vhost devices. This is done through:

- Introducing a new vhost_log structure with refcnt inside.
- Using a global pointer to vhost_log structure that will be used. And
  introduce helper to get the log with expected log size and helper to
- drop the refcnt to the old log.
- Each vhost device still keep track of a pointer to the log that was
  used.

With above, if no resize happens, all vhost device will share a single
vhost log. During resize, a new vhost_log structure will be allocated
and made for the global pointer. And each vhost devices will drop the
refcnt to the old log.

Tested by doing scp during migration for a 2 queues virtio-net-pci.

Cc: Michael S. Tsirkin <mst@redhat.com>
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>
2015-06-04 12:44:49 +02:00
..
dataplane virtio: add feature checking helpers 2015-02-26 13:04:07 +01:00
Makefile.objs dataplane: endianness-aware accesses 2015-02-16 15:07:16 +00:00
vhost-backend.c vhost: Remove superfluous '\n' around error_report() 2015-03-10 08:15:33 +03:00
vhost-user.c vhost-user: add multi queue support 2015-06-01 14:18:55 +02:00
vhost.c vhost: logs sharing 2015-06-04 12:44:49 +02:00
virtio-balloon.c virtio: make features 64bit wide 2015-06-01 14:18:55 +02:00
virtio-bus.c virtio: device_plugged() can fail 2015-05-31 16:44:12 +02:00
virtio-mmio.c virtio-mmio: ioeventfd support 2015-06-01 14:18:55 +02:00
virtio-pci.c virtio-pci: don't try to mask or unmask vqs without notifiers 2015-06-03 18:19:15 +02:00
virtio-pci.h virtio: move host_features 2015-05-31 16:27:18 +02:00
virtio-rng.c virtio: make features 64bit wide 2015-06-01 14:18:55 +02:00
virtio.c virtio: 64bit features fixups. 2015-06-03 18:19:16 +02:00