qemu/include/hw/virtio
Paolo Bonzini 51b19ebe43 virtio: move allocation to virtqueue_pop/vring_pop
The return code of virtqueue_pop/vring_pop is unused except to check for
errors or 0.  We can thus easily move allocation inside the functions
and just return a pointer to the VirtQueueElement.

The advantage is that we will be able to allocate only the space that
is needed for the actual size of the s/g list instead of the full
VIRTQUEUE_MAX_SIZE items.  Currently VirtQueueElement takes about 48K
of memory, and this kind of allocation puts a lot of stress on malloc.
By cutting the size by two or three orders of magnitude, malloc can
use much more efficient algorithms.

The patch is pretty large, but changes to each device are testable
more or less independently.  Splitting it would mostly add churn.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-02-06 20:39:07 +02:00
..
dataplane virtio: move allocation to virtqueue_pop/vring_pop 2016-02-06 20:39:07 +02:00
vhost-backend.h vhost user: add rarp sending after live migration for legacy guest 2015-10-22 14:34:49 +03:00
vhost-scsi.h vhost-scsi: include linux/vhost.h 2015-09-25 12:04:41 +02:00
vhost.h vhost: drop dead code 2015-12-02 17:59:13 +02:00
virtio-access.h virtio: avoid leading underscores for helpers 2015-09-10 11:06:05 +03:00
virtio-balloon.h virtio: move allocation to virtqueue_pop/vring_pop 2016-02-06 20:39:07 +02:00
virtio-blk.h virtio: move allocation to virtqueue_pop/vring_pop 2016-02-06 20:39:07 +02:00
virtio-bus.h virtio: handle non-virtio-1-capable backend for ccw 2015-12-02 19:34:11 +02:00
virtio-gpu.h virtio-gpu: block any rendering until client (ui) is done 2016-02-03 10:41:36 +01:00
virtio-input.h virtio-input: add input routing support 2015-07-03 12:21:11 +02:00
virtio-net.h virtio: move allocation to virtqueue_pop/vring_pop 2016-02-06 20:39:07 +02:00
virtio-rng.h virtio-rng: trigger timer only when guest requests for entropy 2015-07-17 19:05:16 +05:30
virtio-scsi.h virtio: move allocation to virtqueue_pop/vring_pop 2016-02-06 20:39:07 +02:00
virtio-serial.h virtio: move allocation to virtqueue_pop/vring_pop 2016-02-06 20:39:07 +02:00
virtio.h virtio: move allocation to virtqueue_pop/vring_pop 2016-02-06 20:39:07 +02:00