[PATCH] qemu-kvm: Change balloon page size to 1MB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Prasad Joshi <prasadjoshi.linux@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux