All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qemu-kvm: Change balloon page size to 1MB
@ 2012-02-20 17:34 Prasad Joshi
  2012-02-20 17:34 ` [PATCH] virtio-balloon: " Prasad Joshi
  0 siblings, 1 reply; 3+ messages in thread
From: Prasad Joshi @ 2012-02-20 17:34 UTC (permalink / raw)
  To: prasadjoshi.linux; +Cc: amit.shah, kvm, avi

Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com>
---
 hw/virtio-balloon.c |    2 +-
 hw/virtio-balloon.h |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c
index ce9d2c9..765dd97 100644
--- a/hw/virtio-balloon.c
+++ b/hw/virtio-balloon.c
@@ -48,7 +48,7 @@ static void balloon_page(void *addr, int deflate)
 {
 #if defined(__linux__)
     if (!kvm_enabled() || kvm_has_sync_mmu())
-        qemu_madvise(addr, TARGET_PAGE_SIZE,
+        qemu_madvise(addr, BALLOON_PAGE_SIZE,
                 deflate ? QEMU_MADV_WILLNEED : QEMU_MADV_DONTNEED);
 #endif
 }
diff --git a/hw/virtio-balloon.h b/hw/virtio-balloon.h
index 73300dd..0da82bf 100644
--- a/hw/virtio-balloon.h
+++ b/hw/virtio-balloon.h
@@ -28,7 +28,11 @@
 #define VIRTIO_BALLOON_F_STATS_VQ 1       /* Memory stats virtqueue */
 
 /* Size of a PFN in the balloon interface. */
-#define VIRTIO_BALLOON_PFN_SHIFT 12
+#define VIRTIO_BALLOON_PFN_SHIFT 20
+
+/* Size of the balloon page */
+#define BALLOON_PAGE_SIZE (1UL << VIRTIO_BALLOON_PFN_SHIFT)
+
 
 struct virtio_balloon_config
 {
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-21 23:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-20 17:34 [PATCH] qemu-kvm: Change balloon page size to 1MB Prasad Joshi
2012-02-20 17:34 ` [PATCH] virtio-balloon: " Prasad Joshi
2012-02-21 23:03   ` Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.