ia64/linux-2.6.18-xen.hg

view arch/mips/arc/misc.c @ 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 831230e53067
children
line source
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Miscellaneous ARCS PROM routines.
7 *
8 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
9 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
10 * Copyright (C) 1999 Silicon Graphics, Inc.
11 */
12 #include <linux/init.h>
13 #include <linux/kernel.h>
15 #include <asm/bcache.h>
17 #include <asm/arc/types.h>
18 #include <asm/sgialib.h>
19 #include <asm/bootinfo.h>
20 #include <asm/system.h>
22 VOID
23 ArcHalt(VOID)
24 {
25 bc_disable();
26 local_irq_disable();
27 ARC_CALL0(halt);
28 never: goto never;
29 }
31 VOID
32 ArcPowerDown(VOID)
33 {
34 bc_disable();
35 local_irq_disable();
36 ARC_CALL0(pdown);
37 never: goto never;
38 }
40 /* XXX is this a soft reset basically? XXX */
41 VOID
42 ArcRestart(VOID)
43 {
44 bc_disable();
45 local_irq_disable();
46 ARC_CALL0(restart);
47 never: goto never;
48 }
50 VOID
51 ArcReboot(VOID)
52 {
53 bc_disable();
54 local_irq_disable();
55 ARC_CALL0(reboot);
56 never: goto never;
57 }
59 VOID
60 ArcEnterInteractiveMode(VOID)
61 {
62 bc_disable();
63 local_irq_disable();
64 ARC_CALL0(imode);
65 never: goto never;
66 }
68 LONG
69 ArcSaveConfiguration(VOID)
70 {
71 return ARC_CALL0(cfg_save);
72 }
74 struct linux_sysid *
75 ArcGetSystemId(VOID)
76 {
77 return (struct linux_sysid *) ARC_CALL0(get_sysid);
78 }
80 VOID __init
81 ArcFlushAllCaches(VOID)
82 {
83 ARC_CALL0(cache_flush);
84 }
86 DISPLAY_STATUS * __init ArcGetDisplayStatus(ULONG FileID)
87 {
88 return (DISPLAY_STATUS *) ARC_CALL1(GetDisplayStatus, FileID);
89 }