[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/3] Avoid repeated memory allocation in xen_dis
From: |
Anthony PERARD |
Subject: |
Re: [Qemu-devel] [PATCH 3/3] Avoid repeated memory allocation in xen_disk |
Date: |
Fri, 2 Nov 2018 13:53:40 +0000 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Fri, Nov 02, 2018 at 10:01:09AM +0000, Tim Smith wrote:
> xen_disk currently allocates memory to hold the data for each ioreq
> as that ioreq 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 requirement, which is
> BLKIF_MAX_SEGMENTS_PER_REQUEST pages (currently 11 pages) when
> the ioreq is created, and keep that allocation until it is destroyed.
> Since the ioreqs themselves are re-used via a free list, this
> should actually improve memory usage.
>
> Signed-off-by: Tim Smith <address@hidden>
Acked-by: Anthony PERARD <address@hidden>
--
Anthony PERARD