blob: 8cfca173d4bca46fab5c121be80d070858aaa0c6 [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
Eric Parised032182007-06-28 15:55:21 -040034- mmap_min_address
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
36==============================================================
37
38dirty_ratio, dirty_background_ratio, dirty_expire_centisecs,
39dirty_writeback_centisecs, vfs_cache_pressure, laptop_mode,
Andrew Morton9d0243b2006-01-08 01:00:39 -080040block_dump, swap_token_timeout, drop-caches:
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
42See Documentation/filesystems/proc.txt
43
44==============================================================
45
46overcommit_memory:
47
48This value contains a flag that enables memory overcommitment.
49
50When this flag is 0, the kernel attempts to estimate the amount
51of free memory left when userspace requests more memory.
52
53When this flag is 1, the kernel pretends there is always enough
54memory until it actually runs out.
55
56When this flag is 2, the kernel uses a "never overcommit"
57policy that attempts to prevent any overcommit of memory.
58
59This feature can be very useful because there are a lot of
60programs that malloc() huge amounts of memory "just-in-case"
61and don't use much of it.
62
63The default value is 0.
64
65See Documentation/vm/overcommit-accounting and
66security/commoncap.c::cap_vm_enough_memory() for more information.
67
68==============================================================
69
70overcommit_ratio:
71
72When overcommit_memory is set to 2, the committed address
73space is not permitted to exceed swap plus this percentage
74of physical RAM. See above.
75
76==============================================================
77
78page-cluster:
79
80The Linux VM subsystem avoids excessive disk seeks by reading
81multiple pages on a page fault. The number of pages it reads
82is dependent on the amount of memory in your machine.
83
84The number of pages the kernel reads in at once is equal to
852 ^ page-cluster. Values above 2 ^ 5 don't make much sense
86for swap because we only cluster swap data in 32-page groups.
87
88==============================================================
89
90max_map_count:
91
92This file contains the maximum number of memory map areas a process
93may have. Memory map areas are used as a side-effect of calling
94malloc, directly by mmap and mprotect, and also when loading shared
95libraries.
96
97While most applications need less than a thousand maps, certain
98programs, particularly malloc debuggers, may consume lots of them,
99e.g., up to one or two maps per allocation.
100
101The default value is 65536.
102
103==============================================================
104
105min_free_kbytes:
106
107This is used to force the Linux VM to keep a minimum number
108of kilobytes free. The VM uses this number to compute a pages_min
109value for each lowmem zone in the system. Each lowmem zone gets
110a number of reserved free pages based proportionally on its size.
Rohit Seth8ad4b1f2006-01-08 01:00:40 -0800111
112==============================================================
113
114percpu_pagelist_fraction
115
116This is the fraction of pages at most (high mark pcp->high) in each zone that
117are allocated for each per cpu page list. The min value for this is 8. It
118means that we don't allow more than 1/8th of pages in each zone to be
119allocated in any single per_cpu_pagelist. This entry only changes the value
120of hot per cpu pagelists. User can specify a number like 100 to allocate
1211/100th of each zone to each per cpu page list.
122
123The batch value of each per cpu pagelist is also updated as a result. It is
124set to pcp->high/4. The upper limit of batch is (PAGE_SHIFT * 8)
125
126The initial value is zero. Kernel does not use this value at boot time to set
127the high water marks for each per cpu page list.
Christoph Lameter17436602006-01-18 17:42:32 -0800128
129===============================================================
130
131zone_reclaim_mode:
132
Matt LaPlante5d3f0832006-11-30 05:21:10 +0100133Zone_reclaim_mode allows someone to set more or less aggressive approaches to
Christoph Lameter1b2ffb72006-02-01 03:05:34 -0800134reclaim memory when a zone runs out of memory. If it is set to zero then no
135zone reclaim occurs. Allocations will be satisfied from other zones / nodes
136in the system.
137
138This is value ORed together of
139
1401 = Zone reclaim on
1412 = Zone reclaim writes dirty pages out
1424 = Zone reclaim swaps pages
143
144zone_reclaim_mode is set during bootup to 1 if it is determined that pages
145from remote zones will cause a measurable performance reduction. The
Christoph Lameter17436602006-01-18 17:42:32 -0800146page allocator will then reclaim easily reusable pages (those page
Christoph Lameter1b2ffb72006-02-01 03:05:34 -0800147cache pages that are currently not used) before allocating off node pages.
Christoph Lameter17436602006-01-18 17:42:32 -0800148
Christoph Lameter1b2ffb72006-02-01 03:05:34 -0800149It may be beneficial to switch off zone reclaim if the system is
150used for a file server and all of memory should be used for caching files
151from disk. In that case the caching effect is more important than
152data locality.
Christoph Lameter17436602006-01-18 17:42:32 -0800153
Christoph Lameter1b2ffb72006-02-01 03:05:34 -0800154Allowing zone reclaim to write out pages stops processes that are
155writing large amounts of data from dirtying pages on other nodes. Zone
156reclaim will write out dirty pages if a zone fills up and so effectively
157throttle the process. This may decrease the performance of a single process
158since it cannot use all of system memory to buffer the outgoing writes
159anymore but it preserve the memory on other nodes so that the performance
160of other processes running on other nodes will not be affected.
161
162Allowing regular swap effectively restricts allocations to the local
163node unless explicitly overridden by memory policies or cpuset
164configurations.
165
KAMEZAWA Hiroyukifadd8fb2006-06-23 02:03:13 -0700166=============================================================
167
Christoph Lameter96146342006-07-03 00:24:13 -0700168min_unmapped_ratio:
169
170This is available only on NUMA kernels.
171
Christoph Lameter0ff38492006-09-25 23:31:52 -0700172A percentage of the total pages in each zone. Zone reclaim will only
Christoph Lameter96146342006-07-03 00:24:13 -0700173occur if more than this percentage of pages are file backed and unmapped.
174This is to insure that a minimal amount of local pages is still available for
175file I/O even if the node is overallocated.
176
177The default is 1 percent.
178
179=============================================================
180
Christoph Lameter0ff38492006-09-25 23:31:52 -0700181min_slab_ratio:
182
183This is available only on NUMA kernels.
184
185A percentage of the total pages in each zone. On Zone reclaim
186(fallback from the local zone occurs) slabs will be reclaimed if more
187than this percentage of pages in a zone are reclaimable slab pages.
188This insures that the slab growth stays under control even in NUMA
189systems that rarely perform global reclaim.
190
191The default is 5 percent.
192
193Note that slab reclaim is triggered in a per zone / node fashion.
194The process of reclaiming slab memory is currently not node specific
195and may not be fast.
196
197=============================================================
198
KAMEZAWA Hiroyukifadd8fb2006-06-23 02:03:13 -0700199panic_on_oom
200
Yasunori Goto2b744c02007-05-06 14:49:59 -0700201This enables or disables panic on out-of-memory feature.
202
203If this is set to 0, the kernel will kill some rogue process,
204called oom_killer. Usually, oom_killer can kill rogue processes and
205system will survive.
206
207If this is set to 1, the kernel panics when out-of-memory happens.
208However, if a process limits using nodes by mempolicy/cpusets,
209and those nodes become memory exhaustion status, one process
210may be killed by oom-killer. No panic occurs in this case.
211Because other nodes' memory may be free. This means system total status
212may be not fatal yet.
213
214If this is set to 2, the kernel panics compulsorily even on the
215above-mentioned.
KAMEZAWA Hiroyukifadd8fb2006-06-23 02:03:13 -0700216
217The default value is 0.
Yasunori Goto2b744c02007-05-06 14:49:59 -07002181 and 2 are for failover of clustering. Please select either
219according to your policy of failover.
Eric Parised032182007-06-28 15:55:21 -0400220
221==============================================================
222
223mmap_min_addr
224
225This file indicates the amount of address space which a user process will
226be restricted from mmaping. Since kernel null dereference bugs could
227accidentally operate based on the information in the first couple of pages
228of memory userspace processes should not be allowed to write to them. By
229default this value is set to 0 and no protections will be enforced by the
230security module. Setting this value to something like 64k will allow the
231vast majority of applications to work correctly and provide defense in depth
232against future potential kernel bugs.
233