ia64/linux-2.6.18-xen.hg

view arch/sparc64/kernel/una_asm.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 /* una_asm.S: Kernel unaligned trap assembler helpers.
2 *
3 * Copyright (C) 1996,2005 David S. Miller (davem@davemloft.net)
4 * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
5 */
7 .text
9 .globl __do_int_store
10 __do_int_store:
11 rd %asi, %o4
12 wr %o3, 0, %asi
13 mov %o2, %g3
14 cmp %o1, 2
15 be,pn %icc, 2f
16 cmp %o1, 4
17 be,pt %icc, 1f
18 srlx %g3, 24, %g2
19 srlx %g3, 56, %g1
20 srlx %g3, 48, %g7
21 4: stba %g1, [%o0] %asi
22 srlx %g3, 40, %g1
23 5: stba %g7, [%o0 + 1] %asi
24 srlx %g3, 32, %g7
25 6: stba %g1, [%o0 + 2] %asi
26 7: stba %g7, [%o0 + 3] %asi
27 srlx %g3, 16, %g1
28 8: stba %g2, [%o0 + 4] %asi
29 srlx %g3, 8, %g7
30 9: stba %g1, [%o0 + 5] %asi
31 10: stba %g7, [%o0 + 6] %asi
32 ba,pt %xcc, 0f
33 11: stba %g3, [%o0 + 7] %asi
34 1: srl %g3, 16, %g7
35 12: stba %g2, [%o0] %asi
36 srl %g3, 8, %g2
37 13: stba %g7, [%o0 + 1] %asi
38 14: stba %g2, [%o0 + 2] %asi
39 ba,pt %xcc, 0f
40 15: stba %g3, [%o0 + 3] %asi
41 2: srl %g3, 8, %g2
42 16: stba %g2, [%o0] %asi
43 17: stba %g3, [%o0 + 1] %asi
44 0:
45 wr %o4, 0x0, %asi
46 retl
47 mov 0, %o0
48 .size __do_int_store, .-__do_int_store
50 .section __ex_table,"a"
51 .word 4b, __retl_efault
52 .word 5b, __retl_efault
53 .word 6b, __retl_efault
54 .word 7b, __retl_efault
55 .word 8b, __retl_efault
56 .word 9b, __retl_efault
57 .word 10b, __retl_efault
58 .word 11b, __retl_efault
59 .word 12b, __retl_efault
60 .word 13b, __retl_efault
61 .word 14b, __retl_efault
62 .word 15b, __retl_efault
63 .word 16b, __retl_efault
64 .word 17b, __retl_efault
65 .previous
67 .globl do_int_load
68 do_int_load:
69 rd %asi, %o5
70 wr %o4, 0, %asi
71 cmp %o1, 8
72 bge,pn %icc, 9f
73 cmp %o1, 4
74 be,pt %icc, 6f
75 4: lduba [%o2] %asi, %g2
76 5: lduba [%o2 + 1] %asi, %g3
77 sll %g2, 8, %g2
78 brz,pt %o3, 3f
79 add %g2, %g3, %g2
80 sllx %g2, 48, %g2
81 srax %g2, 48, %g2
82 3: ba,pt %xcc, 0f
83 stx %g2, [%o0]
84 6: lduba [%o2 + 1] %asi, %g3
85 sll %g2, 24, %g2
86 7: lduba [%o2 + 2] %asi, %g7
87 sll %g3, 16, %g3
88 8: lduba [%o2 + 3] %asi, %g1
89 sll %g7, 8, %g7
90 or %g2, %g3, %g2
91 or %g7, %g1, %g7
92 or %g2, %g7, %g2
93 brnz,a,pt %o3, 3f
94 sra %g2, 0, %g2
95 3: ba,pt %xcc, 0f
96 stx %g2, [%o0]
97 9: lduba [%o2] %asi, %g2
98 10: lduba [%o2 + 1] %asi, %g3
99 sllx %g2, 56, %g2
100 11: lduba [%o2 + 2] %asi, %g7
101 sllx %g3, 48, %g3
102 12: lduba [%o2 + 3] %asi, %g1
103 sllx %g7, 40, %g7
104 sllx %g1, 32, %g1
105 or %g2, %g3, %g2
106 or %g7, %g1, %g7
107 13: lduba [%o2 + 4] %asi, %g3
108 or %g2, %g7, %g7
109 14: lduba [%o2 + 5] %asi, %g1
110 sllx %g3, 24, %g3
111 15: lduba [%o2 + 6] %asi, %g2
112 sllx %g1, 16, %g1
113 or %g7, %g3, %g7
114 16: lduba [%o2 + 7] %asi, %g3
115 sllx %g2, 8, %g2
116 or %g7, %g1, %g7
117 or %g2, %g3, %g2
118 or %g7, %g2, %g7
119 cmp %o1, 8
120 be,a,pt %icc, 0f
121 stx %g7, [%o0]
122 srlx %g7, 32, %g2
123 sra %g7, 0, %g7
124 stx %g2, [%o0]
125 stx %g7, [%o0 + 8]
126 0:
127 wr %o5, 0x0, %asi
128 retl
129 mov 0, %o0
130 .size __do_int_load, .-__do_int_load
132 .section __ex_table,"a"
133 .word 4b, __retl_efault
134 .word 5b, __retl_efault
135 .word 6b, __retl_efault
136 .word 7b, __retl_efault
137 .word 8b, __retl_efault
138 .word 9b, __retl_efault
139 .word 10b, __retl_efault
140 .word 11b, __retl_efault
141 .word 12b, __retl_efault
142 .word 13b, __retl_efault
143 .word 14b, __retl_efault
144 .word 15b, __retl_efault
145 .word 16b, __retl_efault
146 .previous