diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-11 21:58:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-11 21:58:27 -0400 |
commit | e241e3f2bf975788a1b70dff2eb5180ca395b28e (patch) | |
tree | a3a297bc547ada3d3bdb973d58abb391866ecc96 | |
parent | e5c372280b9cc1057647b4307757b7885a732a7e (diff) | |
parent | 6c64fe7f2adcee21d7c4247f1ec021fd18428fc4 (diff) |
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull virtio update from Michael Tsirkin:
"This adds reporting hugepage stats to virtio-balloon"
* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
virtio_balloon: export hugetlb page allocation counts
-rw-r--r-- | drivers/virtio/virtio_balloon.c | 6 | ||||
-rw-r--r-- | include/uapi/linux/virtio_balloon.h | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index dfe5684000be..6b237e3f4983 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c | |||
@@ -272,6 +272,12 @@ static unsigned int update_balloon_stats(struct virtio_balloon *vb) | |||
272 | pages_to_bytes(events[PSWPOUT])); | 272 | pages_to_bytes(events[PSWPOUT])); |
273 | update_stat(vb, idx++, VIRTIO_BALLOON_S_MAJFLT, events[PGMAJFAULT]); | 273 | update_stat(vb, idx++, VIRTIO_BALLOON_S_MAJFLT, events[PGMAJFAULT]); |
274 | update_stat(vb, idx++, VIRTIO_BALLOON_S_MINFLT, events[PGFAULT]); | 274 | update_stat(vb, idx++, VIRTIO_BALLOON_S_MINFLT, events[PGFAULT]); |
275 | #ifdef CONFIG_HUGETLB_PAGE | ||
276 | update_stat(vb, idx++, VIRTIO_BALLOON_S_HTLB_PGALLOC, | ||
277 | events[HTLB_BUDDY_PGALLOC]); | ||
278 | update_stat(vb, idx++, VIRTIO_BALLOON_S_HTLB_PGFAIL, | ||
279 | events[HTLB_BUDDY_PGALLOC_FAIL]); | ||
280 | #endif | ||
275 | #endif | 281 | #endif |
276 | update_stat(vb, idx++, VIRTIO_BALLOON_S_MEMFREE, | 282 | update_stat(vb, idx++, VIRTIO_BALLOON_S_MEMFREE, |
277 | pages_to_bytes(i.freeram)); | 283 | pages_to_bytes(i.freeram)); |
diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h index 4e8b8304b793..40297a3181ed 100644 --- a/include/uapi/linux/virtio_balloon.h +++ b/include/uapi/linux/virtio_balloon.h | |||
@@ -53,7 +53,9 @@ struct virtio_balloon_config { | |||
53 | #define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */ | 53 | #define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */ |
54 | #define VIRTIO_BALLOON_S_AVAIL 6 /* Available memory as in /proc */ | 54 | #define VIRTIO_BALLOON_S_AVAIL 6 /* Available memory as in /proc */ |
55 | #define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */ | 55 | #define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */ |
56 | #define VIRTIO_BALLOON_S_NR 8 | 56 | #define VIRTIO_BALLOON_S_HTLB_PGALLOC 8 /* Hugetlb page allocations */ |
57 | #define VIRTIO_BALLOON_S_HTLB_PGFAIL 9 /* Hugetlb page allocation failures */ | ||
58 | #define VIRTIO_BALLOON_S_NR 10 | ||
57 | 59 | ||
58 | /* | 60 | /* |
59 | * Memory statistics structure. | 61 | * Memory statistics structure. |