/* Timestamp of the last update of statistics, in seconds. */
VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE = 9,
+ /*
+ * The amount of memory, that can be quickly reclaimed without
+ * additional I/O (in kB). Typically these pages are used for caching files
+ * from disk.
+ */
+ VIR_DOMAIN_MEMORY_STAT_DISK_CACHES = 10,
+
/*
* The number of statistics supported by this version of the interface.
* To add new statistics, add them to the enum and increase this value.
*/
- VIR_DOMAIN_MEMORY_STAT_NR = 10,
+ VIR_DOMAIN_MEMORY_STAT_NR = 11,
# ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_MEMORY_STAT_LAST = VIR_DOMAIN_MEMORY_STAT_NR
* Current balloon value (in kb).
* VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE
* Timestamp of the last statistic
+ * VIR_DOMAIN_MEMORY_STAT_DISK_CACHES
+ * Memory that can be reclaimed without additional I/O, typically disk
+ * caches (in kb).
*
* Returns: The number of stats provided or -1 in case of failure.
*/
STORE_MEM_RECORD(RSS, "rss")
STORE_MEM_RECORD(LAST_UPDATE, "last-update")
STORE_MEM_RECORD(USABLE, "usable")
+ STORE_MEM_RECORD(DISK_CACHES, "disk_caches")
}
#undef STORE_MEM_RECORD
VIR_DOMAIN_MEMORY_STAT_USABLE, 1024);
GET_BALLOON_STATS(data, "last-update",
VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE, 1);
+ GET_BALLOON_STATS(statsdata, "stat-disk-caches",
+ VIR_DOMAIN_MEMORY_STAT_DISK_CACHES, 1024);
ret = got;
cleanup:
virJSONValueFree(cmd);
vshPrint(ctl, "rss %llu\n", stats[i].val);
if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE)
vshPrint(ctl, "last_update %llu\n", stats[i].val);
+ if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_DISK_CACHES)
+ vshPrint(ctl, "disk_caches %llu\n", stats[i].val);
}
ret = true;
usable - The amount of memory which can be reclaimed by balloon
without causing host swapping (in KiB)
last-update - Timestamp of the last update of statistics (in seconds)
+ disk_caches - The amount of memory that can be reclaimed without
+additional I/O, typically disk caches (in KiB)
For QEMU/KVM with a memory balloon, setting the optional I<--period> to a
value larger than 0 in seconds will allow the balloon driver to return
balloon without causing host swapping (in KiB)
"balloon.last-update" - timestamp of the last update of statistics
(in seconds)
+ "balloon.disk_caches " - the amount of memory that can be reclaimed
+ without additional I/O, typically disk
+ caches (in KiB)
I<--vcpu> returns: