kernel.txt 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  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. - bootloader_type [ X86 only ]
  18. - bootloader_version [ X86 only ]
  19. - callhome [ S390 only ]
  20. - auto_msgmni
  21. - core_pattern
  22. - core_pipe_limit
  23. - core_uses_pid
  24. - ctrl-alt-del
  25. - dentry-state
  26. - dmesg_restrict
  27. - domainname
  28. - hostname
  29. - hotplug
  30. - java-appletviewer [ binfmt_java, obsolete ]
  31. - java-interpreter [ binfmt_java, obsolete ]
  32. - kstack_depth_to_print [ X86 only ]
  33. - l2cr [ PPC only ]
  34. - modprobe ==> Documentation/debugging-modules.txt
  35. - modules_disabled
  36. - msgmax
  37. - msgmnb
  38. - msgmni
  39. - nmi_watchdog
  40. - osrelease
  41. - ostype
  42. - overflowgid
  43. - overflowuid
  44. - panic
  45. - pid_max
  46. - powersave-nap [ PPC only ]
  47. - panic_on_unrecovered_nmi
  48. - printk
  49. - randomize_va_space
  50. - real-root-dev ==> Documentation/initrd.txt
  51. - reboot-cmd [ SPARC only ]
  52. - rtsig-max
  53. - rtsig-nr
  54. - sem
  55. - sg-big-buff [ generic SCSI device (sg) ]
  56. - shmall
  57. - shmmax [ sysv ipc ]
  58. - shmmni
  59. - stop-a [ SPARC only ]
  60. - sysrq ==> Documentation/sysrq.txt
  61. - tainted
  62. - threads-max
  63. - unknown_nmi_panic
  64. - version
  65. ==============================================================
  66. acpi_video_flags:
  67. flags
  68. See Doc*/kernel/power/video.txt, it allows mode of video boot to be
  69. set during run time.
  70. ==============================================================
  71. acct:
  72. highwater lowwater frequency
  73. If BSD-style process accounting is enabled these values control
  74. its behaviour. If free space on filesystem where the log lives
  75. goes below <lowwater>% accounting suspends. If free space gets
  76. above <highwater>% accounting resumes. <Frequency> determines
  77. how often do we check the amount of free space (value is in
  78. seconds). Default:
  79. 4 2 30
  80. That is, suspend accounting if there left <= 2% free; resume it
  81. if we got >=4%; consider information about amount of free space
  82. valid for 30 seconds.
  83. ==============================================================
  84. bootloader_type:
  85. x86 bootloader identification
  86. This gives the bootloader type number as indicated by the bootloader,
  87. shifted left by 4, and OR'd with the low four bits of the bootloader
  88. version. The reason for this encoding is that this used to match the
  89. type_of_loader field in the kernel header; the encoding is kept for
  90. backwards compatibility. That is, if the full bootloader type number
  91. is 0x15 and the full version number is 0x234, this file will contain
  92. the value 340 = 0x154.
  93. See the type_of_loader and ext_loader_type fields in
  94. Documentation/x86/boot.txt for additional information.
  95. ==============================================================
  96. bootloader_version:
  97. x86 bootloader version
  98. The complete bootloader version number. In the example above, this
  99. file will contain the value 564 = 0x234.
  100. See the type_of_loader and ext_loader_ver fields in
  101. Documentation/x86/boot.txt for additional information.
  102. ==============================================================
  103. callhome:
  104. Controls the kernel's callhome behavior in case of a kernel panic.
  105. The s390 hardware allows an operating system to send a notification
  106. to a service organization (callhome) in case of an operating system panic.
  107. When the value in this file is 0 (which is the default behavior)
  108. nothing happens in case of a kernel panic. If this value is set to "1"
  109. the complete kernel oops message is send to the IBM customer service
  110. organization in case the mainframe the Linux operating system is running
  111. on has a service contract with IBM.
  112. ==============================================================
  113. core_pattern:
  114. core_pattern is used to specify a core dumpfile pattern name.
  115. . max length 128 characters; default value is "core"
  116. . core_pattern is used as a pattern template for the output filename;
  117. certain string patterns (beginning with '%') are substituted with
  118. their actual values.
  119. . backward compatibility with core_uses_pid:
  120. If core_pattern does not include "%p" (default does not)
  121. and core_uses_pid is set, then .PID will be appended to
  122. the filename.
  123. . corename format specifiers:
  124. %<NUL> '%' is dropped
  125. %% output one '%'
  126. %p pid
  127. %u uid
  128. %g gid
  129. %s signal number
  130. %t UNIX time of dump
  131. %h hostname
  132. %e executable filename
  133. %<OTHER> both are dropped
  134. . If the first character of the pattern is a '|', the kernel will treat
  135. the rest of the pattern as a command to run. The core dump will be
  136. written to the standard input of that program instead of to a file.
  137. ==============================================================
  138. core_pipe_limit:
  139. This sysctl is only applicable when core_pattern is configured to pipe core
  140. files to a user space helper (when the first character of core_pattern is a '|',
  141. see above). When collecting cores via a pipe to an application, it is
  142. occasionally useful for the collecting application to gather data about the
  143. crashing process from its /proc/pid directory. In order to do this safely, the
  144. kernel must wait for the collecting process to exit, so as not to remove the
  145. crashing processes proc files prematurely. This in turn creates the possibility
  146. that a misbehaving userspace collecting process can block the reaping of a
  147. crashed process simply by never exiting. This sysctl defends against that. It
  148. defines how many concurrent crashing processes may be piped to user space
  149. applications in parallel. If this value is exceeded, then those crashing
  150. processes above that value are noted via the kernel log and their cores are
  151. skipped. 0 is a special value, indicating that unlimited processes may be
  152. captured in parallel, but that no waiting will take place (i.e. the collecting
  153. process is not guaranteed access to /proc/<crashing pid>/). This value defaults
  154. to 0.
  155. ==============================================================
  156. core_uses_pid:
  157. The default coredump filename is "core". By setting
  158. core_uses_pid to 1, the coredump filename becomes core.PID.
  159. If core_pattern does not include "%p" (default does not)
  160. and core_uses_pid is set, then .PID will be appended to
  161. the filename.
  162. ==============================================================
  163. ctrl-alt-del:
  164. When the value in this file is 0, ctrl-alt-del is trapped and
  165. sent to the init(1) program to handle a graceful restart.
  166. When, however, the value is > 0, Linux's reaction to a Vulcan
  167. Nerve Pinch (tm) will be an immediate reboot, without even
  168. syncing its dirty buffers.
  169. Note: when a program (like dosemu) has the keyboard in 'raw'
  170. mode, the ctrl-alt-del is intercepted by the program before it
  171. ever reaches the kernel tty layer, and it's up to the program
  172. to decide what to do with it.
  173. ==============================================================
  174. dmesg_restrict:
  175. This toggle indicates whether unprivileged users are prevented from using
  176. dmesg(8) to view messages from the kernel's log buffer. When
  177. dmesg_restrict is set to (0) there are no restrictions. When
  178. dmesg_restrict is set set to (1), users must have CAP_SYS_ADMIN to use
  179. dmesg(8).
  180. The kernel config option CONFIG_SECURITY_DMESG_RESTRICT sets the default
  181. value of dmesg_restrict.
  182. ==============================================================
  183. domainname & hostname:
  184. These files can be used to set the NIS/YP domainname and the
  185. hostname of your box in exactly the same way as the commands
  186. domainname and hostname, i.e.:
  187. # echo "darkstar" > /proc/sys/kernel/hostname
  188. # echo "mydomain" > /proc/sys/kernel/domainname
  189. has the same effect as
  190. # hostname "darkstar"
  191. # domainname "mydomain"
  192. Note, however, that the classic darkstar.frop.org has the
  193. hostname "darkstar" and DNS (Internet Domain Name Server)
  194. domainname "frop.org", not to be confused with the NIS (Network
  195. Information Service) or YP (Yellow Pages) domainname. These two
  196. domain names are in general different. For a detailed discussion
  197. see the hostname(1) man page.
  198. ==============================================================
  199. hotplug:
  200. Path for the hotplug policy agent.
  201. Default value is "/sbin/hotplug".
  202. ==============================================================
  203. l2cr: (PPC only)
  204. This flag controls the L2 cache of G3 processor boards. If
  205. 0, the cache is disabled. Enabled if nonzero.
  206. ==============================================================
  207. kstack_depth_to_print: (X86 only)
  208. Controls the number of words to print when dumping the raw
  209. kernel stack.
  210. ==============================================================
  211. modules_disabled:
  212. A toggle value indicating if modules are allowed to be loaded
  213. in an otherwise modular kernel. This toggle defaults to off
  214. (0), but can be set true (1). Once true, modules can be
  215. neither loaded nor unloaded, and the toggle cannot be set back
  216. to false.
  217. ==============================================================
  218. osrelease, ostype & version:
  219. # cat osrelease
  220. 2.1.88
  221. # cat ostype
  222. Linux
  223. # cat version
  224. #5 Wed Feb 25 21:49:24 MET 1998
  225. The files osrelease and ostype should be clear enough. Version
  226. needs a little more clarification however. The '#5' means that
  227. this is the fifth kernel built from this source base and the
  228. date behind it indicates the time the kernel was built.
  229. The only way to tune these values is to rebuild the kernel :-)
  230. ==============================================================
  231. overflowgid & overflowuid:
  232. if your architecture did not always support 32-bit UIDs (i.e. arm, i386,
  233. m68k, sh, and sparc32), a fixed UID and GID will be returned to
  234. applications that use the old 16-bit UID/GID system calls, if the actual
  235. UID or GID would exceed 65535.
  236. These sysctls allow you to change the value of the fixed UID and GID.
  237. The default is 65534.
  238. ==============================================================
  239. panic:
  240. The value in this file represents the number of seconds the
  241. kernel waits before rebooting on a panic. When you use the
  242. software watchdog, the recommended setting is 60.
  243. ==============================================================
  244. panic_on_oops:
  245. Controls the kernel's behaviour when an oops or BUG is encountered.
  246. 0: try to continue operation
  247. 1: panic immediately. If the `panic' sysctl is also non-zero then the
  248. machine will be rebooted.
  249. ==============================================================
  250. pid_max:
  251. PID allocation wrap value. When the kernel's next PID value
  252. reaches this value, it wraps back to a minimum PID value.
  253. PIDs of value pid_max or larger are not allocated.
  254. ==============================================================
  255. powersave-nap: (PPC only)
  256. If set, Linux-PPC will use the 'nap' mode of powersaving,
  257. otherwise the 'doze' mode will be used.
  258. ==============================================================
  259. printk:
  260. The four values in printk denote: console_loglevel,
  261. default_message_loglevel, minimum_console_loglevel and
  262. default_console_loglevel respectively.
  263. These values influence printk() behavior when printing or
  264. logging error messages. See 'man 2 syslog' for more info on
  265. the different loglevels.
  266. - console_loglevel: messages with a higher priority than
  267. this will be printed to the console
  268. - default_message_level: messages without an explicit priority
  269. will be printed with this priority
  270. - minimum_console_loglevel: minimum (highest) value to which
  271. console_loglevel can be set
  272. - default_console_loglevel: default value for console_loglevel
  273. ==============================================================
  274. printk_ratelimit:
  275. Some warning messages are rate limited. printk_ratelimit specifies
  276. the minimum length of time between these messages (in jiffies), by
  277. default we allow one every 5 seconds.
  278. A value of 0 will disable rate limiting.
  279. ==============================================================
  280. printk_ratelimit_burst:
  281. While long term we enforce one message per printk_ratelimit
  282. seconds, we do allow a burst of messages to pass through.
  283. printk_ratelimit_burst specifies the number of messages we can
  284. send before ratelimiting kicks in.
  285. ==============================================================
  286. printk_delay:
  287. Delay each printk message in printk_delay milliseconds
  288. Value from 0 - 10000 is allowed.
  289. ==============================================================
  290. randomize-va-space:
  291. This option can be used to select the type of process address
  292. space randomization that is used in the system, for architectures
  293. that support this feature.
  294. 0 - Turn the process address space randomization off. This is the
  295. default for architectures that do not support this feature anyways,
  296. and kernels that are booted with the "norandmaps" parameter.
  297. 1 - Make the addresses of mmap base, stack and VDSO page randomized.
  298. This, among other things, implies that shared libraries will be
  299. loaded to random addresses. Also for PIE-linked binaries, the
  300. location of code start is randomized. This is the default if the
  301. CONFIG_COMPAT_BRK option is enabled.
  302. 2 - Additionally enable heap randomization. This is the default if
  303. CONFIG_COMPAT_BRK is disabled.
  304. There are a few legacy applications out there (such as some ancient
  305. versions of libc.so.5 from 1996) that assume that brk area starts
  306. just after the end of the code+bss. These applications break when
  307. start of the brk area is randomized. There are however no known
  308. non-legacy applications that would be broken this way, so for most
  309. systems it is safe to choose full randomization.
  310. Systems with ancient and/or broken binaries should be configured
  311. with CONFIG_COMPAT_BRK enabled, which excludes the heap from process
  312. address space randomization.
  313. ==============================================================
  314. reboot-cmd: (Sparc only)
  315. ??? This seems to be a way to give an argument to the Sparc
  316. ROM/Flash boot loader. Maybe to tell it what to do after
  317. rebooting. ???
  318. ==============================================================
  319. rtsig-max & rtsig-nr:
  320. The file rtsig-max can be used to tune the maximum number
  321. of POSIX realtime (queued) signals that can be outstanding
  322. in the system.
  323. rtsig-nr shows the number of RT signals currently queued.
  324. ==============================================================
  325. sg-big-buff:
  326. This file shows the size of the generic SCSI (sg) buffer.
  327. You can't tune it just yet, but you could change it on
  328. compile time by editing include/scsi/sg.h and changing
  329. the value of SG_BIG_BUFF.
  330. There shouldn't be any reason to change this value. If
  331. you can come up with one, you probably know what you
  332. are doing anyway :)
  333. ==============================================================
  334. shmmax:
  335. This value can be used to query and set the run time limit
  336. on the maximum shared memory segment size that can be created.
  337. Shared memory segments up to 1Gb are now supported in the
  338. kernel. This value defaults to SHMMAX.
  339. ==============================================================
  340. softlockup_thresh:
  341. This value can be used to lower the softlockup tolerance threshold. The
  342. default threshold is 60 seconds. If a cpu is locked up for 60 seconds,
  343. the kernel complains. Valid values are 1-60 seconds. Setting this
  344. tunable to zero will disable the softlockup detection altogether.
  345. ==============================================================
  346. tainted:
  347. Non-zero if the kernel has been tainted. Numeric values, which
  348. can be ORed together:
  349. 1 - A module with a non-GPL license has been loaded, this
  350. includes modules with no license.
  351. Set by modutils >= 2.4.9 and module-init-tools.
  352. 2 - A module was force loaded by insmod -f.
  353. Set by modutils >= 2.4.9 and module-init-tools.
  354. 4 - Unsafe SMP processors: SMP with CPUs not designed for SMP.
  355. 8 - A module was forcibly unloaded from the system by rmmod -f.
  356. 16 - A hardware machine check error occurred on the system.
  357. 32 - A bad page was discovered on the system.
  358. 64 - The user has asked that the system be marked "tainted". This
  359. could be because they are running software that directly modifies
  360. the hardware, or for other reasons.
  361. 128 - The system has died.
  362. 256 - The ACPI DSDT has been overridden with one supplied by the user
  363. instead of using the one provided by the hardware.
  364. 512 - A kernel warning has occurred.
  365. 1024 - A module from drivers/staging was loaded.
  366. ==============================================================
  367. auto_msgmni:
  368. Enables/Disables automatic recomputing of msgmni upon memory add/remove or
  369. upon ipc namespace creation/removal (see the msgmni description above).
  370. Echoing "1" into this file enables msgmni automatic recomputing.
  371. Echoing "0" turns it off.
  372. auto_msgmni default value is 1.
  373. ==============================================================
  374. nmi_watchdog:
  375. Enables/Disables the NMI watchdog on x86 systems. When the value is non-zero
  376. the NMI watchdog is enabled and will continuously test all online cpus to
  377. determine whether or not they are still functioning properly. Currently,
  378. passing "nmi_watchdog=" parameter at boot time is required for this function
  379. to work.
  380. If LAPIC NMI watchdog method is in use (nmi_watchdog=2 kernel parameter), the
  381. NMI watchdog shares registers with oprofile. By disabling the NMI watchdog,
  382. oprofile may have more registers to utilize.
  383. ==============================================================
  384. unknown_nmi_panic:
  385. The value in this file affects behavior of handling NMI. When the value is
  386. non-zero, unknown NMI is trapped and then panic occurs. At that time, kernel
  387. debugging information is displayed on console.
  388. NMI switch that most IA32 servers have fires unknown NMI up, for example.
  389. If a system hangs up, try pressing the NMI switch.
  390. ==============================================================
  391. panic_on_unrecovered_nmi:
  392. The default Linux behaviour on an NMI of either memory or unknown is to continue
  393. operation. For many environments such as scientific computing it is preferable
  394. that the box is taken out and the error dealt with than an uncorrected
  395. parity/ECC error get propogated.
  396. A small number of systems do generate NMI's for bizarre random reasons such as
  397. power management so the default is off. That sysctl works like the existing
  398. panic controls already in that directory.