Skip to content

Commit

Permalink
xen: actually release memory when shrinking domain
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Dan Magenheimer authored and Ingo Molnar committed Jan 22, 2009
1 parent 066941b commit 1058a75
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/xen/balloon.c
Original file line number Diff line number Diff line change
@@ -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. */

0 comments on commit 1058a75

Please sign in to comment.