ia64/linux-2.6.18-xen.hg

view arch/alpha/kernel/proto.h @ 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 #include <linux/interrupt.h>
4 /* Prototypes of functions used across modules here in this directory. */
6 #define vucp volatile unsigned char *
7 #define vusp volatile unsigned short *
8 #define vip volatile int *
9 #define vuip volatile unsigned int *
10 #define vulp volatile unsigned long *
12 struct pt_regs;
13 struct task_struct;
14 struct pci_dev;
15 struct pci_controller;
17 /* core_apecs.c */
18 extern struct pci_ops apecs_pci_ops;
19 extern void apecs_init_arch(void);
20 extern void apecs_pci_clr_err(void);
21 extern void apecs_machine_check(u64, u64, struct pt_regs *);
22 extern void apecs_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
24 /* core_cia.c */
25 extern struct pci_ops cia_pci_ops;
26 extern void cia_init_pci(void);
27 extern void cia_init_arch(void);
28 extern void pyxis_init_arch(void);
29 extern void cia_kill_arch(int);
30 extern void cia_machine_check(u64, u64, struct pt_regs *);
31 extern void cia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
33 /* core_irongate.c */
34 extern struct pci_ops irongate_pci_ops;
35 extern int irongate_pci_clr_err(void);
36 extern void irongate_init_arch(void);
37 extern void irongate_machine_check(u64, u64, struct pt_regs *);
38 #define irongate_pci_tbi ((void *)0)
40 /* core_lca.c */
41 extern struct pci_ops lca_pci_ops;
42 extern void lca_init_arch(void);
43 extern void lca_machine_check(u64, u64, struct pt_regs *);
44 extern void lca_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
46 /* core_marvel.c */
47 extern struct pci_ops marvel_pci_ops;
48 extern void marvel_init_arch(void);
49 extern void marvel_kill_arch(int);
50 extern void marvel_machine_check(u64, u64, struct pt_regs *);
51 extern void marvel_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
52 extern int marvel_pa_to_nid(unsigned long);
53 extern int marvel_cpuid_to_nid(int);
54 extern unsigned long marvel_node_mem_start(int);
55 extern unsigned long marvel_node_mem_size(int);
56 extern struct _alpha_agp_info *marvel_agp_info(void);
57 struct io7 *marvel_find_io7(int pe);
58 struct io7 *marvel_next_io7(struct io7 *prev);
59 void io7_clear_errors(struct io7 *io7);
61 /* core_mcpcia.c */
62 extern struct pci_ops mcpcia_pci_ops;
63 extern void mcpcia_init_arch(void);
64 extern void mcpcia_init_hoses(void);
65 extern void mcpcia_machine_check(u64, u64, struct pt_regs *);
66 extern void mcpcia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
68 /* core_polaris.c */
69 extern struct pci_ops polaris_pci_ops;
70 extern int polaris_read_config_dword(struct pci_dev *, int, u32 *);
71 extern int polaris_write_config_dword(struct pci_dev *, int, u32);
72 extern void polaris_init_arch(void);
73 extern void polaris_machine_check(u64, u64, struct pt_regs *);
74 #define polaris_pci_tbi ((void *)0)
76 /* core_t2.c */
77 extern struct pci_ops t2_pci_ops;
78 extern void t2_init_arch(void);
79 extern void t2_kill_arch(int);
80 extern void t2_machine_check(u64, u64, struct pt_regs *);
81 extern void t2_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
83 /* core_titan.c */
84 extern struct pci_ops titan_pci_ops;
85 extern void titan_init_arch(void);
86 extern void titan_kill_arch(int);
87 extern void titan_machine_check(u64, u64, struct pt_regs *);
88 extern void titan_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
89 extern struct _alpha_agp_info *titan_agp_info(void);
91 /* core_tsunami.c */
92 extern struct pci_ops tsunami_pci_ops;
93 extern void tsunami_init_arch(void);
94 extern void tsunami_kill_arch(int);
95 extern void tsunami_machine_check(u64, u64, struct pt_regs *);
96 extern void tsunami_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
98 /* core_wildfire.c */
99 extern struct pci_ops wildfire_pci_ops;
100 extern void wildfire_init_arch(void);
101 extern void wildfire_kill_arch(int);
102 extern void wildfire_machine_check(u64, u64, struct pt_regs *);
103 extern void wildfire_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t);
104 extern int wildfire_pa_to_nid(unsigned long);
105 extern int wildfire_cpuid_to_nid(int);
106 extern unsigned long wildfire_node_mem_start(int);
107 extern unsigned long wildfire_node_mem_size(int);
109 /* setup.c */
110 extern unsigned long srm_hae;
111 extern int boot_cpuid;
112 #ifdef CONFIG_VERBOSE_MCHECK
113 extern unsigned long alpha_verbose_mcheck;
114 #endif
116 /* srmcons.c */
117 #if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_SRM)
118 extern void register_srm_console(void);
119 extern void unregister_srm_console(void);
120 #else
121 #define register_srm_console()
122 #define unregister_srm_console()
123 #endif
125 /* smp.c */
126 extern void setup_smp(void);
127 extern void handle_ipi(struct pt_regs *);
128 extern void smp_percpu_timer_interrupt(struct pt_regs *);
130 /* bios32.c */
131 /* extern void reset_for_srm(void); */
133 /* time.c */
134 extern irqreturn_t timer_interrupt(int irq, void *dev, struct pt_regs * regs);
135 extern void common_init_rtc(void);
136 extern unsigned long est_cycle_freq;
138 /* smc37c93x.c */
139 extern void SMC93x_Init(void);
141 /* smc37c669.c */
142 extern void SMC669_Init(int);
144 /* es1888.c */
145 extern void es1888_init(void);
147 /* ns87312.c */
148 extern void ns87312_enable_ide(long ide_base);
150 /* ../lib/fpreg.c */
151 extern void alpha_write_fp_reg (unsigned long reg, unsigned long val);
152 extern unsigned long alpha_read_fp_reg (unsigned long reg);
154 /* head.S */
155 extern void wrmces(unsigned long mces);
156 extern void cserve_ena(unsigned long);
157 extern void cserve_dis(unsigned long);
158 extern void __smp_callin(unsigned long);
160 /* entry.S */
161 extern void entArith(void);
162 extern void entIF(void);
163 extern void entInt(void);
164 extern void entMM(void);
165 extern void entSys(void);
166 extern void entUna(void);
167 extern void entDbg(void);
169 /* ptrace.c */
170 extern int ptrace_set_bpt (struct task_struct *child);
171 extern int ptrace_cancel_bpt (struct task_struct *child);
173 /* traps.c */
174 extern void dik_show_regs(struct pt_regs *regs, unsigned long *r9_15);
175 extern void die_if_kernel(char *, struct pt_regs *, long, unsigned long *);
177 /* sys_titan.c */
178 extern void titan_dispatch_irqs(u64, struct pt_regs *);
180 /* ../mm/init.c */
181 extern void switch_to_system_map(void);
182 extern void srm_paging_stop(void);
184 /* ../mm/remap.c */
185 extern int __alpha_remap_area_pages(unsigned long, unsigned long,
186 unsigned long, unsigned long);
188 /* irq.c */
190 #ifdef CONFIG_SMP
191 #define mcheck_expected(cpu) (cpu_data[cpu].mcheck_expected)
192 #define mcheck_taken(cpu) (cpu_data[cpu].mcheck_taken)
193 #define mcheck_extra(cpu) (cpu_data[cpu].mcheck_extra)
194 #else
195 extern struct mcheck_info
196 {
197 unsigned char expected __attribute__((aligned(8)));
198 unsigned char taken;
199 unsigned char extra;
200 } __mcheck_info;
202 #define mcheck_expected(cpu) (*((void)(cpu), &__mcheck_info.expected))
203 #define mcheck_taken(cpu) (*((void)(cpu), &__mcheck_info.taken))
204 #define mcheck_extra(cpu) (*((void)(cpu), &__mcheck_info.extra))
205 #endif
207 extern void process_mcheck_info(unsigned long vector, unsigned long la_ptr,
208 struct pt_regs *regs, const char *machine,
209 int expected);