File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ static unsigned int update_balloon_stats(struct virtio_balloon *vb)
321321 unsigned long events [NR_VM_EVENT_ITEMS ];
322322 struct sysinfo i ;
323323 unsigned int idx = 0 ;
324- long available ;
324+ long available , stall = 0 ;
325325 unsigned long caches ;
326326
327327 all_vm_events (events );
@@ -355,6 +355,23 @@ static unsigned int update_balloon_stats(struct virtio_balloon *vb)
355355 update_stat (vb , idx ++ , VIRTIO_BALLOON_S_OOM_KILL ,
356356 events [OOM_KILL ]);
357357
358+ /* sum all the stall event */
359+ #ifdef CONFIG_ZONE_DMA
360+ stall += events [ALLOCSTALL_DMA ];
361+ #endif
362+ #ifdef CONFIG_ZONE_DMA32
363+ stall += events [ALLOCSTALL_DMA32 ];
364+ #endif
365+ #ifdef CONFIG_HIGHMEM
366+ stall += events [ALLOCSTALL_HIGH ];
367+ #endif
368+ #ifdef CONFIG_ZONE_DEVICE
369+ stall += events [ALLOCSTALL_DEVICE ];
370+ #endif
371+ stall += events [ALLOCSTALL_NORMAL ];
372+ stall += events [ALLOCSTALL_MOVABLE ];
373+ update_stat (vb , idx ++ , VIRTIO_BALLOON_S_ALLOC_STALL , stall );
374+
358375 return idx ;
359376}
360377
Original file line number Diff line number Diff line change @@ -72,7 +72,8 @@ struct virtio_balloon_config {
7272#define VIRTIO_BALLOON_S_HTLB_PGALLOC 8 /* Hugetlb page allocations */
7373#define VIRTIO_BALLOON_S_HTLB_PGFAIL 9 /* Hugetlb page allocation failures */
7474#define VIRTIO_BALLOON_S_OOM_KILL 10 /* OOM killer invocations */
75- #define VIRTIO_BALLOON_S_NR 11
75+ #define VIRTIO_BALLOON_S_ALLOC_STALL 11 /* Stall count of memory allocatoin */
76+ #define VIRTIO_BALLOON_S_NR 12
7677
7778#define VIRTIO_BALLOON_S_NAMES_WITH_PREFIX (VIRTIO_BALLOON_S_NAMES_prefix ) { \
7879 VIRTIO_BALLOON_S_NAMES_prefix "swap-in", \
@@ -85,7 +86,8 @@ struct virtio_balloon_config {
8586 VIRTIO_BALLOON_S_NAMES_prefix "disk-caches", \
8687 VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-allocations", \
8788 VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-failures", \
88- VIRTIO_BALLOON_S_NAMES_prefix "oom-kill" \
89+ VIRTIO_BALLOON_S_NAMES_prefix "oom-kill", \
90+ VIRTIO_BALLOON_S_NAMES_prefix "alloc-stall" \
8991}
9092
9193#define VIRTIO_BALLOON_S_NAMES VIRTIO_BALLOON_S_NAMES_WITH_PREFIX("")
You can’t perform that action at this time.
0 commit comments