ia64/linux-2.6.18-xen.hg

view arch/mips/arc/identify.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 * identify.c: identify machine by looking up system identifier
7 *
8 * Copyright (C) 1998 Thomas Bogendoerfer
9 *
10 * This code is based on arch/mips/sgi/kernel/system.c, which is
11 *
12 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
13 */
14 #include <linux/init.h>
15 #include <linux/kernel.h>
16 #include <linux/types.h>
17 #include <linux/string.h>
19 #include <asm/sgialib.h>
20 #include <asm/bootinfo.h>
22 struct smatch {
23 char *arcname;
24 char *liname;
25 int group;
26 int type;
27 int flags;
28 };
30 static struct smatch mach_table[] = {
31 { "SGI-IP22",
32 "SGI Indy",
33 MACH_GROUP_SGI,
34 MACH_SGI_IP22,
35 PROM_FLAG_ARCS
36 }, { "SGI-IP27",
37 "SGI Origin",
38 MACH_GROUP_SGI,
39 MACH_SGI_IP27,
40 PROM_FLAG_ARCS
41 }, { "SGI-IP28",
42 "SGI IP28",
43 MACH_GROUP_SGI,
44 MACH_SGI_IP28,
45 PROM_FLAG_ARCS
46 }, { "SGI-IP30",
47 "SGI Octane",
48 MACH_GROUP_SGI,
49 MACH_SGI_IP30,
50 PROM_FLAG_ARCS
51 }, { "SGI-IP32",
52 "SGI O2",
53 MACH_GROUP_SGI,
54 MACH_SGI_IP32,
55 PROM_FLAG_ARCS
56 }, { "Microsoft-Jazz",
57 "Jazz MIPS_Magnum_4000",
58 MACH_GROUP_JAZZ,
59 MACH_MIPS_MAGNUM_4000,
60 0
61 }, { "PICA-61",
62 "Jazz Acer_PICA_61",
63 MACH_GROUP_JAZZ,
64 MACH_ACER_PICA_61,
65 0
66 }, { "RM200PCI",
67 "SNI RM200_PCI",
68 MACH_GROUP_SNI_RM,
69 MACH_SNI_RM200_PCI,
70 PROM_FLAG_DONT_FREE_TEMP
71 }
72 };
74 int prom_flags;
76 static struct smatch * __init string_to_mach(const char *s)
77 {
78 int i;
80 for (i = 0; i < (sizeof(mach_table) / sizeof (mach_table[0])); i++) {
81 if (!strcmp(s, mach_table[i].arcname))
82 return &mach_table[i];
83 }
85 panic("Yeee, could not determine architecture type <%s>", s);
86 }
88 char *system_type;
90 const char *get_system_type(void)
91 {
92 return system_type;
93 }
95 void __init prom_identify_arch(void)
96 {
97 pcomponent *p;
98 struct smatch *mach;
99 const char *iname;
101 /*
102 * The root component tells us what machine architecture we have here.
103 */
104 p = ArcGetChild(PROM_NULL_COMPONENT);
105 if (p == NULL) {
106 #ifdef CONFIG_SGI_IP27
107 /* IP27 PROM misbehaves, seems to not implement ARC
108 GetChild(). So we just assume it's an IP27. */
109 iname = "SGI-IP27";
110 #else
111 iname = "Unknown";
112 #endif
113 } else
114 iname = (char *) (long) p->iname;
116 printk("ARCH: %s\n", iname);
117 mach = string_to_mach(iname);
118 system_type = mach->liname;
120 mips_machgroup = mach->group;
121 mips_machtype = mach->type;
122 prom_flags = mach->flags;
123 }