From: Dan Magenheimer Date: Thu, 22 Jan 2009 22:36:08 +0000 (-0800) Subject: xen: actually release memory when shrinking domain X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1058a75f07b9bb8323fb5197be5526220f8b75cf;p=openwrt%2Fstaging%2Fblogic.git xen: actually release memory when shrinking domain 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 Signed-off-by: Jeremy Fitzhardinge Signed-off-by: Ingo Molnar --- diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 8dc7109d61b7..8069d520c460 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -298,6 +298,11 @@ static int decrease_reservation(unsigned long nr_pages) 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. */