cfg80211: Use const more consistently in for_each_element macros
[GitHub/MotorolaMobilityLLC/kernel-slsi.git] / Documentation / sysctl / vm.txt
1 Documentation for /proc/sys/vm/* kernel version 2.6.29
2 (c) 1998, 1999, Rik van Riel <riel@nl.linux.org>
3 (c) 2008 Peter W. Morreale <pmorreale@novell.com>
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
10 /proc/sys/vm and is valid for Linux kernel version 2.6.29.
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:
20
21 - admin_reserve_kbytes
22 - block_dump
23 - compact_memory
24 - compact_unevictable_allowed
25 - dirty_background_bytes
26 - dirty_background_ratio
27 - dirty_bytes
28 - dirty_expire_centisecs
29 - dirty_ratio
30 - dirty_writeback_centisecs
31 - drop_caches
32 - extfrag_threshold
33 - extra_free_kbytes
34 - hugepages_treat_as_movable
35 - hugetlb_shm_group
36 - laptop_mode
37 - legacy_va_layout
38 - lowmem_reserve_ratio
39 - max_map_count
40 - memory_failure_early_kill
41 - memory_failure_recovery
42 - min_free_kbytes
43 - min_slab_ratio
44 - min_unmapped_ratio
45 - mmap_min_addr
46 - mmap_rnd_bits
47 - mmap_rnd_compat_bits
48 - nr_hugepages
49 - nr_overcommit_hugepages
50 - nr_trim_pages (only if CONFIG_MMU=n)
51 - numa_zonelist_order
52 - oom_dump_tasks
53 - reap_mem_on_sigkill
54 - oom_kill_allocating_task
55 - overcommit_kbytes
56 - overcommit_memory
57 - overcommit_ratio
58 - page-cluster
59 - panic_on_oom
60 - percpu_pagelist_fraction
61 - stat_interval
62 - stat_refresh
63 - swappiness
64 - user_reserve_kbytes
65 - vfs_cache_pressure
66 - watermark_scale_factor
67 - zone_reclaim_mode
68
69 ==============================================================
70
71 admin_reserve_kbytes
72
73 The amount of free memory in the system that should be reserved for users
74 with the capability cap_sys_admin.
75
76 admin_reserve_kbytes defaults to min(3% of free pages, 8MB)
77
78 That should provide enough for the admin to log in and kill a process,
79 if necessary, under the default overcommit 'guess' mode.
80
81 Systems running under overcommit 'never' should increase this to account
82 for the full Virtual Memory Size of programs used to recover. Otherwise,
83 root may not be able to log in to recover the system.
84
85 How do you calculate a minimum useful reserve?
86
87 sshd or login + bash (or some other shell) + top (or ps, kill, etc.)
88
89 For overcommit 'guess', we can sum resident set sizes (RSS).
90 On x86_64 this is about 8MB.
91
92 For overcommit 'never', we can take the max of their virtual sizes (VSZ)
93 and add the sum of their RSS.
94 On x86_64 this is about 128MB.
95
96 Changing this takes effect whenever an application requests memory.
97
98 ==============================================================
99
100 block_dump
101
102 block_dump enables block I/O debugging when set to a nonzero value. More
103 information on block I/O debugging is in Documentation/laptops/laptop-mode.txt.
104
105 ==============================================================
106
107 compact_memory
108
109 Available only when CONFIG_COMPACTION is set. When 1 is written to the file,
110 all zones are compacted such that free memory is available in contiguous
111 blocks where possible. This can be important for example in the allocation of
112 huge pages although processes will also directly compact memory as required.
113
114 ==============================================================
115
116 compact_unevictable_allowed
117
118 Available only when CONFIG_COMPACTION is set. When set to 1, compaction is
119 allowed to examine the unevictable lru (mlocked pages) for pages to compact.
120 This should be used on systems where stalls for minor page faults are an
121 acceptable trade for large contiguous free memory. Set to 0 to prevent
122 compaction from moving pages that are unevictable. Default value is 1.
123
124 ==============================================================
125
126 dirty_background_bytes
127
128 Contains the amount of dirty memory at which the background kernel
129 flusher threads will start writeback.
130
131 Note: dirty_background_bytes is the counterpart of dirty_background_ratio. Only
132 one of them may be specified at a time. When one sysctl is written it is
133 immediately taken into account to evaluate the dirty memory limits and the
134 other appears as 0 when read.
135
136 ==============================================================
137
138 dirty_background_ratio
139
140 Contains, as a percentage of total available memory that contains free pages
141 and reclaimable pages, the number of pages at which the background kernel
142 flusher threads will start writing out dirty data.
143
144 The total available memory is not equal to total system memory.
145
146 ==============================================================
147
148 dirty_bytes
149
150 Contains the amount of dirty memory at which a process generating disk writes
151 will itself start writeback.
152
153 Note: dirty_bytes is the counterpart of dirty_ratio. Only one of them may be
154 specified at a time. When one sysctl is written it is immediately taken into
155 account to evaluate the dirty memory limits and the other appears as 0 when
156 read.
157
158 Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any
159 value lower than this limit will be ignored and the old configuration will be
160 retained.
161
162 ==============================================================
163
164 dirty_expire_centisecs
165
166 This tunable is used to define when dirty data is old enough to be eligible
167 for writeout by the kernel flusher threads. It is expressed in 100'ths
168 of a second. Data which has been dirty in-memory for longer than this
169 interval will be written out next time a flusher thread wakes up.
170
171 ==============================================================
172
173 dirty_ratio
174
175 Contains, as a percentage of total available memory that contains free pages
176 and reclaimable pages, the number of pages at which a process which is
177 generating disk writes will itself start writing out dirty data.
178
179 The total available memory is not equal to total system memory.
180
181 ==============================================================
182
183 dirty_writeback_centisecs
184
185 The kernel flusher threads will periodically wake up and write `old' data
186 out to disk. This tunable expresses the interval between those wakeups, in
187 100'ths of a second.
188
189 Setting this to zero disables periodic writeback altogether.
190
191 ==============================================================
192
193 drop_caches
194
195 Writing to this will cause the kernel to drop clean caches, as well as
196 reclaimable slab objects like dentries and inodes. Once dropped, their
197 memory becomes free.
198
199 To free pagecache:
200 echo 1 > /proc/sys/vm/drop_caches
201 To free reclaimable slab objects (includes dentries and inodes):
202 echo 2 > /proc/sys/vm/drop_caches
203 To free slab objects and pagecache:
204 echo 3 > /proc/sys/vm/drop_caches
205
206 This is a non-destructive operation and will not free any dirty objects.
207 To increase the number of objects freed by this operation, the user may run
208 `sync' prior to writing to /proc/sys/vm/drop_caches. This will minimize the
209 number of dirty objects on the system and create more candidates to be
210 dropped.
211
212 This file is not a means to control the growth of the various kernel caches
213 (inodes, dentries, pagecache, etc...) These objects are automatically
214 reclaimed by the kernel when memory is needed elsewhere on the system.
215
216 Use of this file can cause performance problems. Since it discards cached
217 objects, it may cost a significant amount of I/O and CPU to recreate the
218 dropped objects, especially if they were under heavy use. Because of this,
219 use outside of a testing or debugging environment is not recommended.
220
221 You may see informational messages in your kernel log when this file is
222 used:
223
224 cat (1234): drop_caches: 3
225
226 These are informational only. They do not mean that anything is wrong
227 with your system. To disable them, echo 4 (bit 3) into drop_caches.
228
229 ==============================================================
230
231 extfrag_threshold
232
233 This parameter affects whether the kernel will compact memory or direct
234 reclaim to satisfy a high-order allocation. The extfrag/extfrag_index file in
235 debugfs shows what the fragmentation index for each order is in each zone in
236 the system. Values tending towards 0 imply allocations would fail due to lack
237 of memory, values towards 1000 imply failures are due to fragmentation and -1
238 implies that the allocation will succeed as long as watermarks are met.
239
240 The kernel will not compact memory in a zone if the
241 fragmentation index is <= extfrag_threshold. The default value is 500.
242
243 ==============================================================
244
245 highmem_is_dirtyable
246
247 Available only for systems with CONFIG_HIGHMEM enabled (32b systems).
248
249 This parameter controls whether the high memory is considered for dirty
250 writers throttling. This is not the case by default which means that
251 only the amount of memory directly visible/usable by the kernel can
252 be dirtied. As a result, on systems with a large amount of memory and
253 lowmem basically depleted writers might be throttled too early and
254 streaming writes can get very slow.
255
256 Changing the value to non zero would allow more memory to be dirtied
257 and thus allow writers to write more data which can be flushed to the
258 storage more effectively. Note this also comes with a risk of pre-mature
259 OOM killer because some writers (e.g. direct block device writes) can
260 only use the low memory and they can fill it up with dirty data without
261 any throttling.
262
263 ==============================================================
264
265 extra_free_kbytes
266
267 This parameter tells the VM to keep extra free memory between the threshold
268 where background reclaim (kswapd) kicks in, and the threshold where direct
269 reclaim (by allocating processes) kicks in.
270
271 This is useful for workloads that require low latency memory allocations
272 and have a bounded burstiness in memory allocations, for example a
273 realtime application that receives and transmits network traffic
274 (causing in-kernel memory allocations) with a maximum total message burst
275 size of 200MB may need 200MB of extra free memory to avoid direct reclaim
276 related latencies.
277
278 ==============================================================
279
280 hugepages_treat_as_movable
281
282 This parameter controls whether we can allocate hugepages from ZONE_MOVABLE
283 or not. If set to non-zero, hugepages can be allocated from ZONE_MOVABLE.
284 ZONE_MOVABLE is created when kernel boot parameter kernelcore= is specified,
285 so this parameter has no effect if used without kernelcore=.
286
287 Hugepage migration is now available in some situations which depend on the
288 architecture and/or the hugepage size. If a hugepage supports migration,
289 allocation from ZONE_MOVABLE is always enabled for the hugepage regardless
290 of the value of this parameter.
291 IOW, this parameter affects only non-migratable hugepages.
292
293 Assuming that hugepages are not migratable in your system, one usecase of
294 this parameter is that users can make hugepage pool more extensible by
295 enabling the allocation from ZONE_MOVABLE. This is because on ZONE_MOVABLE
296 page reclaim/migration/compaction work more and you can get contiguous
297 memory more likely. Note that using ZONE_MOVABLE for non-migratable
298 hugepages can do harm to other features like memory hotremove (because
299 memory hotremove expects that memory blocks on ZONE_MOVABLE are always
300 removable,) so it's a trade-off responsible for the users.
301
302 ==============================================================
303
304 hugetlb_shm_group
305
306 hugetlb_shm_group contains group id that is allowed to create SysV
307 shared memory segment using hugetlb page.
308
309 ==============================================================
310
311 laptop_mode
312
313 laptop_mode is a knob that controls "laptop mode". All the things that are
314 controlled by this knob are discussed in Documentation/laptops/laptop-mode.txt.
315
316 ==============================================================
317
318 legacy_va_layout
319
320 If non-zero, this sysctl disables the new 32-bit mmap layout - the kernel
321 will use the legacy (2.4) layout for all processes.
322
323 ==============================================================
324
325 lowmem_reserve_ratio
326
327 For some specialised workloads on highmem machines it is dangerous for
328 the kernel to allow process memory to be allocated from the "lowmem"
329 zone. This is because that memory could then be pinned via the mlock()
330 system call, or by unavailability of swapspace.
331
332 And on large highmem machines this lack of reclaimable lowmem memory
333 can be fatal.
334
335 So the Linux page allocator has a mechanism which prevents allocations
336 which _could_ use highmem from using too much lowmem. This means that
337 a certain amount of lowmem is defended from the possibility of being
338 captured into pinned user memory.
339
340 (The same argument applies to the old 16 megabyte ISA DMA region. This
341 mechanism will also defend that region from allocations which could use
342 highmem or lowmem).
343
344 The `lowmem_reserve_ratio' tunable determines how aggressive the kernel is
345 in defending these lower zones.
346
347 If you have a machine which uses highmem or ISA DMA and your
348 applications are using mlock(), or if you are running with no swap then
349 you probably should change the lowmem_reserve_ratio setting.
350
351 The lowmem_reserve_ratio is an array. You can see them by reading this file.
352 -
353 % cat /proc/sys/vm/lowmem_reserve_ratio
354 256 256 32
355 -
356 Note: # of this elements is one fewer than number of zones. Because the highest
357 zone's value is not necessary for following calculation.
358
359 But, these values are not used directly. The kernel calculates # of protection
360 pages for each zones from them. These are shown as array of protection pages
361 in /proc/zoneinfo like followings. (This is an example of x86-64 box).
362 Each zone has an array of protection pages like this.
363
364 -
365 Node 0, zone DMA
366 pages free 1355
367 min 3
368 low 3
369 high 4
370 :
371 :
372 numa_other 0
373 protection: (0, 2004, 2004, 2004)
374 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
375 pagesets
376 cpu: 0 pcp: 0
377 :
378 -
379 These protections are added to score to judge whether this zone should be used
380 for page allocation or should be reclaimed.
381
382 In this example, if normal pages (index=2) are required to this DMA zone and
383 watermark[WMARK_HIGH] is used for watermark, the kernel judges this zone should
384 not be used because pages_free(1355) is smaller than watermark + protection[2]
385 (4 + 2004 = 2008). If this protection value is 0, this zone would be used for
386 normal page requirement. If requirement is DMA zone(index=0), protection[0]
387 (=0) is used.
388
389 zone[i]'s protection[j] is calculated by following expression.
390
391 (i < j):
392 zone[i]->protection[j]
393 = (total sums of managed_pages from zone[i+1] to zone[j] on the node)
394 / lowmem_reserve_ratio[i];
395 (i = j):
396 (should not be protected. = 0;
397 (i > j):
398 (not necessary, but looks 0)
399
400 The default values of lowmem_reserve_ratio[i] are
401 256 (if zone[i] means DMA or DMA32 zone)
402 32 (others).
403 As above expression, they are reciprocal number of ratio.
404 256 means 1/256. # of protection pages becomes about "0.39%" of total managed
405 pages of higher zones on the node.
406
407 If you would like to protect more pages, smaller values are effective.
408 The minimum value is 1 (1/1 -> 100%).
409
410 ==============================================================
411
412 max_map_count:
413
414 This file contains the maximum number of memory map areas a process
415 may have. Memory map areas are used as a side-effect of calling
416 malloc, directly by mmap, mprotect, and madvise, and also when loading
417 shared libraries.
418
419 While most applications need less than a thousand maps, certain
420 programs, particularly malloc debuggers, may consume lots of them,
421 e.g., up to one or two maps per allocation.
422
423 The default value is 65536.
424
425 =============================================================
426
427 memory_failure_early_kill:
428
429 Control how to kill processes when uncorrected memory error (typically
430 a 2bit error in a memory module) is detected in the background by hardware
431 that cannot be handled by the kernel. In some cases (like the page
432 still having a valid copy on disk) the kernel will handle the failure
433 transparently without affecting any applications. But if there is
434 no other uptodate copy of the data it will kill to prevent any data
435 corruptions from propagating.
436
437 1: Kill all processes that have the corrupted and not reloadable page mapped
438 as soon as the corruption is detected. Note this is not supported
439 for a few types of pages, like kernel internally allocated data or
440 the swap cache, but works for the majority of user pages.
441
442 0: Only unmap the corrupted page from all processes and only kill a process
443 who tries to access it.
444
445 The kill is done using a catchable SIGBUS with BUS_MCEERR_AO, so processes can
446 handle this if they want to.
447
448 This is only active on architectures/platforms with advanced machine
449 check handling and depends on the hardware capabilities.
450
451 Applications can override this setting individually with the PR_MCE_KILL prctl
452
453 ==============================================================
454
455 memory_failure_recovery
456
457 Enable memory failure recovery (when supported by the platform)
458
459 1: Attempt recovery.
460
461 0: Always panic on a memory failure.
462
463 ==============================================================
464
465 min_free_kbytes:
466
467 This is used to force the Linux VM to keep a minimum number
468 of kilobytes free. The VM uses this number to compute a
469 watermark[WMARK_MIN] value for each lowmem zone in the system.
470 Each lowmem zone gets a number of reserved free pages based
471 proportionally on its size.
472
473 Some minimal amount of memory is needed to satisfy PF_MEMALLOC
474 allocations; if you set this to lower than 1024KB, your system will
475 become subtly broken, and prone to deadlock under high loads.
476
477 Setting this too high will OOM your machine instantly.
478
479 =============================================================
480
481 min_slab_ratio:
482
483 This is available only on NUMA kernels.
484
485 A percentage of the total pages in each zone. On Zone reclaim
486 (fallback from the local zone occurs) slabs will be reclaimed if more
487 than this percentage of pages in a zone are reclaimable slab pages.
488 This insures that the slab growth stays under control even in NUMA
489 systems that rarely perform global reclaim.
490
491 The default is 5 percent.
492
493 Note that slab reclaim is triggered in a per zone / node fashion.
494 The process of reclaiming slab memory is currently not node specific
495 and may not be fast.
496
497 =============================================================
498
499 min_unmapped_ratio:
500
501 This is available only on NUMA kernels.
502
503 This is a percentage of the total pages in each zone. Zone reclaim will
504 only occur if more than this percentage of pages are in a state that
505 zone_reclaim_mode allows to be reclaimed.
506
507 If zone_reclaim_mode has the value 4 OR'd, then the percentage is compared
508 against all file-backed unmapped pages including swapcache pages and tmpfs
509 files. Otherwise, only unmapped pages backed by normal files but not tmpfs
510 files and similar are considered.
511
512 The default is 1 percent.
513
514 ==============================================================
515
516 mmap_min_addr
517
518 This file indicates the amount of address space which a user process will
519 be restricted from mmapping. Since kernel null dereference bugs could
520 accidentally operate based on the information in the first couple of pages
521 of memory userspace processes should not be allowed to write to them. By
522 default this value is set to 0 and no protections will be enforced by the
523 security module. Setting this value to something like 64k will allow the
524 vast majority of applications to work correctly and provide defense in depth
525 against future potential kernel bugs.
526
527 ==============================================================
528
529 mmap_rnd_bits:
530
531 This value can be used to select the number of bits to use to
532 determine the random offset to the base address of vma regions
533 resulting from mmap allocations on architectures which support
534 tuning address space randomization. This value will be bounded
535 by the architecture's minimum and maximum supported values.
536
537 This value can be changed after boot using the
538 /proc/sys/vm/mmap_rnd_bits tunable
539
540 ==============================================================
541
542 mmap_rnd_compat_bits:
543
544 This value can be used to select the number of bits to use to
545 determine the random offset to the base address of vma regions
546 resulting from mmap allocations for applications run in
547 compatibility mode on architectures which support tuning address
548 space randomization. This value will be bounded by the
549 architecture's minimum and maximum supported values.
550
551 This value can be changed after boot using the
552 /proc/sys/vm/mmap_rnd_compat_bits tunable
553
554 ==============================================================
555
556 nr_hugepages
557
558 Change the minimum size of the hugepage pool.
559
560 See Documentation/vm/hugetlbpage.txt
561
562 ==============================================================
563
564 nr_overcommit_hugepages
565
566 Change the maximum size of the hugepage pool. The maximum is
567 nr_hugepages + nr_overcommit_hugepages.
568
569 See Documentation/vm/hugetlbpage.txt
570
571 ==============================================================
572
573 nr_trim_pages
574
575 This is available only on NOMMU kernels.
576
577 This value adjusts the excess page trimming behaviour of power-of-2 aligned
578 NOMMU mmap allocations.
579
580 A value of 0 disables trimming of allocations entirely, while a value of 1
581 trims excess pages aggressively. Any value >= 1 acts as the watermark where
582 trimming of allocations is initiated.
583
584 The default value is 1.
585
586 See Documentation/nommu-mmap.txt for more information.
587
588 ==============================================================
589
590 numa_zonelist_order
591
592 This sysctl is only for NUMA and it is deprecated. Anything but
593 Node order will fail!
594
595 'where the memory is allocated from' is controlled by zonelists.
596 (This documentation ignores ZONE_HIGHMEM/ZONE_DMA32 for simple explanation.
597 you may be able to read ZONE_DMA as ZONE_DMA32...)
598
599 In non-NUMA case, a zonelist for GFP_KERNEL is ordered as following.
600 ZONE_NORMAL -> ZONE_DMA
601 This means that a memory allocation request for GFP_KERNEL will
602 get memory from ZONE_DMA only when ZONE_NORMAL is not available.
603
604 In NUMA case, you can think of following 2 types of order.
605 Assume 2 node NUMA and below is zonelist of Node(0)'s GFP_KERNEL
606
607 (A) Node(0) ZONE_NORMAL -> Node(0) ZONE_DMA -> Node(1) ZONE_NORMAL
608 (B) Node(0) ZONE_NORMAL -> Node(1) ZONE_NORMAL -> Node(0) ZONE_DMA.
609
610 Type(A) offers the best locality for processes on Node(0), but ZONE_DMA
611 will be used before ZONE_NORMAL exhaustion. This increases possibility of
612 out-of-memory(OOM) of ZONE_DMA because ZONE_DMA is tend to be small.
613
614 Type(B) cannot offer the best locality but is more robust against OOM of
615 the DMA zone.
616
617 Type(A) is called as "Node" order. Type (B) is "Zone" order.
618
619 "Node order" orders the zonelists by node, then by zone within each node.
620 Specify "[Nn]ode" for node order
621
622 "Zone Order" orders the zonelists by zone type, then by node within each
623 zone. Specify "[Zz]one" for zone order.
624
625 Specify "[Dd]efault" to request automatic configuration.
626
627 On 32-bit, the Normal zone needs to be preserved for allocations accessible
628 by the kernel, so "zone" order will be selected.
629
630 On 64-bit, devices that require DMA32/DMA are relatively rare, so "node"
631 order will be selected.
632
633 Default order is recommended unless this is causing problems for your
634 system/application.
635
636 ==============================================================
637
638 oom_dump_tasks
639
640 Enables a system-wide task dump (excluding kernel threads) to be produced
641 when the kernel performs an OOM-killing and includes such information as
642 pid, uid, tgid, vm size, rss, nr_ptes, nr_pmds, swapents, oom_score_adj
643 score, and name. This is helpful to determine why the OOM killer was
644 invoked, to identify the rogue task that caused it, and to determine why
645 the OOM killer chose the task it did to kill.
646
647 If this is set to zero, this information is suppressed. On very
648 large systems with thousands of tasks it may not be feasible to dump
649 the memory state information for each one. Such systems should not
650 be forced to incur a performance penalty in OOM conditions when the
651 information may not be desired.
652
653 If this is set to non-zero, this information is shown whenever the
654 OOM killer actually kills a memory-hogging task.
655
656 The default value is 1 (enabled).
657
658 ==============================================================
659
660 reap_mem_on_sigkill
661
662 This enables or disables the memory reaping for a SIGKILL received
663 process and that the sending process must have the CAP_KILL capabilities.
664
665 If this is set to 1, when a process receives SIGKILL from a process
666 that has the capability, CAP_KILL, the process is added into the oom_reaper
667 queue which can be picked up by the oom_reaper thread to reap the memory of
668 that process. This reaps for the process which received SIGKILL through
669 either sys_kill from user or kill_pid from kernel.
670
671 If this is set to 0, we are not reaping memory of a SIGKILL, sent through
672 either sys_kill from user or kill_pid from kernel, received process.
673
674 The default value is 0 (disabled).
675
676 ==============================================================
677
678 oom_kill_allocating_task
679
680 This enables or disables killing the OOM-triggering task in
681 out-of-memory situations.
682
683 If this is set to zero, the OOM killer will scan through the entire
684 tasklist and select a task based on heuristics to kill. This normally
685 selects a rogue memory-hogging task that frees up a large amount of
686 memory when killed.
687
688 If this is set to non-zero, the OOM killer simply kills the task that
689 triggered the out-of-memory condition. This avoids the expensive
690 tasklist scan.
691
692 If panic_on_oom is selected, it takes precedence over whatever value
693 is used in oom_kill_allocating_task.
694
695 The default value is 0.
696
697 ==============================================================
698
699 overcommit_kbytes:
700
701 When overcommit_memory is set to 2, the committed address space is not
702 permitted to exceed swap plus this amount of physical RAM. See below.
703
704 Note: overcommit_kbytes is the counterpart of overcommit_ratio. Only one
705 of them may be specified at a time. Setting one disables the other (which
706 then appears as 0 when read).
707
708 ==============================================================
709
710 overcommit_memory:
711
712 This value contains a flag that enables memory overcommitment.
713
714 When this flag is 0, the kernel attempts to estimate the amount
715 of free memory left when userspace requests more memory.
716
717 When this flag is 1, the kernel pretends there is always enough
718 memory until it actually runs out.
719
720 When this flag is 2, the kernel uses a "never overcommit"
721 policy that attempts to prevent any overcommit of memory.
722 Note that user_reserve_kbytes affects this policy.
723
724 This feature can be very useful because there are a lot of
725 programs that malloc() huge amounts of memory "just-in-case"
726 and don't use much of it.
727
728 The default value is 0.
729
730 See Documentation/vm/overcommit-accounting and
731 mm/mmap.c::__vm_enough_memory() for more information.
732
733 ==============================================================
734
735 overcommit_ratio:
736
737 When overcommit_memory is set to 2, the committed address
738 space is not permitted to exceed swap plus this percentage
739 of physical RAM. See above.
740
741 ==============================================================
742
743 page-cluster
744
745 page-cluster controls the number of pages up to which consecutive pages
746 are read in from swap in a single attempt. This is the swap counterpart
747 to page cache readahead.
748 The mentioned consecutivity is not in terms of virtual/physical addresses,
749 but consecutive on swap space - that means they were swapped out together.
750
751 It is a logarithmic value - setting it to zero means "1 page", setting
752 it to 1 means "2 pages", setting it to 2 means "4 pages", etc.
753 Zero disables swap readahead completely.
754
755 The default value is three (eight pages at a time). There may be some
756 small benefits in tuning this to a different value if your workload is
757 swap-intensive.
758
759 Lower values mean lower latencies for initial faults, but at the same time
760 extra faults and I/O delays for following faults if they would have been part of
761 that consecutive pages readahead would have brought in.
762
763 =============================================================
764
765 panic_on_oom
766
767 This enables or disables panic on out-of-memory feature.
768
769 If this is set to 0, the kernel will kill some rogue process,
770 called oom_killer. Usually, oom_killer can kill rogue processes and
771 system will survive.
772
773 If this is set to 1, the kernel panics when out-of-memory happens.
774 However, if a process limits using nodes by mempolicy/cpusets,
775 and those nodes become memory exhaustion status, one process
776 may be killed by oom-killer. No panic occurs in this case.
777 Because other nodes' memory may be free. This means system total status
778 may be not fatal yet.
779
780 If this is set to 2, the kernel panics compulsorily even on the
781 above-mentioned. Even oom happens under memory cgroup, the whole
782 system panics.
783
784 The default value is 0.
785 1 and 2 are for failover of clustering. Please select either
786 according to your policy of failover.
787 panic_on_oom=2+kdump gives you very strong tool to investigate
788 why oom happens. You can get snapshot.
789
790 =============================================================
791
792 percpu_pagelist_fraction
793
794 This is the fraction of pages at most (high mark pcp->high) in each zone that
795 are allocated for each per cpu page list. The min value for this is 8. It
796 means that we don't allow more than 1/8th of pages in each zone to be
797 allocated in any single per_cpu_pagelist. This entry only changes the value
798 of hot per cpu pagelists. User can specify a number like 100 to allocate
799 1/100th of each zone to each per cpu page list.
800
801 The batch value of each per cpu pagelist is also updated as a result. It is
802 set to pcp->high/4. The upper limit of batch is (PAGE_SHIFT * 8)
803
804 The initial value is zero. Kernel does not use this value at boot time to set
805 the high water marks for each per cpu page list. If the user writes '0' to this
806 sysctl, it will revert to this default behavior.
807
808 ==============================================================
809
810 stat_interval
811
812 The time interval between which vm statistics are updated. The default
813 is 1 second.
814
815 ==============================================================
816
817 stat_refresh
818
819 Any read or write (by root only) flushes all the per-cpu vm statistics
820 into their global totals, for more accurate reports when testing
821 e.g. cat /proc/sys/vm/stat_refresh /proc/meminfo
822
823 As a side-effect, it also checks for negative totals (elsewhere reported
824 as 0) and "fails" with EINVAL if any are found, with a warning in dmesg.
825 (At time of writing, a few stats are known sometimes to be found negative,
826 with no ill effects: errors and warnings on these stats are suppressed.)
827
828 ==============================================================
829
830 swappiness
831
832 This control is used to define how aggressive the kernel will swap
833 memory pages. Higher values will increase agressiveness, lower values
834 decrease the amount of swap. A value of 0 instructs the kernel not to
835 initiate swap until the amount of free and file-backed pages is less
836 than the high water mark in a zone.
837
838 The default value is 60.
839
840 ==============================================================
841
842 - user_reserve_kbytes
843
844 When overcommit_memory is set to 2, "never overcommit" mode, reserve
845 min(3% of current process size, user_reserve_kbytes) of free memory.
846 This is intended to prevent a user from starting a single memory hogging
847 process, such that they cannot recover (kill the hog).
848
849 user_reserve_kbytes defaults to min(3% of the current process size, 128MB).
850
851 If this is reduced to zero, then the user will be allowed to allocate
852 all free memory with a single process, minus admin_reserve_kbytes.
853 Any subsequent attempts to execute a command will result in
854 "fork: Cannot allocate memory".
855
856 Changing this takes effect whenever an application requests memory.
857
858 ==============================================================
859
860 vfs_cache_pressure
861 ------------------
862
863 This percentage value controls the tendency of the kernel to reclaim
864 the memory which is used for caching of directory and inode objects.
865
866 At the default value of vfs_cache_pressure=100 the kernel will attempt to
867 reclaim dentries and inodes at a "fair" rate with respect to pagecache and
868 swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer
869 to retain dentry and inode caches. When vfs_cache_pressure=0, the kernel will
870 never reclaim dentries and inodes due to memory pressure and this can easily
871 lead to out-of-memory conditions. Increasing vfs_cache_pressure beyond 100
872 causes the kernel to prefer to reclaim dentries and inodes.
873
874 Increasing vfs_cache_pressure significantly beyond 100 may have negative
875 performance impact. Reclaim code needs to take various locks to find freeable
876 directory and inode objects. With vfs_cache_pressure=1000, it will look for
877 ten times more freeable objects than there are.
878
879 =============================================================
880
881 watermark_scale_factor:
882
883 This factor controls the aggressiveness of kswapd. It defines the
884 amount of memory left in a node/system before kswapd is woken up and
885 how much memory needs to be free before kswapd goes back to sleep.
886
887 The unit is in fractions of 10,000. The default value of 10 means the
888 distances between watermarks are 0.1% of the available memory in the
889 node/system. The maximum value is 1000, or 10% of memory.
890
891 A high rate of threads entering direct reclaim (allocstall) or kswapd
892 going to sleep prematurely (kswapd_low_wmark_hit_quickly) can indicate
893 that the number of free pages kswapd maintains for latency reasons is
894 too small for the allocation bursts occurring in the system. This knob
895 can then be used to tune kswapd aggressiveness accordingly.
896
897 ==============================================================
898
899 zone_reclaim_mode:
900
901 Zone_reclaim_mode allows someone to set more or less aggressive approaches to
902 reclaim memory when a zone runs out of memory. If it is set to zero then no
903 zone reclaim occurs. Allocations will be satisfied from other zones / nodes
904 in the system.
905
906 This is value ORed together of
907
908 1 = Zone reclaim on
909 2 = Zone reclaim writes dirty pages out
910 4 = Zone reclaim swaps pages
911
912 zone_reclaim_mode is disabled by default. For file servers or workloads
913 that benefit from having their data cached, zone_reclaim_mode should be
914 left disabled as the caching effect is likely to be more important than
915 data locality.
916
917 zone_reclaim may be enabled if it's known that the workload is partitioned
918 such that each partition fits within a NUMA node and that accessing remote
919 memory would cause a measurable performance reduction. The page allocator
920 will then reclaim easily reusable pages (those page cache pages that are
921 currently not used) before allocating off node pages.
922
923 Allowing zone reclaim to write out pages stops processes that are
924 writing large amounts of data from dirtying pages on other nodes. Zone
925 reclaim will write out dirty pages if a zone fills up and so effectively
926 throttle the process. This may decrease the performance of a single process
927 since it cannot use all of system memory to buffer the outgoing writes
928 anymore but it preserve the memory on other nodes so that the performance
929 of other processes running on other nodes will not be affected.
930
931 Allowing regular swap effectively restricts allocations to the local
932 node unless explicitly overridden by memory policies or cpuset
933 configurations.
934
935 ============ End of Document =================================