All of lore.kernel.org
 help / color / mirror / Atom feed
From: Prasad Joshi <prasadjoshi.linux@gmail.com>
To: prasadjoshi.linux@gmail.com
Cc: amit.shah@redhat.com, kvm@vger.kernel.org, avi@redhat.com
Subject: [PATCH] qemu-kvm: Change balloon page size to 1MB
Date: Mon, 20 Feb 2012 23:04:28 +0530	[thread overview]
Message-ID: <1329759269-2568-1-git-send-email-prasadjoshi.linux@gmail.com> (raw)

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


             reply	other threads:[~2012-02-20 17:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-20 17:34 Prasad Joshi [this message]
2012-02-20 17:34 ` [PATCH] virtio-balloon: Change balloon page size to 1MB Prasad Joshi
2012-02-21 23:03   ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1329759269-2568-1-git-send-email-prasadjoshi.linux@gmail.com \
    --to=prasadjoshi.linux@gmail.com \
    --cc=amit.shah@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.