This adds a new 'cache-clean-interval' option that cleans all qcow2
cache entries that haven't been used in a certain interval, given in
seconds.
This allows setting a large L2 cache size so it can handle scenarios
with lots of I/O and at the same time use little memory during periods
of inactivity.
This feature currently relies on MADV_DONTNEED to free that memory, so
it is not useful in systems that don't follow that behavior.
Signed-off-by: Alberto Garcia <address@hidden>
Cc: Max Reitz <address@hidden>
---
block/qcow2-cache.c | 35 ++++++++++++++++++++++++++++
block/qcow2.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++
block/qcow2.h | 4 ++++
qapi/block-core.json | 7 +++++-
4 files changed, 109 insertions(+), 1 deletion(-)