fs.txt 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. Documentation for /proc/sys/fs/* kernel version 2.2.10
  2. (c) 1998, 1999, Rik van Riel <riel@nl.linux.org>
  3. For general info and legal blurb, please look in README.
  4. ==============================================================
  5. This file contains documentation for the sysctl files in
  6. /proc/sys/fs/ and is valid for Linux kernel version 2.2.
  7. The files in this directory can be used to tune and monitor
  8. miscellaneous and general things in the operation of the Linux
  9. kernel. Since some of the files _can_ be used to screw up your
  10. system, it is advisable to read both documentation and source
  11. before actually making adjustments.
  12. Currently, these files are in /proc/sys/fs:
  13. - dentry-state
  14. - dquot-max
  15. - dquot-nr
  16. - file-max
  17. - file-nr
  18. - inode-max
  19. - inode-nr
  20. - inode-state
  21. - nr_open
  22. - overflowuid
  23. - overflowgid
  24. - suid_dumpable
  25. - super-max
  26. - super-nr
  27. Documentation for the files in /proc/sys/fs/binfmt_misc is
  28. in Documentation/binfmt_misc.txt.
  29. ==============================================================
  30. dentry-state:
  31. From linux/fs/dentry.c:
  32. --------------------------------------------------------------
  33. struct {
  34. int nr_dentry;
  35. int nr_unused;
  36. int age_limit; /* age in seconds */
  37. int want_pages; /* pages requested by system */
  38. int dummy[2];
  39. } dentry_stat = {0, 0, 45, 0,};
  40. --------------------------------------------------------------
  41. Dentries are dynamically allocated and deallocated, and
  42. nr_dentry seems to be 0 all the time. Hence it's safe to
  43. assume that only nr_unused, age_limit and want_pages are
  44. used. Nr_unused seems to be exactly what its name says.
  45. Age_limit is the age in seconds after which dcache entries
  46. can be reclaimed when memory is short and want_pages is
  47. nonzero when shrink_dcache_pages() has been called and the
  48. dcache isn't pruned yet.
  49. ==============================================================
  50. dquot-max & dquot-nr:
  51. The file dquot-max shows the maximum number of cached disk
  52. quota entries.
  53. The file dquot-nr shows the number of allocated disk quota
  54. entries and the number of free disk quota entries.
  55. If the number of free cached disk quotas is very low and
  56. you have some awesome number of simultaneous system users,
  57. you might want to raise the limit.
  58. ==============================================================
  59. file-max & file-nr:
  60. The kernel allocates file handles dynamically, but as yet it
  61. doesn't free them again.
  62. The value in file-max denotes the maximum number of file-
  63. handles that the Linux kernel will allocate. When you get lots
  64. of error messages about running out of file handles, you might
  65. want to increase this limit.
  66. The three values in file-nr denote the number of allocated
  67. file handles, the number of unused file handles and the maximum
  68. number of file handles. When the allocated file handles come
  69. close to the maximum, but the number of unused file handles is
  70. significantly greater than 0, you've encountered a peak in your
  71. usage of file handles and you don't need to increase the maximum.
  72. ==============================================================
  73. nr_open:
  74. This denotes the maximum number of file-handles a process can
  75. allocate. Default value is 1024*1024 (1048576) which should be
  76. enough for most machines. Actual limit depends on RLIMIT_NOFILE
  77. resource limit.
  78. ==============================================================
  79. inode-max, inode-nr & inode-state:
  80. As with file handles, the kernel allocates the inode structures
  81. dynamically, but can't free them yet.
  82. The value in inode-max denotes the maximum number of inode
  83. handlers. This value should be 3-4 times larger than the value
  84. in file-max, since stdin, stdout and network sockets also
  85. need an inode struct to handle them. When you regularly run
  86. out of inodes, you need to increase this value.
  87. The file inode-nr contains the first two items from
  88. inode-state, so we'll skip to that file...
  89. Inode-state contains three actual numbers and four dummies.
  90. The actual numbers are, in order of appearance, nr_inodes,
  91. nr_free_inodes and preshrink.
  92. Nr_inodes stands for the number of inodes the system has
  93. allocated, this can be slightly more than inode-max because
  94. Linux allocates them one pageful at a time.
  95. Nr_free_inodes represents the number of free inodes (?) and
  96. preshrink is nonzero when the nr_inodes > inode-max and the
  97. system needs to prune the inode list instead of allocating
  98. more.
  99. ==============================================================
  100. overflowgid & overflowuid:
  101. Some filesystems only support 16-bit UIDs and GIDs, although in Linux
  102. UIDs and GIDs are 32 bits. When one of these filesystems is mounted
  103. with writes enabled, any UID or GID that would exceed 65535 is translated
  104. to a fixed value before being written to disk.
  105. These sysctls allow you to change the value of the fixed UID and GID.
  106. The default is 65534.
  107. ==============================================================
  108. suid_dumpable:
  109. This value can be used to query and set the core dump mode for setuid
  110. or otherwise protected/tainted binaries. The modes are
  111. 0 - (default) - traditional behaviour. Any process which has changed
  112. privilege levels or is execute only will not be dumped
  113. 1 - (debug) - all processes dump core when possible. The core dump is
  114. owned by the current user and no security is applied. This is
  115. intended for system debugging situations only. Ptrace is unchecked.
  116. 2 - (suidsafe) - any binary which normally would not be dumped is dumped
  117. readable by root only. This allows the end user to remove
  118. such a dump but not access it directly. For security reasons
  119. core dumps in this mode will not overwrite one another or
  120. other files. This mode is appropriate when administrators are
  121. attempting to debug problems in a normal environment.
  122. ==============================================================
  123. super-max & super-nr:
  124. These numbers control the maximum number of superblocks, and
  125. thus the maximum number of mounted filesystems the kernel
  126. can have. You only need to increase super-max if you need to
  127. mount more filesystems than the current value in super-max
  128. allows you to.
  129. ==============================================================
  130. aio-nr & aio-max-nr:
  131. aio-nr shows the current system-wide number of asynchronous io
  132. requests. aio-max-nr allows you to change the maximum value
  133. aio-nr can grow to.
  134. ==============================================================