public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: "dan.magenheimer@oracle.com" <dan.magenheimer@oracle.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Xen-devel <xen-devel@lists.xensource.com>,
	Stable Kernel <stable@kernel.org>
Subject: [PATCH] xen: actually release memory when shrinking domain
Date: Thu, 22 Jan 2009 14:36:08 -0800	[thread overview]
Message-ID: <4978F4D8.6090706@goop.org> (raw)

From: Dan Magenheimer <dan.magenheimer@oracle.com>

Fix this:

> It appears that in the upstream balloon driver,
> > the call to HYPERVISOR_update_va_mapping is missing
> > from decrease_reservation.  I think as a result,
> > the balloon driver is eating memory but not
> > releasing it to Xen, thus rendering the balloon
> > driver essentially useless.  (Can be observed via xentop.)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
 drivers/xen/balloon.c |    5 +++++
 1 file changed, 5 insertions(+)

===================================================================
--- linux-2.6.28/drivers/xen/balloon.c.orig
+++ linux-2.6.28/drivers/xen/balloon.c
@@ -296,6 +296,11 @@
 		frame_list[i] = pfn_to_mfn(pfn);
 
 		scrub_page(page);
+
+		ret = HYPERVISOR_update_va_mapping(
+			(unsigned long)__va(pfn << PAGE_SHIFT),
+			__pte_ma(0), 0);
+		BUG_ON(ret);
 	}
 
 	/* Ensure that ballooned highmem pages don't have kmaps. */



             reply	other threads:[~2009-01-22 22:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22 22:36 Jeremy Fitzhardinge [this message]
2009-01-22 22:42 ` [PATCH] xen: actually release memory when shrinking domain Ingo Molnar
2009-01-23 14:09 ` [Xen-devel] " Ian Campbell
2009-01-23 16:16   ` Jeremy Fitzhardinge

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=4978F4D8.6090706@goop.org \
    --to=jeremy@goop.org \
    --cc=dan.magenheimer@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=stable@kernel.org \
    --cc=xen-devel@lists.xensource.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox