aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/virtio
diff options
context:
space:
mode:
authorKonstantin Khlebnikov <k.khlebnikov@samsung.com>2014-10-09 18:29:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-09 22:26:01 -0400
commit09316c09dde33aae14f34489d9e3d243ec0d5938 (patch)
tree3238cf34be33d587a93db64a9f934f8b1c69cfb8 /drivers/virtio
parent9d1ba8056474a208ed9efb7e58cd014795d9f818 (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 'drivers/virtio')
-rw-r--r--drivers/virtio/Kconfig1
-rw-r--r--drivers/virtio/virtio_balloon.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig
index c6683f2e396c..00b228638274 100644
--- a/drivers/virtio/Kconfig
+++ b/drivers/virtio/Kconfig
@@ -25,6 +25,7 @@ config VIRTIO_PCI
25config VIRTIO_BALLOON 25config VIRTIO_BALLOON
26 tristate "Virtio balloon driver" 26 tristate "Virtio balloon driver"
27 depends on VIRTIO 27 depends on VIRTIO
28 select MEMORY_BALLOON
28 ---help--- 29 ---help---
29 This driver supports increasing and decreasing the amount 30 This driver supports increasing and decreasing the amount
30 of memory within a KVM guest. 31 of memory within a KVM guest.
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 2bad7f9dd2ac..f893148a107b 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -396,6 +396,7 @@ static int virtballoon_migratepage(struct balloon_dev_info *vb_dev_info,
396 spin_lock_irqsave(&vb_dev_info->pages_lock, flags); 396 spin_lock_irqsave(&vb_dev_info->pages_lock, flags);
397 balloon_page_insert(vb_dev_info, newpage); 397 balloon_page_insert(vb_dev_info, newpage);
398 vb_dev_info->isolated_pages--; 398 vb_dev_info->isolated_pages--;
399 __count_vm_event(BALLOON_MIGRATE);
399 spin_unlock_irqrestore(&vb_dev_info->pages_lock, flags); 400 spin_unlock_irqrestore(&vb_dev_info->pages_lock, flags);
400 vb->num_pfns = VIRTIO_BALLOON_PAGES_PER_PAGE; 401 vb->num_pfns = VIRTIO_BALLOON_PAGES_PER_PAGE;
401 set_page_pfns(vb->pfns, newpage); 402 set_page_pfns(vb->pfns, newpage);