view Documentation/arm/nwfpe/NOTES @ 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
line source
1 There seems to be a problem with exp(double) and our emulator. I haven't
2 been able to track it down yet. This does not occur with the emulator
3 supplied by Russell King.
5 I also found one oddity in the emulator. I don't think it is serious but
6 will point it out. The ARM calling conventions require floating point
7 registers f4-f7 to be preserved over a function call. The compiler quite
8 often uses an stfe instruction to save f4 on the stack upon entry to a
9 function, and an ldfe instruction to restore it before returning.
11 I was looking at some code, that calculated a double result, stored it in f4
12 then made a function call. Upon return from the function call the number in
13 f4 had been converted to an extended value in the emulator.
15 This is a side effect of the stfe instruction. The double in f4 had to be
16 converted to extended, then stored. If an lfm/sfm combination had been used,
17 then no conversion would occur. This has performance considerations. The
18 result from the function call and f4 were used in a multiplication. If the
19 emulator sees a multiply of a double and extended, it promotes the double to
20 extended, then does the multiply in extended precision.
22 This code will cause this problem:
24 double x, y, z;
25 z = log(x)/log(y);
27 The result of log(x) (a double) will be calculated, returned in f0, then
28 moved to f4 to preserve it over the log(y) call. The division will be done
29 in extended precision, due to the stfe instruction used to save f4 in log(y).