From mboxrd@z Thu Jan 1 00:00:00 1970 From: Prasad Joshi Subject: [PATCH] qemu-kvm: Change balloon page size to 1MB Date: Mon, 20 Feb 2012 23:04:28 +0530 Message-ID: <1329759269-2568-1-git-send-email-prasadjoshi.linux@gmail.com> Cc: amit.shah@redhat.com, kvm@vger.kernel.org, avi@redhat.com To: prasadjoshi.linux@gmail.com Return-path: Received: from mail-pw0-f46.google.com ([209.85.160.46]:55653 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751582Ab2BTRej (ORCPT ); Mon, 20 Feb 2012 12:34:39 -0500 Received: by pbcun15 with SMTP id un15so6464299pbc.19 for ; Mon, 20 Feb 2012 09:34:39 -0800 (PST) Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Prasad Joshi --- 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