kernel.txt 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. Documentation for /proc/sys/kernel/* kernel version 2.2.10
  2. (c) 1998, 1999, Rik van Riel <riel@nl.linux.org>
  3. (c) 2009, Shen Feng<shen@cn.fujitsu.com>
  4. For general info and legal blurb, please look in README.
  5. ==============================================================
  6. This file contains documentation for the sysctl files in
  7. /proc/sys/kernel/ and is valid for Linux kernel version 2.2.
  8. The files in this directory can be used to tune and monitor
  9. miscellaneous and general things in the operation of the Linux
  10. kernel. Since some of the files _can_ be used to screw up your
  11. system, it is advisable to read both documentation and source
  12. before actually making adjustments.
  13. Currently, these files might (depending on your configuration)
  14. show up in /proc/sys/kernel:
  15. - acpi_video_flags
  16. - acct
  17. - auto_msgmni
  18. - core_pattern
  19. - core_uses_pid
  20. - ctrl-alt-del
  21. - dentry-state
  22. - domainname
  23. - hostname
  24. - hotplug
  25. - java-appletviewer [ binfmt_java, obsolete ]
  26. - java-interpreter [ binfmt_java, obsolete ]
  27. - kstack_depth_to_print [ X86 only ]
  28. - l2cr [ PPC only ]
  29. - modprobe ==> Documentation/debugging-modules.txt
  30. - msgmax
  31. - msgmnb
  32. - msgmni
  33. - nmi_watchdog
  34. - osrelease
  35. - ostype
  36. - overflowgid
  37. - overflowuid
  38. - panic
  39. - pid_max
  40. - powersave-nap [ PPC only ]
  41. - panic_on_unrecovered_nmi
  42. - printk
  43. - randomize_va_space
  44. - real-root-dev ==> Documentation/initrd.txt
  45. - reboot-cmd [ SPARC only ]
  46. - rtsig-max
  47. - rtsig-nr
  48. - sem
  49. - sg-big-buff [ generic SCSI device (sg) ]
  50. - shmall
  51. - shmmax [ sysv ipc ]
  52. - shmmni
  53. - stop-a [ SPARC only ]
  54. - sysrq ==> Documentation/sysrq.txt
  55. - tainted
  56. - threads-max
  57. - unknown_nmi_panic
  58. - version
  59. ==============================================================
  60. acpi_video_flags:
  61. flags
  62. See Doc*/kernel/power/video.txt, it allows mode of video boot to be
  63. set during run time.
  64. ==============================================================
  65. acct:
  66. highwater lowwater frequency
  67. If BSD-style process accounting is enabled these values control
  68. its behaviour. If free space on filesystem where the log lives
  69. goes below <lowwater>% accounting suspends. If free space gets
  70. above <highwater>% accounting resumes. <Frequency> determines
  71. how often do we check the amount of free space (value is in
  72. seconds). Default:
  73. 4 2 30
  74. That is, suspend accounting if there left <= 2% free; resume it
  75. if we got >=4%; consider information about amount of free space
  76. valid for 30 seconds.
  77. ==============================================================
  78. core_pattern:
  79. core_pattern is used to specify a core dumpfile pattern name.
  80. . max length 128 characters; default value is "core"
  81. . core_pattern is used as a pattern template for the output filename;
  82. certain string patterns (beginning with '%') are substituted with
  83. their actual values.
  84. . backward compatibility with core_uses_pid:
  85. If core_pattern does not include "%p" (default does not)
  86. and core_uses_pid is set, then .PID will be appended to
  87. the filename.
  88. . corename format specifiers:
  89. %<NUL> '%' is dropped
  90. %% output one '%'
  91. %p pid
  92. %u uid
  93. %g gid
  94. %s signal number
  95. %t UNIX time of dump
  96. %h hostname
  97. %e executable filename
  98. %<OTHER> both are dropped
  99. . If the first character of the pattern is a '|', the kernel will treat
  100. the rest of the pattern as a command to run. The core dump will be
  101. written to the standard input of that program instead of to a file.
  102. ==============================================================
  103. core_uses_pid:
  104. The default coredump filename is "core". By setting
  105. core_uses_pid to 1, the coredump filename becomes core.PID.
  106. If core_pattern does not include "%p" (default does not)
  107. and core_uses_pid is set, then .PID will be appended to
  108. the filename.
  109. ==============================================================
  110. ctrl-alt-del:
  111. When the value in this file is 0, ctrl-alt-del is trapped and
  112. sent to the init(1) program to handle a graceful restart.
  113. When, however, the value is > 0, Linux's reaction to a Vulcan
  114. Nerve Pinch (tm) will be an immediate reboot, without even
  115. syncing its dirty buffers.
  116. Note: when a program (like dosemu) has the keyboard in 'raw'
  117. mode, the ctrl-alt-del is intercepted by the program before it
  118. ever reaches the kernel tty layer, and it's up to the program
  119. to decide what to do with it.
  120. ==============================================================
  121. domainname & hostname:
  122. These files can be used to set the NIS/YP domainname and the
  123. hostname of your box in exactly the same way as the commands
  124. domainname and hostname, i.e.:
  125. # echo "darkstar" > /proc/sys/kernel/hostname
  126. # echo "mydomain" > /proc/sys/kernel/domainname
  127. has the same effect as
  128. # hostname "darkstar"
  129. # domainname "mydomain"
  130. Note, however, that the classic darkstar.frop.org has the
  131. hostname "darkstar" and DNS (Internet Domain Name Server)
  132. domainname "frop.org", not to be confused with the NIS (Network
  133. Information Service) or YP (Yellow Pages) domainname. These two
  134. domain names are in general different. For a detailed discussion
  135. see the hostname(1) man page.
  136. ==============================================================
  137. hotplug:
  138. Path for the hotplug policy agent.
  139. Default value is "/sbin/hotplug".
  140. ==============================================================
  141. l2cr: (PPC only)
  142. This flag controls the L2 cache of G3 processor boards. If
  143. 0, the cache is disabled. Enabled if nonzero.
  144. ==============================================================
  145. kstack_depth_to_print: (X86 only)
  146. Controls the number of words to print when dumping the raw
  147. kernel stack.
  148. ==============================================================
  149. osrelease, ostype & version:
  150. # cat osrelease
  151. 2.1.88
  152. # cat ostype
  153. Linux
  154. # cat version
  155. #5 Wed Feb 25 21:49:24 MET 1998
  156. The files osrelease and ostype should be clear enough. Version
  157. needs a little more clarification however. The '#5' means that
  158. this is the fifth kernel built from this source base and the
  159. date behind it indicates the time the kernel was built.
  160. The only way to tune these values is to rebuild the kernel :-)
  161. ==============================================================
  162. overflowgid & overflowuid:
  163. if your architecture did not always support 32-bit UIDs (i.e. arm, i386,
  164. m68k, sh, and sparc32), a fixed UID and GID will be returned to
  165. applications that use the old 16-bit UID/GID system calls, if the actual
  166. UID or GID would exceed 65535.
  167. These sysctls allow you to change the value of the fixed UID and GID.
  168. The default is 65534.
  169. ==============================================================
  170. panic:
  171. The value in this file represents the number of seconds the
  172. kernel waits before rebooting on a panic. When you use the
  173. software watchdog, the recommended setting is 60.
  174. ==============================================================
  175. panic_on_oops:
  176. Controls the kernel's behaviour when an oops or BUG is encountered.
  177. 0: try to continue operation
  178. 1: panic immediately. If the `panic' sysctl is also non-zero then the
  179. machine will be rebooted.
  180. ==============================================================
  181. pid_max:
  182. PID allocation wrap value. When the kernel's next PID value
  183. reaches this value, it wraps back to a minimum PID value.
  184. PIDs of value pid_max or larger are not allocated.
  185. ==============================================================
  186. powersave-nap: (PPC only)
  187. If set, Linux-PPC will use the 'nap' mode of powersaving,
  188. otherwise the 'doze' mode will be used.
  189. ==============================================================
  190. printk:
  191. The four values in printk denote: console_loglevel,
  192. default_message_loglevel, minimum_console_loglevel and
  193. default_console_loglevel respectively.
  194. These values influence printk() behavior when printing or
  195. logging error messages. See 'man 2 syslog' for more info on
  196. the different loglevels.
  197. - console_loglevel: messages with a higher priority than
  198. this will be printed to the console
  199. - default_message_level: messages without an explicit priority
  200. will be printed with this priority
  201. - minimum_console_loglevel: minimum (highest) value to which
  202. console_loglevel can be set
  203. - default_console_loglevel: default value for console_loglevel
  204. ==============================================================
  205. printk_ratelimit:
  206. Some warning messages are rate limited. printk_ratelimit specifies
  207. the minimum length of time between these messages (in jiffies), by
  208. default we allow one every 5 seconds.
  209. A value of 0 will disable rate limiting.
  210. ==============================================================
  211. printk_ratelimit_burst:
  212. While long term we enforce one message per printk_ratelimit
  213. seconds, we do allow a burst of messages to pass through.
  214. printk_ratelimit_burst specifies the number of messages we can
  215. send before ratelimiting kicks in.
  216. ==============================================================
  217. randomize-va-space:
  218. This option can be used to select the type of process address
  219. space randomization that is used in the system, for architectures
  220. that support this feature.
  221. 0 - Turn the process address space randomization off by default.
  222. 1 - Make the addresses of mmap base, stack and VDSO page randomized.
  223. This, among other things, implies that shared libraries will be
  224. loaded to random addresses. Also for PIE-linked binaries, the location
  225. of code start is randomized.
  226. With heap randomization, the situation is a little bit more
  227. complicated.
  228. There a few legacy applications out there (such as some ancient
  229. versions of libc.so.5 from 1996) that assume that brk area starts
  230. just after the end of the code+bss. These applications break when
  231. start of the brk area is randomized. There are however no known
  232. non-legacy applications that would be broken this way, so for most
  233. systems it is safe to choose full randomization. However there is
  234. a CONFIG_COMPAT_BRK option for systems with ancient and/or broken
  235. binaries, that makes heap non-randomized, but keeps all other
  236. parts of process address space randomized if randomize_va_space
  237. sysctl is turned on.
  238. ==============================================================
  239. reboot-cmd: (Sparc only)
  240. ??? This seems to be a way to give an argument to the Sparc
  241. ROM/Flash boot loader. Maybe to tell it what to do after
  242. rebooting. ???
  243. ==============================================================
  244. rtsig-max & rtsig-nr:
  245. The file rtsig-max can be used to tune the maximum number
  246. of POSIX realtime (queued) signals that can be outstanding
  247. in the system.
  248. rtsig-nr shows the number of RT signals currently queued.
  249. ==============================================================
  250. sg-big-buff:
  251. This file shows the size of the generic SCSI (sg) buffer.
  252. You can't tune it just yet, but you could change it on
  253. compile time by editing include/scsi/sg.h and changing
  254. the value of SG_BIG_BUFF.
  255. There shouldn't be any reason to change this value. If
  256. you can come up with one, you probably know what you
  257. are doing anyway :)
  258. ==============================================================
  259. shmmax:
  260. This value can be used to query and set the run time limit
  261. on the maximum shared memory segment size that can be created.
  262. Shared memory segments up to 1Gb are now supported in the
  263. kernel. This value defaults to SHMMAX.
  264. ==============================================================
  265. softlockup_thresh:
  266. This value can be used to lower the softlockup tolerance threshold. The
  267. default threshold is 60 seconds. If a cpu is locked up for 60 seconds,
  268. the kernel complains. Valid values are 1-60 seconds. Setting this
  269. tunable to zero will disable the softlockup detection altogether.
  270. ==============================================================
  271. tainted:
  272. Non-zero if the kernel has been tainted. Numeric values, which
  273. can be ORed together:
  274. 1 - A module with a non-GPL license has been loaded, this
  275. includes modules with no license.
  276. Set by modutils >= 2.4.9 and module-init-tools.
  277. 2 - A module was force loaded by insmod -f.
  278. Set by modutils >= 2.4.9 and module-init-tools.
  279. 4 - Unsafe SMP processors: SMP with CPUs not designed for SMP.
  280. 8 - A module was forcibly unloaded from the system by rmmod -f.
  281. 16 - A hardware machine check error occurred on the system.
  282. 32 - A bad page was discovered on the system.
  283. 64 - The user has asked that the system be marked "tainted". This
  284. could be because they are running software that directly modifies
  285. the hardware, or for other reasons.
  286. 128 - The system has died.
  287. 256 - The ACPI DSDT has been overridden with one supplied by the user
  288. instead of using the one provided by the hardware.
  289. 512 - A kernel warning has occurred.
  290. 1024 - A module from drivers/staging was loaded.
  291. ==============================================================
  292. auto_msgmni:
  293. Enables/Disables automatic recomputing of msgmni upon memory add/remove or
  294. upon ipc namespace creation/removal (see the msgmni description above).
  295. Echoing "1" into this file enables msgmni automatic recomputing.
  296. Echoing "0" turns it off.
  297. auto_msgmni default value is 1.
  298. ==============================================================
  299. nmi_watchdog:
  300. Enables/Disables the NMI watchdog on x86 systems. When the value is non-zero
  301. the NMI watchdog is enabled and will continuously test all online cpus to
  302. determine whether or not they are still functioning properly. Currently,
  303. passing "nmi_watchdog=" parameter at boot time is required for this function
  304. to work.
  305. If LAPIC NMI watchdog method is in use (nmi_watchdog=2 kernel parameter), the
  306. NMI watchdog shares registers with oprofile. By disabling the NMI watchdog,
  307. oprofile may have more registers to utilize.
  308. ==============================================================
  309. unknown_nmi_panic:
  310. The value in this file affects behavior of handling NMI. When the value is
  311. non-zero, unknown NMI is trapped and then panic occurs. At that time, kernel
  312. debugging information is displayed on console.
  313. NMI switch that most IA32 servers have fires unknown NMI up, for example.
  314. If a system hangs up, try pressing the NMI switch.
  315. ==============================================================
  316. panic_on_unrecovered_nmi:
  317. The default Linux behaviour on an NMI of either memory or unknown is to continue
  318. operation. For many environments such as scientific computing it is preferable
  319. that the box is taken out and the error dealt with than an uncorrected
  320. parity/ECC error get propogated.
  321. A small number of systems do generate NMI's for bizarre random reasons such as
  322. power management so the default is off. That sysctl works like the existing
  323. panic controls already in that directory.