ia64/linux-2.6.18-xen.hg

view arch/ia64/xen/xensetup.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
line source
1 /*
2 * Support routines for Xen
3 *
4 * Copyright (C) 2005 Dan Magenheimer <dan.magenheimer@hp.com>
5 */
7 #include <asm/processor.h>
8 #include <asm/asmmacro.h>
10 .section .data.read_mostly
11 .align 8
12 .global running_on_xen
13 running_on_xen:
14 data4 0
15 .previous
17 #define isBP p3 // are we the Bootstrap Processor?
19 .text
20 GLOBAL_ENTRY(early_xen_setup)
21 mov r8=ar.rsc // Initialized in head.S
22 (isBP) movl r9=running_on_xen;;
23 extr.u r8=r8,2,2;; // Extract pl fields
24 cmp.eq p7,p0=r8,r0 // p7: !running on xen
25 mov r8=1 // booleanize.
26 (p7) br.ret.sptk.many rp;;
27 (isBP) st4 [r9]=r8
28 movl r10=xen_ivt;;
30 mov cr.iva=r10
32 /* Set xsi base. */
33 #define FW_HYPERCALL_SET_SHARED_INFO_VA 0x600
34 (isBP) mov r2=FW_HYPERCALL_SET_SHARED_INFO_VA
35 (isBP) movl r28=XSI_BASE;;
36 (isBP) break 0x1000;;
38 br.ret.sptk.many rp
39 ;;
40 END(early_xen_setup)