kernel.txt 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058
  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. - acct
  16. - acpi_video_flags
  17. - auto_msgmni
  18. - bootloader_type [ X86 only ]
  19. - bootloader_version [ X86 only ]
  20. - callhome [ S390 only ]
  21. - cap_last_cap
  22. - core_pattern
  23. - core_pipe_limit
  24. - core_uses_pid
  25. - ctrl-alt-del
  26. - dmesg_restrict
  27. - domainname
  28. - hostname
  29. - hotplug
  30. - hardlockup_all_cpu_backtrace
  31. - hung_task_panic
  32. - hung_task_check_count
  33. - hung_task_timeout_secs
  34. - hung_task_warnings
  35. - kexec_load_disabled
  36. - kptr_restrict
  37. - kstack_depth_to_print [ X86 only ]
  38. - l2cr [ PPC only ]
  39. - modprobe ==> Documentation/debugging-modules.txt
  40. - modules_disabled
  41. - msg_next_id [ sysv ipc ]
  42. - msgmax
  43. - msgmnb
  44. - msgmni
  45. - nmi_watchdog
  46. - osrelease
  47. - ostype
  48. - overflowgid
  49. - overflowuid
  50. - panic
  51. - panic_on_oops
  52. - panic_on_stackoverflow
  53. - panic_on_unrecovered_nmi
  54. - panic_on_warn
  55. - panic_on_rcu_stall
  56. - perf_cpu_time_max_percent
  57. - perf_event_paranoid
  58. - perf_event_max_stack
  59. - perf_event_max_contexts_per_stack
  60. - pid_max
  61. - powersave-nap [ PPC only ]
  62. - printk
  63. - printk_delay
  64. - printk_ratelimit
  65. - printk_ratelimit_burst
  66. - pty ==> Documentation/filesystems/devpts.txt
  67. - randomize_va_space
  68. - real-root-dev ==> Documentation/initrd.txt
  69. - reboot-cmd [ SPARC only ]
  70. - rtsig-max
  71. - rtsig-nr
  72. - sem
  73. - sem_next_id [ sysv ipc ]
  74. - sg-big-buff [ generic SCSI device (sg) ]
  75. - shm_next_id [ sysv ipc ]
  76. - shm_rmid_forced
  77. - shmall
  78. - shmmax [ sysv ipc ]
  79. - shmmni
  80. - softlockup_all_cpu_backtrace
  81. - soft_watchdog
  82. - stop-a [ SPARC only ]
  83. - sysrq ==> Documentation/sysrq.txt
  84. - sysctl_writes_strict
  85. - tainted
  86. - threads-max
  87. - unknown_nmi_panic
  88. - watchdog
  89. - watchdog_thresh
  90. - version
  91. ==============================================================
  92. acct:
  93. highwater lowwater frequency
  94. If BSD-style process accounting is enabled these values control
  95. its behaviour. If free space on filesystem where the log lives
  96. goes below <lowwater>% accounting suspends. If free space gets
  97. above <highwater>% accounting resumes. <Frequency> determines
  98. how often do we check the amount of free space (value is in
  99. seconds). Default:
  100. 4 2 30
  101. That is, suspend accounting if there left <= 2% free; resume it
  102. if we got >=4%; consider information about amount of free space
  103. valid for 30 seconds.
  104. ==============================================================
  105. acpi_video_flags:
  106. flags
  107. See Doc*/kernel/power/video.txt, it allows mode of video boot to be
  108. set during run time.
  109. ==============================================================
  110. auto_msgmni:
  111. This variable has no effect and may be removed in future kernel
  112. releases. Reading it always returns 0.
  113. Up to Linux 3.17, it enabled/disabled automatic recomputing of msgmni
  114. upon memory add/remove or upon ipc namespace creation/removal.
  115. Echoing "1" into this file enabled msgmni automatic recomputing.
  116. Echoing "0" turned it off. auto_msgmni default value was 1.
  117. ==============================================================
  118. bootloader_type:
  119. x86 bootloader identification
  120. This gives the bootloader type number as indicated by the bootloader,
  121. shifted left by 4, and OR'd with the low four bits of the bootloader
  122. version. The reason for this encoding is that this used to match the
  123. type_of_loader field in the kernel header; the encoding is kept for
  124. backwards compatibility. That is, if the full bootloader type number
  125. is 0x15 and the full version number is 0x234, this file will contain
  126. the value 340 = 0x154.
  127. See the type_of_loader and ext_loader_type fields in
  128. Documentation/x86/boot.txt for additional information.
  129. ==============================================================
  130. bootloader_version:
  131. x86 bootloader version
  132. The complete bootloader version number. In the example above, this
  133. file will contain the value 564 = 0x234.
  134. See the type_of_loader and ext_loader_ver fields in
  135. Documentation/x86/boot.txt for additional information.
  136. ==============================================================
  137. callhome:
  138. Controls the kernel's callhome behavior in case of a kernel panic.
  139. The s390 hardware allows an operating system to send a notification
  140. to a service organization (callhome) in case of an operating system panic.
  141. When the value in this file is 0 (which is the default behavior)
  142. nothing happens in case of a kernel panic. If this value is set to "1"
  143. the complete kernel oops message is send to the IBM customer service
  144. organization in case the mainframe the Linux operating system is running
  145. on has a service contract with IBM.
  146. ==============================================================
  147. cap_last_cap
  148. Highest valid capability of the running kernel. Exports
  149. CAP_LAST_CAP from the kernel.
  150. ==============================================================
  151. core_pattern:
  152. core_pattern is used to specify a core dumpfile pattern name.
  153. . max length 128 characters; default value is "core"
  154. . core_pattern is used as a pattern template for the output filename;
  155. certain string patterns (beginning with '%') are substituted with
  156. their actual values.
  157. . backward compatibility with core_uses_pid:
  158. If core_pattern does not include "%p" (default does not)
  159. and core_uses_pid is set, then .PID will be appended to
  160. the filename.
  161. . corename format specifiers:
  162. %<NUL> '%' is dropped
  163. %% output one '%'
  164. %p pid
  165. %P global pid (init PID namespace)
  166. %i tid
  167. %I global tid (init PID namespace)
  168. %u uid (in initial user namespace)
  169. %g gid (in initial user namespace)
  170. %d dump mode, matches PR_SET_DUMPABLE and
  171. /proc/sys/fs/suid_dumpable
  172. %s signal number
  173. %t UNIX time of dump
  174. %h hostname
  175. %e executable filename (may be shortened)
  176. %E executable path
  177. %<OTHER> both are dropped
  178. . If the first character of the pattern is a '|', the kernel will treat
  179. the rest of the pattern as a command to run. The core dump will be
  180. written to the standard input of that program instead of to a file.
  181. ==============================================================
  182. core_pipe_limit:
  183. This sysctl is only applicable when core_pattern is configured to pipe
  184. core files to a user space helper (when the first character of
  185. core_pattern is a '|', see above). When collecting cores via a pipe
  186. to an application, it is occasionally useful for the collecting
  187. application to gather data about the crashing process from its
  188. /proc/pid directory. In order to do this safely, the kernel must wait
  189. for the collecting process to exit, so as not to remove the crashing
  190. processes proc files prematurely. This in turn creates the
  191. possibility that a misbehaving userspace collecting process can block
  192. the reaping of a crashed process simply by never exiting. This sysctl
  193. defends against that. It defines how many concurrent crashing
  194. processes may be piped to user space applications in parallel. If
  195. this value is exceeded, then those crashing processes above that value
  196. are noted via the kernel log and their cores are skipped. 0 is a
  197. special value, indicating that unlimited processes may be captured in
  198. parallel, but that no waiting will take place (i.e. the collecting
  199. process is not guaranteed access to /proc/<crashing pid>/). This
  200. value defaults to 0.
  201. ==============================================================
  202. core_uses_pid:
  203. The default coredump filename is "core". By setting
  204. core_uses_pid to 1, the coredump filename becomes core.PID.
  205. If core_pattern does not include "%p" (default does not)
  206. and core_uses_pid is set, then .PID will be appended to
  207. the filename.
  208. ==============================================================
  209. ctrl-alt-del:
  210. When the value in this file is 0, ctrl-alt-del is trapped and
  211. sent to the init(1) program to handle a graceful restart.
  212. When, however, the value is > 0, Linux's reaction to a Vulcan
  213. Nerve Pinch (tm) will be an immediate reboot, without even
  214. syncing its dirty buffers.
  215. Note: when a program (like dosemu) has the keyboard in 'raw'
  216. mode, the ctrl-alt-del is intercepted by the program before it
  217. ever reaches the kernel tty layer, and it's up to the program
  218. to decide what to do with it.
  219. ==============================================================
  220. dmesg_restrict:
  221. This toggle indicates whether unprivileged users are prevented
  222. from using dmesg(8) to view messages from the kernel's log buffer.
  223. When dmesg_restrict is set to (0) there are no restrictions. When
  224. dmesg_restrict is set set to (1), users must have CAP_SYSLOG to use
  225. dmesg(8).
  226. The kernel config option CONFIG_SECURITY_DMESG_RESTRICT sets the
  227. default value of dmesg_restrict.
  228. ==============================================================
  229. domainname & hostname:
  230. These files can be used to set the NIS/YP domainname and the
  231. hostname of your box in exactly the same way as the commands
  232. domainname and hostname, i.e.:
  233. # echo "darkstar" > /proc/sys/kernel/hostname
  234. # echo "mydomain" > /proc/sys/kernel/domainname
  235. has the same effect as
  236. # hostname "darkstar"
  237. # domainname "mydomain"
  238. Note, however, that the classic darkstar.frop.org has the
  239. hostname "darkstar" and DNS (Internet Domain Name Server)
  240. domainname "frop.org", not to be confused with the NIS (Network
  241. Information Service) or YP (Yellow Pages) domainname. These two
  242. domain names are in general different. For a detailed discussion
  243. see the hostname(1) man page.
  244. ==============================================================
  245. hardlockup_all_cpu_backtrace:
  246. This value controls the hard lockup detector behavior when a hard
  247. lockup condition is detected as to whether or not to gather further
  248. debug information. If enabled, arch-specific all-CPU stack dumping
  249. will be initiated.
  250. 0: do nothing. This is the default behavior.
  251. 1: on detection capture more debug information.
  252. ==============================================================
  253. hotplug:
  254. Path for the hotplug policy agent.
  255. Default value is "/sbin/hotplug".
  256. ==============================================================
  257. hung_task_panic:
  258. Controls the kernel's behavior when a hung task is detected.
  259. This file shows up if CONFIG_DETECT_HUNG_TASK is enabled.
  260. 0: continue operation. This is the default behavior.
  261. 1: panic immediately.
  262. ==============================================================
  263. hung_task_check_count:
  264. The upper bound on the number of tasks that are checked.
  265. This file shows up if CONFIG_DETECT_HUNG_TASK is enabled.
  266. ==============================================================
  267. hung_task_timeout_secs:
  268. Check interval. When a task in D state did not get scheduled
  269. for more than this value report a warning.
  270. This file shows up if CONFIG_DETECT_HUNG_TASK is enabled.
  271. 0: means infinite timeout - no checking done.
  272. Possible values to set are in range {0..LONG_MAX/HZ}.
  273. ==============================================================
  274. hung_task_warnings:
  275. The maximum number of warnings to report. During a check interval
  276. if a hung task is detected, this value is decreased by 1.
  277. When this value reaches 0, no more warnings will be reported.
  278. This file shows up if CONFIG_DETECT_HUNG_TASK is enabled.
  279. -1: report an infinite number of warnings.
  280. ==============================================================
  281. kexec_load_disabled:
  282. A toggle indicating if the kexec_load syscall has been disabled. This
  283. value defaults to 0 (false: kexec_load enabled), but can be set to 1
  284. (true: kexec_load disabled). Once true, kexec can no longer be used, and
  285. the toggle cannot be set back to false. This allows a kexec image to be
  286. loaded before disabling the syscall, allowing a system to set up (and
  287. later use) an image without it being altered. Generally used together
  288. with the "modules_disabled" sysctl.
  289. ==============================================================
  290. kptr_restrict:
  291. This toggle indicates whether restrictions are placed on
  292. exposing kernel addresses via /proc and other interfaces.
  293. When kptr_restrict is set to (0), the default, there are no restrictions.
  294. When kptr_restrict is set to (1), kernel pointers printed using the %pK
  295. format specifier will be replaced with 0's unless the user has CAP_SYSLOG
  296. and effective user and group ids are equal to the real ids. This is
  297. because %pK checks are done at read() time rather than open() time, so
  298. if permissions are elevated between the open() and the read() (e.g via
  299. a setuid binary) then %pK will not leak kernel pointers to unprivileged
  300. users. Note, this is a temporary solution only. The correct long-term
  301. solution is to do the permission checks at open() time. Consider removing
  302. world read permissions from files that use %pK, and using dmesg_restrict
  303. to protect against uses of %pK in dmesg(8) if leaking kernel pointer
  304. values to unprivileged users is a concern.
  305. When kptr_restrict is set to (2), kernel pointers printed using
  306. %pK will be replaced with 0's regardless of privileges.
  307. ==============================================================
  308. kstack_depth_to_print: (X86 only)
  309. Controls the number of words to print when dumping the raw
  310. kernel stack.
  311. ==============================================================
  312. l2cr: (PPC only)
  313. This flag controls the L2 cache of G3 processor boards. If
  314. 0, the cache is disabled. Enabled if nonzero.
  315. ==============================================================
  316. modules_disabled:
  317. A toggle value indicating if modules are allowed to be loaded
  318. in an otherwise modular kernel. This toggle defaults to off
  319. (0), but can be set true (1). Once true, modules can be
  320. neither loaded nor unloaded, and the toggle cannot be set back
  321. to false. Generally used with the "kexec_load_disabled" toggle.
  322. ==============================================================
  323. msg_next_id, sem_next_id, and shm_next_id:
  324. These three toggles allows to specify desired id for next allocated IPC
  325. object: message, semaphore or shared memory respectively.
  326. By default they are equal to -1, which means generic allocation logic.
  327. Possible values to set are in range {0..INT_MAX}.
  328. Notes:
  329. 1) kernel doesn't guarantee, that new object will have desired id. So,
  330. it's up to userspace, how to handle an object with "wrong" id.
  331. 2) Toggle with non-default value will be set back to -1 by kernel after
  332. successful IPC object allocation.
  333. ==============================================================
  334. nmi_watchdog:
  335. This parameter can be used to control the NMI watchdog
  336. (i.e. the hard lockup detector) on x86 systems.
  337. 0 - disable the hard lockup detector
  338. 1 - enable the hard lockup detector
  339. The hard lockup detector monitors each CPU for its ability to respond to
  340. timer interrupts. The mechanism utilizes CPU performance counter registers
  341. that are programmed to generate Non-Maskable Interrupts (NMIs) periodically
  342. while a CPU is busy. Hence, the alternative name 'NMI watchdog'.
  343. The NMI watchdog is disabled by default if the kernel is running as a guest
  344. in a KVM virtual machine. This default can be overridden by adding
  345. nmi_watchdog=1
  346. to the guest kernel command line (see Documentation/kernel-parameters.txt).
  347. ==============================================================
  348. numa_balancing
  349. Enables/disables automatic page fault based NUMA memory
  350. balancing. Memory is moved automatically to nodes
  351. that access it often.
  352. Enables/disables automatic NUMA memory balancing. On NUMA machines, there
  353. is a performance penalty if remote memory is accessed by a CPU. When this
  354. feature is enabled the kernel samples what task thread is accessing memory
  355. by periodically unmapping pages and later trapping a page fault. At the
  356. time of the page fault, it is determined if the data being accessed should
  357. be migrated to a local memory node.
  358. The unmapping of pages and trapping faults incur additional overhead that
  359. ideally is offset by improved memory locality but there is no universal
  360. guarantee. If the target workload is already bound to NUMA nodes then this
  361. feature should be disabled. Otherwise, if the system overhead from the
  362. feature is too high then the rate the kernel samples for NUMA hinting
  363. faults may be controlled by the numa_balancing_scan_period_min_ms,
  364. numa_balancing_scan_delay_ms, numa_balancing_scan_period_max_ms,
  365. numa_balancing_scan_size_mb, and numa_balancing_settle_count sysctls.
  366. ==============================================================
  367. numa_balancing_scan_period_min_ms, numa_balancing_scan_delay_ms,
  368. numa_balancing_scan_period_max_ms, numa_balancing_scan_size_mb
  369. Automatic NUMA balancing scans tasks address space and unmaps pages to
  370. detect if pages are properly placed or if the data should be migrated to a
  371. memory node local to where the task is running. Every "scan delay" the task
  372. scans the next "scan size" number of pages in its address space. When the
  373. end of the address space is reached the scanner restarts from the beginning.
  374. In combination, the "scan delay" and "scan size" determine the scan rate.
  375. When "scan delay" decreases, the scan rate increases. The scan delay and
  376. hence the scan rate of every task is adaptive and depends on historical
  377. behaviour. If pages are properly placed then the scan delay increases,
  378. otherwise the scan delay decreases. The "scan size" is not adaptive but
  379. the higher the "scan size", the higher the scan rate.
  380. Higher scan rates incur higher system overhead as page faults must be
  381. trapped and potentially data must be migrated. However, the higher the scan
  382. rate, the more quickly a tasks memory is migrated to a local node if the
  383. workload pattern changes and minimises performance impact due to remote
  384. memory accesses. These sysctls control the thresholds for scan delays and
  385. the number of pages scanned.
  386. numa_balancing_scan_period_min_ms is the minimum time in milliseconds to
  387. scan a tasks virtual memory. It effectively controls the maximum scanning
  388. rate for each task.
  389. numa_balancing_scan_delay_ms is the starting "scan delay" used for a task
  390. when it initially forks.
  391. numa_balancing_scan_period_max_ms is the maximum time in milliseconds to
  392. scan a tasks virtual memory. It effectively controls the minimum scanning
  393. rate for each task.
  394. numa_balancing_scan_size_mb is how many megabytes worth of pages are
  395. scanned for a given scan.
  396. ==============================================================
  397. osrelease, ostype & version:
  398. # cat osrelease
  399. 2.1.88
  400. # cat ostype
  401. Linux
  402. # cat version
  403. #5 Wed Feb 25 21:49:24 MET 1998
  404. The files osrelease and ostype should be clear enough. Version
  405. needs a little more clarification however. The '#5' means that
  406. this is the fifth kernel built from this source base and the
  407. date behind it indicates the time the kernel was built.
  408. The only way to tune these values is to rebuild the kernel :-)
  409. ==============================================================
  410. overflowgid & overflowuid:
  411. if your architecture did not always support 32-bit UIDs (i.e. arm,
  412. i386, m68k, sh, and sparc32), a fixed UID and GID will be returned to
  413. applications that use the old 16-bit UID/GID system calls, if the
  414. actual UID or GID would exceed 65535.
  415. These sysctls allow you to change the value of the fixed UID and GID.
  416. The default is 65534.
  417. ==============================================================
  418. panic:
  419. The value in this file represents the number of seconds the kernel
  420. waits before rebooting on a panic. When you use the software watchdog,
  421. the recommended setting is 60.
  422. ==============================================================
  423. panic_on_io_nmi:
  424. Controls the kernel's behavior when a CPU receives an NMI caused by
  425. an IO error.
  426. 0: try to continue operation (default)
  427. 1: panic immediately. The IO error triggered an NMI. This indicates a
  428. serious system condition which could result in IO data corruption.
  429. Rather than continuing, panicking might be a better choice. Some
  430. servers issue this sort of NMI when the dump button is pushed,
  431. and you can use this option to take a crash dump.
  432. ==============================================================
  433. panic_on_oops:
  434. Controls the kernel's behaviour when an oops or BUG is encountered.
  435. 0: try to continue operation
  436. 1: panic immediately. If the `panic' sysctl is also non-zero then the
  437. machine will be rebooted.
  438. ==============================================================
  439. panic_on_stackoverflow:
  440. Controls the kernel's behavior when detecting the overflows of
  441. kernel, IRQ and exception stacks except a user stack.
  442. This file shows up if CONFIG_DEBUG_STACKOVERFLOW is enabled.
  443. 0: try to continue operation.
  444. 1: panic immediately.
  445. ==============================================================
  446. panic_on_unrecovered_nmi:
  447. The default Linux behaviour on an NMI of either memory or unknown is
  448. to continue operation. For many environments such as scientific
  449. computing it is preferable that the box is taken out and the error
  450. dealt with than an uncorrected parity/ECC error get propagated.
  451. A small number of systems do generate NMI's for bizarre random reasons
  452. such as power management so the default is off. That sysctl works like
  453. the existing panic controls already in that directory.
  454. ==============================================================
  455. panic_on_warn:
  456. Calls panic() in the WARN() path when set to 1. This is useful to avoid
  457. a kernel rebuild when attempting to kdump at the location of a WARN().
  458. 0: only WARN(), default behaviour.
  459. 1: call panic() after printing out WARN() location.
  460. ==============================================================
  461. panic_on_rcu_stall:
  462. When set to 1, calls panic() after RCU stall detection messages. This
  463. is useful to define the root cause of RCU stalls using a vmcore.
  464. 0: do not panic() when RCU stall takes place, default behavior.
  465. 1: panic() after printing RCU stall messages.
  466. ==============================================================
  467. perf_cpu_time_max_percent:
  468. Hints to the kernel how much CPU time it should be allowed to
  469. use to handle perf sampling events. If the perf subsystem
  470. is informed that its samples are exceeding this limit, it
  471. will drop its sampling frequency to attempt to reduce its CPU
  472. usage.
  473. Some perf sampling happens in NMIs. If these samples
  474. unexpectedly take too long to execute, the NMIs can become
  475. stacked up next to each other so much that nothing else is
  476. allowed to execute.
  477. 0: disable the mechanism. Do not monitor or correct perf's
  478. sampling rate no matter how CPU time it takes.
  479. 1-100: attempt to throttle perf's sample rate to this
  480. percentage of CPU. Note: the kernel calculates an
  481. "expected" length of each sample event. 100 here means
  482. 100% of that expected length. Even if this is set to
  483. 100, you may still see sample throttling if this
  484. length is exceeded. Set to 0 if you truly do not care
  485. how much CPU is consumed.
  486. ==============================================================
  487. perf_event_paranoid:
  488. Controls use of the performance events system by unprivileged
  489. users (without CAP_SYS_ADMIN). The default value is 2.
  490. -1: Allow use of (almost) all events by all users
  491. >=0: Disallow raw tracepoint access by users without CAP_IOC_LOCK
  492. >=1: Disallow CPU event access by users without CAP_SYS_ADMIN
  493. >=2: Disallow kernel profiling by users without CAP_SYS_ADMIN
  494. ==============================================================
  495. perf_event_max_stack:
  496. Controls maximum number of stack frames to copy for (attr.sample_type &
  497. PERF_SAMPLE_CALLCHAIN) configured events, for instance, when using
  498. 'perf record -g' or 'perf trace --call-graph fp'.
  499. This can only be done when no events are in use that have callchains
  500. enabled, otherwise writing to this file will return -EBUSY.
  501. The default value is 127.
  502. ==============================================================
  503. perf_event_max_contexts_per_stack:
  504. Controls maximum number of stack frame context entries for
  505. (attr.sample_type & PERF_SAMPLE_CALLCHAIN) configured events, for
  506. instance, when using 'perf record -g' or 'perf trace --call-graph fp'.
  507. This can only be done when no events are in use that have callchains
  508. enabled, otherwise writing to this file will return -EBUSY.
  509. The default value is 8.
  510. ==============================================================
  511. pid_max:
  512. PID allocation wrap value. When the kernel's next PID value
  513. reaches this value, it wraps back to a minimum PID value.
  514. PIDs of value pid_max or larger are not allocated.
  515. ==============================================================
  516. ns_last_pid:
  517. The last pid allocated in the current (the one task using this sysctl
  518. lives in) pid namespace. When selecting a pid for a next task on fork
  519. kernel tries to allocate a number starting from this one.
  520. ==============================================================
  521. powersave-nap: (PPC only)
  522. If set, Linux-PPC will use the 'nap' mode of powersaving,
  523. otherwise the 'doze' mode will be used.
  524. ==============================================================
  525. printk:
  526. The four values in printk denote: console_loglevel,
  527. default_message_loglevel, minimum_console_loglevel and
  528. default_console_loglevel respectively.
  529. These values influence printk() behavior when printing or
  530. logging error messages. See 'man 2 syslog' for more info on
  531. the different loglevels.
  532. - console_loglevel: messages with a higher priority than
  533. this will be printed to the console
  534. - default_message_loglevel: messages without an explicit priority
  535. will be printed with this priority
  536. - minimum_console_loglevel: minimum (highest) value to which
  537. console_loglevel can be set
  538. - default_console_loglevel: default value for console_loglevel
  539. ==============================================================
  540. printk_delay:
  541. Delay each printk message in printk_delay milliseconds
  542. Value from 0 - 10000 is allowed.
  543. ==============================================================
  544. printk_ratelimit:
  545. Some warning messages are rate limited. printk_ratelimit specifies
  546. the minimum length of time between these messages (in jiffies), by
  547. default we allow one every 5 seconds.
  548. A value of 0 will disable rate limiting.
  549. ==============================================================
  550. printk_ratelimit_burst:
  551. While long term we enforce one message per printk_ratelimit
  552. seconds, we do allow a burst of messages to pass through.
  553. printk_ratelimit_burst specifies the number of messages we can
  554. send before ratelimiting kicks in.
  555. ==============================================================
  556. printk_devkmsg:
  557. Control the logging to /dev/kmsg from userspace:
  558. ratelimit: default, ratelimited
  559. on: unlimited logging to /dev/kmsg from userspace
  560. off: logging to /dev/kmsg disabled
  561. The kernel command line parameter printk.devkmsg= overrides this and is
  562. a one-time setting until next reboot: once set, it cannot be changed by
  563. this sysctl interface anymore.
  564. ==============================================================
  565. randomize_va_space:
  566. This option can be used to select the type of process address
  567. space randomization that is used in the system, for architectures
  568. that support this feature.
  569. 0 - Turn the process address space randomization off. This is the
  570. default for architectures that do not support this feature anyways,
  571. and kernels that are booted with the "norandmaps" parameter.
  572. 1 - Make the addresses of mmap base, stack and VDSO page randomized.
  573. This, among other things, implies that shared libraries will be
  574. loaded to random addresses. Also for PIE-linked binaries, the
  575. location of code start is randomized. This is the default if the
  576. CONFIG_COMPAT_BRK option is enabled.
  577. 2 - Additionally enable heap randomization. This is the default if
  578. CONFIG_COMPAT_BRK is disabled.
  579. There are a few legacy applications out there (such as some ancient
  580. versions of libc.so.5 from 1996) that assume that brk area starts
  581. just after the end of the code+bss. These applications break when
  582. start of the brk area is randomized. There are however no known
  583. non-legacy applications that would be broken this way, so for most
  584. systems it is safe to choose full randomization.
  585. Systems with ancient and/or broken binaries should be configured
  586. with CONFIG_COMPAT_BRK enabled, which excludes the heap from process
  587. address space randomization.
  588. ==============================================================
  589. reboot-cmd: (Sparc only)
  590. ??? This seems to be a way to give an argument to the Sparc
  591. ROM/Flash boot loader. Maybe to tell it what to do after
  592. rebooting. ???
  593. ==============================================================
  594. rtsig-max & rtsig-nr:
  595. The file rtsig-max can be used to tune the maximum number
  596. of POSIX realtime (queued) signals that can be outstanding
  597. in the system.
  598. rtsig-nr shows the number of RT signals currently queued.
  599. ==============================================================
  600. sched_schedstats:
  601. Enables/disables scheduler statistics. Enabling this feature
  602. incurs a small amount of overhead in the scheduler but is
  603. useful for debugging and performance tuning.
  604. ==============================================================
  605. sg-big-buff:
  606. This file shows the size of the generic SCSI (sg) buffer.
  607. You can't tune it just yet, but you could change it on
  608. compile time by editing include/scsi/sg.h and changing
  609. the value of SG_BIG_BUFF.
  610. There shouldn't be any reason to change this value. If
  611. you can come up with one, you probably know what you
  612. are doing anyway :)
  613. ==============================================================
  614. shmall:
  615. This parameter sets the total amount of shared memory pages that
  616. can be used system wide. Hence, SHMALL should always be at least
  617. ceil(shmmax/PAGE_SIZE).
  618. If you are not sure what the default PAGE_SIZE is on your Linux
  619. system, you can run the following command:
  620. # getconf PAGE_SIZE
  621. ==============================================================
  622. shmmax:
  623. This value can be used to query and set the run time limit
  624. on the maximum shared memory segment size that can be created.
  625. Shared memory segments up to 1Gb are now supported in the
  626. kernel. This value defaults to SHMMAX.
  627. ==============================================================
  628. shm_rmid_forced:
  629. Linux lets you set resource limits, including how much memory one
  630. process can consume, via setrlimit(2). Unfortunately, shared memory
  631. segments are allowed to exist without association with any process, and
  632. thus might not be counted against any resource limits. If enabled,
  633. shared memory segments are automatically destroyed when their attach
  634. count becomes zero after a detach or a process termination. It will
  635. also destroy segments that were created, but never attached to, on exit
  636. from the process. The only use left for IPC_RMID is to immediately
  637. destroy an unattached segment. Of course, this breaks the way things are
  638. defined, so some applications might stop working. Note that this
  639. feature will do you no good unless you also configure your resource
  640. limits (in particular, RLIMIT_AS and RLIMIT_NPROC). Most systems don't
  641. need this.
  642. Note that if you change this from 0 to 1, already created segments
  643. without users and with a dead originative process will be destroyed.
  644. ==============================================================
  645. sysctl_writes_strict:
  646. Control how file position affects the behavior of updating sysctl values
  647. via the /proc/sys interface:
  648. -1 - Legacy per-write sysctl value handling, with no printk warnings.
  649. Each write syscall must fully contain the sysctl value to be
  650. written, and multiple writes on the same sysctl file descriptor
  651. will rewrite the sysctl value, regardless of file position.
  652. 0 - Same behavior as above, but warn about processes that perform writes
  653. to a sysctl file descriptor when the file position is not 0.
  654. 1 - (default) Respect file position when writing sysctl strings. Multiple
  655. writes will append to the sysctl value buffer. Anything past the max
  656. length of the sysctl value buffer will be ignored. Writes to numeric
  657. sysctl entries must always be at file position 0 and the value must
  658. be fully contained in the buffer sent in the write syscall.
  659. ==============================================================
  660. softlockup_all_cpu_backtrace:
  661. This value controls the soft lockup detector thread's behavior
  662. when a soft lockup condition is detected as to whether or not
  663. to gather further debug information. If enabled, each cpu will
  664. be issued an NMI and instructed to capture stack trace.
  665. This feature is only applicable for architectures which support
  666. NMI.
  667. 0: do nothing. This is the default behavior.
  668. 1: on detection capture more debug information.
  669. ==============================================================
  670. soft_watchdog
  671. This parameter can be used to control the soft lockup detector.
  672. 0 - disable the soft lockup detector
  673. 1 - enable the soft lockup detector
  674. The soft lockup detector monitors CPUs for threads that are hogging the CPUs
  675. without rescheduling voluntarily, and thus prevent the 'watchdog/N' threads
  676. from running. The mechanism depends on the CPUs ability to respond to timer
  677. interrupts which are needed for the 'watchdog/N' threads to be woken up by
  678. the watchdog timer function, otherwise the NMI watchdog - if enabled - can
  679. detect a hard lockup condition.
  680. ==============================================================
  681. tainted:
  682. Non-zero if the kernel has been tainted. Numeric values, which
  683. can be ORed together:
  684. 1 - A module with a non-GPL license has been loaded, this
  685. includes modules with no license.
  686. Set by modutils >= 2.4.9 and module-init-tools.
  687. 2 - A module was force loaded by insmod -f.
  688. Set by modutils >= 2.4.9 and module-init-tools.
  689. 4 - Unsafe SMP processors: SMP with CPUs not designed for SMP.
  690. 8 - A module was forcibly unloaded from the system by rmmod -f.
  691. 16 - A hardware machine check error occurred on the system.
  692. 32 - A bad page was discovered on the system.
  693. 64 - The user has asked that the system be marked "tainted". This
  694. could be because they are running software that directly modifies
  695. the hardware, or for other reasons.
  696. 128 - The system has died.
  697. 256 - The ACPI DSDT has been overridden with one supplied by the user
  698. instead of using the one provided by the hardware.
  699. 512 - A kernel warning has occurred.
  700. 1024 - A module from drivers/staging was loaded.
  701. 2048 - The system is working around a severe firmware bug.
  702. 4096 - An out-of-tree module has been loaded.
  703. 8192 - An unsigned module has been loaded in a kernel supporting module
  704. signature.
  705. 16384 - A soft lockup has previously occurred on the system.
  706. 32768 - The kernel has been live patched.
  707. ==============================================================
  708. threads-max
  709. This value controls the maximum number of threads that can be created
  710. using fork().
  711. During initialization the kernel sets this value such that even if the
  712. maximum number of threads is created, the thread structures occupy only
  713. a part (1/8th) of the available RAM pages.
  714. The minimum value that can be written to threads-max is 20.
  715. The maximum value that can be written to threads-max is given by the
  716. constant FUTEX_TID_MASK (0x3fffffff).
  717. If a value outside of this range is written to threads-max an error
  718. EINVAL occurs.
  719. The value written is checked against the available RAM pages. If the
  720. thread structures would occupy too much (more than 1/8th) of the
  721. available RAM pages threads-max is reduced accordingly.
  722. ==============================================================
  723. unknown_nmi_panic:
  724. The value in this file affects behavior of handling NMI. When the
  725. value is non-zero, unknown NMI is trapped and then panic occurs. At
  726. that time, kernel debugging information is displayed on console.
  727. NMI switch that most IA32 servers have fires unknown NMI up, for
  728. example. If a system hangs up, try pressing the NMI switch.
  729. ==============================================================
  730. watchdog:
  731. This parameter can be used to disable or enable the soft lockup detector
  732. _and_ the NMI watchdog (i.e. the hard lockup detector) at the same time.
  733. 0 - disable both lockup detectors
  734. 1 - enable both lockup detectors
  735. The soft lockup detector and the NMI watchdog can also be disabled or
  736. enabled individually, using the soft_watchdog and nmi_watchdog parameters.
  737. If the watchdog parameter is read, for example by executing
  738. cat /proc/sys/kernel/watchdog
  739. the output of this command (0 or 1) shows the logical OR of soft_watchdog
  740. and nmi_watchdog.
  741. ==============================================================
  742. watchdog_cpumask:
  743. This value can be used to control on which cpus the watchdog may run.
  744. The default cpumask is all possible cores, but if NO_HZ_FULL is
  745. enabled in the kernel config, and cores are specified with the
  746. nohz_full= boot argument, those cores are excluded by default.
  747. Offline cores can be included in this mask, and if the core is later
  748. brought online, the watchdog will be started based on the mask value.
  749. Typically this value would only be touched in the nohz_full case
  750. to re-enable cores that by default were not running the watchdog,
  751. if a kernel lockup was suspected on those cores.
  752. The argument value is the standard cpulist format for cpumasks,
  753. so for example to enable the watchdog on cores 0, 2, 3, and 4 you
  754. might say:
  755. echo 0,2-4 > /proc/sys/kernel/watchdog_cpumask
  756. ==============================================================
  757. watchdog_thresh:
  758. This value can be used to control the frequency of hrtimer and NMI
  759. events and the soft and hard lockup thresholds. The default threshold
  760. is 10 seconds.
  761. The softlockup threshold is (2 * watchdog_thresh). Setting this
  762. tunable to zero will disable lockup detection altogether.
  763. ==============================================================