ia64/linux-2.6.18-xen.hg

view Documentation/cputopology.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
2 Export cpu topology info via sysfs. Items (attributes) are similar
3 to /proc/cpuinfo.
5 1) /sys/devices/system/cpu/cpuX/topology/physical_package_id:
6 represent the physical package id of cpu X;
7 2) /sys/devices/system/cpu/cpuX/topology/core_id:
8 represent the cpu core id to cpu X;
9 3) /sys/devices/system/cpu/cpuX/topology/thread_siblings:
10 represent the thread siblings to cpu X in the same core;
11 4) /sys/devices/system/cpu/cpuX/topology/core_siblings:
12 represent the thread siblings to cpu X in the same physical package;
14 To implement it in an architecture-neutral way, a new source file,
15 drivers/base/topology.c, is to export the 4 attributes.
17 If one architecture wants to support this feature, it just needs to
18 implement 4 defines, typically in file include/asm-XXX/topology.h.
19 The 4 defines are:
20 #define topology_physical_package_id(cpu)
21 #define topology_core_id(cpu)
22 #define topology_thread_siblings(cpu)
23 #define topology_core_siblings(cpu)
25 The type of **_id is int.
26 The type of siblings is cpumask_t.
28 To be consistent on all architectures, the 4 attributes should have
29 deafult values if their values are unavailable. Below is the rule.
30 1) physical_package_id: If cpu has no physical package id, -1 is the
31 default value.
32 2) core_id: If cpu doesn't support multi-core, its core id is 0.
33 3) thread_siblings: Just include itself, if the cpu doesn't support
34 HT/multi-thread.
35 4) core_siblings: Just include itself, if the cpu doesn't support
36 multi-core and HT/Multi-thread.
38 So be careful when declaring the 4 defines in include/asm-XXX/topology.h.
40 If an attribute isn't defined on an architecture, it won't be exported.