kernel.rst 39 KB

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