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