From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Jonathan Helman <jonathan.helman@oracle.com>,
Jason Wang <jasowang@redhat.com>
Subject: [Qemu-devel] [PULL 4/4] virtio-balloon: add hugetlb page allocation counts
Date: Fri, 27 Apr 2018 06:29:37 +0300 [thread overview]
Message-ID: <1524799751-151698-5-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1524799751-151698-1-git-send-email-mst@redhat.com>
From: Jonathan Helman <jonathan.helman@oracle.com>
qemu should read and report hugetlb page allocation
counts exported in the following kernel patch:
commit 4c3ca37c4a4394978fd0f005625f6064ed2b9a64
Author: Jonathan Helman <jonathan.helman@oracle.com>
Date: Mon Mar 19 11:00:35 2018 -0700
virtio_balloon: export hugetlb page allocation counts
Export the number of successful and failed hugetlb page
allocations via the virtio balloon driver. These 2 counts
come directly from the vm_events HTLB_BUDDY_PGALLOC and
HTLB_BUDDY_PGALLOC_FAIL.
Signed-off-by: Jonathan Helman <jonathan.helman@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Jason Wang <jasowang@redhat.com>
---
docs/virtio-balloon-stats.txt | 2 ++
include/standard-headers/linux/virtio_balloon.h | 4 +++-
hw/virtio/virtio-balloon.c | 2 ++
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/docs/virtio-balloon-stats.txt b/docs/virtio-balloon-stats.txt
index 7a66d25..9985e1d 100644
--- a/docs/virtio-balloon-stats.txt
+++ b/docs/virtio-balloon-stats.txt
@@ -34,6 +34,8 @@ which will return a dictionary containing:
- stat-total-memory
- stat-available-memory
- stat-disk-caches
+ - stat-htlb-pgalloc
+ - stat-htlb-pgfail
o A key named last-update, which contains the last stats update
timestamp in seconds. Since this timestamp is generated by the host,
diff --git a/include/standard-headers/linux/virtio_balloon.h b/include/standard-headers/linux/virtio_balloon.h
index 7b0a41b..e446805 100644
--- a/include/standard-headers/linux/virtio_balloon.h
+++ b/include/standard-headers/linux/virtio_balloon.h
@@ -53,7 +53,9 @@ struct virtio_balloon_config {
#define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */
#define VIRTIO_BALLOON_S_AVAIL 6 /* Available memory as in /proc */
#define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */
-#define VIRTIO_BALLOON_S_NR 8
+#define VIRTIO_BALLOON_S_HTLB_PGALLOC 8 /* Hugetlb page allocations */
+#define VIRTIO_BALLOON_S_HTLB_PGFAIL 9 /* Hugetlb page allocation failures */
+#define VIRTIO_BALLOON_S_NR 10
/*
* Memory statistics structure.
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index f456cea..1f7a87f 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -52,6 +52,8 @@ static const char *balloon_stat_names[] = {
[VIRTIO_BALLOON_S_MEMTOT] = "stat-total-memory",
[VIRTIO_BALLOON_S_AVAIL] = "stat-available-memory",
[VIRTIO_BALLOON_S_CACHES] = "stat-disk-caches",
+ [VIRTIO_BALLOON_S_HTLB_PGALLOC] = "stat-htlb-pgalloc",
+ [VIRTIO_BALLOON_S_HTLB_PGFAIL] = "stat-htlb-pgfail",
[VIRTIO_BALLOON_S_NR] = NULL
};
--
MST
next prev parent reply other threads:[~2018-04-27 3:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-27 3:29 [Qemu-devel] [PULL 0/4] pc, pci, virtio: fixes, features Michael S. Tsirkin
2018-04-27 3:29 ` [Qemu-devel] [PULL 1/4] intel-iommu: send PSI always when notify_unmap set Michael S. Tsirkin
2018-04-27 3:29 ` [Qemu-devel] [PULL 2/4] hw/pci-host/q35: Replace hardcoded value with macro Michael S. Tsirkin
2018-04-27 3:29 ` [Qemu-devel] [PULL 3/4] allocate pci id for mdpy Michael S. Tsirkin
2018-04-27 3:29 ` Michael S. Tsirkin [this message]
2018-04-27 9:49 ` [Qemu-devel] [PULL 0/4] pc, pci, virtio: fixes, features Peter Maydell
2018-04-27 15:21 ` Michael S. Tsirkin
2018-04-27 15:24 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1524799751-151698-5-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=jasowang@redhat.com \
--cc=jonathan.helman@oracle.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).