diff options
Diffstat (limited to 'Documentation/sysctl/vm.txt')
-rw-r--r-- | Documentation/sysctl/vm.txt | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index 078701fdbd4d..dcc75a9ed919 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -18,6 +18,7 @@ files can be found in mm/swap.c. | |||
18 | 18 | ||
19 | Currently, these files are in /proc/sys/vm: | 19 | Currently, these files are in /proc/sys/vm: |
20 | 20 | ||
21 | - admin_reserve_kbytes | ||
21 | - block_dump | 22 | - block_dump |
22 | - compact_memory | 23 | - compact_memory |
23 | - dirty_background_bytes | 24 | - dirty_background_bytes |
@@ -53,11 +54,41 @@ Currently, these files are in /proc/sys/vm: | |||
53 | - percpu_pagelist_fraction | 54 | - percpu_pagelist_fraction |
54 | - stat_interval | 55 | - stat_interval |
55 | - swappiness | 56 | - swappiness |
57 | - user_reserve_kbytes | ||
56 | - vfs_cache_pressure | 58 | - vfs_cache_pressure |
57 | - zone_reclaim_mode | 59 | - zone_reclaim_mode |
58 | 60 | ||
59 | ============================================================== | 61 | ============================================================== |
60 | 62 | ||
63 | admin_reserve_kbytes | ||
64 | |||
65 | The amount of free memory in the system that should be reserved for users | ||
66 | with the capability cap_sys_admin. | ||
67 | |||
68 | admin_reserve_kbytes defaults to min(3% of free pages, 8MB) | ||
69 | |||
70 | That should provide enough for the admin to log in and kill a process, | ||
71 | if necessary, under the default overcommit 'guess' mode. | ||
72 | |||
73 | Systems running under overcommit 'never' should increase this to account | ||
74 | for the full Virtual Memory Size of programs used to recover. Otherwise, | ||
75 | root may not be able to log in to recover the system. | ||
76 | |||
77 | How do you calculate a minimum useful reserve? | ||
78 | |||
79 | sshd or login + bash (or some other shell) + top (or ps, kill, etc.) | ||
80 | |||
81 | For overcommit 'guess', we can sum resident set sizes (RSS). | ||
82 | On x86_64 this is about 8MB. | ||
83 | |||
84 | For overcommit 'never', we can take the max of their virtual sizes (VSZ) | ||
85 | and add the sum of their RSS. | ||
86 | On x86_64 this is about 128MB. | ||
87 | |||
88 | Changing this takes effect whenever an application requests memory. | ||
89 | |||
90 | ============================================================== | ||
91 | |||
61 | block_dump | 92 | block_dump |
62 | 93 | ||
63 | block_dump enables block I/O debugging when set to a nonzero value. More | 94 | block_dump enables block I/O debugging when set to a nonzero value. More |
@@ -542,6 +573,7 @@ memory until it actually runs out. | |||
542 | 573 | ||
543 | When this flag is 2, the kernel uses a "never overcommit" | 574 | When this flag is 2, the kernel uses a "never overcommit" |
544 | policy that attempts to prevent any overcommit of memory. | 575 | policy that attempts to prevent any overcommit of memory. |
576 | Note that user_reserve_kbytes affects this policy. | ||
545 | 577 | ||
546 | This feature can be very useful because there are a lot of | 578 | This feature can be very useful because there are a lot of |
547 | programs that malloc() huge amounts of memory "just-in-case" | 579 | programs that malloc() huge amounts of memory "just-in-case" |
@@ -645,6 +677,24 @@ The default value is 60. | |||
645 | 677 | ||
646 | ============================================================== | 678 | ============================================================== |
647 | 679 | ||
680 | - user_reserve_kbytes | ||
681 | |||
682 | When overcommit_memory is set to 2, "never overommit" mode, reserve | ||
683 | min(3% of current process size, user_reserve_kbytes) of free memory. | ||
684 | This is intended to prevent a user from starting a single memory hogging | ||
685 | process, such that they cannot recover (kill the hog). | ||
686 | |||
687 | user_reserve_kbytes defaults to min(3% of the current process size, 128MB). | ||
688 | |||
689 | If this is reduced to zero, then the user will be allowed to allocate | ||
690 | all free memory with a single process, minus admin_reserve_kbytes. | ||
691 | Any subsequent attempts to execute a command will result in | ||
692 | "fork: Cannot allocate memory". | ||
693 | |||
694 | Changing this takes effect whenever an application requests memory. | ||
695 | |||
696 | ============================================================== | ||
697 | |||
648 | vfs_cache_pressure | 698 | vfs_cache_pressure |
649 | ------------------ | 699 | ------------------ |
650 | 700 | ||