ia64/linux-2.6.18-xen.hg

view arch/alpha/boot/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 * arch/alpha/boot/head.S
3 *
4 * initial bootloader stuff..
5 */
7 #include <asm/system.h>
9 .set noreorder
10 .globl __start
11 .ent __start
12 __start:
13 br $29,2f
14 2: ldgp $29,0($29)
15 jsr $26,start_kernel
16 call_pal PAL_halt
17 .end __start
19 .align 5
20 .globl wrent
21 .ent wrent
22 wrent:
23 .prologue 0
24 call_pal PAL_wrent
25 ret ($26)
26 .end wrent
28 .align 5
29 .globl wrkgp
30 .ent wrkgp
31 wrkgp:
32 .prologue 0
33 call_pal PAL_wrkgp
34 ret ($26)
35 .end wrkgp
37 .align 5
38 .globl switch_to_osf_pal
39 .ent switch_to_osf_pal
40 switch_to_osf_pal:
41 subq $30,128,$30
42 .frame $30,128,$26
43 stq $26,0($30)
44 stq $1,8($30)
45 stq $2,16($30)
46 stq $3,24($30)
47 stq $4,32($30)
48 stq $5,40($30)
49 stq $6,48($30)
50 stq $7,56($30)
51 stq $8,64($30)
52 stq $9,72($30)
53 stq $10,80($30)
54 stq $11,88($30)
55 stq $12,96($30)
56 stq $13,104($30)
57 stq $14,112($30)
58 stq $15,120($30)
59 .prologue 0
61 stq $30,0($17) /* save KSP in PCB */
63 bis $30,$30,$20 /* a4 = KSP */
64 br $17,1f
66 ldq $26,0($30)
67 ldq $1,8($30)
68 ldq $2,16($30)
69 ldq $3,24($30)
70 ldq $4,32($30)
71 ldq $5,40($30)
72 ldq $6,48($30)
73 ldq $7,56($30)
74 ldq $8,64($30)
75 ldq $9,72($30)
76 ldq $10,80($30)
77 ldq $11,88($30)
78 ldq $12,96($30)
79 ldq $13,104($30)
80 ldq $14,112($30)
81 ldq $15,120($30)
82 addq $30,128,$30
83 ret ($26)
84 1: call_pal PAL_swppal
85 .end switch_to_osf_pal
87 .align 3
88 .globl tbi
89 .ent tbi
90 tbi:
91 .prologue 0
92 call_pal PAL_tbi
93 ret ($26)
94 .end tbi
96 .align 3
97 .globl halt
98 .ent halt
99 halt:
100 .prologue 0
101 call_pal PAL_halt
102 .end halt
104 /* $16 - new stack page */
105 .align 3
106 .globl move_stack
107 .ent move_stack
108 move_stack:
109 .prologue 0
110 lda $0, 0x1fff($31)
111 and $0, $30, $1 /* Stack offset */
112 or $1, $16, $16 /* New stack pointer */
113 mov $30, $1
114 mov $16, $2
115 1: ldq $3, 0($1) /* Move the stack */
116 addq $1, 8, $1
117 stq $3, 0($2)
118 and $0, $1, $4
119 addq $2, 8, $2
120 bne $4, 1b
121 mov $16, $30
122 ret ($26)
123 .end move_stack