[PATCH] xen: actually release memory when shrinking domain

From: Jeremy Fitzhardinge
Date: Thu Jan 22 2009 - 17:36:44 EST


From: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>

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@xxxxxxxxxx>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
---
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. */


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/