[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 06/49] virtio: move allocation to virtqueue_pop/v
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PULL 06/49] virtio: move allocation to virtqueue_pop/vring_pop |
Date: |
Fri, 5 Feb 2016 12:52:55 +0000 |
On 4 February 2016 at 21:51, Michael S. Tsirkin <address@hidden> wrote:
> From: Paolo Bonzini <address@hidden>
>
> 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 <address@hidden>
> Reviewed-by: Michael S. Tsirkin <address@hidden>
> Signed-off-by: Michael S. Tsirkin <address@hidden>
> Reviewed-by: Cornelia Huck <address@hidden>
> ---
> hw/9pfs/virtio-9p.h | 2 +-
> include/hw/virtio/dataplane/vring.h | 2 +-
> include/hw/virtio/virtio-balloon.h | 2 +-
> include/hw/virtio/virtio-blk.h | 3 +-
> include/hw/virtio/virtio-net.h | 2 +-
> include/hw/virtio/virtio-scsi.h | 2 +-
> include/hw/virtio/virtio-serial.h | 2 +-
> include/hw/virtio/virtio.h | 2 +-
> hw/9pfs/9p.c | 2 +-
> hw/9pfs/virtio-9p-device.c | 17 ++++----
> hw/block/dataplane/virtio-blk.c | 11 +++--
> hw/block/virtio-blk.c | 15 +++----
> hw/char/virtio-serial-bus.c | 80
> +++++++++++++++++++++++--------------
> hw/display/virtio-gpu.c | 21 ++++++----
> hw/input/virtio-input.c | 24 +++++++----
> hw/net/virtio-net.c | 69 ++++++++++++++++++++------------
> hw/scsi/virtio-scsi-dataplane.c | 15 +++----
> hw/scsi/virtio-scsi.c | 18 ++++-----
> hw/virtio/dataplane/vring.c | 18 +++++----
> hw/virtio/virtio-balloon.c | 22 ++++++----
> hw/virtio/virtio-rng.c | 10 +++--
> hw/virtio/virtio.c | 12 ++++--
> roms/seabios | 2 +-
> 23 files changed, 210 insertions(+), 143 deletions(-)
> --- a/roms/seabios
> +++ b/roms/seabios
> @@ -1 +1 @@
> -Subproject commit 01a84bea2d28a19d2405c1ecac4bdef17683cc0c
> +Subproject commit 33fbe13a3e2a01e0ba1087a8feed801a0451db21
> --
> MST
Hi. This commit in this pull request includes a seabios submodule
update, but the commit message says nothing about it. Is it
really supposed to be here?
thanks
-- PMM
- [Qemu-devel] [PULL 00/49] pc and misc cleanups and fixes, virtio optimizations, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 14/49] virtio: combine write of an entry into used ring, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 01/49] Fix virtio migration, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 02/49] pc: acpi: merge SSDT into DSDT, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 03/49] tests: pc: acpi: drop not needed 'expected SSDT' blobs, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 04/49] tests: pc: acpi: add expected DSDT.bridge blobs and update DSDT blobs, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 05/49] virtio: move VirtQueueElement at the beginning of the structs, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 07/49] virtio: introduce qemu_get/put_virtqueue_element, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 06/49] virtio: move allocation to virtqueue_pop/vring_pop, Michael S. Tsirkin, 2016/02/04
- Re: [Qemu-devel] [PULL 06/49] virtio: move allocation to virtqueue_pop/vring_pop,
Peter Maydell <=
- [Qemu-devel] [PULL 08/49] virtio: introduce virtqueue_alloc_element, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 09/49] virtio: slim down allocation of VirtQueueElements, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 10/49] vring: slim down allocation of VirtQueueElements, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 11/49] virtio: combine the read of a descriptor, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 12/49] virtio: cache used_idx in a VirtQueue field, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 13/49] virtio: read avail_idx from VQ only when necessary, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 15/49] hw/pxb: add pxb devices to the bridge category, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 16/49] vhost-user-test: use correct ROM to speed up and avoid spurious failures, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 17/49] hw/pci: ensure that only PCI/PCIe bridges can be attached to pxb/pxb-pcie devices, Michael S. Tsirkin, 2016/02/04