[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/3] qcow2: mark the memory as no longer needed
Re: [Qemu-devel] [PATCH 1/3] qcow2: mark the memory as no longer needed after qcow2_cache_empty()
Tue, 26 May 2015 17:39:12 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
On 18.05.2015 18:48, Alberto Garcia wrote:
After having emptied the cache, the data in the cache tables is no
longer useful, so we can tell the kernel that we are done with it. In
Linux this frees the resources associated with it.
The effect of this can be seen in the block-commit operation: it moves
data from the top to the base image (and fills both caches), then it
empties the top image. At this point the data in that cache is no
longer needed so it's just wasting memory.
Signed-off-by: Alberto Garcia <address@hidden>
block/qcow2-cache.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
Looks good, but by applying the same logic, you could do the same call
in qcow2_cache_create(). So what about it? :-)
Also note that bdrv_commit() is used only by the HMP commit operation,
not by QMP commit.
[Qemu-devel] [PATCH 2/3] qcow2: add option to clean unused cache entries after some time, Alberto Garcia, 2015/05/18