ia64/linux-2.6.18-xen.hg

view arch/alpha/kernel/alpha_ksyms.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 * linux/arch/alpha/kernel/ksyms.c
3 *
4 * Export the alpha-specific functions that are needed for loadable
5 * modules.
6 */
8 #include <linux/module.h>
9 #include <linux/string.h>
10 #include <linux/user.h>
11 #include <linux/elfcore.h>
12 #include <linux/socket.h>
13 #include <linux/syscalls.h>
14 #include <linux/in.h>
15 #include <linux/in6.h>
16 #include <linux/pci.h>
17 #include <linux/screen_info.h>
18 #include <linux/tty.h>
19 #include <linux/mm.h>
20 #include <linux/delay.h>
21 #include <linux/dma-mapping.h>
23 #include <asm/io.h>
24 #include <asm/console.h>
25 #include <asm/hwrpb.h>
26 #include <asm/uaccess.h>
27 #include <asm/processor.h>
28 #include <asm/checksum.h>
29 #include <linux/interrupt.h>
30 #include <asm/fpu.h>
31 #include <asm/irq.h>
32 #include <asm/machvec.h>
33 #include <asm/pgalloc.h>
34 #include <asm/semaphore.h>
35 #include <asm/tlbflush.h>
36 #include <asm/cacheflush.h>
37 #include <asm/vga.h>
39 #define __KERNEL_SYSCALLS__
40 #include <asm/unistd.h>
42 extern struct hwrpb_struct *hwrpb;
43 extern spinlock_t rtc_lock;
45 /* these are C runtime functions with special calling conventions: */
46 extern void __divl (void);
47 extern void __reml (void);
48 extern void __divq (void);
49 extern void __remq (void);
50 extern void __divlu (void);
51 extern void __remlu (void);
52 extern void __divqu (void);
53 extern void __remqu (void);
55 EXPORT_SYMBOL(alpha_mv);
56 EXPORT_SYMBOL(screen_info);
57 EXPORT_SYMBOL(perf_irq);
58 EXPORT_SYMBOL(callback_getenv);
59 EXPORT_SYMBOL(callback_setenv);
60 EXPORT_SYMBOL(callback_save_env);
61 #ifdef CONFIG_ALPHA_GENERIC
62 EXPORT_SYMBOL(alpha_using_srm);
63 #endif /* CONFIG_ALPHA_GENERIC */
65 /* platform dependent support */
66 EXPORT_SYMBOL(strcat);
67 EXPORT_SYMBOL(strcpy);
68 EXPORT_SYMBOL(strlen);
69 EXPORT_SYMBOL(strncpy);
70 EXPORT_SYMBOL(strncat);
71 EXPORT_SYMBOL(strchr);
72 EXPORT_SYMBOL(strrchr);
73 EXPORT_SYMBOL(memmove);
74 EXPORT_SYMBOL(__memcpy);
75 EXPORT_SYMBOL(__memset);
76 EXPORT_SYMBOL(__memsetw);
77 EXPORT_SYMBOL(__constant_c_memset);
78 EXPORT_SYMBOL(copy_page);
79 EXPORT_SYMBOL(clear_page);
81 EXPORT_SYMBOL(__direct_map_base);
82 EXPORT_SYMBOL(__direct_map_size);
84 #ifdef CONFIG_PCI
85 EXPORT_SYMBOL(pci_alloc_consistent);
86 EXPORT_SYMBOL(pci_free_consistent);
87 EXPORT_SYMBOL(pci_map_single);
88 EXPORT_SYMBOL(pci_map_page);
89 EXPORT_SYMBOL(pci_unmap_single);
90 EXPORT_SYMBOL(pci_unmap_page);
91 EXPORT_SYMBOL(pci_map_sg);
92 EXPORT_SYMBOL(pci_unmap_sg);
93 EXPORT_SYMBOL(pci_dma_supported);
94 EXPORT_SYMBOL(pci_dac_dma_supported);
95 EXPORT_SYMBOL(pci_dac_page_to_dma);
96 EXPORT_SYMBOL(pci_dac_dma_to_page);
97 EXPORT_SYMBOL(pci_dac_dma_to_offset);
98 EXPORT_SYMBOL(alpha_gendev_to_pci);
99 #endif
100 EXPORT_SYMBOL(dma_set_mask);
102 EXPORT_SYMBOL(dump_thread);
103 EXPORT_SYMBOL(dump_elf_thread);
104 EXPORT_SYMBOL(dump_elf_task);
105 EXPORT_SYMBOL(dump_elf_task_fp);
106 EXPORT_SYMBOL(hwrpb);
107 EXPORT_SYMBOL(start_thread);
108 EXPORT_SYMBOL(alpha_read_fp_reg);
109 EXPORT_SYMBOL(alpha_read_fp_reg_s);
110 EXPORT_SYMBOL(alpha_write_fp_reg);
111 EXPORT_SYMBOL(alpha_write_fp_reg_s);
113 /* In-kernel system calls. */
114 EXPORT_SYMBOL(kernel_thread);
115 EXPORT_SYMBOL(sys_dup);
116 EXPORT_SYMBOL(sys_exit);
117 EXPORT_SYMBOL(sys_write);
118 EXPORT_SYMBOL(sys_lseek);
119 EXPORT_SYMBOL(execve);
120 EXPORT_SYMBOL(sys_setsid);
121 EXPORT_SYMBOL(sys_wait4);
123 /* Networking helper routines. */
124 EXPORT_SYMBOL(csum_tcpudp_magic);
125 EXPORT_SYMBOL(ip_compute_csum);
126 EXPORT_SYMBOL(ip_fast_csum);
127 EXPORT_SYMBOL(csum_partial_copy_nocheck);
128 EXPORT_SYMBOL(csum_partial_copy_from_user);
129 EXPORT_SYMBOL(csum_ipv6_magic);
131 #ifdef CONFIG_MATHEMU_MODULE
132 extern long (*alpha_fp_emul_imprecise)(struct pt_regs *, unsigned long);
133 extern long (*alpha_fp_emul) (unsigned long pc);
134 EXPORT_SYMBOL(alpha_fp_emul_imprecise);
135 EXPORT_SYMBOL(alpha_fp_emul);
136 #endif
138 #ifdef CONFIG_ALPHA_BROKEN_IRQ_MASK
139 EXPORT_SYMBOL(__min_ipl);
140 #endif
142 /*
143 * The following are specially called from the uaccess assembly stubs.
144 */
145 EXPORT_SYMBOL(__copy_user);
146 EXPORT_SYMBOL(__do_clear_user);
147 EXPORT_SYMBOL(__strncpy_from_user);
148 EXPORT_SYMBOL(__strnlen_user);
150 /* Semaphore helper functions. */
151 EXPORT_SYMBOL(__down_failed);
152 EXPORT_SYMBOL(__down_failed_interruptible);
153 EXPORT_SYMBOL(__up_wakeup);
154 EXPORT_SYMBOL(down);
155 EXPORT_SYMBOL(down_interruptible);
156 EXPORT_SYMBOL(down_trylock);
157 EXPORT_SYMBOL(up);
159 /*
160 * SMP-specific symbols.
161 */
163 #ifdef CONFIG_SMP
164 EXPORT_SYMBOL(flush_tlb_mm);
165 EXPORT_SYMBOL(flush_tlb_range);
166 EXPORT_SYMBOL(flush_tlb_page);
167 EXPORT_SYMBOL(smp_imb);
168 EXPORT_SYMBOL(cpu_data);
169 EXPORT_SYMBOL(smp_num_cpus);
170 EXPORT_SYMBOL(smp_call_function);
171 EXPORT_SYMBOL(smp_call_function_on_cpu);
172 EXPORT_SYMBOL(_atomic_dec_and_lock);
173 #endif /* CONFIG_SMP */
175 /*
176 * NUMA specific symbols
177 */
178 #ifdef CONFIG_DISCONTIGMEM
179 EXPORT_SYMBOL(node_data);
180 #endif /* CONFIG_DISCONTIGMEM */
182 EXPORT_SYMBOL(rtc_lock);
184 /*
185 * The following are special because they're not called
186 * explicitly (the C compiler or assembler generates them in
187 * response to division operations). Fortunately, their
188 * interface isn't gonna change any time soon now, so it's OK
189 * to leave it out of version control.
190 */
191 # undef memcpy
192 # undef memset
193 EXPORT_SYMBOL(__divl);
194 EXPORT_SYMBOL(__divlu);
195 EXPORT_SYMBOL(__divq);
196 EXPORT_SYMBOL(__divqu);
197 EXPORT_SYMBOL(__reml);
198 EXPORT_SYMBOL(__remlu);
199 EXPORT_SYMBOL(__remq);
200 EXPORT_SYMBOL(__remqu);
201 EXPORT_SYMBOL(memcpy);
202 EXPORT_SYMBOL(memset);
203 EXPORT_SYMBOL(memchr);
205 #ifdef CONFIG_ALPHA_IRONGATE
206 EXPORT_SYMBOL(irongate_ioremap);
207 EXPORT_SYMBOL(irongate_iounmap);
208 #endif