ia64/linux-2.6.18-xen.hg

view Documentation/cpu-freq/user-guide.txt @ 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 CPU frequency and voltage scaling code in the Linux(TM) kernel
4 L i n u x C P U F r e q
6 U S E R G U I D E
9 Dominik Brodowski <linux@brodo.de>
13 Clock scaling allows you to change the clock speed of the CPUs on the
14 fly. This is a nice method to save battery power, because the lower
15 the clock speed, the less power the CPU consumes.
18 Contents:
19 ---------
20 1. Supported Architectures and Processors
21 1.1 ARM
22 1.2 x86
23 1.3 sparc64
24 1.4 ppc
25 1.5 SuperH
27 2. "Policy" / "Governor"?
28 2.1 Policy
29 2.2 Governor
31 3. How to change the CPU cpufreq policy and/or speed
32 3.1 Preferred interface: sysfs
33 3.2 Deprecated interfaces
37 1. Supported Architectures and Processors
38 =========================================
40 1.1 ARM
41 -------
43 The following ARM processors are supported by cpufreq:
45 ARM Integrator
46 ARM-SA1100
47 ARM-SA1110
50 1.2 x86
51 -------
53 The following processors for the x86 architecture are supported by cpufreq:
55 AMD Elan - SC400, SC410
56 AMD mobile K6-2+
57 AMD mobile K6-3+
58 AMD mobile Duron
59 AMD mobile Athlon
60 AMD Opteron
61 AMD Athlon 64
62 Cyrix Media GXm
63 Intel mobile PIII and Intel mobile PIII-M on certain chipsets
64 Intel Pentium 4, Intel Xeon
65 Intel Pentium M (Centrino)
66 National Semiconductors Geode GX
67 Transmeta Crusoe
68 Transmeta Efficeon
69 VIA Cyrix 3 / C3
70 various processors on some ACPI 2.0-compatible systems [*]
72 [*] Only if "ACPI Processor Performance States" are available
73 to the ACPI<->BIOS interface.
76 1.3 sparc64
77 -----------
79 The following processors for the sparc64 architecture are supported by
80 cpufreq:
82 UltraSPARC-III
85 1.4 ppc
86 -------
88 Several "PowerBook" and "iBook2" notebooks are supported.
91 1.5 SuperH
92 ----------
94 The following SuperH processors are supported by cpufreq:
96 SH-3
97 SH-4
100 2. "Policy" / "Governor" ?
101 ==========================
103 Some CPU frequency scaling-capable processor switch between various
104 frequencies and operating voltages "on the fly" without any kernel or
105 user involvement. This guarantees very fast switching to a frequency
106 which is high enough to serve the user's needs, but low enough to save
107 power.
110 2.1 Policy
111 ----------
113 On these systems, all you can do is select the lower and upper
114 frequency limit as well as whether you want more aggressive
115 power-saving or more instantly available processing power.
118 2.2 Governor
119 ------------
121 On all other cpufreq implementations, these boundaries still need to
122 be set. Then, a "governor" must be selected. Such a "governor" decides
123 what speed the processor shall run within the boundaries. One such
124 "governor" is the "userspace" governor. This one allows the user - or
125 a yet-to-implement userspace program - to decide what specific speed
126 the processor shall run at.
129 3. How to change the CPU cpufreq policy and/or speed
130 ====================================================
132 3.1 Preferred Interface: sysfs
133 ------------------------------
135 The preferred interface is located in the sysfs filesystem. If you
136 mounted it at /sys, the cpufreq interface is located in a subdirectory
137 "cpufreq" within the cpu-device directory
138 (e.g. /sys/devices/system/cpu/cpu0/cpufreq/ for the first CPU).
140 cpuinfo_min_freq : this file shows the minimum operating
141 frequency the processor can run at(in kHz)
142 cpuinfo_max_freq : this file shows the maximum operating
143 frequency the processor can run at(in kHz)
144 scaling_driver : this file shows what cpufreq driver is
145 used to set the frequency on this CPU
147 scaling_available_governors : this file shows the CPUfreq governors
148 available in this kernel. You can see the
149 currently activated governor in
151 scaling_governor, and by "echoing" the name of another
152 governor you can change it. Please note
153 that some governors won't load - they only
154 work on some specific architectures or
155 processors.
156 scaling_min_freq and
157 scaling_max_freq show the current "policy limits" (in
158 kHz). By echoing new values into these
159 files, you can change these limits.
160 NOTE: when setting a policy you need to
161 first set scaling_max_freq, then
162 scaling_min_freq.
165 If you have selected the "userspace" governor which allows you to
166 set the CPU operating frequency to a specific value, you can read out
167 the current frequency in
169 scaling_setspeed. By "echoing" a new frequency into this
170 you can change the speed of the CPU,
171 but only within the limits of
172 scaling_min_freq and scaling_max_freq.
175 3.2 Deprecated Interfaces
176 -------------------------
178 Depending on your kernel configuration, you might find the following
179 cpufreq-related files:
180 /proc/cpufreq
181 /proc/sys/cpu/*/speed
182 /proc/sys/cpu/*/speed-min
183 /proc/sys/cpu/*/speed-max
185 These are files for deprecated interfaces to cpufreq, which offer far
186 less functionality. Because of this, these interfaces aren't described
187 here.