diff options
author | Jason Wang <jasowang@redhat.com> | 2015-06-04 05:28:46 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-06-04 12:44:49 +0200 |
commit | 309750fad51f17d1ec6195c5d8ad7d741596ddb6 (patch) | |
tree | cc12aaf687a92a9d35870700035234e10dd6791c /docs | |
parent | 6e7d82497dc8da7d420c8fa6632d759e08a18bc3 (diff) |
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>
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions