When the guest OS runs under critical memory pressure, the guest starts to kill processes. A guest monitor agent may scan 'oom_kill' from /proc/vmstat, and reports the OOM KILL event. However, the agent may be killed and we will loss this critical event(and the later events). For now we can also grep for magic words in guest kernel log from host side. Rather than this unstable way, virtio balloon reports OOM-KILL invocations instead.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -71,7 +71,8 @@ struct virtio_balloon_config { · 70 unmodified lines | |||
| 71 | #define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */ | 71 | #define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */ |
| 72 | #define VIRTIO_BALLOON_S_HTLB_PGALLOC 8 /* Hugetlb page allocations */ | 72 | #define VIRTIO_BALLOON_S_HTLB_PGALLOC 8 /* Hugetlb page allocations */ |
| 73 | #define VIRTIO_BALLOON_S_HTLB_PGFAIL 9 /* Hugetlb page allocation failures */ | 73 | #define VIRTIO_BALLOON_S_HTLB_PGFAIL 9 /* Hugetlb page allocation failures */ |
| 74 | #define VIRTIO_BALLOON_S_NR 10 | 74 | #define VIRTIO_BALLOON_S_OOM_KILL 10 /* OOM killer invocations */ |
| 75 | #define VIRTIO_BALLOON_S_NR 11 | ||
| 75 | 76 | ||
| 76 | #define VIRTIO_BALLOON_S_NAMES_WITH_PREFIX(VIRTIO_BALLOON_S_NAMES_prefix) { \ | 77 | #define VIRTIO_BALLOON_S_NAMES_WITH_PREFIX(VIRTIO_BALLOON_S_NAMES_prefix) { \ |
| 77 | VIRTIO_BALLOON_S_NAMES_prefix "swap-in", \ | 78 | VIRTIO_BALLOON_S_NAMES_prefix "swap-in", \ |
| @@ -83,7 +84,8 @@ struct virtio_balloon_config { · 5 unmodified lines | |||
| 83 | VIRTIO_BALLOON_S_NAMES_prefix "available-memory", \ | 84 | VIRTIO_BALLOON_S_NAMES_prefix "available-memory", \ |
| 84 | VIRTIO_BALLOON_S_NAMES_prefix "disk-caches", \ | 85 | VIRTIO_BALLOON_S_NAMES_prefix "disk-caches", \ |
| 85 | VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-allocations", \ | 86 | VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-allocations", \ |
| 86 | VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-failures" \ | 87 | VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-failures", \ |
| 88 | VIRTIO_BALLOON_S_NAMES_prefix "oom-kills" \ | ||
| 87 | } | 89 | } |
| 88 | 90 | ||
| 89 | #define VIRTIO_BALLOON_S_NAMES VIRTIO_BALLOON_S_NAMES_WITH_PREFIX("") | 91 | #define VIRTIO_BALLOON_S_NAMES VIRTIO_BALLOON_S_NAMES_WITH_PREFIX("") |