diff options
| author | Konstantin Khlebnikov <k.khlebnikov@samsung.com> | 2014-10-09 18:29:32 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-09 22:26:01 -0400 |
| commit | 09316c09dde33aae14f34489d9e3d243ec0d5938 (patch) | |
| tree | 3238cf34be33d587a93db64a9f934f8b1c69cfb8 /include | |
| parent | 9d1ba8056474a208ed9efb7e58cd014795d9f818 (diff) | |
mm/balloon_compaction: add vmstat counters and kpageflags bit
Always mark pages with PageBalloon even if balloon compaction is disabled
and expose this mark in /proc/kpageflags as KPF_BALLOON.
Also this patch adds three counters into /proc/vmstat: "balloon_inflate",
"balloon_deflate" and "balloon_migrate". They accumulate balloon
activity. Current size of balloon is (balloon_inflate - balloon_deflate)
pages.
All generic balloon code now gathered under option CONFIG_MEMORY_BALLOON.
It should be selected by ballooning driver which wants use this feature.
Currently virtio-balloon is the only user.
Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
Cc: Rafael Aquini <aquini@redhat.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/balloon_compaction.h | 2 | ||||
| -rw-r--r-- | include/linux/vm_event_item.h | 7 | ||||
| -rw-r--r-- | include/uapi/linux/kernel-page-flags.h | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/balloon_compaction.h b/include/linux/balloon_compaction.h index bc3d2985cc9a..9b0a15d06a4f 100644 --- a/include/linux/balloon_compaction.h +++ b/include/linux/balloon_compaction.h | |||
| @@ -166,11 +166,13 @@ static inline gfp_t balloon_mapping_gfp_mask(void) | |||
| 166 | static inline void balloon_page_insert(struct balloon_dev_info *balloon, | 166 | static inline void balloon_page_insert(struct balloon_dev_info *balloon, |
| 167 | struct page *page) | 167 | struct page *page) |
| 168 | { | 168 | { |
| 169 | __SetPageBalloon(page); | ||
| 169 | list_add(&page->lru, &balloon->pages); | 170 | list_add(&page->lru, &balloon->pages); |
| 170 | } | 171 | } |
| 171 | 172 | ||
| 172 | static inline void balloon_page_delete(struct page *page) | 173 | static inline void balloon_page_delete(struct page *page) |
| 173 | { | 174 | { |
| 175 | __ClearPageBalloon(page); | ||
| 174 | list_del(&page->lru); | 176 | list_del(&page->lru); |
| 175 | } | 177 | } |
| 176 | 178 | ||
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index ced92345c963..730334cdf037 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h | |||
| @@ -72,6 +72,13 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
| 72 | THP_ZERO_PAGE_ALLOC, | 72 | THP_ZERO_PAGE_ALLOC, |
| 73 | THP_ZERO_PAGE_ALLOC_FAILED, | 73 | THP_ZERO_PAGE_ALLOC_FAILED, |
| 74 | #endif | 74 | #endif |
| 75 | #ifdef CONFIG_MEMORY_BALLOON | ||
| 76 | BALLOON_INFLATE, | ||
| 77 | BALLOON_DEFLATE, | ||
| 78 | #ifdef CONFIG_BALLOON_COMPACTION | ||
| 79 | BALLOON_MIGRATE, | ||
| 80 | #endif | ||
| 81 | #endif | ||
| 75 | #ifdef CONFIG_DEBUG_TLBFLUSH | 82 | #ifdef CONFIG_DEBUG_TLBFLUSH |
| 76 | #ifdef CONFIG_SMP | 83 | #ifdef CONFIG_SMP |
| 77 | NR_TLB_REMOTE_FLUSH, /* cpu tried to flush others' tlbs */ | 84 | NR_TLB_REMOTE_FLUSH, /* cpu tried to flush others' tlbs */ |
diff --git a/include/uapi/linux/kernel-page-flags.h b/include/uapi/linux/kernel-page-flags.h index 5116a0e48172..2f96d233c980 100644 --- a/include/uapi/linux/kernel-page-flags.h +++ b/include/uapi/linux/kernel-page-flags.h | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | 31 | ||
| 32 | #define KPF_KSM 21 | 32 | #define KPF_KSM 21 |
| 33 | #define KPF_THP 22 | 33 | #define KPF_THP 22 |
| 34 | #define KPF_BALLOON 23 | ||
| 34 | 35 | ||
| 35 | 36 | ||
| 36 | #endif /* _UAPILINUX_KERNEL_PAGE_FLAGS_H */ | 37 | #endif /* _UAPILINUX_KERNEL_PAGE_FLAGS_H */ |
