blob: b89570c304346f4ddf928996044bcbc7f2e72a72 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001Documentation for /proc/sys/vm/* kernel version 2.2.10
2 (c) 1998, 1999, Rik van Riel <riel@nl.linux.org>
3
4For general info and legal blurb, please look in README.
5
6==============================================================
7
8This file contains the documentation for the sysctl files in
9/proc/sys/vm and is valid for Linux kernel version 2.2.
10
11The files in this directory can be used to tune the operation
12of the virtual memory (VM) subsystem of the Linux kernel and
13the writeout of dirty data to disk.
14
15Default values and initialization routines for most of these
16files can be found in mm/swap.c.
17
18Currently, these files are in /proc/sys/vm:
19- overcommit_memory
20- page-cluster
21- dirty_ratio
22- dirty_background_ratio
23- dirty_expire_centisecs
24- dirty_writeback_centisecs
25- max_map_count
26- min_free_kbytes
27- laptop_mode
28- block_dump
Andrew Morton9d0243b2006-01-08 01:00:39 -080029- drop-caches
Christoph Lameter17436602006-01-18 17:42:32 -080030- zone_reclaim_mode
Christoph Lameter96146342006-07-03 00:24:13 -070031- min_unmapped_ratio
Christoph Lameter0ff38492006-09-25 23:31:52 -070032- min_slab_ratio
KAMEZAWA Hiroyukifadd8fb2006-06-23 02:03:13 -070033- panic_on_oom
David Rientjesfe071d72007-10-16 23:25:56 -070034- oom_kill_allocating_task
Eric Parised032182007-06-28 15:55:21 -040035- mmap_min_address
KAMEZAWA Hiroyukif0c0b2b2007-07-15 23:38:01 -070036- numa_zonelist_order
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
38==============================================================
39
40dirty_ratio, dirty_background_ratio, dirty_expire_centisecs,
41dirty_writeback_centisecs, vfs_cache_pressure, laptop_mode,
Mel Gormaned7ed362007-07-17 04:03:14 -070042block_dump, swap_token_timeout, drop-caches,
43hugepages_treat_as_movable:
Linus Torvalds1da177e2005-04-16 15:20:36 -070044
45See Documentation/filesystems/proc.txt
46
47==============================================================
48
49overcommit_memory:
50
51This value contains a flag that enables memory overcommitment.
52
53When this flag is 0, the kernel attempts to estimate the amount
54of free memory left when userspace requests more memory.
55
56When this flag is 1, the kernel pretends there is always enough
57memory until it actually runs out.
58
59When this flag is 2, the kernel uses a "never overcommit"
60policy that attempts to prevent any overcommit of memory.
61
62This feature can be very useful because there are a lot of
63programs that malloc() huge amounts of memory "just-in-case"
64and don't use much of it.
65
66The default value is 0.
67
68See Documentation/vm/overcommit-accounting and
69security/commoncap.c::cap_vm_enough_memory() for more information.
70
71==============================================================
72
73overcommit_ratio:
74
75When overcommit_memory is set to 2, the committed address
76space is not permitted to exceed swap plus this percentage
77of physical RAM. See above.
78
79==============================================================
80
81page-cluster:
82
83The Linux VM subsystem avoids excessive disk seeks by reading
84multiple pages on a page fault. The number of pages it reads
85is dependent on the amount of memory in your machine.
86
87The number of pages the kernel reads in at once is equal to
882 ^ page-cluster. Values above 2 ^ 5 don't make much sense
89for swap because we only cluster swap data in 32-page groups.
90
91==============================================================
92
93max_map_count:
94
95This file contains the maximum number of memory map areas a process
96may have. Memory map areas are used as a side-effect of calling
97malloc, directly by mmap and mprotect, and also when loading shared
98libraries.
99
100While most applications need less than a thousand maps, certain
101programs, particularly malloc debuggers, may consume lots of them,
102e.g., up to one or two maps per allocation.
103
104The default value is 65536.
105
106==============================================================
107
108min_free_kbytes:
109
110This is used to force the Linux VM to keep a minimum number
111of kilobytes free. The VM uses this number to compute a pages_min
112value for each lowmem zone in the system. Each lowmem zone gets
113a number of reserved free pages based proportionally on its size.
Rohit Seth8ad4b1f2006-01-08 01:00:40 -0800114
Pavel Machek24950892007-10-16 23:31:28 -0700115Some minimal ammount of memory is needed to satisfy PF_MEMALLOC
116allocations; if you set this to lower than 1024KB, your system will
117become subtly broken, and prone to deadlock under high loads.
118
119Setting this too high will OOM your machine instantly.
120
Rohit Seth8ad4b1f2006-01-08 01:00:40 -0800121==============================================================
122
123percpu_pagelist_fraction
124
125This is the fraction of pages at most (high mark pcp->high) in each zone that
126are allocated for each per cpu page list. The min value for this is 8. It
127means that we don't allow more than 1/8th of pages in each zone to be
128allocated in any single per_cpu_pagelist. This entry only changes the value
129of hot per cpu pagelists. User can specify a number like 100 to allocate
1301/100th of each zone to each per cpu page list.
131
132The batch value of each per cpu pagelist is also updated as a result. It is
133set to pcp->high/4. The upper limit of batch is (PAGE_SHIFT * 8)
134
135The initial value is zero. Kernel does not use this value at boot time to set
136the high water marks for each per cpu page list.
Christoph Lameter17436602006-01-18 17:42:32 -0800137
138===============================================================
139
140zone_reclaim_mode:
141
Matt LaPlante5d3f0832006-11-30 05:21:10 +0100142Zone_reclaim_mode allows someone to set more or less aggressive approaches to
Christoph Lameter1b2ffb72006-02-01 03:05:34 -0800143reclaim memory when a zone runs out of memory. If it is set to zero then no
144zone reclaim occurs. Allocations will be satisfied from other zones / nodes
145in the system.
146
147This is value ORed together of
148
1491 = Zone reclaim on
1502 = Zone reclaim writes dirty pages out
1514 = Zone reclaim swaps pages
152
153zone_reclaim_mode is set during bootup to 1 if it is determined that pages
154from remote zones will cause a measurable performance reduction. The
Christoph Lameter17436602006-01-18 17:42:32 -0800155page allocator will then reclaim easily reusable pages (those page
Christoph Lameter1b2ffb72006-02-01 03:05:34 -0800156cache pages that are currently not used) before allocating off node pages.
Christoph Lameter17436602006-01-18 17:42:32 -0800157
Christoph Lameter1b2ffb72006-02-01 03:05:34 -0800158It may be beneficial to switch off zone reclaim if the system is
159used for a file server and all of memory should be used for caching files
160from disk. In that case the caching effect is more important than
161data locality.
Christoph Lameter17436602006-01-18 17:42:32 -0800162
Christoph Lameter1b2ffb72006-02-01 03:05:34 -0800163Allowing zone reclaim to write out pages stops processes that are
164writing large amounts of data from dirtying pages on other nodes. Zone
165reclaim will write out dirty pages if a zone fills up and so effectively
166throttle the process. This may decrease the performance of a single process
167since it cannot use all of system memory to buffer the outgoing writes
168anymore but it preserve the memory on other nodes so that the performance
169of other processes running on other nodes will not be affected.
170
171Allowing regular swap effectively restricts allocations to the local
172node unless explicitly overridden by memory policies or cpuset
173configurations.
174
KAMEZAWA Hiroyukifadd8fb2006-06-23 02:03:13 -0700175=============================================================
176
Christoph Lameter96146342006-07-03 00:24:13 -0700177min_unmapped_ratio:
178
179This is available only on NUMA kernels.
180
Christoph Lameter0ff38492006-09-25 23:31:52 -0700181A percentage of the total pages in each zone. Zone reclaim will only
Christoph Lameter96146342006-07-03 00:24:13 -0700182occur if more than this percentage of pages are file backed and unmapped.
183This is to insure that a minimal amount of local pages is still available for
184file I/O even if the node is overallocated.
185
186The default is 1 percent.
187
188=============================================================
189
Christoph Lameter0ff38492006-09-25 23:31:52 -0700190min_slab_ratio:
191
192This is available only on NUMA kernels.
193
194A percentage of the total pages in each zone. On Zone reclaim
195(fallback from the local zone occurs) slabs will be reclaimed if more
196than this percentage of pages in a zone are reclaimable slab pages.
197This insures that the slab growth stays under control even in NUMA
198systems that rarely perform global reclaim.
199
200The default is 5 percent.
201
202Note that slab reclaim is triggered in a per zone / node fashion.
203The process of reclaiming slab memory is currently not node specific
204and may not be fast.
205
206=============================================================
207
KAMEZAWA Hiroyukifadd8fb2006-06-23 02:03:13 -0700208panic_on_oom
209
Yasunori Goto2b744c02007-05-06 14:49:59 -0700210This enables or disables panic on out-of-memory feature.
211
212If this is set to 0, the kernel will kill some rogue process,
213called oom_killer. Usually, oom_killer can kill rogue processes and
214system will survive.
215
216If this is set to 1, the kernel panics when out-of-memory happens.
217However, if a process limits using nodes by mempolicy/cpusets,
218and those nodes become memory exhaustion status, one process
219may be killed by oom-killer. No panic occurs in this case.
220Because other nodes' memory may be free. This means system total status
221may be not fatal yet.
222
223If this is set to 2, the kernel panics compulsorily even on the
224above-mentioned.
KAMEZAWA Hiroyukifadd8fb2006-06-23 02:03:13 -0700225
226The default value is 0.
Yasunori Goto2b744c02007-05-06 14:49:59 -07002271 and 2 are for failover of clustering. Please select either
228according to your policy of failover.
Eric Parised032182007-06-28 15:55:21 -0400229
David Rientjesfe071d72007-10-16 23:25:56 -0700230=============================================================
231
232oom_kill_allocating_task
233
234This enables or disables killing the OOM-triggering task in
235out-of-memory situations.
236
237If this is set to zero, the OOM killer will scan through the entire
238tasklist and select a task based on heuristics to kill. This normally
239selects a rogue memory-hogging task that frees up a large amount of
240memory when killed.
241
242If this is set to non-zero, the OOM killer simply kills the task that
243triggered the out-of-memory condition. This avoids the expensive
244tasklist scan.
245
246If panic_on_oom is selected, it takes precedence over whatever value
247is used in oom_kill_allocating_task.
248
249The default value is 0.
250
Eric Parised032182007-06-28 15:55:21 -0400251==============================================================
252
253mmap_min_addr
254
255This file indicates the amount of address space which a user process will
256be restricted from mmaping. Since kernel null dereference bugs could
257accidentally operate based on the information in the first couple of pages
258of memory userspace processes should not be allowed to write to them. By
259default this value is set to 0 and no protections will be enforced by the
260security module. Setting this value to something like 64k will allow the
261vast majority of applications to work correctly and provide defense in depth
262against future potential kernel bugs.
263
KAMEZAWA Hiroyukif0c0b2b2007-07-15 23:38:01 -0700264==============================================================
265
266numa_zonelist_order
267
268This sysctl is only for NUMA.
269'where the memory is allocated from' is controlled by zonelists.
270(This documentation ignores ZONE_HIGHMEM/ZONE_DMA32 for simple explanation.
271 you may be able to read ZONE_DMA as ZONE_DMA32...)
272
273In non-NUMA case, a zonelist for GFP_KERNEL is ordered as following.
274ZONE_NORMAL -> ZONE_DMA
275This means that a memory allocation request for GFP_KERNEL will
276get memory from ZONE_DMA only when ZONE_NORMAL is not available.
277
278In NUMA case, you can think of following 2 types of order.
279Assume 2 node NUMA and below is zonelist of Node(0)'s GFP_KERNEL
280
281(A) Node(0) ZONE_NORMAL -> Node(0) ZONE_DMA -> Node(1) ZONE_NORMAL
282(B) Node(0) ZONE_NORMAL -> Node(1) ZONE_NORMAL -> Node(0) ZONE_DMA.
283
284Type(A) offers the best locality for processes on Node(0), but ZONE_DMA
285will be used before ZONE_NORMAL exhaustion. This increases possibility of
286out-of-memory(OOM) of ZONE_DMA because ZONE_DMA is tend to be small.
287
288Type(B) cannot offer the best locality but is more robust against OOM of
289the DMA zone.
290
291Type(A) is called as "Node" order. Type (B) is "Zone" order.
292
293"Node order" orders the zonelists by node, then by zone within each node.
294Specify "[Nn]ode" for zone order
295
296"Zone Order" orders the zonelists by zone type, then by node within each
297zone. Specify "[Zz]one"for zode order.
298
299Specify "[Dd]efault" to request automatic configuration. Autoconfiguration
300will select "node" order in following case.
301(1) if the DMA zone does not exist or
302(2) if the DMA zone comprises greater than 50% of the available memory or
303(3) if any node's DMA zone comprises greater than 60% of its local memory and
304 the amount of local memory is big enough.
305
306Otherwise, "zone" order will be selected. Default order is recommended unless
307this is causing problems for your system/application.