]>
Commit | Line | Data |
---|---|---|
db0fb184 | 1 | Documentation for /proc/sys/vm/* kernel version 2.6.29 |
1da177e4 | 2 | (c) 1998, 1999, Rik van Riel <riel@nl.linux.org> |
db0fb184 | 3 | (c) 2008 Peter W. Morreale <pmorreale@novell.com> |
1da177e4 LT |
4 | |
5 | For general info and legal blurb, please look in README. | |
6 | ||
7 | ============================================================== | |
8 | ||
9 | This file contains the documentation for the sysctl files in | |
db0fb184 | 10 | /proc/sys/vm and is valid for Linux kernel version 2.6.29. |
1da177e4 LT |
11 | |
12 | The files in this directory can be used to tune the operation | |
13 | of the virtual memory (VM) subsystem of the Linux kernel and | |
14 | the writeout of dirty data to disk. | |
15 | ||
16 | Default values and initialization routines for most of these | |
17 | files can be found in mm/swap.c. | |
18 | ||
19 | Currently, these files are in /proc/sys/vm: | |
db0fb184 PM |
20 | |
21 | - block_dump | |
76ab0f53 | 22 | - compact_memory |
db0fb184 | 23 | - dirty_background_bytes |
1da177e4 | 24 | - dirty_background_ratio |
db0fb184 | 25 | - dirty_bytes |
1da177e4 | 26 | - dirty_expire_centisecs |
db0fb184 | 27 | - dirty_ratio |
1da177e4 | 28 | - dirty_writeback_centisecs |
db0fb184 | 29 | - drop_caches |
5e771905 | 30 | - extfrag_threshold |
db0fb184 PM |
31 | - hugepages_treat_as_movable |
32 | - hugetlb_shm_group | |
33 | - laptop_mode | |
34 | - legacy_va_layout | |
35 | - lowmem_reserve_ratio | |
1da177e4 | 36 | - max_map_count |
6a46079c AK |
37 | - memory_failure_early_kill |
38 | - memory_failure_recovery | |
1da177e4 | 39 | - min_free_kbytes |
0ff38490 | 40 | - min_slab_ratio |
db0fb184 PM |
41 | - min_unmapped_ratio |
42 | - mmap_min_addr | |
d5dbac87 NA |
43 | - nr_hugepages |
44 | - nr_overcommit_hugepages | |
db0fb184 PM |
45 | - nr_pdflush_threads |
46 | - nr_trim_pages (only if CONFIG_MMU=n) | |
47 | - numa_zonelist_order | |
48 | - oom_dump_tasks | |
49 | - oom_kill_allocating_task | |
50 | - overcommit_memory | |
51 | - overcommit_ratio | |
52 | - page-cluster | |
53 | - panic_on_oom | |
54 | - percpu_pagelist_fraction | |
55 | - stat_interval | |
56 | - swappiness | |
57 | - vfs_cache_pressure | |
58 | - zone_reclaim_mode | |
59 | ||
1da177e4 LT |
60 | ============================================================== |
61 | ||
db0fb184 | 62 | block_dump |
1da177e4 | 63 | |
db0fb184 PM |
64 | block_dump enables block I/O debugging when set to a nonzero value. More |
65 | information on block I/O debugging is in Documentation/laptops/laptop-mode.txt. | |
1da177e4 LT |
66 | |
67 | ============================================================== | |
68 | ||
76ab0f53 MG |
69 | compact_memory |
70 | ||
71 | Available only when CONFIG_COMPACTION is set. When 1 is written to the file, | |
72 | all zones are compacted such that free memory is available in contiguous | |
73 | blocks where possible. This can be important for example in the allocation of | |
74 | huge pages although processes will also directly compact memory as required. | |
75 | ||
76 | ============================================================== | |
77 | ||
db0fb184 | 78 | dirty_background_bytes |
1da177e4 | 79 | |
db0fb184 PM |
80 | Contains the amount of dirty memory at which the pdflush background writeback |
81 | daemon will start writeback. | |
1da177e4 | 82 | |
db0fb184 PM |
83 | If dirty_background_bytes is written, dirty_background_ratio becomes a function |
84 | of its value (dirty_background_bytes / the amount of dirtyable system memory). | |
1da177e4 | 85 | |
db0fb184 | 86 | ============================================================== |
1da177e4 | 87 | |
db0fb184 | 88 | dirty_background_ratio |
1da177e4 | 89 | |
db0fb184 PM |
90 | Contains, as a percentage of total system memory, the number of pages at which |
91 | the pdflush background writeback daemon will start writing out dirty data. | |
1da177e4 | 92 | |
db0fb184 | 93 | ============================================================== |
1da177e4 | 94 | |
db0fb184 PM |
95 | dirty_bytes |
96 | ||
97 | Contains the amount of dirty memory at which a process generating disk writes | |
98 | will itself start writeback. | |
99 | ||
100 | If dirty_bytes is written, dirty_ratio becomes a function of its value | |
101 | (dirty_bytes / the amount of dirtyable system memory). | |
1da177e4 | 102 | |
9e4a5bda AR |
103 | Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any |
104 | value lower than this limit will be ignored and the old configuration will be | |
105 | retained. | |
106 | ||
1da177e4 LT |
107 | ============================================================== |
108 | ||
db0fb184 | 109 | dirty_expire_centisecs |
1da177e4 | 110 | |
db0fb184 PM |
111 | This tunable is used to define when dirty data is old enough to be eligible |
112 | for writeout by the pdflush daemons. It is expressed in 100'ths of a second. | |
113 | Data which has been dirty in-memory for longer than this interval will be | |
114 | written out next time a pdflush daemon wakes up. | |
115 | ||
116 | ============================================================== | |
117 | ||
118 | dirty_ratio | |
119 | ||
120 | Contains, as a percentage of total system memory, the number of pages at which | |
121 | a process which is generating disk writes will itself start writing out dirty | |
122 | data. | |
1da177e4 LT |
123 | |
124 | ============================================================== | |
125 | ||
db0fb184 | 126 | dirty_writeback_centisecs |
1da177e4 | 127 | |
db0fb184 PM |
128 | The pdflush writeback daemons will periodically wake up and write `old' data |
129 | out to disk. This tunable expresses the interval between those wakeups, in | |
130 | 100'ths of a second. | |
1da177e4 | 131 | |
db0fb184 | 132 | Setting this to zero disables periodic writeback altogether. |
1da177e4 LT |
133 | |
134 | ============================================================== | |
135 | ||
db0fb184 | 136 | drop_caches |
1da177e4 | 137 | |
db0fb184 PM |
138 | Writing to this will cause the kernel to drop clean caches, dentries and |
139 | inodes from memory, causing that memory to become free. | |
1da177e4 | 140 | |
db0fb184 PM |
141 | To free pagecache: |
142 | echo 1 > /proc/sys/vm/drop_caches | |
143 | To free dentries and inodes: | |
144 | echo 2 > /proc/sys/vm/drop_caches | |
145 | To free pagecache, dentries and inodes: | |
146 | echo 3 > /proc/sys/vm/drop_caches | |
1da177e4 | 147 | |
db0fb184 PM |
148 | As this is a non-destructive operation and dirty objects are not freeable, the |
149 | user should run `sync' first. | |
1da177e4 LT |
150 | |
151 | ============================================================== | |
152 | ||
5e771905 MG |
153 | extfrag_threshold |
154 | ||
155 | This parameter affects whether the kernel will compact memory or direct | |
156 | reclaim to satisfy a high-order allocation. /proc/extfrag_index shows what | |
157 | the fragmentation index for each order is in each zone in the system. Values | |
158 | tending towards 0 imply allocations would fail due to lack of memory, | |
159 | values towards 1000 imply failures are due to fragmentation and -1 implies | |
160 | that the allocation will succeed as long as watermarks are met. | |
161 | ||
162 | The kernel will not compact memory in a zone if the | |
163 | fragmentation index is <= extfrag_threshold. The default value is 500. | |
164 | ||
165 | ============================================================== | |
166 | ||
db0fb184 | 167 | hugepages_treat_as_movable |
1da177e4 | 168 | |
db0fb184 PM |
169 | This parameter is only useful when kernelcore= is specified at boot time to |
170 | create ZONE_MOVABLE for pages that may be reclaimed or migrated. Huge pages | |
171 | are not movable so are not normally allocated from ZONE_MOVABLE. A non-zero | |
172 | value written to hugepages_treat_as_movable allows huge pages to be allocated | |
173 | from ZONE_MOVABLE. | |
8ad4b1fb | 174 | |
db0fb184 PM |
175 | Once enabled, the ZONE_MOVABLE is treated as an area of memory the huge |
176 | pages pool can easily grow or shrink within. Assuming that applications are | |
177 | not running that mlock() a lot of memory, it is likely the huge pages pool | |
178 | can grow to the size of ZONE_MOVABLE by repeatedly entering the desired value | |
179 | into nr_hugepages and triggering page reclaim. | |
24950898 | 180 | |
8ad4b1fb RS |
181 | ============================================================== |
182 | ||
db0fb184 | 183 | hugetlb_shm_group |
8ad4b1fb | 184 | |
db0fb184 PM |
185 | hugetlb_shm_group contains group id that is allowed to create SysV |
186 | shared memory segment using hugetlb page. | |
8ad4b1fb | 187 | |
db0fb184 | 188 | ============================================================== |
8ad4b1fb | 189 | |
db0fb184 | 190 | laptop_mode |
1743660b | 191 | |
db0fb184 PM |
192 | laptop_mode is a knob that controls "laptop mode". All the things that are |
193 | controlled by this knob are discussed in Documentation/laptops/laptop-mode.txt. | |
1743660b | 194 | |
db0fb184 | 195 | ============================================================== |
1743660b | 196 | |
db0fb184 | 197 | legacy_va_layout |
1b2ffb78 | 198 | |
2174efb6 | 199 | If non-zero, this sysctl disables the new 32-bit mmap layout - the kernel |
db0fb184 | 200 | will use the legacy (2.4) layout for all processes. |
1b2ffb78 | 201 | |
db0fb184 | 202 | ============================================================== |
1b2ffb78 | 203 | |
db0fb184 PM |
204 | lowmem_reserve_ratio |
205 | ||
206 | For some specialised workloads on highmem machines it is dangerous for | |
207 | the kernel to allow process memory to be allocated from the "lowmem" | |
208 | zone. This is because that memory could then be pinned via the mlock() | |
209 | system call, or by unavailability of swapspace. | |
210 | ||
211 | And on large highmem machines this lack of reclaimable lowmem memory | |
212 | can be fatal. | |
213 | ||
214 | So the Linux page allocator has a mechanism which prevents allocations | |
215 | which _could_ use highmem from using too much lowmem. This means that | |
216 | a certain amount of lowmem is defended from the possibility of being | |
217 | captured into pinned user memory. | |
218 | ||
219 | (The same argument applies to the old 16 megabyte ISA DMA region. This | |
220 | mechanism will also defend that region from allocations which could use | |
221 | highmem or lowmem). | |
222 | ||
223 | The `lowmem_reserve_ratio' tunable determines how aggressive the kernel is | |
224 | in defending these lower zones. | |
225 | ||
226 | If you have a machine which uses highmem or ISA DMA and your | |
227 | applications are using mlock(), or if you are running with no swap then | |
228 | you probably should change the lowmem_reserve_ratio setting. | |
229 | ||
230 | The lowmem_reserve_ratio is an array. You can see them by reading this file. | |
231 | - | |
232 | % cat /proc/sys/vm/lowmem_reserve_ratio | |
233 | 256 256 32 | |
234 | - | |
235 | Note: # of this elements is one fewer than number of zones. Because the highest | |
236 | zone's value is not necessary for following calculation. | |
237 | ||
238 | But, these values are not used directly. The kernel calculates # of protection | |
239 | pages for each zones from them. These are shown as array of protection pages | |
240 | in /proc/zoneinfo like followings. (This is an example of x86-64 box). | |
241 | Each zone has an array of protection pages like this. | |
242 | ||
243 | - | |
244 | Node 0, zone DMA | |
245 | pages free 1355 | |
246 | min 3 | |
247 | low 3 | |
248 | high 4 | |
249 | : | |
250 | : | |
251 | numa_other 0 | |
252 | protection: (0, 2004, 2004, 2004) | |
253 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
254 | pagesets | |
255 | cpu: 0 pcp: 0 | |
256 | : | |
257 | - | |
258 | These protections are added to score to judge whether this zone should be used | |
259 | for page allocation or should be reclaimed. | |
260 | ||
261 | In this example, if normal pages (index=2) are required to this DMA zone and | |
41858966 MG |
262 | watermark[WMARK_HIGH] is used for watermark, the kernel judges this zone should |
263 | not be used because pages_free(1355) is smaller than watermark + protection[2] | |
db0fb184 PM |
264 | (4 + 2004 = 2008). If this protection value is 0, this zone would be used for |
265 | normal page requirement. If requirement is DMA zone(index=0), protection[0] | |
266 | (=0) is used. | |
267 | ||
268 | zone[i]'s protection[j] is calculated by following expression. | |
269 | ||
270 | (i < j): | |
271 | zone[i]->protection[j] | |
272 | = (total sums of present_pages from zone[i+1] to zone[j] on the node) | |
273 | / lowmem_reserve_ratio[i]; | |
274 | (i = j): | |
275 | (should not be protected. = 0; | |
276 | (i > j): | |
277 | (not necessary, but looks 0) | |
278 | ||
279 | The default values of lowmem_reserve_ratio[i] are | |
280 | 256 (if zone[i] means DMA or DMA32 zone) | |
281 | 32 (others). | |
282 | As above expression, they are reciprocal number of ratio. | |
283 | 256 means 1/256. # of protection pages becomes about "0.39%" of total present | |
284 | pages of higher zones on the node. | |
285 | ||
286 | If you would like to protect more pages, smaller values are effective. | |
287 | The minimum value is 1 (1/1 -> 100%). | |
1b2ffb78 | 288 | |
db0fb184 | 289 | ============================================================== |
1b2ffb78 | 290 | |
db0fb184 | 291 | max_map_count: |
1743660b | 292 | |
db0fb184 PM |
293 | This file contains the maximum number of memory map areas a process |
294 | may have. Memory map areas are used as a side-effect of calling | |
295 | malloc, directly by mmap and mprotect, and also when loading shared | |
296 | libraries. | |
1743660b | 297 | |
db0fb184 PM |
298 | While most applications need less than a thousand maps, certain |
299 | programs, particularly malloc debuggers, may consume lots of them, | |
300 | e.g., up to one or two maps per allocation. | |
fadd8fbd | 301 | |
db0fb184 | 302 | The default value is 65536. |
9614634f | 303 | |
6a46079c AK |
304 | ============================================================= |
305 | ||
306 | memory_failure_early_kill: | |
307 | ||
308 | Control how to kill processes when uncorrected memory error (typically | |
309 | a 2bit error in a memory module) is detected in the background by hardware | |
310 | that cannot be handled by the kernel. In some cases (like the page | |
311 | still having a valid copy on disk) the kernel will handle the failure | |
312 | transparently without affecting any applications. But if there is | |
313 | no other uptodate copy of the data it will kill to prevent any data | |
314 | corruptions from propagating. | |
315 | ||
316 | 1: Kill all processes that have the corrupted and not reloadable page mapped | |
317 | as soon as the corruption is detected. Note this is not supported | |
318 | for a few types of pages, like kernel internally allocated data or | |
319 | the swap cache, but works for the majority of user pages. | |
320 | ||
321 | 0: Only unmap the corrupted page from all processes and only kill a process | |
322 | who tries to access it. | |
323 | ||
324 | The kill is done using a catchable SIGBUS with BUS_MCEERR_AO, so processes can | |
325 | handle this if they want to. | |
326 | ||
327 | This is only active on architectures/platforms with advanced machine | |
328 | check handling and depends on the hardware capabilities. | |
329 | ||
330 | Applications can override this setting individually with the PR_MCE_KILL prctl | |
331 | ||
332 | ============================================================== | |
333 | ||
334 | memory_failure_recovery | |
335 | ||
336 | Enable memory failure recovery (when supported by the platform) | |
337 | ||
338 | 1: Attempt recovery. | |
339 | ||
340 | 0: Always panic on a memory failure. | |
341 | ||
db0fb184 | 342 | ============================================================== |
9614634f | 343 | |
db0fb184 | 344 | min_free_kbytes: |
9614634f | 345 | |
db0fb184 | 346 | This is used to force the Linux VM to keep a minimum number |
41858966 MG |
347 | of kilobytes free. The VM uses this number to compute a |
348 | watermark[WMARK_MIN] value for each lowmem zone in the system. | |
349 | Each lowmem zone gets a number of reserved free pages based | |
350 | proportionally on its size. | |
db0fb184 PM |
351 | |
352 | Some minimal amount of memory is needed to satisfy PF_MEMALLOC | |
353 | allocations; if you set this to lower than 1024KB, your system will | |
354 | become subtly broken, and prone to deadlock under high loads. | |
355 | ||
356 | Setting this too high will OOM your machine instantly. | |
9614634f CL |
357 | |
358 | ============================================================= | |
359 | ||
0ff38490 CL |
360 | min_slab_ratio: |
361 | ||
362 | This is available only on NUMA kernels. | |
363 | ||
364 | A percentage of the total pages in each zone. On Zone reclaim | |
365 | (fallback from the local zone occurs) slabs will be reclaimed if more | |
366 | than this percentage of pages in a zone are reclaimable slab pages. | |
367 | This insures that the slab growth stays under control even in NUMA | |
368 | systems that rarely perform global reclaim. | |
369 | ||
370 | The default is 5 percent. | |
371 | ||
372 | Note that slab reclaim is triggered in a per zone / node fashion. | |
373 | The process of reclaiming slab memory is currently not node specific | |
374 | and may not be fast. | |
375 | ||
376 | ============================================================= | |
377 | ||
db0fb184 | 378 | min_unmapped_ratio: |
fadd8fbd | 379 | |
db0fb184 | 380 | This is available only on NUMA kernels. |
fadd8fbd | 381 | |
90afa5de MG |
382 | This is a percentage of the total pages in each zone. Zone reclaim will |
383 | only occur if more than this percentage of pages are in a state that | |
384 | zone_reclaim_mode allows to be reclaimed. | |
385 | ||
386 | If zone_reclaim_mode has the value 4 OR'd, then the percentage is compared | |
387 | against all file-backed unmapped pages including swapcache pages and tmpfs | |
388 | files. Otherwise, only unmapped pages backed by normal files but not tmpfs | |
389 | files and similar are considered. | |
2b744c01 | 390 | |
db0fb184 | 391 | The default is 1 percent. |
fadd8fbd | 392 | |
db0fb184 | 393 | ============================================================== |
2b744c01 | 394 | |
db0fb184 | 395 | mmap_min_addr |
ed032189 | 396 | |
db0fb184 | 397 | This file indicates the amount of address space which a user process will |
af901ca1 | 398 | be restricted from mmapping. Since kernel null dereference bugs could |
db0fb184 PM |
399 | accidentally operate based on the information in the first couple of pages |
400 | of memory userspace processes should not be allowed to write to them. By | |
401 | default this value is set to 0 and no protections will be enforced by the | |
402 | security module. Setting this value to something like 64k will allow the | |
403 | vast majority of applications to work correctly and provide defense in depth | |
404 | against future potential kernel bugs. | |
fe071d7e | 405 | |
db0fb184 | 406 | ============================================================== |
fef1bdd6 | 407 | |
db0fb184 | 408 | nr_hugepages |
fef1bdd6 | 409 | |
db0fb184 | 410 | Change the minimum size of the hugepage pool. |
fef1bdd6 | 411 | |
db0fb184 | 412 | See Documentation/vm/hugetlbpage.txt |
fef1bdd6 | 413 | |
db0fb184 | 414 | ============================================================== |
fef1bdd6 | 415 | |
db0fb184 | 416 | nr_overcommit_hugepages |
fef1bdd6 | 417 | |
db0fb184 PM |
418 | Change the maximum size of the hugepage pool. The maximum is |
419 | nr_hugepages + nr_overcommit_hugepages. | |
fe071d7e | 420 | |
db0fb184 | 421 | See Documentation/vm/hugetlbpage.txt |
fe071d7e | 422 | |
db0fb184 | 423 | ============================================================== |
fe071d7e | 424 | |
db0fb184 | 425 | nr_pdflush_threads |
fe071d7e | 426 | |
db0fb184 PM |
427 | The current number of pdflush threads. This value is read-only. |
428 | The value changes according to the number of dirty pages in the system. | |
fe071d7e | 429 | |
19f59460 | 430 | When necessary, additional pdflush threads are created, one per second, up to |
db0fb184 | 431 | nr_pdflush_threads_max. |
fe071d7e | 432 | |
ed032189 EP |
433 | ============================================================== |
434 | ||
db0fb184 | 435 | nr_trim_pages |
ed032189 | 436 | |
db0fb184 PM |
437 | This is available only on NOMMU kernels. |
438 | ||
439 | This value adjusts the excess page trimming behaviour of power-of-2 aligned | |
440 | NOMMU mmap allocations. | |
441 | ||
442 | A value of 0 disables trimming of allocations entirely, while a value of 1 | |
443 | trims excess pages aggressively. Any value >= 1 acts as the watermark where | |
444 | trimming of allocations is initiated. | |
445 | ||
446 | The default value is 1. | |
447 | ||
448 | See Documentation/nommu-mmap.txt for more information. | |
ed032189 | 449 | |
f0c0b2b8 KH |
450 | ============================================================== |
451 | ||
452 | numa_zonelist_order | |
453 | ||
454 | This sysctl is only for NUMA. | |
455 | 'where the memory is allocated from' is controlled by zonelists. | |
456 | (This documentation ignores ZONE_HIGHMEM/ZONE_DMA32 for simple explanation. | |
457 | you may be able to read ZONE_DMA as ZONE_DMA32...) | |
458 | ||
459 | In non-NUMA case, a zonelist for GFP_KERNEL is ordered as following. | |
460 | ZONE_NORMAL -> ZONE_DMA | |
461 | This means that a memory allocation request for GFP_KERNEL will | |
462 | get memory from ZONE_DMA only when ZONE_NORMAL is not available. | |
463 | ||
464 | In NUMA case, you can think of following 2 types of order. | |
465 | Assume 2 node NUMA and below is zonelist of Node(0)'s GFP_KERNEL | |
466 | ||
467 | (A) Node(0) ZONE_NORMAL -> Node(0) ZONE_DMA -> Node(1) ZONE_NORMAL | |
468 | (B) Node(0) ZONE_NORMAL -> Node(1) ZONE_NORMAL -> Node(0) ZONE_DMA. | |
469 | ||
470 | Type(A) offers the best locality for processes on Node(0), but ZONE_DMA | |
471 | will be used before ZONE_NORMAL exhaustion. This increases possibility of | |
472 | out-of-memory(OOM) of ZONE_DMA because ZONE_DMA is tend to be small. | |
473 | ||
474 | Type(B) cannot offer the best locality but is more robust against OOM of | |
475 | the DMA zone. | |
476 | ||
477 | Type(A) is called as "Node" order. Type (B) is "Zone" order. | |
478 | ||
479 | "Node order" orders the zonelists by node, then by zone within each node. | |
480 | Specify "[Nn]ode" for zone order | |
481 | ||
482 | "Zone Order" orders the zonelists by zone type, then by node within each | |
483 | zone. Specify "[Zz]one"for zode order. | |
484 | ||
485 | Specify "[Dd]efault" to request automatic configuration. Autoconfiguration | |
486 | will select "node" order in following case. | |
487 | (1) if the DMA zone does not exist or | |
488 | (2) if the DMA zone comprises greater than 50% of the available memory or | |
489 | (3) if any node's DMA zone comprises greater than 60% of its local memory and | |
490 | the amount of local memory is big enough. | |
491 | ||
492 | Otherwise, "zone" order will be selected. Default order is recommended unless | |
493 | this is causing problems for your system/application. | |
d5dbac87 NA |
494 | |
495 | ============================================================== | |
496 | ||
db0fb184 | 497 | oom_dump_tasks |
d5dbac87 | 498 | |
db0fb184 PM |
499 | Enables a system-wide task dump (excluding kernel threads) to be |
500 | produced when the kernel performs an OOM-killing and includes such | |
501 | information as pid, uid, tgid, vm size, rss, cpu, oom_adj score, and | |
502 | name. This is helpful to determine why the OOM killer was invoked | |
503 | and to identify the rogue task that caused it. | |
d5dbac87 | 504 | |
db0fb184 PM |
505 | If this is set to zero, this information is suppressed. On very |
506 | large systems with thousands of tasks it may not be feasible to dump | |
507 | the memory state information for each one. Such systems should not | |
508 | be forced to incur a performance penalty in OOM conditions when the | |
509 | information may not be desired. | |
510 | ||
511 | If this is set to non-zero, this information is shown whenever the | |
512 | OOM killer actually kills a memory-hogging task. | |
513 | ||
514 | The default value is 0. | |
d5dbac87 NA |
515 | |
516 | ============================================================== | |
517 | ||
db0fb184 | 518 | oom_kill_allocating_task |
d5dbac87 | 519 | |
db0fb184 PM |
520 | This enables or disables killing the OOM-triggering task in |
521 | out-of-memory situations. | |
d5dbac87 | 522 | |
db0fb184 PM |
523 | If this is set to zero, the OOM killer will scan through the entire |
524 | tasklist and select a task based on heuristics to kill. This normally | |
525 | selects a rogue memory-hogging task that frees up a large amount of | |
526 | memory when killed. | |
527 | ||
528 | If this is set to non-zero, the OOM killer simply kills the task that | |
529 | triggered the out-of-memory condition. This avoids the expensive | |
530 | tasklist scan. | |
531 | ||
532 | If panic_on_oom is selected, it takes precedence over whatever value | |
533 | is used in oom_kill_allocating_task. | |
534 | ||
535 | The default value is 0. | |
dd8632a1 PM |
536 | |
537 | ============================================================== | |
538 | ||
db0fb184 | 539 | overcommit_memory: |
dd8632a1 | 540 | |
db0fb184 | 541 | This value contains a flag that enables memory overcommitment. |
dd8632a1 | 542 | |
db0fb184 PM |
543 | When this flag is 0, the kernel attempts to estimate the amount |
544 | of free memory left when userspace requests more memory. | |
dd8632a1 | 545 | |
db0fb184 PM |
546 | When this flag is 1, the kernel pretends there is always enough |
547 | memory until it actually runs out. | |
dd8632a1 | 548 | |
db0fb184 PM |
549 | When this flag is 2, the kernel uses a "never overcommit" |
550 | policy that attempts to prevent any overcommit of memory. | |
dd8632a1 | 551 | |
db0fb184 PM |
552 | This feature can be very useful because there are a lot of |
553 | programs that malloc() huge amounts of memory "just-in-case" | |
554 | and don't use much of it. | |
555 | ||
556 | The default value is 0. | |
557 | ||
558 | See Documentation/vm/overcommit-accounting and | |
559 | security/commoncap.c::cap_vm_enough_memory() for more information. | |
560 | ||
561 | ============================================================== | |
562 | ||
563 | overcommit_ratio: | |
564 | ||
565 | When overcommit_memory is set to 2, the committed address | |
566 | space is not permitted to exceed swap plus this percentage | |
567 | of physical RAM. See above. | |
568 | ||
569 | ============================================================== | |
570 | ||
571 | page-cluster | |
572 | ||
573 | page-cluster controls the number of pages which are written to swap in | |
574 | a single attempt. The swap I/O size. | |
575 | ||
576 | It is a logarithmic value - setting it to zero means "1 page", setting | |
577 | it to 1 means "2 pages", setting it to 2 means "4 pages", etc. | |
578 | ||
579 | The default value is three (eight pages at a time). There may be some | |
580 | small benefits in tuning this to a different value if your workload is | |
581 | swap-intensive. | |
582 | ||
583 | ============================================================= | |
584 | ||
585 | panic_on_oom | |
586 | ||
587 | This enables or disables panic on out-of-memory feature. | |
588 | ||
589 | If this is set to 0, the kernel will kill some rogue process, | |
590 | called oom_killer. Usually, oom_killer can kill rogue processes and | |
591 | system will survive. | |
592 | ||
593 | If this is set to 1, the kernel panics when out-of-memory happens. | |
594 | However, if a process limits using nodes by mempolicy/cpusets, | |
595 | and those nodes become memory exhaustion status, one process | |
596 | may be killed by oom-killer. No panic occurs in this case. | |
597 | Because other nodes' memory may be free. This means system total status | |
598 | may be not fatal yet. | |
599 | ||
600 | If this is set to 2, the kernel panics compulsorily even on the | |
daaf1e68 KH |
601 | above-mentioned. Even oom happens under memory cgroup, the whole |
602 | system panics. | |
db0fb184 PM |
603 | |
604 | The default value is 0. | |
605 | 1 and 2 are for failover of clustering. Please select either | |
606 | according to your policy of failover. | |
daaf1e68 KH |
607 | panic_on_oom=2+kdump gives you very strong tool to investigate |
608 | why oom happens. You can get snapshot. | |
db0fb184 PM |
609 | |
610 | ============================================================= | |
611 | ||
612 | percpu_pagelist_fraction | |
613 | ||
614 | This is the fraction of pages at most (high mark pcp->high) in each zone that | |
615 | are allocated for each per cpu page list. The min value for this is 8. It | |
616 | means that we don't allow more than 1/8th of pages in each zone to be | |
617 | allocated in any single per_cpu_pagelist. This entry only changes the value | |
618 | of hot per cpu pagelists. User can specify a number like 100 to allocate | |
619 | 1/100th of each zone to each per cpu page list. | |
620 | ||
621 | The batch value of each per cpu pagelist is also updated as a result. It is | |
622 | set to pcp->high/4. The upper limit of batch is (PAGE_SHIFT * 8) | |
623 | ||
624 | The initial value is zero. Kernel does not use this value at boot time to set | |
625 | the high water marks for each per cpu page list. | |
626 | ||
627 | ============================================================== | |
628 | ||
629 | stat_interval | |
630 | ||
631 | The time interval between which vm statistics are updated. The default | |
632 | is 1 second. | |
633 | ||
634 | ============================================================== | |
635 | ||
636 | swappiness | |
637 | ||
638 | This control is used to define how aggressive the kernel will swap | |
639 | memory pages. Higher values will increase agressiveness, lower values | |
19f59460 | 640 | decrease the amount of swap. |
db0fb184 PM |
641 | |
642 | The default value is 60. | |
643 | ||
644 | ============================================================== | |
645 | ||
646 | vfs_cache_pressure | |
647 | ------------------ | |
648 | ||
649 | Controls the tendency of the kernel to reclaim the memory which is used for | |
650 | caching of directory and inode objects. | |
651 | ||
652 | At the default value of vfs_cache_pressure=100 the kernel will attempt to | |
653 | reclaim dentries and inodes at a "fair" rate with respect to pagecache and | |
654 | swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer | |
55c37a84 JK |
655 | to retain dentry and inode caches. When vfs_cache_pressure=0, the kernel will |
656 | never reclaim dentries and inodes due to memory pressure and this can easily | |
657 | lead to out-of-memory conditions. Increasing vfs_cache_pressure beyond 100 | |
db0fb184 PM |
658 | causes the kernel to prefer to reclaim dentries and inodes. |
659 | ||
660 | ============================================================== | |
661 | ||
662 | zone_reclaim_mode: | |
663 | ||
664 | Zone_reclaim_mode allows someone to set more or less aggressive approaches to | |
665 | reclaim memory when a zone runs out of memory. If it is set to zero then no | |
666 | zone reclaim occurs. Allocations will be satisfied from other zones / nodes | |
667 | in the system. | |
668 | ||
669 | This is value ORed together of | |
670 | ||
671 | 1 = Zone reclaim on | |
672 | 2 = Zone reclaim writes dirty pages out | |
673 | 4 = Zone reclaim swaps pages | |
674 | ||
675 | zone_reclaim_mode is set during bootup to 1 if it is determined that pages | |
676 | from remote zones will cause a measurable performance reduction. The | |
677 | page allocator will then reclaim easily reusable pages (those page | |
678 | cache pages that are currently not used) before allocating off node pages. | |
679 | ||
680 | It may be beneficial to switch off zone reclaim if the system is | |
681 | used for a file server and all of memory should be used for caching files | |
682 | from disk. In that case the caching effect is more important than | |
683 | data locality. | |
684 | ||
685 | Allowing zone reclaim to write out pages stops processes that are | |
686 | writing large amounts of data from dirtying pages on other nodes. Zone | |
687 | reclaim will write out dirty pages if a zone fills up and so effectively | |
688 | throttle the process. This may decrease the performance of a single process | |
689 | since it cannot use all of system memory to buffer the outgoing writes | |
690 | anymore but it preserve the memory on other nodes so that the performance | |
691 | of other processes running on other nodes will not be affected. | |
692 | ||
693 | Allowing regular swap effectively restricts allocations to the local | |
694 | node unless explicitly overridden by memory policies or cpuset | |
695 | configurations. | |
696 | ||
697 | ============ End of Document ================================= |