ia64/linux-2.6.18-xen.hg

view arch/alpha/kernel/head.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 831230e53067
children
line source
1 /*
2 * alpha/boot/head.S
3 *
4 * initial boot stuff.. At this point, the bootloader has already
5 * switched into OSF/1 PAL-code, and loaded us at the correct address
6 * (START_ADDR). So there isn't much left for us to do: just set up
7 * the kernel global pointer and jump to the kernel entry-point.
8 */
10 #include <asm/system.h>
11 #include <asm/asm-offsets.h>
13 .globl swapper_pg_dir
14 .globl _stext
15 swapper_pg_dir=SWAPPER_PGD
17 .set noreorder
18 .globl __start
19 .ent __start
20 _stext:
21 __start:
22 .prologue 0
23 br $27,1f
24 1: ldgp $29,0($27)
25 /* We need to get current_task_info loaded up... */
26 lda $8,init_thread_union
27 /* ... and find our stack ... */
28 lda $30,0x4000 - SIZEOF_PT_REGS($8)
29 /* ... and then we can start the kernel. */
30 jsr $26,start_kernel
31 call_pal PAL_halt
32 .end __start
34 #ifdef CONFIG_SMP
35 .align 3
36 .globl __smp_callin
37 .ent __smp_callin
38 /* On entry here from SRM console, the HWPCB of the per-cpu
39 slot for this processor has been loaded. We've arranged
40 for the UNIQUE value for this process to contain the PCBB
41 of the target idle task. */
42 __smp_callin:
43 .prologue 1
44 ldgp $29,0($27) # First order of business, load the GP.
46 call_pal PAL_rduniq # Grab the target PCBB.
47 mov $0,$16 # Install it.
48 call_pal PAL_swpctx
50 lda $8,0x3fff # Find "current".
51 bic $30,$8,$8
53 jsr $26,smp_callin
54 call_pal PAL_halt
55 .end __smp_callin
56 #endif /* CONFIG_SMP */
58 #
59 # The following two functions are needed for supporting SRM PALcode
60 # on the PC164 (at least), since that PALcode manages the interrupt
61 # masking, and we cannot duplicate the effort without causing problems
62 #
64 .align 3
65 .globl cserve_ena
66 .ent cserve_ena
67 cserve_ena:
68 .prologue 0
69 bis $16,$16,$17
70 lda $16,52($31)
71 call_pal PAL_cserve
72 ret ($26)
73 .end cserve_ena
75 .align 3
76 .globl cserve_dis
77 .ent cserve_dis
78 cserve_dis:
79 .prologue 0
80 bis $16,$16,$17
81 lda $16,53($31)
82 call_pal PAL_cserve
83 ret ($26)
84 .end cserve_dis
86 #
87 # It is handy, on occasion, to make halt actually just loop.
88 # Putting it here means we dont have to recompile the whole
89 # kernel.
90 #
92 .align 3
93 .globl halt
94 .ent halt
95 halt:
96 .prologue 0
97 call_pal PAL_halt
98 .end halt