qemu: Add entry for balloon stats stat-htlb-pgalloc and stat-htlb-pgfail

Qemu added reporting of virtio balloon new statistics stat-htlb-pgalloc and
stat-htlb-pgfail since qemu-3.0 commit b7b12644297. The value of
stat-htlb-pgalloc represents the number of successful hugetlb page allocations
while stat-htlb-pgfail represents the number of failed ones. Add this
statistics reporting to libvirt.

To enable this feature for vm, guest kenel >= 4.17 is required because
the exporting hugetlb page allocation for virtio balloon is introduced
since 6c64fe7f.

Signed-off-by: Han Han <hhan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Han Han
2019-04-28 17:18:05 +08:00
committed by Michal Privoznik
parent dfd70ca1eb
commit a699b19f6c
6 changed files with 32 additions and 1 deletions

View File

@@ -636,11 +636,23 @@ typedef enum {
*/
VIR_DOMAIN_MEMORY_STAT_DISK_CACHES = 10,
/*
* The amount of successful huge page allocations from inside the domain via
* virtio balloon.
*/
VIR_DOMAIN_MEMORY_STAT_HUGETLB_PGALLOC = 11,
/*
* The amount of failed huge page allocations from inside the domain via
* virtio balloon.
*/
VIR_DOMAIN_MEMORY_STAT_HUGETLB_PGFAIL = 12,
/*
* 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 = 11,
VIR_DOMAIN_MEMORY_STAT_NR = 13,
# ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_MEMORY_STAT_LAST = VIR_DOMAIN_MEMORY_STAT_NR