
On 4/28/19 11:18 AM, Han Han wrote:
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> --- include/libvirt/libvirt-domain.h | 14 +++++++++++++- src/libvirt-domain.c | 5 ++++- src/qemu/qemu_driver.c | 2 ++ src/qemu/qemu_monitor_json.c | 5 +++++ tools/virsh-domain-monitor.c | 4 ++++ tools/virsh.pod | 2 ++ 6 files changed, 30 insertions(+), 2 deletions(-)
Just a note for anybody reading this, these are the hugepages within the guest, i.e. 'virsh allocpages' run inside the guest, not host. Therefore ...
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 7d36820b5a..192d25c1db 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -636,11 +636,23 @@ typedef enum { */ VIR_DOMAIN_MEMORY_STAT_DISK_CACHES = 10,
+ /* + * The amount of successful hugetlb(Huge Page Tables) allocations via + * virtio balloon. + */ + VIR_DOMAIN_MEMORY_STAT_HUGETLB_PGALLOC = 11, + + /* + * The amount of failed hugetlb(Huge Page Tables) allocations via + * virtio balloon. + */ + VIR_DOMAIN_MEMORY_STAT_HUGETLB_PGFAIL = 12,
.. I'll update these to make it clearer. ACKed and pushed, sorry for the delay. Michal