diff options
author | Tim Smith | 2018-12-12 12:16:26 +0100 |
---|---|---|
committer | Anthony PERARD | 2019-01-14 14:45:40 +0100 |
commit | c6025bd197d0dbcc5067553fd12538d8b29383c2 (patch) | |
tree | b4b04c95b9c75162cdf60dbcda51c9ca7563071b /hw/xen/xen_devconfig.c | |
parent | xen-block: improve response latency (diff) | |
download | qemu-c6025bd197d0dbcc5067553fd12538d8b29383c2.tar.gz qemu-c6025bd197d0dbcc5067553fd12538d8b29383c2.tar.xz qemu-c6025bd197d0dbcc5067553fd12538d8b29383c2.zip |
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>
Diffstat (limited to 'hw/xen/xen_devconfig.c')
0 files changed, 0 insertions, 0 deletions