annotate Documentation/sysctl/vm.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 3e8752eb6d9c
rev   line source
ian@0 1 Documentation for /proc/sys/vm/* kernel version 2.2.10
ian@0 2 (c) 1998, 1999, Rik van Riel <riel@nl.linux.org>
ian@0 3
ian@0 4 For general info and legal blurb, please look in README.
ian@0 5
ian@0 6 ==============================================================
ian@0 7
ian@0 8 This file contains the documentation for the sysctl files in
ian@0 9 /proc/sys/vm and is valid for Linux kernel version 2.2.
ian@0 10
ian@0 11 The files in this directory can be used to tune the operation
ian@0 12 of the virtual memory (VM) subsystem of the Linux kernel and
ian@0 13 the writeout of dirty data to disk.
ian@0 14
ian@0 15 Default values and initialization routines for most of these
ian@0 16 files can be found in mm/swap.c.
ian@0 17
ian@0 18 Currently, these files are in /proc/sys/vm:
ian@0 19 - overcommit_memory
ian@0 20 - page-cluster
ian@0 21 - dirty_ratio
ian@0 22 - dirty_background_ratio
ian@0 23 - dirty_expire_centisecs
ian@0 24 - dirty_writeback_centisecs
ian@0 25 - max_map_count
ian@0 26 - min_free_kbytes
ian@0 27 - laptop_mode
ian@0 28 - block_dump
ian@0 29 - drop-caches
ian@0 30 - zone_reclaim_mode
ian@0 31 - min_unmapped_ratio
ian@240 32 - min_slab_ratio
ian@0 33 - panic_on_oom
ian@0 34
ian@0 35 ==============================================================
ian@0 36
ian@0 37 dirty_ratio, dirty_background_ratio, dirty_expire_centisecs,
ian@0 38 dirty_writeback_centisecs, vfs_cache_pressure, laptop_mode,
ian@0 39 block_dump, swap_token_timeout, drop-caches:
ian@0 40
ian@0 41 See Documentation/filesystems/proc.txt
ian@0 42
ian@0 43 ==============================================================
ian@0 44
ian@0 45 overcommit_memory:
ian@0 46
ian@0 47 This value contains a flag that enables memory overcommitment.
ian@0 48
ian@0 49 When this flag is 0, the kernel attempts to estimate the amount
ian@0 50 of free memory left when userspace requests more memory.
ian@0 51
ian@0 52 When this flag is 1, the kernel pretends there is always enough
ian@0 53 memory until it actually runs out.
ian@0 54
ian@0 55 When this flag is 2, the kernel uses a "never overcommit"
ian@0 56 policy that attempts to prevent any overcommit of memory.
ian@0 57
ian@0 58 This feature can be very useful because there are a lot of
ian@0 59 programs that malloc() huge amounts of memory "just-in-case"
ian@0 60 and don't use much of it.
ian@0 61
ian@0 62 The default value is 0.
ian@0 63
ian@0 64 See Documentation/vm/overcommit-accounting and
ian@0 65 security/commoncap.c::cap_vm_enough_memory() for more information.
ian@0 66
ian@0 67 ==============================================================
ian@0 68
ian@0 69 overcommit_ratio:
ian@0 70
ian@0 71 When overcommit_memory is set to 2, the committed address
ian@0 72 space is not permitted to exceed swap plus this percentage
ian@0 73 of physical RAM. See above.
ian@0 74
ian@0 75 ==============================================================
ian@0 76
ian@0 77 page-cluster:
ian@0 78
ian@0 79 The Linux VM subsystem avoids excessive disk seeks by reading
ian@0 80 multiple pages on a page fault. The number of pages it reads
ian@0 81 is dependent on the amount of memory in your machine.
ian@0 82
ian@0 83 The number of pages the kernel reads in at once is equal to
ian@0 84 2 ^ page-cluster. Values above 2 ^ 5 don't make much sense
ian@0 85 for swap because we only cluster swap data in 32-page groups.
ian@0 86
ian@0 87 ==============================================================
ian@0 88
ian@0 89 max_map_count:
ian@0 90
ian@0 91 This file contains the maximum number of memory map areas a process
ian@0 92 may have. Memory map areas are used as a side-effect of calling
ian@0 93 malloc, directly by mmap and mprotect, and also when loading shared
ian@0 94 libraries.
ian@0 95
ian@0 96 While most applications need less than a thousand maps, certain
ian@0 97 programs, particularly malloc debuggers, may consume lots of them,
ian@0 98 e.g., up to one or two maps per allocation.
ian@0 99
ian@0 100 The default value is 65536.
ian@0 101
ian@0 102 ==============================================================
ian@0 103
ian@0 104 min_free_kbytes:
ian@0 105
ian@0 106 This is used to force the Linux VM to keep a minimum number
ian@0 107 of kilobytes free. The VM uses this number to compute a pages_min
ian@0 108 value for each lowmem zone in the system. Each lowmem zone gets
ian@0 109 a number of reserved free pages based proportionally on its size.
ian@0 110
ian@0 111 ==============================================================
ian@0 112
ian@0 113 percpu_pagelist_fraction
ian@0 114
ian@0 115 This is the fraction of pages at most (high mark pcp->high) in each zone that
ian@0 116 are allocated for each per cpu page list. The min value for this is 8. It
ian@0 117 means that we don't allow more than 1/8th of pages in each zone to be
ian@0 118 allocated in any single per_cpu_pagelist. This entry only changes the value
ian@0 119 of hot per cpu pagelists. User can specify a number like 100 to allocate
ian@0 120 1/100th of each zone to each per cpu page list.
ian@0 121
ian@0 122 The batch value of each per cpu pagelist is also updated as a result. It is
ian@0 123 set to pcp->high/4. The upper limit of batch is (PAGE_SHIFT * 8)
ian@0 124
ian@0 125 The initial value is zero. Kernel does not use this value at boot time to set
ian@0 126 the high water marks for each per cpu page list.
ian@0 127
ian@0 128 ===============================================================
ian@0 129
ian@0 130 zone_reclaim_mode:
ian@0 131
ian@0 132 Zone_reclaim_mode allows to set more or less agressive approaches to
ian@0 133 reclaim memory when a zone runs out of memory. If it is set to zero then no
ian@0 134 zone reclaim occurs. Allocations will be satisfied from other zones / nodes
ian@0 135 in the system.
ian@0 136
ian@0 137 This is value ORed together of
ian@0 138
ian@0 139 1 = Zone reclaim on
ian@0 140 2 = Zone reclaim writes dirty pages out
ian@0 141 4 = Zone reclaim swaps pages
ian@0 142
ian@0 143 zone_reclaim_mode is set during bootup to 1 if it is determined that pages
ian@0 144 from remote zones will cause a measurable performance reduction. The
ian@0 145 page allocator will then reclaim easily reusable pages (those page
ian@0 146 cache pages that are currently not used) before allocating off node pages.
ian@0 147
ian@0 148 It may be beneficial to switch off zone reclaim if the system is
ian@0 149 used for a file server and all of memory should be used for caching files
ian@0 150 from disk. In that case the caching effect is more important than
ian@0 151 data locality.
ian@0 152
ian@0 153 Allowing zone reclaim to write out pages stops processes that are
ian@0 154 writing large amounts of data from dirtying pages on other nodes. Zone
ian@0 155 reclaim will write out dirty pages if a zone fills up and so effectively
ian@0 156 throttle the process. This may decrease the performance of a single process
ian@0 157 since it cannot use all of system memory to buffer the outgoing writes
ian@0 158 anymore but it preserve the memory on other nodes so that the performance
ian@0 159 of other processes running on other nodes will not be affected.
ian@0 160
ian@0 161 Allowing regular swap effectively restricts allocations to the local
ian@0 162 node unless explicitly overridden by memory policies or cpuset
ian@0 163 configurations.
ian@0 164
ian@0 165 =============================================================
ian@0 166
ian@0 167 min_unmapped_ratio:
ian@0 168
ian@0 169 This is available only on NUMA kernels.
ian@0 170
ian@240 171 A percentage of the total pages in each zone. Zone reclaim will only
ian@0 172 occur if more than this percentage of pages are file backed and unmapped.
ian@0 173 This is to insure that a minimal amount of local pages is still available for
ian@0 174 file I/O even if the node is overallocated.
ian@0 175
ian@0 176 The default is 1 percent.
ian@0 177
ian@0 178 =============================================================
ian@0 179
ian@240 180 min_slab_ratio:
ian@240 181
ian@240 182 This is available only on NUMA kernels.
ian@240 183
ian@240 184 A percentage of the total pages in each zone. On Zone reclaim
ian@240 185 (fallback from the local zone occurs) slabs will be reclaimed if more
ian@240 186 than this percentage of pages in a zone are reclaimable slab pages.
ian@240 187 This insures that the slab growth stays under control even in NUMA
ian@240 188 systems that rarely perform global reclaim.
ian@240 189
ian@240 190 The default is 5 percent.
ian@240 191
ian@240 192 Note that slab reclaim is triggered in a per zone / node fashion.
ian@240 193 The process of reclaiming slab memory is currently not node specific
ian@240 194 and may not be fast.
ian@240 195
ian@240 196 =============================================================
ian@240 197
ian@0 198 panic_on_oom
ian@0 199
ian@0 200 This enables or disables panic on out-of-memory feature. If this is set to 1,
ian@0 201 the kernel panics when out-of-memory happens. If this is set to 0, the kernel
ian@0 202 will kill some rogue process, called oom_killer. Usually, oom_killer can kill
ian@0 203 rogue processes and system will survive. If you want to panic the system
ian@0 204 rather than killing rogue processes, set this to 1.
ian@0 205
ian@0 206 The default value is 0.
ian@0 207