qemu/hw/block/dataplane
Tim Smith c6025bd197 xen-block: avoid repeated memory allocation
The xen-block dataplane currently allocates memory to hold the data for
each request as that request is used, and frees it afterwards. Because
it requires page-aligned blocks, this interacts poorly with non-page-
aligned allocations and balloons the heap.

Instead, allocate the maximum possible buffer size required for the
protocol, which is BLKIF_MAX_SEGMENTS_PER_REQUEST (currently 11) pages
when the request structure is created, and keep that buffer until it is
destroyed. Since the requests are re-used via a free list, this should
actually improve memory usage.

Signed-off-by: Tim Smith <tim.smith@citrix.com>

Re-based and commit comment adjusted.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
2019-01-14 13:45:40 +00:00
..
Makefile.objs xen: add header and build dataplane/xen-block.c 2019-01-14 13:45:40 +00:00
trace-events docs: fix broken paths to docs/devel/tracing.txt 2017-07-31 13:12:53 +03:00
virtio-blk.c Replace '-enable-kvm' with '-accel kvm' in docs and help texts 2018-06-28 19:05:32 +02:00
virtio-blk.h hw/block: Fix the return type 2017-12-19 09:25:28 +00:00
xen-block.c xen-block: avoid repeated memory allocation 2019-01-14 13:45:40 +00:00
xen-block.h xen: remove 'XenBlkDev' and 'blkdev' names from dataplane/xen-block 2019-01-14 13:45:40 +00:00