vm.txt 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804
  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. For general info and legal blurb, please look in README.
  5. ==============================================================
  6. This file contains the documentation for the sysctl files in
  7. /proc/sys/vm and is valid for Linux kernel version 2.6.29.
  8. The files in this directory can be used to tune the operation
  9. of the virtual memory (VM) subsystem of the Linux kernel and
  10. the writeout of dirty data to disk.
  11. Default values and initialization routines for most of these
  12. files can be found in mm/swap.c.
  13. Currently, these files are in /proc/sys/vm:
  14. - admin_reserve_kbytes
  15. - block_dump
  16. - compact_memory
  17. - dirty_background_bytes
  18. - dirty_background_ratio
  19. - dirty_bytes
  20. - dirty_expire_centisecs
  21. - dirty_ratio
  22. - dirty_writeback_centisecs
  23. - drop_caches
  24. - extfrag_threshold
  25. - hugepages_treat_as_movable
  26. - hugetlb_shm_group
  27. - laptop_mode
  28. - legacy_va_layout
  29. - lowmem_reserve_ratio
  30. - max_map_count
  31. - memory_failure_early_kill
  32. - memory_failure_recovery
  33. - min_free_kbytes
  34. - min_slab_ratio
  35. - min_unmapped_ratio
  36. - mmap_min_addr
  37. - nr_hugepages
  38. - nr_overcommit_hugepages
  39. - nr_trim_pages (only if CONFIG_MMU=n)
  40. - numa_zonelist_order
  41. - oom_dump_tasks
  42. - oom_kill_allocating_task
  43. - overcommit_kbytes
  44. - overcommit_memory
  45. - overcommit_ratio
  46. - page-cluster
  47. - panic_on_oom
  48. - percpu_pagelist_fraction
  49. - stat_interval
  50. - swappiness
  51. - user_reserve_kbytes
  52. - vfs_cache_pressure
  53. - zone_reclaim_mode
  54. ==============================================================
  55. admin_reserve_kbytes
  56. The amount of free memory in the system that should be reserved for users
  57. with the capability cap_sys_admin.
  58. admin_reserve_kbytes defaults to min(3% of free pages, 8MB)
  59. That should provide enough for the admin to log in and kill a process,
  60. if necessary, under the default overcommit 'guess' mode.
  61. Systems running under overcommit 'never' should increase this to account
  62. for the full Virtual Memory Size of programs used to recover. Otherwise,
  63. root may not be able to log in to recover the system.
  64. How do you calculate a minimum useful reserve?
  65. sshd or login + bash (or some other shell) + top (or ps, kill, etc.)
  66. For overcommit 'guess', we can sum resident set sizes (RSS).
  67. On x86_64 this is about 8MB.
  68. For overcommit 'never', we can take the max of their virtual sizes (VSZ)
  69. and add the sum of their RSS.
  70. On x86_64 this is about 128MB.
  71. Changing this takes effect whenever an application requests memory.
  72. ==============================================================
  73. block_dump
  74. block_dump enables block I/O debugging when set to a nonzero value. More
  75. information on block I/O debugging is in Documentation/laptops/laptop-mode.txt.
  76. ==============================================================
  77. compact_memory
  78. Available only when CONFIG_COMPACTION is set. When 1 is written to the file,
  79. all zones are compacted such that free memory is available in contiguous
  80. blocks where possible. This can be important for example in the allocation of
  81. huge pages although processes will also directly compact memory as required.
  82. ==============================================================
  83. dirty_background_bytes
  84. Contains the amount of dirty memory at which the background kernel
  85. flusher threads will start writeback.
  86. Note: dirty_background_bytes is the counterpart of dirty_background_ratio. Only
  87. one of them may be specified at a time. When one sysctl is written it is
  88. immediately taken into account to evaluate the dirty memory limits and the
  89. other appears as 0 when read.
  90. ==============================================================
  91. dirty_background_ratio
  92. Contains, as a percentage of total available memory that contains free pages
  93. and reclaimable pages, the number of pages at which the background kernel
  94. flusher threads will start writing out dirty data.
  95. The total avaiable memory is not equal to total system memory.
  96. ==============================================================
  97. dirty_bytes
  98. Contains the amount of dirty memory at which a process generating disk writes
  99. will itself start writeback.
  100. Note: dirty_bytes is the counterpart of dirty_ratio. Only one of them may be
  101. specified at a time. When one sysctl is written it is immediately taken into
  102. account to evaluate the dirty memory limits and the other appears as 0 when
  103. read.
  104. Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any
  105. value lower than this limit will be ignored and the old configuration will be
  106. retained.
  107. ==============================================================
  108. dirty_expire_centisecs
  109. This tunable is used to define when dirty data is old enough to be eligible
  110. for writeout by the kernel flusher threads. It is expressed in 100'ths
  111. of a second. Data which has been dirty in-memory for longer than this
  112. interval will be written out next time a flusher thread wakes up.
  113. ==============================================================
  114. dirty_ratio
  115. Contains, as a percentage of total available memory that contains free pages
  116. and reclaimable pages, the number of pages at which a process which is
  117. generating disk writes will itself start writing out dirty data.
  118. The total avaiable memory is not equal to total system memory.
  119. ==============================================================
  120. dirty_writeback_centisecs
  121. The kernel flusher threads will periodically wake up and write `old' data
  122. out to disk. This tunable expresses the interval between those wakeups, in
  123. 100'ths of a second.
  124. Setting this to zero disables periodic writeback altogether.
  125. ==============================================================
  126. drop_caches
  127. Writing to this will cause the kernel to drop clean caches, as well as
  128. reclaimable slab objects like dentries and inodes. Once dropped, their
  129. memory becomes free.
  130. To free pagecache:
  131. echo 1 > /proc/sys/vm/drop_caches
  132. To free reclaimable slab objects (includes dentries and inodes):
  133. echo 2 > /proc/sys/vm/drop_caches
  134. To free slab objects and pagecache:
  135. echo 3 > /proc/sys/vm/drop_caches
  136. This is a non-destructive operation and will not free any dirty objects.
  137. To increase the number of objects freed by this operation, the user may run
  138. `sync' prior to writing to /proc/sys/vm/drop_caches. This will minimize the
  139. number of dirty objects on the system and create more candidates to be
  140. dropped.
  141. This file is not a means to control the growth of the various kernel caches
  142. (inodes, dentries, pagecache, etc...) These objects are automatically
  143. reclaimed by the kernel when memory is needed elsewhere on the system.
  144. Use of this file can cause performance problems. Since it discards cached
  145. objects, it may cost a significant amount of I/O and CPU to recreate the
  146. dropped objects, especially if they were under heavy use. Because of this,
  147. use outside of a testing or debugging environment is not recommended.
  148. You may see informational messages in your kernel log when this file is
  149. used:
  150. cat (1234): drop_caches: 3
  151. These are informational only. They do not mean that anything is wrong
  152. with your system. To disable them, echo 4 (bit 3) into drop_caches.
  153. ==============================================================
  154. extfrag_threshold
  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. The kernel will not compact memory in a zone if the
  162. fragmentation index is <= extfrag_threshold. The default value is 500.
  163. ==============================================================
  164. hugepages_treat_as_movable
  165. This parameter controls whether we can allocate hugepages from ZONE_MOVABLE
  166. or not. If set to non-zero, hugepages can be allocated from ZONE_MOVABLE.
  167. ZONE_MOVABLE is created when kernel boot parameter kernelcore= is specified,
  168. so this parameter has no effect if used without kernelcore=.
  169. Hugepage migration is now available in some situations which depend on the
  170. architecture and/or the hugepage size. If a hugepage supports migration,
  171. allocation from ZONE_MOVABLE is always enabled for the hugepage regardless
  172. of the value of this parameter.
  173. IOW, this parameter affects only non-migratable hugepages.
  174. Assuming that hugepages are not migratable in your system, one usecase of
  175. this parameter is that users can make hugepage pool more extensible by
  176. enabling the allocation from ZONE_MOVABLE. This is because on ZONE_MOVABLE
  177. page reclaim/migration/compaction work more and you can get contiguous
  178. memory more likely. Note that using ZONE_MOVABLE for non-migratable
  179. hugepages can do harm to other features like memory hotremove (because
  180. memory hotremove expects that memory blocks on ZONE_MOVABLE are always
  181. removable,) so it's a trade-off responsible for the users.
  182. ==============================================================
  183. hugetlb_shm_group
  184. hugetlb_shm_group contains group id that is allowed to create SysV
  185. shared memory segment using hugetlb page.
  186. ==============================================================
  187. laptop_mode
  188. laptop_mode is a knob that controls "laptop mode". All the things that are
  189. controlled by this knob are discussed in Documentation/laptops/laptop-mode.txt.
  190. ==============================================================
  191. legacy_va_layout
  192. If non-zero, this sysctl disables the new 32-bit mmap layout - the kernel
  193. will use the legacy (2.4) layout for all processes.
  194. ==============================================================
  195. lowmem_reserve_ratio
  196. For some specialised workloads on highmem machines it is dangerous for
  197. the kernel to allow process memory to be allocated from the "lowmem"
  198. zone. This is because that memory could then be pinned via the mlock()
  199. system call, or by unavailability of swapspace.
  200. And on large highmem machines this lack of reclaimable lowmem memory
  201. can be fatal.
  202. So the Linux page allocator has a mechanism which prevents allocations
  203. which _could_ use highmem from using too much lowmem. This means that
  204. a certain amount of lowmem is defended from the possibility of being
  205. captured into pinned user memory.
  206. (The same argument applies to the old 16 megabyte ISA DMA region. This
  207. mechanism will also defend that region from allocations which could use
  208. highmem or lowmem).
  209. The `lowmem_reserve_ratio' tunable determines how aggressive the kernel is
  210. in defending these lower zones.
  211. If you have a machine which uses highmem or ISA DMA and your
  212. applications are using mlock(), or if you are running with no swap then
  213. you probably should change the lowmem_reserve_ratio setting.
  214. The lowmem_reserve_ratio is an array. You can see them by reading this file.
  215. -
  216. % cat /proc/sys/vm/lowmem_reserve_ratio
  217. 256 256 32
  218. -
  219. Note: # of this elements is one fewer than number of zones. Because the highest
  220. zone's value is not necessary for following calculation.
  221. But, these values are not used directly. The kernel calculates # of protection
  222. pages for each zones from them. These are shown as array of protection pages
  223. in /proc/zoneinfo like followings. (This is an example of x86-64 box).
  224. Each zone has an array of protection pages like this.
  225. -
  226. Node 0, zone DMA
  227. pages free 1355
  228. min 3
  229. low 3
  230. high 4
  231. :
  232. :
  233. numa_other 0
  234. protection: (0, 2004, 2004, 2004)
  235. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  236. pagesets
  237. cpu: 0 pcp: 0
  238. :
  239. -
  240. These protections are added to score to judge whether this zone should be used
  241. for page allocation or should be reclaimed.
  242. In this example, if normal pages (index=2) are required to this DMA zone and
  243. watermark[WMARK_HIGH] is used for watermark, the kernel judges this zone should
  244. not be used because pages_free(1355) is smaller than watermark + protection[2]
  245. (4 + 2004 = 2008). If this protection value is 0, this zone would be used for
  246. normal page requirement. If requirement is DMA zone(index=0), protection[0]
  247. (=0) is used.
  248. zone[i]'s protection[j] is calculated by following expression.
  249. (i < j):
  250. zone[i]->protection[j]
  251. = (total sums of present_pages from zone[i+1] to zone[j] on the node)
  252. / lowmem_reserve_ratio[i];
  253. (i = j):
  254. (should not be protected. = 0;
  255. (i > j):
  256. (not necessary, but looks 0)
  257. The default values of lowmem_reserve_ratio[i] are
  258. 256 (if zone[i] means DMA or DMA32 zone)
  259. 32 (others).
  260. As above expression, they are reciprocal number of ratio.
  261. 256 means 1/256. # of protection pages becomes about "0.39%" of total present
  262. pages of higher zones on the node.
  263. If you would like to protect more pages, smaller values are effective.
  264. The minimum value is 1 (1/1 -> 100%).
  265. ==============================================================
  266. max_map_count:
  267. This file contains the maximum number of memory map areas a process
  268. may have. Memory map areas are used as a side-effect of calling
  269. malloc, directly by mmap and mprotect, and also when loading shared
  270. libraries.
  271. While most applications need less than a thousand maps, certain
  272. programs, particularly malloc debuggers, may consume lots of them,
  273. e.g., up to one or two maps per allocation.
  274. The default value is 65536.
  275. =============================================================
  276. memory_failure_early_kill:
  277. Control how to kill processes when uncorrected memory error (typically
  278. a 2bit error in a memory module) is detected in the background by hardware
  279. that cannot be handled by the kernel. In some cases (like the page
  280. still having a valid copy on disk) the kernel will handle the failure
  281. transparently without affecting any applications. But if there is
  282. no other uptodate copy of the data it will kill to prevent any data
  283. corruptions from propagating.
  284. 1: Kill all processes that have the corrupted and not reloadable page mapped
  285. as soon as the corruption is detected. Note this is not supported
  286. for a few types of pages, like kernel internally allocated data or
  287. the swap cache, but works for the majority of user pages.
  288. 0: Only unmap the corrupted page from all processes and only kill a process
  289. who tries to access it.
  290. The kill is done using a catchable SIGBUS with BUS_MCEERR_AO, so processes can
  291. handle this if they want to.
  292. This is only active on architectures/platforms with advanced machine
  293. check handling and depends on the hardware capabilities.
  294. Applications can override this setting individually with the PR_MCE_KILL prctl
  295. ==============================================================
  296. memory_failure_recovery
  297. Enable memory failure recovery (when supported by the platform)
  298. 1: Attempt recovery.
  299. 0: Always panic on a memory failure.
  300. ==============================================================
  301. min_free_kbytes:
  302. This is used to force the Linux VM to keep a minimum number
  303. of kilobytes free. The VM uses this number to compute a
  304. watermark[WMARK_MIN] value for each lowmem zone in the system.
  305. Each lowmem zone gets a number of reserved free pages based
  306. proportionally on its size.
  307. Some minimal amount of memory is needed to satisfy PF_MEMALLOC
  308. allocations; if you set this to lower than 1024KB, your system will
  309. become subtly broken, and prone to deadlock under high loads.
  310. Setting this too high will OOM your machine instantly.
  311. =============================================================
  312. min_slab_ratio:
  313. This is available only on NUMA kernels.
  314. A percentage of the total pages in each zone. On Zone reclaim
  315. (fallback from the local zone occurs) slabs will be reclaimed if more
  316. than this percentage of pages in a zone are reclaimable slab pages.
  317. This insures that the slab growth stays under control even in NUMA
  318. systems that rarely perform global reclaim.
  319. The default is 5 percent.
  320. Note that slab reclaim is triggered in a per zone / node fashion.
  321. The process of reclaiming slab memory is currently not node specific
  322. and may not be fast.
  323. =============================================================
  324. min_unmapped_ratio:
  325. This is available only on NUMA kernels.
  326. This is a percentage of the total pages in each zone. Zone reclaim will
  327. only occur if more than this percentage of pages are in a state that
  328. zone_reclaim_mode allows to be reclaimed.
  329. If zone_reclaim_mode has the value 4 OR'd, then the percentage is compared
  330. against all file-backed unmapped pages including swapcache pages and tmpfs
  331. files. Otherwise, only unmapped pages backed by normal files but not tmpfs
  332. files and similar are considered.
  333. The default is 1 percent.
  334. ==============================================================
  335. mmap_min_addr
  336. This file indicates the amount of address space which a user process will
  337. be restricted from mmapping. Since kernel null dereference bugs could
  338. accidentally operate based on the information in the first couple of pages
  339. of memory userspace processes should not be allowed to write to them. By
  340. default this value is set to 0 and no protections will be enforced by the
  341. security module. Setting this value to something like 64k will allow the
  342. vast majority of applications to work correctly and provide defense in depth
  343. against future potential kernel bugs.
  344. ==============================================================
  345. nr_hugepages
  346. Change the minimum size of the hugepage pool.
  347. See Documentation/vm/hugetlbpage.txt
  348. ==============================================================
  349. nr_overcommit_hugepages
  350. Change the maximum size of the hugepage pool. The maximum is
  351. nr_hugepages + nr_overcommit_hugepages.
  352. See Documentation/vm/hugetlbpage.txt
  353. ==============================================================
  354. nr_trim_pages
  355. This is available only on NOMMU kernels.
  356. This value adjusts the excess page trimming behaviour of power-of-2 aligned
  357. NOMMU mmap allocations.
  358. A value of 0 disables trimming of allocations entirely, while a value of 1
  359. trims excess pages aggressively. Any value >= 1 acts as the watermark where
  360. trimming of allocations is initiated.
  361. The default value is 1.
  362. See Documentation/nommu-mmap.txt for more information.
  363. ==============================================================
  364. numa_zonelist_order
  365. This sysctl is only for NUMA.
  366. 'where the memory is allocated from' is controlled by zonelists.
  367. (This documentation ignores ZONE_HIGHMEM/ZONE_DMA32 for simple explanation.
  368. you may be able to read ZONE_DMA as ZONE_DMA32...)
  369. In non-NUMA case, a zonelist for GFP_KERNEL is ordered as following.
  370. ZONE_NORMAL -> ZONE_DMA
  371. This means that a memory allocation request for GFP_KERNEL will
  372. get memory from ZONE_DMA only when ZONE_NORMAL is not available.
  373. In NUMA case, you can think of following 2 types of order.
  374. Assume 2 node NUMA and below is zonelist of Node(0)'s GFP_KERNEL
  375. (A) Node(0) ZONE_NORMAL -> Node(0) ZONE_DMA -> Node(1) ZONE_NORMAL
  376. (B) Node(0) ZONE_NORMAL -> Node(1) ZONE_NORMAL -> Node(0) ZONE_DMA.
  377. Type(A) offers the best locality for processes on Node(0), but ZONE_DMA
  378. will be used before ZONE_NORMAL exhaustion. This increases possibility of
  379. out-of-memory(OOM) of ZONE_DMA because ZONE_DMA is tend to be small.
  380. Type(B) cannot offer the best locality but is more robust against OOM of
  381. the DMA zone.
  382. Type(A) is called as "Node" order. Type (B) is "Zone" order.
  383. "Node order" orders the zonelists by node, then by zone within each node.
  384. Specify "[Nn]ode" for node order
  385. "Zone Order" orders the zonelists by zone type, then by node within each
  386. zone. Specify "[Zz]one" for zone order.
  387. Specify "[Dd]efault" to request automatic configuration. Autoconfiguration
  388. will select "node" order in following case.
  389. (1) if the DMA zone does not exist or
  390. (2) if the DMA zone comprises greater than 50% of the available memory or
  391. (3) if any node's DMA zone comprises greater than 70% of its local memory and
  392. the amount of local memory is big enough.
  393. Otherwise, "zone" order will be selected. Default order is recommended unless
  394. this is causing problems for your system/application.
  395. ==============================================================
  396. oom_dump_tasks
  397. Enables a system-wide task dump (excluding kernel threads) to be
  398. produced when the kernel performs an OOM-killing and includes such
  399. information as pid, uid, tgid, vm size, rss, nr_ptes, swapents,
  400. oom_score_adj score, and name. This is helpful to determine why the
  401. OOM killer was invoked, to identify the rogue task that caused it,
  402. and to determine why the OOM killer chose the task it did to kill.
  403. If this is set to zero, this information is suppressed. On very
  404. large systems with thousands of tasks it may not be feasible to dump
  405. the memory state information for each one. Such systems should not
  406. be forced to incur a performance penalty in OOM conditions when the
  407. information may not be desired.
  408. If this is set to non-zero, this information is shown whenever the
  409. OOM killer actually kills a memory-hogging task.
  410. The default value is 1 (enabled).
  411. ==============================================================
  412. oom_kill_allocating_task
  413. This enables or disables killing the OOM-triggering task in
  414. out-of-memory situations.
  415. If this is set to zero, the OOM killer will scan through the entire
  416. tasklist and select a task based on heuristics to kill. This normally
  417. selects a rogue memory-hogging task that frees up a large amount of
  418. memory when killed.
  419. If this is set to non-zero, the OOM killer simply kills the task that
  420. triggered the out-of-memory condition. This avoids the expensive
  421. tasklist scan.
  422. If panic_on_oom is selected, it takes precedence over whatever value
  423. is used in oom_kill_allocating_task.
  424. The default value is 0.
  425. ==============================================================
  426. overcommit_kbytes:
  427. When overcommit_memory is set to 2, the committed address space is not
  428. permitted to exceed swap plus this amount of physical RAM. See below.
  429. Note: overcommit_kbytes is the counterpart of overcommit_ratio. Only one
  430. of them may be specified at a time. Setting one disables the other (which
  431. then appears as 0 when read).
  432. ==============================================================
  433. overcommit_memory:
  434. This value contains a flag that enables memory overcommitment.
  435. When this flag is 0, the kernel attempts to estimate the amount
  436. of free memory left when userspace requests more memory.
  437. When this flag is 1, the kernel pretends there is always enough
  438. memory until it actually runs out.
  439. When this flag is 2, the kernel uses a "never overcommit"
  440. policy that attempts to prevent any overcommit of memory.
  441. Note that user_reserve_kbytes affects this policy.
  442. This feature can be very useful because there are a lot of
  443. programs that malloc() huge amounts of memory "just-in-case"
  444. and don't use much of it.
  445. The default value is 0.
  446. See Documentation/vm/overcommit-accounting and
  447. security/commoncap.c::cap_vm_enough_memory() for more information.
  448. ==============================================================
  449. overcommit_ratio:
  450. When overcommit_memory is set to 2, the committed address
  451. space is not permitted to exceed swap plus this percentage
  452. of physical RAM. See above.
  453. ==============================================================
  454. page-cluster
  455. page-cluster controls the number of pages up to which consecutive pages
  456. are read in from swap in a single attempt. This is the swap counterpart
  457. to page cache readahead.
  458. The mentioned consecutivity is not in terms of virtual/physical addresses,
  459. but consecutive on swap space - that means they were swapped out together.
  460. It is a logarithmic value - setting it to zero means "1 page", setting
  461. it to 1 means "2 pages", setting it to 2 means "4 pages", etc.
  462. Zero disables swap readahead completely.
  463. The default value is three (eight pages at a time). There may be some
  464. small benefits in tuning this to a different value if your workload is
  465. swap-intensive.
  466. Lower values mean lower latencies for initial faults, but at the same time
  467. extra faults and I/O delays for following faults if they would have been part of
  468. that consecutive pages readahead would have brought in.
  469. =============================================================
  470. panic_on_oom
  471. This enables or disables panic on out-of-memory feature.
  472. If this is set to 0, the kernel will kill some rogue process,
  473. called oom_killer. Usually, oom_killer can kill rogue processes and
  474. system will survive.
  475. If this is set to 1, the kernel panics when out-of-memory happens.
  476. However, if a process limits using nodes by mempolicy/cpusets,
  477. and those nodes become memory exhaustion status, one process
  478. may be killed by oom-killer. No panic occurs in this case.
  479. Because other nodes' memory may be free. This means system total status
  480. may be not fatal yet.
  481. If this is set to 2, the kernel panics compulsorily even on the
  482. above-mentioned. Even oom happens under memory cgroup, the whole
  483. system panics.
  484. The default value is 0.
  485. 1 and 2 are for failover of clustering. Please select either
  486. according to your policy of failover.
  487. panic_on_oom=2+kdump gives you very strong tool to investigate
  488. why oom happens. You can get snapshot.
  489. =============================================================
  490. percpu_pagelist_fraction
  491. This is the fraction of pages at most (high mark pcp->high) in each zone that
  492. are allocated for each per cpu page list. The min value for this is 8. It
  493. means that we don't allow more than 1/8th of pages in each zone to be
  494. allocated in any single per_cpu_pagelist. This entry only changes the value
  495. of hot per cpu pagelists. User can specify a number like 100 to allocate
  496. 1/100th of each zone to each per cpu page list.
  497. The batch value of each per cpu pagelist is also updated as a result. It is
  498. set to pcp->high/4. The upper limit of batch is (PAGE_SHIFT * 8)
  499. The initial value is zero. Kernel does not use this value at boot time to set
  500. the high water marks for each per cpu page list. If the user writes '0' to this
  501. sysctl, it will revert to this default behavior.
  502. ==============================================================
  503. stat_interval
  504. The time interval between which vm statistics are updated. The default
  505. is 1 second.
  506. ==============================================================
  507. swappiness
  508. This control is used to define how aggressive the kernel will swap
  509. memory pages. Higher values will increase agressiveness, lower values
  510. decrease the amount of swap. A value of 0 instructs the kernel not to
  511. initiate swap until the amount of free and file-backed pages is less
  512. than the high water mark in a zone.
  513. The default value is 60.
  514. ==============================================================
  515. - user_reserve_kbytes
  516. When overcommit_memory is set to 2, "never overommit" mode, reserve
  517. min(3% of current process size, user_reserve_kbytes) of free memory.
  518. This is intended to prevent a user from starting a single memory hogging
  519. process, such that they cannot recover (kill the hog).
  520. user_reserve_kbytes defaults to min(3% of the current process size, 128MB).
  521. If this is reduced to zero, then the user will be allowed to allocate
  522. all free memory with a single process, minus admin_reserve_kbytes.
  523. Any subsequent attempts to execute a command will result in
  524. "fork: Cannot allocate memory".
  525. Changing this takes effect whenever an application requests memory.
  526. ==============================================================
  527. vfs_cache_pressure
  528. ------------------
  529. This percentage value controls the tendency of the kernel to reclaim
  530. the memory which is used for caching of directory and inode objects.
  531. At the default value of vfs_cache_pressure=100 the kernel will attempt to
  532. reclaim dentries and inodes at a "fair" rate with respect to pagecache and
  533. swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer
  534. to retain dentry and inode caches. When vfs_cache_pressure=0, the kernel will
  535. never reclaim dentries and inodes due to memory pressure and this can easily
  536. lead to out-of-memory conditions. Increasing vfs_cache_pressure beyond 100
  537. causes the kernel to prefer to reclaim dentries and inodes.
  538. Increasing vfs_cache_pressure significantly beyond 100 may have negative
  539. performance impact. Reclaim code needs to take various locks to find freeable
  540. directory and inode objects. With vfs_cache_pressure=1000, it will look for
  541. ten times more freeable objects than there are.
  542. ==============================================================
  543. zone_reclaim_mode:
  544. Zone_reclaim_mode allows someone to set more or less aggressive approaches to
  545. reclaim memory when a zone runs out of memory. If it is set to zero then no
  546. zone reclaim occurs. Allocations will be satisfied from other zones / nodes
  547. in the system.
  548. This is value ORed together of
  549. 1 = Zone reclaim on
  550. 2 = Zone reclaim writes dirty pages out
  551. 4 = Zone reclaim swaps pages
  552. zone_reclaim_mode is disabled by default. For file servers or workloads
  553. that benefit from having their data cached, zone_reclaim_mode should be
  554. left disabled as the caching effect is likely to be more important than
  555. data locality.
  556. zone_reclaim may be enabled if it's known that the workload is partitioned
  557. such that each partition fits within a NUMA node and that accessing remote
  558. memory would cause a measurable performance reduction. The page allocator
  559. will then reclaim easily reusable pages (those page cache pages that are
  560. currently not used) before allocating off node pages.
  561. Allowing zone reclaim to write out pages stops processes that are
  562. writing large amounts of data from dirtying pages on other nodes. Zone
  563. reclaim will write out dirty pages if a zone fills up and so effectively
  564. throttle the process. This may decrease the performance of a single process
  565. since it cannot use all of system memory to buffer the outgoing writes
  566. anymore but it preserve the memory on other nodes so that the performance
  567. of other processes running on other nodes will not be affected.
  568. Allowing regular swap effectively restricts allocations to the local
  569. node unless explicitly overridden by memory policies or cpuset
  570. configurations.
  571. ============ End of Document =================================