ia64/linux-2.6.18-xen.hg

annotate arch/ia64/xen/xcom_asm.S @ 897:329ea0ccb344

balloon: try harder to balloon up under memory pressure.

Currently if the balloon driver is unable to increase the guest's
reservation it assumes the failure was due to reaching its full
allocation, gives up on the ballooning operation and records the limit
it reached as the "hard limit". The driver will not try again until
the target is set again (even to the same value).

However it is possible that ballooning has in fact failed due to
memory pressure in the host and therefore it is desirable to keep
attempting to reach the target in case memory becomes available. The
most likely scenario is that some guests are ballooning down while
others are ballooning up and therefore there is temporary memory
pressure while things stabilise. You would not expect a well behaved
toolstack to ask a domain to balloon to more than its allocation nor
would you expect it to deliberately over-commit memory by setting
balloon targets which exceed the total host memory.

This patch drops the concept of a hard limit and causes the balloon
driver to retry increasing the reservation on a timer in the same
manner as when decreasing the reservation.

Also if we partially succeed in increasing the reservation
(i.e. receive less pages than we asked for) then we may as well keep
those pages rather than returning them to Xen.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 05 14:01:20 2009 +0100 (2009-06-05)
parents 3588f645c754
children
rev   line source
alex@406 1 /*
alex@406 2 * xencomm suspend support
alex@406 3 * Support routines for Xen
alex@406 4 *
alex@406 5 * Copyright (C) 2005 Dan Magenheimer <dan.magenheimer@hp.com>
alex@406 6 */
alex@406 7 #include <asm/asmmacro.h>
alex@406 8 #include <xen/interface/xen.h>
alex@406 9
alex@406 10 /*
alex@406 11 * Stub for suspend.
alex@406 12 * Just force the stacked registers to be written in memory.
alex@406 13 */
alex@406 14 GLOBAL_ENTRY(xencomm_arch_hypercall_suspend)
alex@406 15 ;;
alex@406 16 alloc r20=ar.pfs,0,0,6,0
alex@406 17 mov r2=__HYPERVISOR_sched_op
alex@406 18 ;;
alex@406 19 /* We don't want to deal with RSE. */
alex@406 20 flushrs
alex@406 21 mov r33=r32
alex@406 22 mov r32=2 // SCHEDOP_shutdown
alex@406 23 ;;
alex@406 24 break 0x1000
alex@406 25 ;;
alex@406 26 br.ret.sptk.many b0
alex@406 27 END(xencomm_arch_hypercall_suspend)