xref: /openbmc/linux/Documentation/admin-guide/sysctl/kernel.rst (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
157043247SMauro Carvalho Chehab===================================
257043247SMauro Carvalho ChehabDocumentation for /proc/sys/kernel/
357043247SMauro Carvalho Chehab===================================
457043247SMauro Carvalho Chehab
5021622dfSStephen Kitt.. See scripts/check-sysctl-docs to keep this up to date
6021622dfSStephen Kitt
7021622dfSStephen Kitt
857043247SMauro Carvalho ChehabCopyright (c) 1998, 1999,  Rik van Riel <riel@nl.linux.org>
957043247SMauro Carvalho Chehab
1057043247SMauro Carvalho ChehabCopyright (c) 2009,        Shen Feng<shen@cn.fujitsu.com>
1157043247SMauro Carvalho Chehab
122793e19dSMauro Carvalho ChehabFor general info and legal blurb, please look in
132793e19dSMauro Carvalho ChehabDocumentation/admin-guide/sysctl/index.rst.
1457043247SMauro Carvalho Chehab
1557043247SMauro Carvalho Chehab------------------------------------------------------------------------------
1657043247SMauro Carvalho Chehab
1757043247SMauro Carvalho ChehabThis file contains documentation for the sysctl files in
18d151a23dSStephen Kitt``/proc/sys/kernel/``.
1957043247SMauro Carvalho Chehab
2057043247SMauro Carvalho ChehabThe files in this directory can be used to tune and monitor
2157043247SMauro Carvalho Chehabmiscellaneous and general things in the operation of the Linux
22a3cb66a5SStephen Kittkernel. Since some of the files *can* be used to screw up your
2357043247SMauro Carvalho Chehabsystem, it is advisable to read both documentation and source
2457043247SMauro Carvalho Chehabbefore actually making adjustments.
2557043247SMauro Carvalho Chehab
2657043247SMauro Carvalho ChehabCurrently, these files might (depending on your configuration)
27a3cb66a5SStephen Kittshow up in ``/proc/sys/kernel``:
2857043247SMauro Carvalho Chehab
29a3cb66a5SStephen Kitt.. contents:: :local:
3057043247SMauro Carvalho Chehab
3157043247SMauro Carvalho Chehab
32a3cb66a5SStephen Kittacct
33a3cb66a5SStephen Kitt====
34a3cb66a5SStephen Kitt
35a3cb66a5SStephen Kitt::
3657043247SMauro Carvalho Chehab
3757043247SMauro Carvalho Chehab    highwater lowwater frequency
3857043247SMauro Carvalho Chehab
3957043247SMauro Carvalho ChehabIf BSD-style process accounting is enabled these values control
4057043247SMauro Carvalho Chehabits behaviour. If free space on filesystem where the log lives
4130fb8761SStephen Kittgoes below ``lowwater``\ % accounting suspends. If free space gets
4230fb8761SStephen Kittabove ``highwater``\ % accounting resumes. ``frequency`` determines
4357043247SMauro Carvalho Chehabhow often do we check the amount of free space (value is in
4457043247SMauro Carvalho Chehabseconds). Default:
45a3cb66a5SStephen Kitt
46a3cb66a5SStephen Kitt::
47a3cb66a5SStephen Kitt
4857043247SMauro Carvalho Chehab    4 2 30
49a3cb66a5SStephen Kitt
50a3cb66a5SStephen KittThat is, suspend accounting if free space drops below 2%; resume it
51a3cb66a5SStephen Kittif it increases to at least 4%; consider information about amount of
52a3cb66a5SStephen Kittfree space valid for 30 seconds.
5357043247SMauro Carvalho Chehab
5457043247SMauro Carvalho Chehab
55a3cb66a5SStephen Kittacpi_video_flags
56a3cb66a5SStephen Kitt================
5757043247SMauro Carvalho Chehab
582793e19dSMauro Carvalho ChehabSee Documentation/power/video.rst. This allows the video resume mode to be set,
592bd49cb5SStephen Kittin a similar fashion to the ``acpi_sleep`` kernel parameter, by
602bd49cb5SStephen Kittcombining the following values:
612bd49cb5SStephen Kitt
622bd49cb5SStephen Kitt= =======
632bd49cb5SStephen Kitt1 s3_bios
642bd49cb5SStephen Kitt2 s3_mode
652bd49cb5SStephen Kitt4 s3_beep
662bd49cb5SStephen Kitt= =======
6757043247SMauro Carvalho Chehab
68bfca3dd3SPetr Vorelarch
69bfca3dd3SPetr Vorel====
70bfca3dd3SPetr Vorel
71bfca3dd3SPetr VorelThe machine hardware name, the same output as ``uname -m``
72bfca3dd3SPetr Vorel(e.g. ``x86_64`` or ``aarch64``).
7357043247SMauro Carvalho Chehab
74a3cb66a5SStephen Kittauto_msgmni
75a3cb66a5SStephen Kitt===========
7657043247SMauro Carvalho Chehab
7757043247SMauro Carvalho ChehabThis variable has no effect and may be removed in future kernel
7857043247SMauro Carvalho Chehabreleases. Reading it always returns 0.
79a3cb66a5SStephen KittUp to Linux 3.17, it enabled/disabled automatic recomputing of
80a3cb66a5SStephen Kitt`msgmni`_
81a3cb66a5SStephen Kittupon memory add/remove or upon IPC namespace creation/removal.
8257043247SMauro Carvalho ChehabEchoing "1" into this file enabled msgmni automatic recomputing.
83a3cb66a5SStephen KittEchoing "0" turned it off. The default value was 1.
8457043247SMauro Carvalho Chehab
8557043247SMauro Carvalho Chehab
86a3cb66a5SStephen Kittbootloader_type (x86 only)
87a3cb66a5SStephen Kitt==========================
8857043247SMauro Carvalho Chehab
8957043247SMauro Carvalho ChehabThis gives the bootloader type number as indicated by the bootloader,
9057043247SMauro Carvalho Chehabshifted left by 4, and OR'd with the low four bits of the bootloader
9157043247SMauro Carvalho Chehabversion.  The reason for this encoding is that this used to match the
92a3cb66a5SStephen Kitt``type_of_loader`` field in the kernel header; the encoding is kept for
9357043247SMauro Carvalho Chehabbackwards compatibility.  That is, if the full bootloader type number
9457043247SMauro Carvalho Chehabis 0x15 and the full version number is 0x234, this file will contain
9557043247SMauro Carvalho Chehabthe value 340 = 0x154.
9657043247SMauro Carvalho Chehab
97a3cb66a5SStephen KittSee the ``type_of_loader`` and ``ext_loader_type`` fields in
98ff61f079SJonathan CorbetDocumentation/arch/x86/boot.rst for additional information.
9957043247SMauro Carvalho Chehab
10057043247SMauro Carvalho Chehab
101a3cb66a5SStephen Kittbootloader_version (x86 only)
102a3cb66a5SStephen Kitt=============================
10357043247SMauro Carvalho Chehab
10457043247SMauro Carvalho ChehabThe complete bootloader version number.  In the example above, this
10557043247SMauro Carvalho Chehabfile will contain the value 564 = 0x234.
10657043247SMauro Carvalho Chehab
107a3cb66a5SStephen KittSee the ``type_of_loader`` and ``ext_loader_ver`` fields in
108ff61f079SJonathan CorbetDocumentation/arch/x86/boot.rst for additional information.
10957043247SMauro Carvalho Chehab
11057043247SMauro Carvalho Chehab
1115d8e5aeeSStephen Kittbpf_stats_enabled
1125d8e5aeeSStephen Kitt=================
1135d8e5aeeSStephen Kitt
1145d8e5aeeSStephen KittControls whether the kernel should collect statistics on BPF programs
1155d8e5aeeSStephen Kitt(total time spent running, number of times run...). Enabling
1165d8e5aeeSStephen Kittstatistics causes a slight reduction in performance on each program
1175d8e5aeeSStephen Kittrun. The statistics can be seen using ``bpftool``.
1185d8e5aeeSStephen Kitt
1195d8e5aeeSStephen Kitt= ===================================
1205d8e5aeeSStephen Kitt0 Don't collect statistics (default).
1215d8e5aeeSStephen Kitt1 Collect statistics.
1225d8e5aeeSStephen Kitt= ===================================
1235d8e5aeeSStephen Kitt
1245d8e5aeeSStephen Kitt
1256bc47621SStephen Kittcad_pid
1266bc47621SStephen Kitt=======
1276bc47621SStephen Kitt
1286bc47621SStephen KittThis is the pid which will be signalled on reboot (notably, by
1296bc47621SStephen KittCtrl-Alt-Delete). Writing a value to this file which doesn't
1306bc47621SStephen Kittcorrespond to a running process will result in ``-ESRCH``.
1316bc47621SStephen Kitt
1326bc47621SStephen KittSee also `ctrl-alt-del`_.
1336bc47621SStephen Kitt
1346bc47621SStephen Kitt
135a3cb66a5SStephen Kittcap_last_cap
136a3cb66a5SStephen Kitt============
13757043247SMauro Carvalho Chehab
13857043247SMauro Carvalho ChehabHighest valid capability of the running kernel.  Exports
139a3cb66a5SStephen Kitt``CAP_LAST_CAP`` from the kernel.
14057043247SMauro Carvalho Chehab
14157043247SMauro Carvalho Chehab
142aadc0cd5SStephen Kitt.. _core_pattern:
143aadc0cd5SStephen Kitt
144a3cb66a5SStephen Kittcore_pattern
145a3cb66a5SStephen Kitt============
14657043247SMauro Carvalho Chehab
147a3cb66a5SStephen Kitt``core_pattern`` is used to specify a core dumpfile pattern name.
14857043247SMauro Carvalho Chehab
14957043247SMauro Carvalho Chehab* max length 127 characters; default value is "core"
150a3cb66a5SStephen Kitt* ``core_pattern`` is used as a pattern template for the output
151a3cb66a5SStephen Kitt  filename; certain string patterns (beginning with '%') are
152a3cb66a5SStephen Kitt  substituted with their actual values.
153a3cb66a5SStephen Kitt* backward compatibility with ``core_uses_pid``:
15457043247SMauro Carvalho Chehab
155a3cb66a5SStephen Kitt	If ``core_pattern`` does not include "%p" (default does not)
156a3cb66a5SStephen Kitt	and ``core_uses_pid`` is set, then .PID will be appended to
15757043247SMauro Carvalho Chehab	the filename.
15857043247SMauro Carvalho Chehab
159a3cb66a5SStephen Kitt* corename format specifiers
16057043247SMauro Carvalho Chehab
161a3cb66a5SStephen Kitt	========	==========================================
16257043247SMauro Carvalho Chehab	%<NUL>		'%' is dropped
16357043247SMauro Carvalho Chehab	%%		output one '%'
16457043247SMauro Carvalho Chehab	%p		pid
16557043247SMauro Carvalho Chehab	%P		global pid (init PID namespace)
16657043247SMauro Carvalho Chehab	%i		tid
16757043247SMauro Carvalho Chehab	%I		global tid (init PID namespace)
16857043247SMauro Carvalho Chehab	%u		uid (in initial user namespace)
16957043247SMauro Carvalho Chehab	%g		gid (in initial user namespace)
170a3cb66a5SStephen Kitt	%d		dump mode, matches ``PR_SET_DUMPABLE`` and
171a3cb66a5SStephen Kitt			``/proc/sys/fs/suid_dumpable``
17257043247SMauro Carvalho Chehab	%s		signal number
17357043247SMauro Carvalho Chehab	%t		UNIX time of dump
17457043247SMauro Carvalho Chehab	%h		hostname
175f38c85f1SLepton Wu	%e		executable filename (may be shortened, could be changed by prctl etc)
176f38c85f1SLepton Wu	%f      	executable filename
17757043247SMauro Carvalho Chehab	%E		executable path
178895f2c20Sd.hatayama@fujitsu.com	%c		maximum size of core file by resource limit RLIMIT_CORE
1798603b6f5SOleksandr Natalenko	%C		CPU the task ran on
18057043247SMauro Carvalho Chehab	%<OTHER>	both are dropped
181a3cb66a5SStephen Kitt	========	==========================================
18257043247SMauro Carvalho Chehab
18357043247SMauro Carvalho Chehab* If the first character of the pattern is a '|', the kernel will treat
18457043247SMauro Carvalho Chehab  the rest of the pattern as a command to run.  The core dump will be
18557043247SMauro Carvalho Chehab  written to the standard input of that program instead of to a file.
18657043247SMauro Carvalho Chehab
18757043247SMauro Carvalho Chehab
188a3cb66a5SStephen Kittcore_pipe_limit
189a3cb66a5SStephen Kitt===============
19057043247SMauro Carvalho Chehab
191a3cb66a5SStephen KittThis sysctl is only applicable when `core_pattern`_ is configured to
192a3cb66a5SStephen Kittpipe core files to a user space helper (when the first character of
193a3cb66a5SStephen Kitt``core_pattern`` is a '|', see above).
194a3cb66a5SStephen KittWhen collecting cores via a pipe to an application, it is occasionally
195a3cb66a5SStephen Kittuseful for the collecting application to gather data about the
196a3cb66a5SStephen Kittcrashing process from its ``/proc/pid`` directory.
197a3cb66a5SStephen KittIn order to do this safely, the kernel must wait for the collecting
198a3cb66a5SStephen Kittprocess to exit, so as not to remove the crashing processes proc files
199a3cb66a5SStephen Kittprematurely.
200a3cb66a5SStephen KittThis in turn creates the possibility that a misbehaving userspace
201a3cb66a5SStephen Kittcollecting process can block the reaping of a crashed process simply
202a3cb66a5SStephen Kittby never exiting.
203a3cb66a5SStephen KittThis sysctl defends against that.
204a3cb66a5SStephen KittIt defines how many concurrent crashing processes may be piped to user
205a3cb66a5SStephen Kittspace applications in parallel.
206a3cb66a5SStephen KittIf this value is exceeded, then those crashing processes above that
207a3cb66a5SStephen Kittvalue are noted via the kernel log and their cores are skipped.
208a3cb66a5SStephen Kitt0 is a special value, indicating that unlimited processes may be
209a3cb66a5SStephen Kittcaptured in parallel, but that no waiting will take place (i.e. the
210a3cb66a5SStephen Kittcollecting process is not guaranteed access to ``/proc/<crashing
211a3cb66a5SStephen Kittpid>/``).
212a3cb66a5SStephen KittThis value defaults to 0.
21357043247SMauro Carvalho Chehab
21457043247SMauro Carvalho Chehab
215a3cb66a5SStephen Kittcore_uses_pid
216a3cb66a5SStephen Kitt=============
21757043247SMauro Carvalho Chehab
21857043247SMauro Carvalho ChehabThe default coredump filename is "core".  By setting
219a3cb66a5SStephen Kitt``core_uses_pid`` to 1, the coredump filename becomes core.PID.
220a3cb66a5SStephen KittIf `core_pattern`_ does not include "%p" (default does not)
221a3cb66a5SStephen Kittand ``core_uses_pid`` is set, then .PID will be appended to
22257043247SMauro Carvalho Chehabthe filename.
22357043247SMauro Carvalho Chehab
22457043247SMauro Carvalho Chehab
225a3cb66a5SStephen Kittctrl-alt-del
226a3cb66a5SStephen Kitt============
22757043247SMauro Carvalho Chehab
22857043247SMauro Carvalho ChehabWhen the value in this file is 0, ctrl-alt-del is trapped and
229a3cb66a5SStephen Kittsent to the ``init(1)`` program to handle a graceful restart.
23057043247SMauro Carvalho ChehabWhen, however, the value is > 0, Linux's reaction to a Vulcan
23157043247SMauro Carvalho ChehabNerve Pinch (tm) will be an immediate reboot, without even
23257043247SMauro Carvalho Chehabsyncing its dirty buffers.
23357043247SMauro Carvalho Chehab
23457043247SMauro Carvalho ChehabNote:
23557043247SMauro Carvalho Chehab  when a program (like dosemu) has the keyboard in 'raw'
23657043247SMauro Carvalho Chehab  mode, the ctrl-alt-del is intercepted by the program before it
23757043247SMauro Carvalho Chehab  ever reaches the kernel tty layer, and it's up to the program
23857043247SMauro Carvalho Chehab  to decide what to do with it.
23957043247SMauro Carvalho Chehab
24057043247SMauro Carvalho Chehab
241a3cb66a5SStephen Kittdmesg_restrict
242a3cb66a5SStephen Kitt==============
24357043247SMauro Carvalho Chehab
24457043247SMauro Carvalho ChehabThis toggle indicates whether unprivileged users are prevented
245a3cb66a5SStephen Kittfrom using ``dmesg(8)`` to view messages from the kernel's log
246a3cb66a5SStephen Kittbuffer.
247a3cb66a5SStephen KittWhen ``dmesg_restrict`` is set to 0 there are no restrictions.
248ee74db08SRandy DunlapWhen ``dmesg_restrict`` is set to 1, users must have
249a3cb66a5SStephen Kitt``CAP_SYSLOG`` to use ``dmesg(8)``.
25057043247SMauro Carvalho Chehab
251a3cb66a5SStephen KittThe kernel config option ``CONFIG_SECURITY_DMESG_RESTRICT`` sets the
252a3cb66a5SStephen Kittdefault value of ``dmesg_restrict``.
25357043247SMauro Carvalho Chehab
25457043247SMauro Carvalho Chehab
255a3cb66a5SStephen Kittdomainname & hostname
256a3cb66a5SStephen Kitt=====================
25757043247SMauro Carvalho Chehab
25857043247SMauro Carvalho ChehabThese files can be used to set the NIS/YP domainname and the
25957043247SMauro Carvalho Chehabhostname of your box in exactly the same way as the commands
26057043247SMauro Carvalho Chehabdomainname and hostname, i.e.::
26157043247SMauro Carvalho Chehab
26257043247SMauro Carvalho Chehab	# echo "darkstar" > /proc/sys/kernel/hostname
26357043247SMauro Carvalho Chehab	# echo "mydomain" > /proc/sys/kernel/domainname
26457043247SMauro Carvalho Chehab
26557043247SMauro Carvalho Chehabhas the same effect as::
26657043247SMauro Carvalho Chehab
26757043247SMauro Carvalho Chehab	# hostname "darkstar"
26857043247SMauro Carvalho Chehab	# domainname "mydomain"
26957043247SMauro Carvalho Chehab
27057043247SMauro Carvalho ChehabNote, however, that the classic darkstar.frop.org has the
27157043247SMauro Carvalho Chehabhostname "darkstar" and DNS (Internet Domain Name Server)
27257043247SMauro Carvalho Chehabdomainname "frop.org", not to be confused with the NIS (Network
27357043247SMauro Carvalho ChehabInformation Service) or YP (Yellow Pages) domainname. These two
27457043247SMauro Carvalho Chehabdomain names are in general different. For a detailed discussion
275a3cb66a5SStephen Kittsee the ``hostname(1)`` man page.
27657043247SMauro Carvalho Chehab
27757043247SMauro Carvalho Chehab
278d75829c1SStephen Kittfirmware_config
279d75829c1SStephen Kitt===============
280d75829c1SStephen Kitt
2812793e19dSMauro Carvalho ChehabSee Documentation/driver-api/firmware/fallback-mechanisms.rst.
282d75829c1SStephen Kitt
283d75829c1SStephen KittThe entries in this directory allow the firmware loader helper
284d75829c1SStephen Kittfallback to be controlled:
285d75829c1SStephen Kitt
286d75829c1SStephen Kitt* ``force_sysfs_fallback``, when set to 1, forces the use of the
287d75829c1SStephen Kitt  fallback;
288d75829c1SStephen Kitt* ``ignore_sysfs_fallback``, when set to 1, ignores any fallback.
289d75829c1SStephen Kitt
290d75829c1SStephen Kitt
29150cdae76SStephen Kittftrace_dump_on_oops
29250cdae76SStephen Kitt===================
29350cdae76SStephen Kitt
29450cdae76SStephen KittDetermines whether ``ftrace_dump()`` should be called on an oops (or
29550cdae76SStephen Kittkernel panic). This will output the contents of the ftrace buffers to
29650cdae76SStephen Kittthe console.  This is very useful for capturing traces that lead to
29750cdae76SStephen Kittcrashes and outputting them to a serial console.
29850cdae76SStephen Kitt
29950cdae76SStephen Kitt= ===================================================
30050cdae76SStephen Kitt0 Disabled (default).
30150cdae76SStephen Kitt1 Dump buffers of all CPUs.
30250cdae76SStephen Kitt2 Dump the buffer of the CPU that triggered the oops.
30350cdae76SStephen Kitt= ===================================================
30450cdae76SStephen Kitt
30550cdae76SStephen Kitt
30650cdae76SStephen Kittftrace_enabled, stack_tracer_enabled
30750cdae76SStephen Kitt====================================
30850cdae76SStephen Kitt
3092793e19dSMauro Carvalho ChehabSee Documentation/trace/ftrace.rst.
31050cdae76SStephen Kitt
31150cdae76SStephen Kitt
312a3cb66a5SStephen Kitthardlockup_all_cpu_backtrace
313a3cb66a5SStephen Kitt============================
31457043247SMauro Carvalho Chehab
31557043247SMauro Carvalho ChehabThis value controls the hard lockup detector behavior when a hard
31657043247SMauro Carvalho Chehablockup condition is detected as to whether or not to gather further
31757043247SMauro Carvalho Chehabdebug information. If enabled, arch-specific all-CPU stack dumping
31857043247SMauro Carvalho Chehabwill be initiated.
31957043247SMauro Carvalho Chehab
320a3cb66a5SStephen Kitt= ============================================
321a3cb66a5SStephen Kitt0 Do nothing. This is the default behavior.
322a3cb66a5SStephen Kitt1 On detection capture more debug information.
323a3cb66a5SStephen Kitt= ============================================
32457043247SMauro Carvalho Chehab
32557043247SMauro Carvalho Chehab
326a3cb66a5SStephen Kitthardlockup_panic
327a3cb66a5SStephen Kitt================
32857043247SMauro Carvalho Chehab
32957043247SMauro Carvalho ChehabThis parameter can be used to control whether the kernel panics
33057043247SMauro Carvalho Chehabwhen a hard lockup is detected.
33157043247SMauro Carvalho Chehab
332a3cb66a5SStephen Kitt= ===========================
333a3cb66a5SStephen Kitt0 Don't panic on hard lockup.
334a3cb66a5SStephen Kitt1 Panic on hard lockup.
335a3cb66a5SStephen Kitt= ===========================
33657043247SMauro Carvalho Chehab
3372793e19dSMauro Carvalho ChehabSee Documentation/admin-guide/lockup-watchdogs.rst for more information.
338a3cb66a5SStephen KittThis can also be set using the nmi_watchdog kernel parameter.
33957043247SMauro Carvalho Chehab
34057043247SMauro Carvalho Chehab
341a3cb66a5SStephen Kitthotplug
342a3cb66a5SStephen Kitt=======
34357043247SMauro Carvalho Chehab
34457043247SMauro Carvalho ChehabPath for the hotplug policy agent.
3451e886090SRasmus VillemoesDefault value is ``CONFIG_UEVENT_HELPER_PATH``, which in turn defaults
3461e886090SRasmus Villemoesto the empty string.
3471e886090SRasmus Villemoes
3481e886090SRasmus VillemoesThis file only exists when ``CONFIG_UEVENT_HELPER`` is enabled. Most
3491e886090SRasmus Villemoesmodern systems rely exclusively on the netlink-based uevent source and
3501e886090SRasmus Villemoesdon't need this.
35157043247SMauro Carvalho Chehab
35257043247SMauro Carvalho Chehab
353e996919bSRandy Dunlaphung_task_all_cpu_backtrace
354e996919bSRandy Dunlap===========================
3550ec9dc9bSGuilherme G. Piccoli
3560ec9dc9bSGuilherme G. PiccoliIf this option is set, the kernel will send an NMI to all CPUs to dump
3570ec9dc9bSGuilherme G. Piccolitheir backtraces when a hung task is detected. This file shows up if
3580ec9dc9bSGuilherme G. PiccoliCONFIG_DETECT_HUNG_TASK and CONFIG_SMP are enabled.
3590ec9dc9bSGuilherme G. Piccoli
3600ec9dc9bSGuilherme G. Piccoli0: Won't show all CPUs backtraces when a hung task is detected.
3610ec9dc9bSGuilherme G. PiccoliThis is the default behavior.
3620ec9dc9bSGuilherme G. Piccoli
3630ec9dc9bSGuilherme G. Piccoli1: Will non-maskably interrupt all CPUs and dump their backtraces when
3640ec9dc9bSGuilherme G. Piccolia hung task is detected.
3650ec9dc9bSGuilherme G. Piccoli
3660ec9dc9bSGuilherme G. Piccoli
367a3cb66a5SStephen Kitthung_task_panic
368a3cb66a5SStephen Kitt===============
36957043247SMauro Carvalho Chehab
37057043247SMauro Carvalho ChehabControls the kernel's behavior when a hung task is detected.
371a3cb66a5SStephen KittThis file shows up if ``CONFIG_DETECT_HUNG_TASK`` is enabled.
37257043247SMauro Carvalho Chehab
373a3cb66a5SStephen Kitt= =================================================
374a3cb66a5SStephen Kitt0 Continue operation. This is the default behavior.
375a3cb66a5SStephen Kitt1 Panic immediately.
376a3cb66a5SStephen Kitt= =================================================
37757043247SMauro Carvalho Chehab
37857043247SMauro Carvalho Chehab
379a3cb66a5SStephen Kitthung_task_check_count
380a3cb66a5SStephen Kitt=====================
38157043247SMauro Carvalho Chehab
38257043247SMauro Carvalho ChehabThe upper bound on the number of tasks that are checked.
383a3cb66a5SStephen KittThis file shows up if ``CONFIG_DETECT_HUNG_TASK`` is enabled.
38457043247SMauro Carvalho Chehab
38557043247SMauro Carvalho Chehab
386a3cb66a5SStephen Kitthung_task_timeout_secs
387a3cb66a5SStephen Kitt======================
38857043247SMauro Carvalho Chehab
38957043247SMauro Carvalho ChehabWhen a task in D state did not get scheduled
39057043247SMauro Carvalho Chehabfor more than this value report a warning.
391a3cb66a5SStephen KittThis file shows up if ``CONFIG_DETECT_HUNG_TASK`` is enabled.
39257043247SMauro Carvalho Chehab
393a3cb66a5SStephen Kitt0 means infinite timeout, no checking is done.
39457043247SMauro Carvalho Chehab
395a3cb66a5SStephen KittPossible values to set are in range {0:``LONG_MAX``/``HZ``}.
39657043247SMauro Carvalho Chehab
39757043247SMauro Carvalho Chehab
398a3cb66a5SStephen Kitthung_task_check_interval_secs
399a3cb66a5SStephen Kitt=============================
40057043247SMauro Carvalho Chehab
40157043247SMauro Carvalho ChehabHung task check interval. If hung task checking is enabled
402a3cb66a5SStephen Kitt(see `hung_task_timeout_secs`_), the check is done every
403a3cb66a5SStephen Kitt``hung_task_check_interval_secs`` seconds.
404a3cb66a5SStephen KittThis file shows up if ``CONFIG_DETECT_HUNG_TASK`` is enabled.
40557043247SMauro Carvalho Chehab
406a3cb66a5SStephen Kitt0 (default) means use ``hung_task_timeout_secs`` as checking
407a3cb66a5SStephen Kittinterval.
408a3cb66a5SStephen Kitt
409a3cb66a5SStephen KittPossible values to set are in range {0:``LONG_MAX``/``HZ``}.
41057043247SMauro Carvalho Chehab
41157043247SMauro Carvalho Chehab
412a3cb66a5SStephen Kitthung_task_warnings
413a3cb66a5SStephen Kitt==================
41457043247SMauro Carvalho Chehab
41557043247SMauro Carvalho ChehabThe maximum number of warnings to report. During a check interval
41657043247SMauro Carvalho Chehabif a hung task is detected, this value is decreased by 1.
41757043247SMauro Carvalho ChehabWhen this value reaches 0, no more warnings will be reported.
418a3cb66a5SStephen KittThis file shows up if ``CONFIG_DETECT_HUNG_TASK`` is enabled.
41957043247SMauro Carvalho Chehab
42057043247SMauro Carvalho Chehab-1: report an infinite number of warnings.
42157043247SMauro Carvalho Chehab
42257043247SMauro Carvalho Chehab
423a3cb66a5SStephen Kitthyperv_record_panic_msg
424a3cb66a5SStephen Kitt=======================
42557043247SMauro Carvalho Chehab
42657043247SMauro Carvalho ChehabControls whether the panic kmsg data should be reported to Hyper-V.
42757043247SMauro Carvalho Chehab
428a3cb66a5SStephen Kitt= =========================================================
429a3cb66a5SStephen Kitt0 Do not report panic kmsg data.
430a3cb66a5SStephen Kitt1 Report the panic kmsg data. This is the default behavior.
431a3cb66a5SStephen Kitt= =========================================================
43257043247SMauro Carvalho Chehab
43357043247SMauro Carvalho Chehab
434997c798eSStephen Kittignore-unaligned-usertrap
435997c798eSStephen Kitt=========================
436997c798eSStephen Kitt
437997c798eSStephen KittOn architectures where unaligned accesses cause traps, and where this
438997c798eSStephen Kittfeature is supported (``CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN``;
43961a6fcccSHuacai Chencurrently, ``arc``, ``ia64`` and ``loongarch``), controls whether all
44061a6fcccSHuacai Chenunaligned traps are logged.
441997c798eSStephen Kitt
442997c798eSStephen Kitt= =============================================================
443997c798eSStephen Kitt0 Log all unaligned accesses.
444997c798eSStephen Kitt1 Only warn the first time a process traps. This is the default
445997c798eSStephen Kitt  setting.
446997c798eSStephen Kitt= =============================================================
447997c798eSStephen Kitt
448997c798eSStephen KittSee also `unaligned-trap`_ and `unaligned-dump-stack`_. On ``ia64``,
449997c798eSStephen Kittthis allows system administrators to override the
450997c798eSStephen Kitt``IA64_THREAD_UAC_NOPRINT`` ``prctl`` and avoid logs being flooded.
451997c798eSStephen Kitt
452997c798eSStephen Kitt
453*76d3ccecSMatteo Rizzoio_uring_disabled
454*76d3ccecSMatteo Rizzo=================
455*76d3ccecSMatteo Rizzo
456*76d3ccecSMatteo RizzoPrevents all processes from creating new io_uring instances. Enabling this
457*76d3ccecSMatteo Rizzoshrinks the kernel's attack surface.
458*76d3ccecSMatteo Rizzo
459*76d3ccecSMatteo Rizzo= ======================================================================
460*76d3ccecSMatteo Rizzo0 All processes can create io_uring instances as normal. This is the
461*76d3ccecSMatteo Rizzo  default setting.
462*76d3ccecSMatteo Rizzo1 io_uring creation is disabled (io_uring_setup() will fail with
463*76d3ccecSMatteo Rizzo  -EPERM) for unprivileged processes not in the io_uring_group group.
464*76d3ccecSMatteo Rizzo  Existing io_uring instances can still be used.  See the
465*76d3ccecSMatteo Rizzo  documentation for io_uring_group for more information.
466*76d3ccecSMatteo Rizzo2 io_uring creation is disabled for all processes. io_uring_setup()
467*76d3ccecSMatteo Rizzo  always fails with -EPERM. Existing io_uring instances can still be
468*76d3ccecSMatteo Rizzo  used.
469*76d3ccecSMatteo Rizzo= ======================================================================
470*76d3ccecSMatteo Rizzo
471*76d3ccecSMatteo Rizzo
472*76d3ccecSMatteo Rizzoio_uring_group
473*76d3ccecSMatteo Rizzo==============
474*76d3ccecSMatteo Rizzo
475*76d3ccecSMatteo RizzoWhen io_uring_disabled is set to 1, a process must either be
476*76d3ccecSMatteo Rizzoprivileged (CAP_SYS_ADMIN) or be in the io_uring_group group in order
477*76d3ccecSMatteo Rizzoto create an io_uring instance.  If io_uring_group is set to -1 (the
478*76d3ccecSMatteo Rizzodefault), only processes with the CAP_SYS_ADMIN capability may create
479*76d3ccecSMatteo Rizzoio_uring instances.
480*76d3ccecSMatteo Rizzo
481*76d3ccecSMatteo Rizzo
482a3cb66a5SStephen Kittkexec_load_disabled
483a3cb66a5SStephen Kitt===================
48457043247SMauro Carvalho Chehab
48506dcb013SRicardo RibaldaA toggle indicating if the syscalls ``kexec_load`` and
48606dcb013SRicardo Ribalda``kexec_file_load`` have been disabled.
48706dcb013SRicardo RibaldaThis value defaults to 0 (false: ``kexec_*load`` enabled), but can be
48806dcb013SRicardo Ribaldaset to 1 (true: ``kexec_*load`` disabled).
489a3cb66a5SStephen KittOnce true, kexec can no longer be used, and the toggle cannot be set
490a3cb66a5SStephen Kittback to false.
491a3cb66a5SStephen KittThis allows a kexec image to be loaded before disabling the syscall,
492a3cb66a5SStephen Kittallowing a system to set up (and later use) an image without it being
493a3cb66a5SStephen Kittaltered.
494a3cb66a5SStephen KittGenerally used together with the `modules_disabled`_ sysctl.
49557043247SMauro Carvalho Chehab
496a42aaad2SRicardo Ribaldakexec_load_limit_panic
497a42aaad2SRicardo Ribalda======================
498a42aaad2SRicardo Ribalda
499a42aaad2SRicardo RibaldaThis parameter specifies a limit to the number of times the syscalls
500a42aaad2SRicardo Ribalda``kexec_load`` and ``kexec_file_load`` can be called with a crash
501a42aaad2SRicardo Ribaldaimage. It can only be set with a more restrictive value than the
502a42aaad2SRicardo Ribaldacurrent one.
503a42aaad2SRicardo Ribalda
504a42aaad2SRicardo Ribalda== ======================================================
505a42aaad2SRicardo Ribalda-1 Unlimited calls to kexec. This is the default setting.
506a42aaad2SRicardo RibaldaN  Number of calls left.
507a42aaad2SRicardo Ribalda== ======================================================
508a42aaad2SRicardo Ribalda
509a42aaad2SRicardo Ribaldakexec_load_limit_reboot
510a42aaad2SRicardo Ribalda=======================
511a42aaad2SRicardo Ribalda
512a42aaad2SRicardo RibaldaSimilar functionality as ``kexec_load_limit_panic``, but for a normal
513a42aaad2SRicardo Ribaldaimage.
51457043247SMauro Carvalho Chehab
515a3cb66a5SStephen Kittkptr_restrict
516a3cb66a5SStephen Kitt=============
51757043247SMauro Carvalho Chehab
51857043247SMauro Carvalho ChehabThis toggle indicates whether restrictions are placed on
519a3cb66a5SStephen Kittexposing kernel addresses via ``/proc`` and other interfaces.
52057043247SMauro Carvalho Chehab
521a3cb66a5SStephen KittWhen ``kptr_restrict`` is set to 0 (the default) the address is hashed
522a3cb66a5SStephen Kittbefore printing.
523a3cb66a5SStephen Kitt(This is the equivalent to %p.)
52457043247SMauro Carvalho Chehab
525a3cb66a5SStephen KittWhen ``kptr_restrict`` is set to 1, kernel pointers printed using the
526a3cb66a5SStephen Kitt%pK format specifier will be replaced with 0s unless the user has
527a3cb66a5SStephen Kitt``CAP_SYSLOG`` and effective user and group ids are equal to the real
528a3cb66a5SStephen Kittids.
529a3cb66a5SStephen KittThis is because %pK checks are done at read() time rather than open()
530a3cb66a5SStephen Kitttime, so if permissions are elevated between the open() and the read()
531a3cb66a5SStephen Kitt(e.g via a setuid binary) then %pK will not leak kernel pointers to
532a3cb66a5SStephen Kittunprivileged users.
533a3cb66a5SStephen KittNote, this is a temporary solution only.
534a3cb66a5SStephen KittThe correct long-term solution is to do the permission checks at
535a3cb66a5SStephen Kittopen() time.
536a3cb66a5SStephen KittConsider removing world read permissions from files that use %pK, and
537a3cb66a5SStephen Kittusing `dmesg_restrict`_ to protect against uses of %pK in ``dmesg(8)``
538a3cb66a5SStephen Kittif leaking kernel pointer values to unprivileged users is a concern.
53957043247SMauro Carvalho Chehab
540a3cb66a5SStephen KittWhen ``kptr_restrict`` is set to 2, kernel pointers printed using
541a3cb66a5SStephen Kitt%pK will be replaced with 0s regardless of privileges.
54257043247SMauro Carvalho Chehab
54357043247SMauro Carvalho Chehab
544a3cb66a5SStephen Kittmodprobe
545a3cb66a5SStephen Kitt========
546a3cb66a5SStephen Kitt
54752338dfbSEric BiggersThe full path to the usermode helper for autoloading kernel modules,
548f4d3f25aSRasmus Villemoesby default ``CONFIG_MODPROBE_PATH``, which in turn defaults to
549f4d3f25aSRasmus Villemoes"/sbin/modprobe".  This binary is executed when the kernel requests a
550f4d3f25aSRasmus Villemoesmodule.  For example, if userspace passes an unknown filesystem type
551f4d3f25aSRasmus Villemoesto mount(), then the kernel will automatically request the
552f4d3f25aSRasmus Villemoescorresponding filesystem module by executing this usermode helper.
55352338dfbSEric BiggersThis usermode helper should insert the needed module into the kernel.
55452338dfbSEric Biggers
55552338dfbSEric BiggersThis sysctl only affects module autoloading.  It has no effect on the
55652338dfbSEric Biggersability to explicitly insert modules.
55752338dfbSEric Biggers
55852338dfbSEric BiggersThis sysctl can be used to debug module loading requests::
5590317c537SStephen Kitt
5600317c537SStephen Kitt    echo '#! /bin/sh' > /tmp/modprobe
5610317c537SStephen Kitt    echo 'echo "$@" >> /tmp/modprobe.log' >> /tmp/modprobe
5620317c537SStephen Kitt    echo 'exec /sbin/modprobe "$@"' >> /tmp/modprobe
5630317c537SStephen Kitt    chmod a+x /tmp/modprobe
5640317c537SStephen Kitt    echo /tmp/modprobe > /proc/sys/kernel/modprobe
5650317c537SStephen Kitt
56652338dfbSEric BiggersAlternatively, if this sysctl is set to the empty string, then module
56752338dfbSEric Biggersautoloading is completely disabled.  The kernel will not try to
56852338dfbSEric Biggersexecute a usermode helper at all, nor will it call the
56952338dfbSEric Biggerskernel_module_request LSM hook.
570a3cb66a5SStephen Kitt
57152338dfbSEric BiggersIf CONFIG_STATIC_USERMODEHELPER=y is set in the kernel configuration,
57252338dfbSEric Biggersthen the configured static usermode helper overrides this sysctl,
57352338dfbSEric Biggersexcept that the empty string is still accepted to completely disable
57452338dfbSEric Biggersmodule autoloading as described above.
575a3cb66a5SStephen Kitt
576a3cb66a5SStephen Kittmodules_disabled
577a3cb66a5SStephen Kitt================
57857043247SMauro Carvalho Chehab
57957043247SMauro Carvalho ChehabA toggle value indicating if modules are allowed to be loaded
58057043247SMauro Carvalho Chehabin an otherwise modular kernel.  This toggle defaults to off
58157043247SMauro Carvalho Chehab(0), but can be set true (1).  Once true, modules can be
58257043247SMauro Carvalho Chehabneither loaded nor unloaded, and the toggle cannot be set back
583a3cb66a5SStephen Kittto false.  Generally used with the `kexec_load_disabled`_ toggle.
58457043247SMauro Carvalho Chehab
58557043247SMauro Carvalho Chehab
586a3cb66a5SStephen Kitt.. _msgmni:
587a3cb66a5SStephen Kitt
588a3cb66a5SStephen Kittmsgmax, msgmnb, and msgmni
589a3cb66a5SStephen Kitt==========================
590a3cb66a5SStephen Kitt
591fa5b5264SStephen Kitt``msgmax`` is the maximum size of an IPC message, in bytes. 8192 by
592fa5b5264SStephen Kittdefault (``MSGMAX``).
593fa5b5264SStephen Kitt
594fa5b5264SStephen Kitt``msgmnb`` is the maximum size of an IPC queue, in bytes. 16384 by
595fa5b5264SStephen Kittdefault (``MSGMNB``).
596fa5b5264SStephen Kitt
597fa5b5264SStephen Kitt``msgmni`` is the maximum number of IPC queues. 32000 by default
598fa5b5264SStephen Kitt(``MSGMNI``).
599fa5b5264SStephen Kitt
600a3cb66a5SStephen Kitt
601a3cb66a5SStephen Kittmsg_next_id, sem_next_id, and shm_next_id (System V IPC)
602a3cb66a5SStephen Kitt========================================================
60357043247SMauro Carvalho Chehab
60457043247SMauro Carvalho ChehabThese three toggles allows to specify desired id for next allocated IPC
60557043247SMauro Carvalho Chehabobject: message, semaphore or shared memory respectively.
60657043247SMauro Carvalho Chehab
60757043247SMauro Carvalho ChehabBy default they are equal to -1, which means generic allocation logic.
608a3cb66a5SStephen KittPossible values to set are in range {0:``INT_MAX``}.
60957043247SMauro Carvalho Chehab
61057043247SMauro Carvalho ChehabNotes:
61157043247SMauro Carvalho Chehab  1) kernel doesn't guarantee, that new object will have desired id. So,
61257043247SMauro Carvalho Chehab     it's up to userspace, how to handle an object with "wrong" id.
61357043247SMauro Carvalho Chehab  2) Toggle with non-default value will be set back to -1 by kernel after
61457043247SMauro Carvalho Chehab     successful IPC object allocation. If an IPC object allocation syscall
61557043247SMauro Carvalho Chehab     fails, it is undefined if the value remains unmodified or is reset to -1.
61657043247SMauro Carvalho Chehab
61717444d9bSStephen Kitt
61817444d9bSStephen Kittngroups_max
61917444d9bSStephen Kitt===========
62017444d9bSStephen Kitt
62117444d9bSStephen KittMaximum number of supplementary groups, _i.e._ the maximum size which
62217444d9bSStephen Kitt``setgroups`` will accept. Exports ``NGROUPS_MAX`` from the kernel.
62317444d9bSStephen Kitt
62417444d9bSStephen Kitt
62517444d9bSStephen Kitt
626a3cb66a5SStephen Kittnmi_watchdog
627a3cb66a5SStephen Kitt============
62857043247SMauro Carvalho Chehab
62957043247SMauro Carvalho ChehabThis parameter can be used to control the NMI watchdog
63057043247SMauro Carvalho Chehab(i.e. the hard lockup detector) on x86 systems.
63157043247SMauro Carvalho Chehab
632a3cb66a5SStephen Kitt= =================================
633a3cb66a5SStephen Kitt0 Disable the hard lockup detector.
634a3cb66a5SStephen Kitt1 Enable the hard lockup detector.
635a3cb66a5SStephen Kitt= =================================
63657043247SMauro Carvalho Chehab
63757043247SMauro Carvalho ChehabThe hard lockup detector monitors each CPU for its ability to respond to
63857043247SMauro Carvalho Chehabtimer interrupts. The mechanism utilizes CPU performance counter registers
63957043247SMauro Carvalho Chehabthat are programmed to generate Non-Maskable Interrupts (NMIs) periodically
64057043247SMauro Carvalho Chehabwhile a CPU is busy. Hence, the alternative name 'NMI watchdog'.
64157043247SMauro Carvalho Chehab
64257043247SMauro Carvalho ChehabThe NMI watchdog is disabled by default if the kernel is running as a guest
64357043247SMauro Carvalho Chehabin a KVM virtual machine. This default can be overridden by adding::
64457043247SMauro Carvalho Chehab
64557043247SMauro Carvalho Chehab   nmi_watchdog=1
64657043247SMauro Carvalho Chehab
6472793e19dSMauro Carvalho Chehabto the guest kernel command line (see
6482793e19dSMauro Carvalho ChehabDocumentation/admin-guide/kernel-parameters.rst).
64957043247SMauro Carvalho Chehab
65057043247SMauro Carvalho Chehab
651118b1366SLaurent Dufournmi_wd_lpm_factor (PPC only)
652118b1366SLaurent Dufour============================
653118b1366SLaurent Dufour
654118b1366SLaurent DufourFactor to apply to the NMI watchdog timeout (only when ``nmi_watchdog`` is
655118b1366SLaurent Dufourset to 1). This factor represents the percentage added to
656118b1366SLaurent Dufour``watchdog_thresh`` when calculating the NMI watchdog timeout during an
657118b1366SLaurent DufourLPM. The soft lockup timeout is not impacted.
658118b1366SLaurent Dufour
659118b1366SLaurent DufourA value of 0 means no change. The default value is 200 meaning the NMI
660118b1366SLaurent Dufourwatchdog is set to 30s (based on ``watchdog_thresh`` equal to 10).
661118b1366SLaurent Dufour
662118b1366SLaurent Dufour
663a3cb66a5SStephen Kittnuma_balancing
664a3cb66a5SStephen Kitt==============
66557043247SMauro Carvalho Chehab
666c574bbe9SHuang YingEnables/disables and configures automatic page fault based NUMA memory
667c574bbe9SHuang Yingbalancing.  Memory is moved automatically to nodes that access it often.
668c574bbe9SHuang YingThe value to set can be the result of ORing the following:
66957043247SMauro Carvalho Chehab
670c574bbe9SHuang Ying= =================================
671c574bbe9SHuang Ying0 NUMA_BALANCING_DISABLED
672c574bbe9SHuang Ying1 NUMA_BALANCING_NORMAL
673c574bbe9SHuang Ying2 NUMA_BALANCING_MEMORY_TIERING
674c574bbe9SHuang Ying= =================================
675c574bbe9SHuang Ying
676c574bbe9SHuang YingOr NUMA_BALANCING_NORMAL to optimize page placement among different
677c574bbe9SHuang YingNUMA nodes to reduce remote accessing.  On NUMA machines, there is a
678c574bbe9SHuang Yingperformance penalty if remote memory is accessed by a CPU. When this
679c574bbe9SHuang Yingfeature is enabled the kernel samples what task thread is accessing
680c574bbe9SHuang Yingmemory by periodically unmapping pages and later trapping a page
681c574bbe9SHuang Yingfault. At the time of the page fault, it is determined if the data
682c574bbe9SHuang Yingbeing accessed should be migrated to a local memory node.
68357043247SMauro Carvalho Chehab
68457043247SMauro Carvalho ChehabThe unmapping of pages and trapping faults incur additional overhead that
68557043247SMauro Carvalho Chehabideally is offset by improved memory locality but there is no universal
68657043247SMauro Carvalho Chehabguarantee. If the target workload is already bound to NUMA nodes then this
6873624ba7bSHuang Yingfeature should be disabled.
68857043247SMauro Carvalho Chehab
689c574bbe9SHuang YingOr NUMA_BALANCING_MEMORY_TIERING to optimize page placement among
690c574bbe9SHuang Yingdifferent types of memory (represented as different NUMA nodes) to
691c574bbe9SHuang Yingplace the hot pages in the fast memory.  This is implemented based on
692c574bbe9SHuang Yingunmapping and page fault too.
69357043247SMauro Carvalho Chehab
694c6833e10SHuang Yingnuma_balancing_promote_rate_limit_MBps
695c6833e10SHuang Ying======================================
696c6833e10SHuang Ying
697c6833e10SHuang YingToo high promotion/demotion throughput between different memory types
698c6833e10SHuang Yingmay hurt application latency.  This can be used to rate limit the
699c6833e10SHuang Yingpromotion throughput.  The per-node max promotion throughput in MB/s
700c6833e10SHuang Yingwill be limited to be no more than the set value.
701c6833e10SHuang Ying
702c6833e10SHuang YingA rule of thumb is to set this to less than 1/10 of the PMEM node
703c6833e10SHuang Yingwrite bandwidth.
704c6833e10SHuang Ying
705e996919bSRandy Dunlapoops_all_cpu_backtrace
706e996919bSRandy Dunlap======================
70760c958d8SGuilherme G. Piccoli
70860c958d8SGuilherme G. PiccoliIf this option is set, the kernel will send an NMI to all CPUs to dump
70960c958d8SGuilherme G. Piccolitheir backtraces when an oops event occurs. It should be used as a last
71060c958d8SGuilherme G. Piccoliresort in case a panic cannot be triggered (to protect VMs running, for
71160c958d8SGuilherme G. Piccoliexample) or kdump can't be collected. This file shows up if CONFIG_SMP
71260c958d8SGuilherme G. Piccoliis enabled.
71360c958d8SGuilherme G. Piccoli
71460c958d8SGuilherme G. Piccoli0: Won't show all CPUs backtraces when an oops is detected.
71560c958d8SGuilherme G. PiccoliThis is the default behavior.
71660c958d8SGuilherme G. Piccoli
71760c958d8SGuilherme G. Piccoli1: Will non-maskably interrupt all CPUs and dump their backtraces when
71860c958d8SGuilherme G. Piccolian oops event is detected.
71960c958d8SGuilherme G. Piccoli
72060c958d8SGuilherme G. Piccoli
721d4ccd54dSJann Hornoops_limit
722d4ccd54dSJann Horn==========
723d4ccd54dSJann Horn
724d4ccd54dSJann HornNumber of kernel oopses after which the kernel should panic when
725de92f657SKees Cook``panic_on_oops`` is not set. Setting this to 0 disables checking
726de92f657SKees Cookthe count. Setting this to  1 has the same effect as setting
727de92f657SKees Cook``panic_on_oops=1``. The default value is 10000.
728d4ccd54dSJann Horn
729d4ccd54dSJann Horn
730a3cb66a5SStephen Kittosrelease, ostype & version
731a3cb66a5SStephen Kitt===========================
73257043247SMauro Carvalho Chehab
73357043247SMauro Carvalho Chehab::
73457043247SMauro Carvalho Chehab
73557043247SMauro Carvalho Chehab  # cat osrelease
73657043247SMauro Carvalho Chehab  2.1.88
73757043247SMauro Carvalho Chehab  # cat ostype
73857043247SMauro Carvalho Chehab  Linux
73957043247SMauro Carvalho Chehab  # cat version
74057043247SMauro Carvalho Chehab  #5 Wed Feb 25 21:49:24 MET 1998
74157043247SMauro Carvalho Chehab
742a3cb66a5SStephen KittThe files ``osrelease`` and ``ostype`` should be clear enough.
743a3cb66a5SStephen Kitt``version``
74457043247SMauro Carvalho Chehabneeds a little more clarification however. The '#5' means that
74557043247SMauro Carvalho Chehabthis is the fifth kernel built from this source base and the
74657043247SMauro Carvalho Chehabdate behind it indicates the time the kernel was built.
74757043247SMauro Carvalho ChehabThe only way to tune these values is to rebuild the kernel :-)
74857043247SMauro Carvalho Chehab
74957043247SMauro Carvalho Chehab
750a3cb66a5SStephen Kittoverflowgid & overflowuid
751a3cb66a5SStephen Kitt=========================
75257043247SMauro Carvalho Chehab
75357043247SMauro Carvalho Chehabif your architecture did not always support 32-bit UIDs (i.e. arm,
75457043247SMauro Carvalho Chehabi386, m68k, sh, and sparc32), a fixed UID and GID will be returned to
75557043247SMauro Carvalho Chehabapplications that use the old 16-bit UID/GID system calls, if the
75657043247SMauro Carvalho Chehabactual UID or GID would exceed 65535.
75757043247SMauro Carvalho Chehab
75857043247SMauro Carvalho ChehabThese sysctls allow you to change the value of the fixed UID and GID.
75957043247SMauro Carvalho ChehabThe default is 65534.
76057043247SMauro Carvalho Chehab
76157043247SMauro Carvalho Chehab
762a3cb66a5SStephen Kittpanic
763a3cb66a5SStephen Kitt=====
76457043247SMauro Carvalho Chehab
765404347e6SStephen KittThe value in this file determines the behaviour of the kernel on a
766404347e6SStephen Kittpanic:
767404347e6SStephen Kitt
768404347e6SStephen Kitt* if zero, the kernel will loop forever;
769404347e6SStephen Kitt* if negative, the kernel will reboot immediately;
770404347e6SStephen Kitt* if positive, the kernel will reboot after the corresponding number
771404347e6SStephen Kitt  of seconds.
772404347e6SStephen Kitt
773404347e6SStephen KittWhen you use the software watchdog, the recommended setting is 60.
77457043247SMauro Carvalho Chehab
77557043247SMauro Carvalho Chehab
776a3cb66a5SStephen Kittpanic_on_io_nmi
777a3cb66a5SStephen Kitt===============
77857043247SMauro Carvalho Chehab
77957043247SMauro Carvalho ChehabControls the kernel's behavior when a CPU receives an NMI caused by
78057043247SMauro Carvalho Chehaban IO error.
78157043247SMauro Carvalho Chehab
782a3cb66a5SStephen Kitt= ==================================================================
783a3cb66a5SStephen Kitt0 Try to continue operation (default).
784a3cb66a5SStephen Kitt1 Panic immediately. The IO error triggered an NMI. This indicates a
78557043247SMauro Carvalho Chehab  serious system condition which could result in IO data corruption.
78657043247SMauro Carvalho Chehab  Rather than continuing, panicking might be a better choice. Some
78757043247SMauro Carvalho Chehab  servers issue this sort of NMI when the dump button is pushed,
78857043247SMauro Carvalho Chehab  and you can use this option to take a crash dump.
789a3cb66a5SStephen Kitt= ==================================================================
79057043247SMauro Carvalho Chehab
79157043247SMauro Carvalho Chehab
792a3cb66a5SStephen Kittpanic_on_oops
793a3cb66a5SStephen Kitt=============
79457043247SMauro Carvalho Chehab
79557043247SMauro Carvalho ChehabControls the kernel's behaviour when an oops or BUG is encountered.
79657043247SMauro Carvalho Chehab
797a3cb66a5SStephen Kitt= ===================================================================
798a3cb66a5SStephen Kitt0 Try to continue operation.
799a3cb66a5SStephen Kitt1 Panic immediately.  If the `panic` sysctl is also non-zero then the
80057043247SMauro Carvalho Chehab  machine will be rebooted.
801a3cb66a5SStephen Kitt= ===================================================================
80257043247SMauro Carvalho Chehab
80357043247SMauro Carvalho Chehab
804a3cb66a5SStephen Kittpanic_on_stackoverflow
805a3cb66a5SStephen Kitt======================
80657043247SMauro Carvalho Chehab
80757043247SMauro Carvalho ChehabControls the kernel's behavior when detecting the overflows of
80857043247SMauro Carvalho Chehabkernel, IRQ and exception stacks except a user stack.
809a3cb66a5SStephen KittThis file shows up if ``CONFIG_DEBUG_STACKOVERFLOW`` is enabled.
81057043247SMauro Carvalho Chehab
811a3cb66a5SStephen Kitt= ==========================
812a3cb66a5SStephen Kitt0 Try to continue operation.
813a3cb66a5SStephen Kitt1 Panic immediately.
814a3cb66a5SStephen Kitt= ==========================
81557043247SMauro Carvalho Chehab
81657043247SMauro Carvalho Chehab
817a3cb66a5SStephen Kittpanic_on_unrecovered_nmi
818a3cb66a5SStephen Kitt========================
81957043247SMauro Carvalho Chehab
82057043247SMauro Carvalho ChehabThe default Linux behaviour on an NMI of either memory or unknown is
82157043247SMauro Carvalho Chehabto continue operation. For many environments such as scientific
82257043247SMauro Carvalho Chehabcomputing it is preferable that the box is taken out and the error
82357043247SMauro Carvalho Chehabdealt with than an uncorrected parity/ECC error get propagated.
82457043247SMauro Carvalho Chehab
825a3cb66a5SStephen KittA small number of systems do generate NMIs for bizarre random reasons
82657043247SMauro Carvalho Chehabsuch as power management so the default is off. That sysctl works like
82757043247SMauro Carvalho Chehabthe existing panic controls already in that directory.
82857043247SMauro Carvalho Chehab
82957043247SMauro Carvalho Chehab
830a3cb66a5SStephen Kittpanic_on_warn
831a3cb66a5SStephen Kitt=============
83257043247SMauro Carvalho Chehab
83357043247SMauro Carvalho ChehabCalls panic() in the WARN() path when set to 1.  This is useful to avoid
83457043247SMauro Carvalho Chehaba kernel rebuild when attempting to kdump at the location of a WARN().
83557043247SMauro Carvalho Chehab
836a3cb66a5SStephen Kitt= ================================================
837a3cb66a5SStephen Kitt0 Only WARN(), default behaviour.
838a3cb66a5SStephen Kitt1 Call panic() after printing out WARN() location.
839a3cb66a5SStephen Kitt= ================================================
84057043247SMauro Carvalho Chehab
84157043247SMauro Carvalho Chehab
842a3cb66a5SStephen Kittpanic_print
843a3cb66a5SStephen Kitt===========
84457043247SMauro Carvalho Chehab
84557043247SMauro Carvalho ChehabBitmask for printing system info when panic happens. User can chose
84657043247SMauro Carvalho Chehabcombination of the following bits:
84757043247SMauro Carvalho Chehab
848a3cb66a5SStephen Kitt=====  ============================================
84957043247SMauro Carvalho Chehabbit 0  print all tasks info
85057043247SMauro Carvalho Chehabbit 1  print system memory info
85157043247SMauro Carvalho Chehabbit 2  print timer info
852a3cb66a5SStephen Kittbit 3  print locks info if ``CONFIG_LOCKDEP`` is on
85357043247SMauro Carvalho Chehabbit 4  print ftrace buffer
854a1ff1de0SGuilherme G. Piccolibit 5  print all printk messages in buffer
8558d470a45SGuilherme G. Piccolibit 6  print all CPUs backtrace (if available in the arch)
856a3cb66a5SStephen Kitt=====  ============================================
85757043247SMauro Carvalho Chehab
85857043247SMauro Carvalho ChehabSo for example to print tasks and memory info on panic, user can::
85957043247SMauro Carvalho Chehab
86057043247SMauro Carvalho Chehab  echo 3 > /proc/sys/kernel/panic_print
86157043247SMauro Carvalho Chehab
86257043247SMauro Carvalho Chehab
863a3cb66a5SStephen Kittpanic_on_rcu_stall
864a3cb66a5SStephen Kitt==================
86557043247SMauro Carvalho Chehab
86657043247SMauro Carvalho ChehabWhen set to 1, calls panic() after RCU stall detection messages. This
86757043247SMauro Carvalho Chehabis useful to define the root cause of RCU stalls using a vmcore.
86857043247SMauro Carvalho Chehab
869a3cb66a5SStephen Kitt= ============================================================
870a3cb66a5SStephen Kitt0 Do not panic() when RCU stall takes place, default behavior.
871a3cb66a5SStephen Kitt1 panic() after printing RCU stall messages.
872a3cb66a5SStephen Kitt= ============================================================
87357043247SMauro Carvalho Chehab
87481c65365SJoel Savitzmax_rcu_stall_to_panic
87581c65365SJoel Savitz======================
87681c65365SJoel Savitz
87781c65365SJoel SavitzWhen ``panic_on_rcu_stall`` is set to 1, this value determines the
87881c65365SJoel Savitznumber of times that RCU can stall before panic() is called.
87981c65365SJoel Savitz
88081c65365SJoel SavitzWhen ``panic_on_rcu_stall`` is set to 0, this value is has no effect.
88157043247SMauro Carvalho Chehab
882a3cb66a5SStephen Kittperf_cpu_time_max_percent
883a3cb66a5SStephen Kitt=========================
88457043247SMauro Carvalho Chehab
88557043247SMauro Carvalho ChehabHints to the kernel how much CPU time it should be allowed to
88657043247SMauro Carvalho Chehabuse to handle perf sampling events.  If the perf subsystem
88757043247SMauro Carvalho Chehabis informed that its samples are exceeding this limit, it
88857043247SMauro Carvalho Chehabwill drop its sampling frequency to attempt to reduce its CPU
88957043247SMauro Carvalho Chehabusage.
89057043247SMauro Carvalho Chehab
89157043247SMauro Carvalho ChehabSome perf sampling happens in NMIs.  If these samples
89257043247SMauro Carvalho Chehabunexpectedly take too long to execute, the NMIs can become
89357043247SMauro Carvalho Chehabstacked up next to each other so much that nothing else is
89457043247SMauro Carvalho Chehaballowed to execute.
89557043247SMauro Carvalho Chehab
896a3cb66a5SStephen Kitt===== ========================================================
897a3cb66a5SStephen Kitt0     Disable the mechanism.  Do not monitor or correct perf's
89857043247SMauro Carvalho Chehab      sampling rate no matter how CPU time it takes.
89957043247SMauro Carvalho Chehab
900a3cb66a5SStephen Kitt1-100 Attempt to throttle perf's sample rate to this
90157043247SMauro Carvalho Chehab      percentage of CPU.  Note: the kernel calculates an
90257043247SMauro Carvalho Chehab      "expected" length of each sample event.  100 here means
90357043247SMauro Carvalho Chehab      100% of that expected length.  Even if this is set to
90457043247SMauro Carvalho Chehab      100, you may still see sample throttling if this
90557043247SMauro Carvalho Chehab      length is exceeded.  Set to 0 if you truly do not care
90657043247SMauro Carvalho Chehab      how much CPU is consumed.
907a3cb66a5SStephen Kitt===== ========================================================
90857043247SMauro Carvalho Chehab
90957043247SMauro Carvalho Chehab
910a3cb66a5SStephen Kittperf_event_paranoid
911a3cb66a5SStephen Kitt===================
91257043247SMauro Carvalho Chehab
91357043247SMauro Carvalho ChehabControls use of the performance events system by unprivileged
914025b16f8SAlexey Budankovusers (without CAP_PERFMON).  The default value is 2.
915025b16f8SAlexey Budankov
916025b16f8SAlexey BudankovFor backward compatibility reasons access to system performance
917025b16f8SAlexey Budankovmonitoring and observability remains open for CAP_SYS_ADMIN
918025b16f8SAlexey Budankovprivileged processes but CAP_SYS_ADMIN usage for secure system
919025b16f8SAlexey Budankovperformance monitoring and observability operations is discouraged
920025b16f8SAlexey Budankovwith respect to CAP_PERFMON use cases.
92157043247SMauro Carvalho Chehab
92257043247SMauro Carvalho Chehab===  ==================================================================
923a3cb66a5SStephen Kitt -1  Allow use of (almost) all events by all users.
92457043247SMauro Carvalho Chehab
925a3cb66a5SStephen Kitt     Ignore mlock limit after perf_event_mlock_kb without
926a3cb66a5SStephen Kitt     ``CAP_IPC_LOCK``.
92757043247SMauro Carvalho Chehab
928a3cb66a5SStephen Kitt>=0  Disallow ftrace function tracepoint by users without
929025b16f8SAlexey Budankov     ``CAP_PERFMON``.
93057043247SMauro Carvalho Chehab
931025b16f8SAlexey Budankov     Disallow raw tracepoint access by users without ``CAP_PERFMON``.
93257043247SMauro Carvalho Chehab
933025b16f8SAlexey Budankov>=1  Disallow CPU event access by users without ``CAP_PERFMON``.
93457043247SMauro Carvalho Chehab
935025b16f8SAlexey Budankov>=2  Disallow kernel profiling by users without ``CAP_PERFMON``.
93657043247SMauro Carvalho Chehab===  ==================================================================
93757043247SMauro Carvalho Chehab
93857043247SMauro Carvalho Chehab
939a3cb66a5SStephen Kittperf_event_max_stack
940a3cb66a5SStephen Kitt====================
94157043247SMauro Carvalho Chehab
942a3cb66a5SStephen KittControls maximum number of stack frames to copy for (``attr.sample_type &
943a3cb66a5SStephen KittPERF_SAMPLE_CALLCHAIN``) configured events, for instance, when using
944a3cb66a5SStephen Kitt'``perf record -g``' or '``perf trace --call-graph fp``'.
94557043247SMauro Carvalho Chehab
94657043247SMauro Carvalho ChehabThis can only be done when no events are in use that have callchains
947a3cb66a5SStephen Kittenabled, otherwise writing to this file will return ``-EBUSY``.
94857043247SMauro Carvalho Chehab
94957043247SMauro Carvalho ChehabThe default value is 127.
95057043247SMauro Carvalho Chehab
95157043247SMauro Carvalho Chehab
952a3cb66a5SStephen Kittperf_event_mlock_kb
953a3cb66a5SStephen Kitt===================
95457043247SMauro Carvalho Chehab
955751d5b27SAndrew KlychkovControl size of per-cpu ring buffer not counted against mlock limit.
95657043247SMauro Carvalho Chehab
95757043247SMauro Carvalho ChehabThe default value is 512 + 1 page
95857043247SMauro Carvalho Chehab
95957043247SMauro Carvalho Chehab
960a3cb66a5SStephen Kittperf_event_max_contexts_per_stack
961a3cb66a5SStephen Kitt=================================
96257043247SMauro Carvalho Chehab
96357043247SMauro Carvalho ChehabControls maximum number of stack frame context entries for
964a3cb66a5SStephen Kitt(``attr.sample_type & PERF_SAMPLE_CALLCHAIN``) configured events, for
965a3cb66a5SStephen Kittinstance, when using '``perf record -g``' or '``perf trace --call-graph fp``'.
96657043247SMauro Carvalho Chehab
96757043247SMauro Carvalho ChehabThis can only be done when no events are in use that have callchains
968a3cb66a5SStephen Kittenabled, otherwise writing to this file will return ``-EBUSY``.
96957043247SMauro Carvalho Chehab
97057043247SMauro Carvalho ChehabThe default value is 8.
97157043247SMauro Carvalho Chehab
97257043247SMauro Carvalho Chehab
97357972127SAlexandre Ghitiperf_user_access (arm64 and riscv only)
97457972127SAlexandre Ghiti=======================================
975e2012600SRob Herring
97657972127SAlexandre GhitiControls user space access for reading perf event counters.
97757972127SAlexandre Ghiti
97857972127SAlexandre Ghitiarm64
97957972127SAlexandre Ghiti=====
980e2012600SRob Herring
981e2012600SRob HerringThe default value is 0 (access disabled).
982e2012600SRob Herring
98357972127SAlexandre GhitiWhen set to 1, user space can read performance monitor counter registers
98457972127SAlexandre Ghitidirectly.
98557972127SAlexandre Ghiti
986e4624435SJonathan CorbetSee Documentation/arch/arm64/perf.rst for more information.
987e2012600SRob Herring
98857972127SAlexandre Ghitiriscv
98957972127SAlexandre Ghiti=====
99057972127SAlexandre Ghiti
99157972127SAlexandre GhitiWhen set to 0, user space access is disabled.
99257972127SAlexandre Ghiti
99357972127SAlexandre GhitiThe default value is 1, user space can read performance monitor counter
99457972127SAlexandre Ghitiregisters through perf, any direct access without perf intervention will trigger
99557972127SAlexandre Ghitian illegal instruction.
99657972127SAlexandre Ghiti
99757972127SAlexandre GhitiWhen set to 2, which enables legacy mode (user space has direct access to cycle
99857972127SAlexandre Ghitiand insret CSRs only). Note that this legacy value is deprecated and will be
99957972127SAlexandre Ghitiremoved once all user space applications are fixed.
100057972127SAlexandre Ghiti
100157972127SAlexandre GhitiNote that the time CSR is always directly accessible to all modes.
1002e2012600SRob Herring
1003a3cb66a5SStephen Kittpid_max
1004a3cb66a5SStephen Kitt=======
100557043247SMauro Carvalho Chehab
100657043247SMauro Carvalho ChehabPID allocation wrap value.  When the kernel's next PID value
100757043247SMauro Carvalho Chehabreaches this value, it wraps back to a minimum PID value.
1008a3cb66a5SStephen KittPIDs of value ``pid_max`` or larger are not allocated.
100957043247SMauro Carvalho Chehab
101057043247SMauro Carvalho Chehab
1011a3cb66a5SStephen Kittns_last_pid
1012a3cb66a5SStephen Kitt===========
101357043247SMauro Carvalho Chehab
101457043247SMauro Carvalho ChehabThe last pid allocated in the current (the one task using this sysctl
101557043247SMauro Carvalho Chehablives in) pid namespace. When selecting a pid for a next task on fork
101657043247SMauro Carvalho Chehabkernel tries to allocate a number starting from this one.
101757043247SMauro Carvalho Chehab
101857043247SMauro Carvalho Chehab
1019a3cb66a5SStephen Kittpowersave-nap (PPC only)
1020a3cb66a5SStephen Kitt========================
102157043247SMauro Carvalho Chehab
102257043247SMauro Carvalho ChehabIf set, Linux-PPC will use the 'nap' mode of powersaving,
102357043247SMauro Carvalho Chehabotherwise the 'doze' mode will be used.
102457043247SMauro Carvalho Chehab
1025a3cb66a5SStephen Kitt
102657043247SMauro Carvalho Chehab==============================================================
102757043247SMauro Carvalho Chehab
1028a3cb66a5SStephen Kittprintk
1029a3cb66a5SStephen Kitt======
103057043247SMauro Carvalho Chehab
1031a3cb66a5SStephen KittThe four values in printk denote: ``console_loglevel``,
1032a3cb66a5SStephen Kitt``default_message_loglevel``, ``minimum_console_loglevel`` and
1033a3cb66a5SStephen Kitt``default_console_loglevel`` respectively.
103457043247SMauro Carvalho Chehab
103557043247SMauro Carvalho ChehabThese values influence printk() behavior when printing or
1036a3cb66a5SStephen Kittlogging error messages. See '``man 2 syslog``' for more info on
103757043247SMauro Carvalho Chehabthe different loglevels.
103857043247SMauro Carvalho Chehab
1039a3cb66a5SStephen Kitt======================== =====================================
1040a3cb66a5SStephen Kittconsole_loglevel         messages with a higher priority than
104157043247SMauro Carvalho Chehab                         this will be printed to the console
1042a3cb66a5SStephen Kittdefault_message_loglevel messages without an explicit priority
104357043247SMauro Carvalho Chehab                         will be printed with this priority
1044a3cb66a5SStephen Kittminimum_console_loglevel minimum (highest) value to which
104557043247SMauro Carvalho Chehab                         console_loglevel can be set
1046a3cb66a5SStephen Kittdefault_console_loglevel default value for console_loglevel
1047a3cb66a5SStephen Kitt======================== =====================================
104857043247SMauro Carvalho Chehab
104957043247SMauro Carvalho Chehab
1050a3cb66a5SStephen Kittprintk_delay
1051a3cb66a5SStephen Kitt============
105257043247SMauro Carvalho Chehab
1053a3cb66a5SStephen KittDelay each printk message in ``printk_delay`` milliseconds
105457043247SMauro Carvalho Chehab
105557043247SMauro Carvalho ChehabValue from 0 - 10000 is allowed.
105657043247SMauro Carvalho Chehab
105757043247SMauro Carvalho Chehab
1058a3cb66a5SStephen Kittprintk_ratelimit
1059a3cb66a5SStephen Kitt================
106057043247SMauro Carvalho Chehab
1061a3cb66a5SStephen KittSome warning messages are rate limited. ``printk_ratelimit`` specifies
1062ca30ad85SOleksandr Natalenkothe minimum length of time between these messages (in seconds).
1063ca30ad85SOleksandr NatalenkoThe default value is 5 seconds.
106457043247SMauro Carvalho Chehab
106557043247SMauro Carvalho ChehabA value of 0 will disable rate limiting.
106657043247SMauro Carvalho Chehab
106757043247SMauro Carvalho Chehab
1068a3cb66a5SStephen Kittprintk_ratelimit_burst
1069a3cb66a5SStephen Kitt======================
107057043247SMauro Carvalho Chehab
1071a3cb66a5SStephen KittWhile long term we enforce one message per `printk_ratelimit`_
107257043247SMauro Carvalho Chehabseconds, we do allow a burst of messages to pass through.
1073a3cb66a5SStephen Kitt``printk_ratelimit_burst`` specifies the number of messages we can
107457043247SMauro Carvalho Chehabsend before ratelimiting kicks in.
107557043247SMauro Carvalho Chehab
1076ca30ad85SOleksandr NatalenkoThe default value is 10 messages.
1077ca30ad85SOleksandr Natalenko
107857043247SMauro Carvalho Chehab
1079a3cb66a5SStephen Kittprintk_devkmsg
1080a3cb66a5SStephen Kitt==============
108157043247SMauro Carvalho Chehab
1082a3cb66a5SStephen KittControl the logging to ``/dev/kmsg`` from userspace:
108357043247SMauro Carvalho Chehab
1084a3cb66a5SStephen Kitt========= =============================================
1085a3cb66a5SStephen Kittratelimit default, ratelimited
1086a3cb66a5SStephen Kitton        unlimited logging to /dev/kmsg from userspace
1087a3cb66a5SStephen Kittoff       logging to /dev/kmsg disabled
1088a3cb66a5SStephen Kitt========= =============================================
108957043247SMauro Carvalho Chehab
1090a3cb66a5SStephen KittThe kernel command line parameter ``printk.devkmsg=`` overrides this and is
109157043247SMauro Carvalho Chehaba one-time setting until next reboot: once set, it cannot be changed by
109257043247SMauro Carvalho Chehabthis sysctl interface anymore.
109357043247SMauro Carvalho Chehab
1094a3cb66a5SStephen Kitt==============================================================
109557043247SMauro Carvalho Chehab
1096a3cb66a5SStephen Kitt
1097a3cb66a5SStephen Kittpty
1098a3cb66a5SStephen Kitt===
1099a3cb66a5SStephen Kitt
110001478b83SMauro Carvalho ChehabSee Documentation/filesystems/devpts.rst.
1101a3cb66a5SStephen Kitt
1102a3cb66a5SStephen Kitt
11030b227076SStephen Kittrandom
11040b227076SStephen Kitt======
11050b227076SStephen Kitt
11060b227076SStephen KittThis is a directory, with the following entries:
11070b227076SStephen Kitt
11080b227076SStephen Kitt* ``boot_id``: a UUID generated the first time this is retrieved, and
11090b227076SStephen Kitt  unvarying after that;
11100b227076SStephen Kitt
1111069c4ea6SJason A. Donenfeld* ``uuid``: a UUID generated every time this is retrieved (this can
1112069c4ea6SJason A. Donenfeld  thus be used to generate UUIDs at will);
1113069c4ea6SJason A. Donenfeld
11140b227076SStephen Kitt* ``entropy_avail``: the pool's entropy count, in bits;
11150b227076SStephen Kitt
11160b227076SStephen Kitt* ``poolsize``: the entropy pool size, in bits;
11170b227076SStephen Kitt
11180b227076SStephen Kitt* ``urandom_min_reseed_secs``: obsolete (used to determine the minimum
1119489c7fc4SJason A. Donenfeld  number of seconds between urandom pool reseeding). This file is
1120489c7fc4SJason A. Donenfeld  writable for compatibility purposes, but writing to it has no effect
1121069c4ea6SJason A. Donenfeld  on any RNG behavior;
11220b227076SStephen Kitt
11230b227076SStephen Kitt* ``write_wakeup_threshold``: when the entropy count drops below this
11240b227076SStephen Kitt  (as a number of bits), processes waiting to write to ``/dev/random``
1125489c7fc4SJason A. Donenfeld  are woken up. This file is writable for compatibility purposes, but
1126489c7fc4SJason A. Donenfeld  writing to it has no effect on any RNG behavior.
11270b227076SStephen Kitt
11280b227076SStephen Kitt
1129a3cb66a5SStephen Kittrandomize_va_space
1130a3cb66a5SStephen Kitt==================
113157043247SMauro Carvalho Chehab
113257043247SMauro Carvalho ChehabThis option can be used to select the type of process address
113357043247SMauro Carvalho Chehabspace randomization that is used in the system, for architectures
113457043247SMauro Carvalho Chehabthat support this feature.
113557043247SMauro Carvalho Chehab
113657043247SMauro Carvalho Chehab==  ===========================================================================
113757043247SMauro Carvalho Chehab0   Turn the process address space randomization off.  This is the
113857043247SMauro Carvalho Chehab    default for architectures that do not support this feature anyways,
113957043247SMauro Carvalho Chehab    and kernels that are booted with the "norandmaps" parameter.
114057043247SMauro Carvalho Chehab
114157043247SMauro Carvalho Chehab1   Make the addresses of mmap base, stack and VDSO page randomized.
114257043247SMauro Carvalho Chehab    This, among other things, implies that shared libraries will be
114357043247SMauro Carvalho Chehab    loaded to random addresses.  Also for PIE-linked binaries, the
114457043247SMauro Carvalho Chehab    location of code start is randomized.  This is the default if the
1145a3cb66a5SStephen Kitt    ``CONFIG_COMPAT_BRK`` option is enabled.
114657043247SMauro Carvalho Chehab
114757043247SMauro Carvalho Chehab2   Additionally enable heap randomization.  This is the default if
1148a3cb66a5SStephen Kitt    ``CONFIG_COMPAT_BRK`` is disabled.
114957043247SMauro Carvalho Chehab
115057043247SMauro Carvalho Chehab    There are a few legacy applications out there (such as some ancient
115157043247SMauro Carvalho Chehab    versions of libc.so.5 from 1996) that assume that brk area starts
115257043247SMauro Carvalho Chehab    just after the end of the code+bss.  These applications break when
115357043247SMauro Carvalho Chehab    start of the brk area is randomized.  There are however no known
115457043247SMauro Carvalho Chehab    non-legacy applications that would be broken this way, so for most
115557043247SMauro Carvalho Chehab    systems it is safe to choose full randomization.
115657043247SMauro Carvalho Chehab
115757043247SMauro Carvalho Chehab    Systems with ancient and/or broken binaries should be configured
1158a3cb66a5SStephen Kitt    with ``CONFIG_COMPAT_BRK`` enabled, which excludes the heap from process
115957043247SMauro Carvalho Chehab    address space randomization.
116057043247SMauro Carvalho Chehab==  ===========================================================================
116157043247SMauro Carvalho Chehab
116257043247SMauro Carvalho Chehab
1163a3cb66a5SStephen Kittreal-root-dev
1164a3cb66a5SStephen Kitt=============
1165a3cb66a5SStephen Kitt
11662793e19dSMauro Carvalho ChehabSee Documentation/admin-guide/initrd.rst.
1167a3cb66a5SStephen Kitt
1168a3cb66a5SStephen Kitt
1169a3cb66a5SStephen Kittreboot-cmd (SPARC only)
1170a3cb66a5SStephen Kitt=======================
117157043247SMauro Carvalho Chehab
117257043247SMauro Carvalho Chehab??? This seems to be a way to give an argument to the Sparc
117357043247SMauro Carvalho ChehabROM/Flash boot loader. Maybe to tell it what to do after
117457043247SMauro Carvalho Chehabrebooting. ???
117557043247SMauro Carvalho Chehab
117657043247SMauro Carvalho Chehab
1177a3cb66a5SStephen Kittsched_energy_aware
1178a3cb66a5SStephen Kitt==================
117957043247SMauro Carvalho Chehab
118057043247SMauro Carvalho ChehabEnables/disables Energy Aware Scheduling (EAS). EAS starts
118157043247SMauro Carvalho Chehabautomatically on platforms where it can run (that is,
118257043247SMauro Carvalho Chehabplatforms with asymmetric CPU topologies and having an Energy
118357043247SMauro Carvalho ChehabModel available). If your platform happens to meet the
118457043247SMauro Carvalho Chehabrequirements for EAS but you do not want to use it, change
118557043247SMauro Carvalho Chehabthis value to 0.
118657043247SMauro Carvalho Chehab
1187fcb50170SMel Gormantask_delayacct
1188fcb50170SMel Gorman===============
1189fcb50170SMel Gorman
1190fcb50170SMel GormanEnables/disables task delay accounting (see
11910f60a29cSMauro Carvalho ChehabDocumentation/accounting/delay-accounting.rst. Enabling this feature incurs
1192fcb50170SMel Gormana small amount of overhead in the scheduler but is useful for debugging
1193fcb50170SMel Gormanand performance tuning. It is required by some tools such as iotop.
119457043247SMauro Carvalho Chehab
1195a3cb66a5SStephen Kittsched_schedstats
1196a3cb66a5SStephen Kitt================
119757043247SMauro Carvalho Chehab
119857043247SMauro Carvalho ChehabEnables/disables scheduler statistics. Enabling this feature
119957043247SMauro Carvalho Chehabincurs a small amount of overhead in the scheduler but is
120057043247SMauro Carvalho Chehabuseful for debugging and performance tuning.
120157043247SMauro Carvalho Chehab
1202d151a23dSStephen Kittsched_util_clamp_min
1203d151a23dSStephen Kitt====================
12041f73d1abSQais Yousef
12051f73d1abSQais YousefMax allowed *minimum* utilization.
12061f73d1abSQais Yousef
12071f73d1abSQais YousefDefault value is 1024, which is the maximum possible value.
12081f73d1abSQais Yousef
12091f73d1abSQais YousefIt means that any requested uclamp.min value cannot be greater than
12101f73d1abSQais Yousefsched_util_clamp_min, i.e., it is restricted to the range
12111f73d1abSQais Yousef[0:sched_util_clamp_min].
12121f73d1abSQais Yousef
1213d151a23dSStephen Kittsched_util_clamp_max
1214d151a23dSStephen Kitt====================
12151f73d1abSQais Yousef
12161f73d1abSQais YousefMax allowed *maximum* utilization.
12171f73d1abSQais Yousef
12181f73d1abSQais YousefDefault value is 1024, which is the maximum possible value.
12191f73d1abSQais Yousef
12201f73d1abSQais YousefIt means that any requested uclamp.max value cannot be greater than
12211f73d1abSQais Yousefsched_util_clamp_max, i.e., it is restricted to the range
12221f73d1abSQais Yousef[0:sched_util_clamp_max].
12231f73d1abSQais Yousef
1224d151a23dSStephen Kittsched_util_clamp_min_rt_default
1225d151a23dSStephen Kitt===============================
12261f73d1abSQais Yousef
12271f73d1abSQais YousefBy default Linux is tuned for performance. Which means that RT tasks always run
12281f73d1abSQais Yousefat the highest frequency and most capable (highest capacity) CPU (in
12291f73d1abSQais Yousefheterogeneous systems).
12301f73d1abSQais Yousef
12311f73d1abSQais YousefUclamp achieves this by setting the requested uclamp.min of all RT tasks to
12321f73d1abSQais Yousef1024 by default, which effectively boosts the tasks to run at the highest
12331f73d1abSQais Youseffrequency and biases them to run on the biggest CPU.
12341f73d1abSQais Yousef
12351f73d1abSQais YousefThis knob allows admins to change the default behavior when uclamp is being
12361f73d1abSQais Yousefused. In battery powered devices particularly, running at the maximum
12371f73d1abSQais Yousefcapacity and frequency will increase energy consumption and shorten the battery
12381f73d1abSQais Youseflife.
12391f73d1abSQais Yousef
12401f73d1abSQais YousefThis knob is only effective for RT tasks which the user hasn't modified their
12411f73d1abSQais Yousefrequested uclamp.min value via sched_setattr() syscall.
12421f73d1abSQais Yousef
12431f73d1abSQais YousefThis knob will not escape the range constraint imposed by sched_util_clamp_min
12441f73d1abSQais Yousefdefined above.
12451f73d1abSQais Yousef
12461f73d1abSQais YousefFor example if
12471f73d1abSQais Yousef
12481f73d1abSQais Yousef	sched_util_clamp_min_rt_default = 800
12491f73d1abSQais Yousef	sched_util_clamp_min = 600
12501f73d1abSQais Yousef
12511f73d1abSQais YousefThen the boost will be clamped to 600 because 800 is outside of the permissible
12521f73d1abSQais Yousefrange of [0:600]. This could happen for instance if a powersave mode will
12531f73d1abSQais Yousefrestrict all boosts temporarily by modifying sched_util_clamp_min. As soon as
12541f73d1abSQais Yousefthis restriction is lifted, the requested sched_util_clamp_min_rt_default
12551f73d1abSQais Yousefwill take effect.
125657043247SMauro Carvalho Chehab
1257a3cb66a5SStephen Kittseccomp
1258a3cb66a5SStephen Kitt=======
1259a3cb66a5SStephen Kitt
12602793e19dSMauro Carvalho ChehabSee Documentation/userspace-api/seccomp_filter.rst.
1261a3cb66a5SStephen Kitt
1262a3cb66a5SStephen Kitt
1263a3cb66a5SStephen Kittsg-big-buff
1264a3cb66a5SStephen Kitt===========
126557043247SMauro Carvalho Chehab
126657043247SMauro Carvalho ChehabThis file shows the size of the generic SCSI (sg) buffer.
126757043247SMauro Carvalho ChehabYou can't tune it just yet, but you could change it on
1268a3cb66a5SStephen Kittcompile time by editing ``include/scsi/sg.h`` and changing
1269a3cb66a5SStephen Kittthe value of ``SG_BIG_BUFF``.
127057043247SMauro Carvalho Chehab
127157043247SMauro Carvalho ChehabThere shouldn't be any reason to change this value. If
127257043247SMauro Carvalho Chehabyou can come up with one, you probably know what you
127357043247SMauro Carvalho Chehabare doing anyway :)
127457043247SMauro Carvalho Chehab
127557043247SMauro Carvalho Chehab
1276a3cb66a5SStephen Kittshmall
1277a3cb66a5SStephen Kitt======
127857043247SMauro Carvalho Chehab
127957043247SMauro Carvalho ChehabThis parameter sets the total amount of shared memory pages that
1280a3cb66a5SStephen Kittcan be used system wide. Hence, ``shmall`` should always be at least
1281a3cb66a5SStephen Kitt``ceil(shmmax/PAGE_SIZE)``.
128257043247SMauro Carvalho Chehab
1283a3cb66a5SStephen KittIf you are not sure what the default ``PAGE_SIZE`` is on your Linux
1284a3cb66a5SStephen Kittsystem, you can run the following command::
128557043247SMauro Carvalho Chehab
128657043247SMauro Carvalho Chehab	# getconf PAGE_SIZE
128757043247SMauro Carvalho Chehab
128857043247SMauro Carvalho Chehab
1289a3cb66a5SStephen Kittshmmax
1290a3cb66a5SStephen Kitt======
129157043247SMauro Carvalho Chehab
129257043247SMauro Carvalho ChehabThis value can be used to query and set the run time limit
129357043247SMauro Carvalho Chehabon the maximum shared memory segment size that can be created.
129457043247SMauro Carvalho ChehabShared memory segments up to 1Gb are now supported in the
1295a3cb66a5SStephen Kittkernel.  This value defaults to ``SHMMAX``.
129657043247SMauro Carvalho Chehab
129757043247SMauro Carvalho Chehab
1298a3cb66a5SStephen Kittshmmni
1299a3cb66a5SStephen Kitt======
1300a3cb66a5SStephen Kitt
1301fa5b5264SStephen KittThis value determines the maximum number of shared memory segments.
1302fa5b5264SStephen Kitt4096 by default (``SHMMNI``).
1303fa5b5264SStephen Kitt
1304a3cb66a5SStephen Kitt
1305a3cb66a5SStephen Kittshm_rmid_forced
1306a3cb66a5SStephen Kitt===============
130757043247SMauro Carvalho Chehab
130857043247SMauro Carvalho ChehabLinux lets you set resource limits, including how much memory one
1309a3cb66a5SStephen Kittprocess can consume, via ``setrlimit(2)``.  Unfortunately, shared memory
131057043247SMauro Carvalho Chehabsegments are allowed to exist without association with any process, and
131157043247SMauro Carvalho Chehabthus might not be counted against any resource limits.  If enabled,
131257043247SMauro Carvalho Chehabshared memory segments are automatically destroyed when their attach
131357043247SMauro Carvalho Chehabcount becomes zero after a detach or a process termination.  It will
131457043247SMauro Carvalho Chehabalso destroy segments that were created, but never attached to, on exit
1315a3cb66a5SStephen Kittfrom the process.  The only use left for ``IPC_RMID`` is to immediately
131657043247SMauro Carvalho Chehabdestroy an unattached segment.  Of course, this breaks the way things are
131757043247SMauro Carvalho Chehabdefined, so some applications might stop working.  Note that this
131857043247SMauro Carvalho Chehabfeature will do you no good unless you also configure your resource
1319a3cb66a5SStephen Kittlimits (in particular, ``RLIMIT_AS`` and ``RLIMIT_NPROC``).  Most systems don't
132057043247SMauro Carvalho Chehabneed this.
132157043247SMauro Carvalho Chehab
132257043247SMauro Carvalho ChehabNote that if you change this from 0 to 1, already created segments
132357043247SMauro Carvalho Chehabwithout users and with a dead originative process will be destroyed.
132457043247SMauro Carvalho Chehab
132557043247SMauro Carvalho Chehab
1326a3cb66a5SStephen Kittsysctl_writes_strict
1327a3cb66a5SStephen Kitt====================
132857043247SMauro Carvalho Chehab
132957043247SMauro Carvalho ChehabControl how file position affects the behavior of updating sysctl values
1330a3cb66a5SStephen Kittvia the ``/proc/sys`` interface:
133157043247SMauro Carvalho Chehab
133257043247SMauro Carvalho Chehab  ==   ======================================================================
133357043247SMauro Carvalho Chehab  -1   Legacy per-write sysctl value handling, with no printk warnings.
133457043247SMauro Carvalho Chehab       Each write syscall must fully contain the sysctl value to be
133557043247SMauro Carvalho Chehab       written, and multiple writes on the same sysctl file descriptor
133657043247SMauro Carvalho Chehab       will rewrite the sysctl value, regardless of file position.
133757043247SMauro Carvalho Chehab   0   Same behavior as above, but warn about processes that perform writes
133857043247SMauro Carvalho Chehab       to a sysctl file descriptor when the file position is not 0.
133957043247SMauro Carvalho Chehab   1   (default) Respect file position when writing sysctl strings. Multiple
134057043247SMauro Carvalho Chehab       writes will append to the sysctl value buffer. Anything past the max
134157043247SMauro Carvalho Chehab       length of the sysctl value buffer will be ignored. Writes to numeric
134257043247SMauro Carvalho Chehab       sysctl entries must always be at file position 0 and the value must
134357043247SMauro Carvalho Chehab       be fully contained in the buffer sent in the write syscall.
134457043247SMauro Carvalho Chehab  ==   ======================================================================
134557043247SMauro Carvalho Chehab
134657043247SMauro Carvalho Chehab
1347a3cb66a5SStephen Kittsoftlockup_all_cpu_backtrace
1348a3cb66a5SStephen Kitt============================
134957043247SMauro Carvalho Chehab
135057043247SMauro Carvalho ChehabThis value controls the soft lockup detector thread's behavior
135157043247SMauro Carvalho Chehabwhen a soft lockup condition is detected as to whether or not
135257043247SMauro Carvalho Chehabto gather further debug information. If enabled, each cpu will
135357043247SMauro Carvalho Chehabbe issued an NMI and instructed to capture stack trace.
135457043247SMauro Carvalho Chehab
135557043247SMauro Carvalho ChehabThis feature is only applicable for architectures which support
135657043247SMauro Carvalho ChehabNMI.
135757043247SMauro Carvalho Chehab
1358a3cb66a5SStephen Kitt= ============================================
1359a3cb66a5SStephen Kitt0 Do nothing. This is the default behavior.
1360a3cb66a5SStephen Kitt1 On detection capture more debug information.
1361a3cb66a5SStephen Kitt= ============================================
136257043247SMauro Carvalho Chehab
136357043247SMauro Carvalho Chehab
13640a07bef6SGuilherme G. Piccolisoftlockup_panic
13650a07bef6SGuilherme G. Piccoli=================
13660a07bef6SGuilherme G. Piccoli
13670a07bef6SGuilherme G. PiccoliThis parameter can be used to control whether the kernel panics
13680a07bef6SGuilherme G. Piccoliwhen a soft lockup is detected.
13690a07bef6SGuilherme G. Piccoli
13700a07bef6SGuilherme G. Piccoli= ============================================
13710a07bef6SGuilherme G. Piccoli0 Don't panic on soft lockup.
13720a07bef6SGuilherme G. Piccoli1 Panic on soft lockup.
13730a07bef6SGuilherme G. Piccoli= ============================================
13740a07bef6SGuilherme G. Piccoli
13750a07bef6SGuilherme G. PiccoliThis can also be set using the softlockup_panic kernel parameter.
13760a07bef6SGuilherme G. Piccoli
13770a07bef6SGuilherme G. Piccoli
1378a3cb66a5SStephen Kittsoft_watchdog
1379a3cb66a5SStephen Kitt=============
138057043247SMauro Carvalho Chehab
138157043247SMauro Carvalho ChehabThis parameter can be used to control the soft lockup detector.
138257043247SMauro Carvalho Chehab
1383a3cb66a5SStephen Kitt= =================================
1384a3cb66a5SStephen Kitt0 Disable the soft lockup detector.
1385a3cb66a5SStephen Kitt1 Enable the soft lockup detector.
1386a3cb66a5SStephen Kitt= =================================
138757043247SMauro Carvalho Chehab
138857043247SMauro Carvalho ChehabThe soft lockup detector monitors CPUs for threads that are hogging the CPUs
1389256f7a67SWang Qingwithout rescheduling voluntarily, and thus prevent the 'migration/N' threads
1390256f7a67SWang Qingfrom running, causing the watchdog work fail to execute. The mechanism depends
1391256f7a67SWang Qingon the CPUs ability to respond to timer interrupts which are needed for the
1392256f7a67SWang Qingwatchdog work to be queued by the watchdog timer function, otherwise the NMI
1393256f7a67SWang Qingwatchdog — if enabled — can detect a hard lockup condition.
139457043247SMauro Carvalho Chehab
139557043247SMauro Carvalho Chehab
139672720937SGuilherme G. Piccolisplit_lock_mitigate (x86 only)
139772720937SGuilherme G. Piccoli==============================
139872720937SGuilherme G. Piccoli
139972720937SGuilherme G. PiccoliOn x86, each "split lock" imposes a system-wide performance penalty. On larger
140072720937SGuilherme G. Piccolisystems, large numbers of split locks from unprivileged users can result in
140172720937SGuilherme G. Piccolidenials of service to well-behaved and potentially more important users.
140272720937SGuilherme G. Piccoli
140372720937SGuilherme G. PiccoliThe kernel mitigates these bad users by detecting split locks and imposing
140472720937SGuilherme G. Piccolipenalties: forcing them to wait and only allowing one core to execute split
140572720937SGuilherme G. Piccolilocks at a time.
140672720937SGuilherme G. Piccoli
140772720937SGuilherme G. PiccoliThese mitigations can make those bad applications unbearably slow. Setting
140872720937SGuilherme G. Piccolisplit_lock_mitigate=0 may restore some application performance, but will also
140972720937SGuilherme G. Piccoliincrease system exposure to denial of service attacks from split lock users.
141072720937SGuilherme G. Piccoli
141172720937SGuilherme G. Piccoli= ===================================================================
141272720937SGuilherme G. Piccoli0 Disable the mitigation mode - just warns the split lock on kernel log
141372720937SGuilherme G. Piccoli  and exposes the system to denials of service from the split lockers.
141472720937SGuilherme G. Piccoli1 Enable the mitigation mode (this is the default) - penalizes the split
141572720937SGuilherme G. Piccoli  lockers with intentional performance degradation.
141672720937SGuilherme G. Piccoli= ===================================================================
141772720937SGuilherme G. Piccoli
141872720937SGuilherme G. Piccoli
1419a3cb66a5SStephen Kittstack_erasing
1420a3cb66a5SStephen Kitt=============
142157043247SMauro Carvalho Chehab
142257043247SMauro Carvalho ChehabThis parameter can be used to control kernel stack erasing at the end
1423a3cb66a5SStephen Kittof syscalls for kernels built with ``CONFIG_GCC_PLUGIN_STACKLEAK``.
142457043247SMauro Carvalho Chehab
142557043247SMauro Carvalho ChehabThat erasing reduces the information which kernel stack leak bugs
142657043247SMauro Carvalho Chehabcan reveal and blocks some uninitialized stack variable attacks.
142757043247SMauro Carvalho ChehabThe tradeoff is the performance impact: on a single CPU system kernel
142857043247SMauro Carvalho Chehabcompilation sees a 1% slowdown, other systems and workloads may vary.
142957043247SMauro Carvalho Chehab
1430a3cb66a5SStephen Kitt= ====================================================================
1431a3cb66a5SStephen Kitt0 Kernel stack erasing is disabled, STACKLEAK_METRICS are not updated.
1432a3cb66a5SStephen Kitt1 Kernel stack erasing is enabled (default), it is performed before
143357043247SMauro Carvalho Chehab  returning to the userspace at the end of syscalls.
1434a3cb66a5SStephen Kitt= ====================================================================
1435a3cb66a5SStephen Kitt
1436a3cb66a5SStephen Kitt
1437a3cb66a5SStephen Kittstop-a (SPARC only)
1438a3cb66a5SStephen Kitt===================
1439a3cb66a5SStephen Kitt
1440a1ad4f15SStephen KittControls Stop-A:
1441a1ad4f15SStephen Kitt
1442a1ad4f15SStephen Kitt= ====================================
1443a1ad4f15SStephen Kitt0 Stop-A has no effect.
1444a1ad4f15SStephen Kitt1 Stop-A breaks to the PROM (default).
1445a1ad4f15SStephen Kitt= ====================================
1446a1ad4f15SStephen Kitt
1447a1ad4f15SStephen KittStop-A is always enabled on a panic, so that the user can return to
1448a1ad4f15SStephen Kittthe boot PROM.
1449a1ad4f15SStephen Kitt
1450a3cb66a5SStephen Kitt
1451a3cb66a5SStephen Kittsysrq
1452a3cb66a5SStephen Kitt=====
1453a3cb66a5SStephen Kitt
14542793e19dSMauro Carvalho ChehabSee Documentation/admin-guide/sysrq.rst.
145557043247SMauro Carvalho Chehab
145657043247SMauro Carvalho Chehab
145757043247SMauro Carvalho Chehabtainted
145857043247SMauro Carvalho Chehab=======
145957043247SMauro Carvalho Chehab
146057043247SMauro Carvalho ChehabNon-zero if the kernel has been tainted. Numeric values, which can be
146157043247SMauro Carvalho ChehabORed together. The letters are seen in "Tainted" line of Oops reports.
146257043247SMauro Carvalho Chehab
146357043247SMauro Carvalho Chehab======  =====  ==============================================================
146457043247SMauro Carvalho Chehab     1  `(P)`  proprietary module was loaded
146557043247SMauro Carvalho Chehab     2  `(F)`  module was force loaded
1466547f574fSMathieu Chouquet-Stringer     4  `(S)`  kernel running on an out of specification system
146757043247SMauro Carvalho Chehab     8  `(R)`  module was force unloaded
146857043247SMauro Carvalho Chehab    16  `(M)`  processor reported a Machine Check Exception (MCE)
146957043247SMauro Carvalho Chehab    32  `(B)`  bad page referenced or some unexpected page flags
147057043247SMauro Carvalho Chehab    64  `(U)`  taint requested by userspace application
147157043247SMauro Carvalho Chehab   128  `(D)`  kernel died recently, i.e. there was an OOPS or BUG
147257043247SMauro Carvalho Chehab   256  `(A)`  an ACPI table was overridden by user
147357043247SMauro Carvalho Chehab   512  `(W)`  kernel issued warning
147457043247SMauro Carvalho Chehab  1024  `(C)`  staging driver was loaded
147557043247SMauro Carvalho Chehab  2048  `(I)`  workaround for bug in platform firmware applied
147657043247SMauro Carvalho Chehab  4096  `(O)`  externally-built ("out-of-tree") module was loaded
147757043247SMauro Carvalho Chehab  8192  `(E)`  unsigned module was loaded
147857043247SMauro Carvalho Chehab 16384  `(L)`  soft lockup occurred
147957043247SMauro Carvalho Chehab 32768  `(K)`  kernel has been live patched
148057043247SMauro Carvalho Chehab 65536  `(X)`  Auxiliary taint, defined and used by for distros
148157043247SMauro Carvalho Chehab131072  `(T)`  The kernel was built with the struct randomization plugin
148257043247SMauro Carvalho Chehab======  =====  ==============================================================
148357043247SMauro Carvalho Chehab
14842793e19dSMauro Carvalho ChehabSee Documentation/admin-guide/tainted-kernels.rst for more information.
148557043247SMauro Carvalho Chehab
1486db38d5c1SRafael AquiniNote:
1487db38d5c1SRafael Aquini  writes to this sysctl interface will fail with ``EINVAL`` if the kernel is
1488db38d5c1SRafael Aquini  booted with the command line option ``panic_on_taint=<bitmask>,nousertaint``
1489db38d5c1SRafael Aquini  and any of the ORed together values being written to ``tainted`` match with
1490db38d5c1SRafael Aquini  the bitmask declared on panic_on_taint.
14912793e19dSMauro Carvalho Chehab  See Documentation/admin-guide/kernel-parameters.rst for more details on
14922793e19dSMauro Carvalho Chehab  that particular kernel command line option and its optional
14932793e19dSMauro Carvalho Chehab  ``nousertaint`` switch.
149457043247SMauro Carvalho Chehab
1495a3cb66a5SStephen Kittthreads-max
1496a3cb66a5SStephen Kitt===========
149757043247SMauro Carvalho Chehab
149857043247SMauro Carvalho ChehabThis value controls the maximum number of threads that can be created
1499a3cb66a5SStephen Kittusing ``fork()``.
150057043247SMauro Carvalho Chehab
150157043247SMauro Carvalho ChehabDuring initialization the kernel sets this value such that even if the
150257043247SMauro Carvalho Chehabmaximum number of threads is created, the thread structures occupy only
150357043247SMauro Carvalho Chehaba part (1/8th) of the available RAM pages.
150457043247SMauro Carvalho Chehab
1505a3cb66a5SStephen KittThe minimum value that can be written to ``threads-max`` is 1.
150657043247SMauro Carvalho Chehab
1507a3cb66a5SStephen KittThe maximum value that can be written to ``threads-max`` is given by the
1508a3cb66a5SStephen Kittconstant ``FUTEX_TID_MASK`` (0x3fffffff).
150957043247SMauro Carvalho Chehab
1510a3cb66a5SStephen KittIf a value outside of this range is written to ``threads-max`` an
1511a3cb66a5SStephen Kitt``EINVAL`` error occurs.
151257043247SMauro Carvalho Chehab
151357043247SMauro Carvalho Chehab
151450cdae76SStephen Kitttraceoff_on_warning
151550cdae76SStephen Kitt===================
151650cdae76SStephen Kitt
15172793e19dSMauro Carvalho ChehabWhen set, disables tracing (see Documentation/trace/ftrace.rst) when a
151850cdae76SStephen Kitt``WARN()`` is hit.
151950cdae76SStephen Kitt
152050cdae76SStephen Kitt
152150cdae76SStephen Kitttracepoint_printk
152250cdae76SStephen Kitt=================
152350cdae76SStephen Kitt
152450cdae76SStephen KittWhen tracepoints are sent to printk() (enabled by the ``tp_printk``
152550cdae76SStephen Kittboot parameter), this entry provides runtime control::
152650cdae76SStephen Kitt
152750cdae76SStephen Kitt    echo 0 > /proc/sys/kernel/tracepoint_printk
152850cdae76SStephen Kitt
152950cdae76SStephen Kittwill stop tracepoints from being sent to printk(), and::
153050cdae76SStephen Kitt
153150cdae76SStephen Kitt    echo 1 > /proc/sys/kernel/tracepoint_printk
153250cdae76SStephen Kitt
153350cdae76SStephen Kittwill send them to printk() again.
153450cdae76SStephen Kitt
153550cdae76SStephen KittThis only works if the kernel was booted with ``tp_printk`` enabled.
153650cdae76SStephen Kitt
15372793e19dSMauro Carvalho ChehabSee Documentation/admin-guide/kernel-parameters.rst and
15382793e19dSMauro Carvalho ChehabDocumentation/trace/boottime-trace.rst.
153950cdae76SStephen Kitt
154050cdae76SStephen Kitt
1541997c798eSStephen Kitt.. _unaligned-dump-stack:
1542997c798eSStephen Kitt
1543997c798eSStephen Kittunaligned-dump-stack (ia64)
1544997c798eSStephen Kitt===========================
1545997c798eSStephen Kitt
1546997c798eSStephen KittWhen logging unaligned accesses, controls whether the stack is
1547997c798eSStephen Kittdumped.
1548997c798eSStephen Kitt
1549997c798eSStephen Kitt= ===================================================
1550997c798eSStephen Kitt0 Do not dump the stack. This is the default setting.
1551997c798eSStephen Kitt1 Dump the stack.
1552997c798eSStephen Kitt= ===================================================
1553997c798eSStephen Kitt
1554997c798eSStephen KittSee also `ignore-unaligned-usertrap`_.
1555997c798eSStephen Kitt
1556997c798eSStephen Kitt
1557997c798eSStephen Kittunaligned-trap
1558997c798eSStephen Kitt==============
1559997c798eSStephen Kitt
1560997c798eSStephen KittOn architectures where unaligned accesses cause traps, and where this
1561997c798eSStephen Kittfeature is supported (``CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW``; currently,
156261a6fcccSHuacai Chen``arc``, ``parisc`` and ``loongarch``), controls whether unaligned traps
156361a6fcccSHuacai Chenare caught and emulated (instead of failing).
1564997c798eSStephen Kitt
1565997c798eSStephen Kitt= ========================================================
1566997c798eSStephen Kitt0 Do not emulate unaligned accesses.
1567997c798eSStephen Kitt1 Emulate unaligned accesses. This is the default setting.
1568997c798eSStephen Kitt= ========================================================
1569997c798eSStephen Kitt
1570997c798eSStephen KittSee also `ignore-unaligned-usertrap`_.
1571997c798eSStephen Kitt
1572997c798eSStephen Kitt
1573a3cb66a5SStephen Kittunknown_nmi_panic
1574a3cb66a5SStephen Kitt=================
157557043247SMauro Carvalho Chehab
157657043247SMauro Carvalho ChehabThe value in this file affects behavior of handling NMI. When the
157757043247SMauro Carvalho Chehabvalue is non-zero, unknown NMI is trapped and then panic occurs. At
157857043247SMauro Carvalho Chehabthat time, kernel debugging information is displayed on console.
157957043247SMauro Carvalho Chehab
158057043247SMauro Carvalho ChehabNMI switch that most IA32 servers have fires unknown NMI up, for
158157043247SMauro Carvalho Chehabexample.  If a system hangs up, try pressing the NMI switch.
158257043247SMauro Carvalho Chehab
158357043247SMauro Carvalho Chehab
15845d8e5aeeSStephen Kittunprivileged_bpf_disabled
15855d8e5aeeSStephen Kitt=========================
15865d8e5aeeSStephen Kitt
15875d8e5aeeSStephen KittWriting 1 to this entry will disable unprivileged calls to ``bpf()``;
158808389d88SDaniel Borkmannonce disabled, calling ``bpf()`` without ``CAP_SYS_ADMIN`` or ``CAP_BPF``
158908389d88SDaniel Borkmannwill return ``-EPERM``. Once set to 1, this can't be cleared from the
159008389d88SDaniel Borkmannrunning kernel anymore.
15915d8e5aeeSStephen Kitt
159208389d88SDaniel BorkmannWriting 2 to this entry will also disable unprivileged calls to ``bpf()``,
159308389d88SDaniel Borkmannhowever, an admin can still change this setting later on, if needed, by
159408389d88SDaniel Borkmannwriting 0 or 1 to this entry.
15955d8e5aeeSStephen Kitt
159608389d88SDaniel BorkmannIf ``BPF_UNPRIV_DEFAULT_OFF`` is enabled in the kernel config, then this
159708389d88SDaniel Borkmannentry will default to 2 instead of 0.
159808389d88SDaniel Borkmann
159908389d88SDaniel Borkmann= =============================================================
160008389d88SDaniel Borkmann0 Unprivileged calls to ``bpf()`` are enabled
160108389d88SDaniel Borkmann1 Unprivileged calls to ``bpf()`` are disabled without recovery
160208389d88SDaniel Borkmann2 Unprivileged calls to ``bpf()`` are disabled
160308389d88SDaniel Borkmann= =============================================================
16045d8e5aeeSStephen Kitt
16059fc9e278SKees Cook
16069fc9e278SKees Cookwarn_limit
16079fc9e278SKees Cook==========
16089fc9e278SKees Cook
16099fc9e278SKees CookNumber of kernel warnings after which the kernel should panic when
16109fc9e278SKees Cook``panic_on_warn`` is not set. Setting this to 0 disables checking
16119fc9e278SKees Cookthe warning count. Setting this to 1 has the same effect as setting
16129fc9e278SKees Cook``panic_on_warn=1``. The default value is 0.
16139fc9e278SKees Cook
16149fc9e278SKees Cook
1615a3cb66a5SStephen Kittwatchdog
1616a3cb66a5SStephen Kitt========
161757043247SMauro Carvalho Chehab
161857043247SMauro Carvalho ChehabThis parameter can be used to disable or enable the soft lockup detector
1619a3cb66a5SStephen Kitt*and* the NMI watchdog (i.e. the hard lockup detector) at the same time.
162057043247SMauro Carvalho Chehab
1621a3cb66a5SStephen Kitt= ==============================
1622a3cb66a5SStephen Kitt0 Disable both lockup detectors.
1623a3cb66a5SStephen Kitt1 Enable both lockup detectors.
1624a3cb66a5SStephen Kitt= ==============================
162557043247SMauro Carvalho Chehab
162657043247SMauro Carvalho ChehabThe soft lockup detector and the NMI watchdog can also be disabled or
1627a3cb66a5SStephen Kittenabled individually, using the ``soft_watchdog`` and ``nmi_watchdog``
1628a3cb66a5SStephen Kittparameters.
1629a3cb66a5SStephen KittIf the ``watchdog`` parameter is read, for example by executing::
163057043247SMauro Carvalho Chehab
163157043247SMauro Carvalho Chehab   cat /proc/sys/kernel/watchdog
163257043247SMauro Carvalho Chehab
1633a3cb66a5SStephen Kittthe output of this command (0 or 1) shows the logical OR of
1634a3cb66a5SStephen Kitt``soft_watchdog`` and ``nmi_watchdog``.
163557043247SMauro Carvalho Chehab
163657043247SMauro Carvalho Chehab
1637a3cb66a5SStephen Kittwatchdog_cpumask
1638a3cb66a5SStephen Kitt================
163957043247SMauro Carvalho Chehab
164057043247SMauro Carvalho ChehabThis value can be used to control on which cpus the watchdog may run.
1641a3cb66a5SStephen KittThe default cpumask is all possible cores, but if ``NO_HZ_FULL`` is
164257043247SMauro Carvalho Chehabenabled in the kernel config, and cores are specified with the
1643a3cb66a5SStephen Kitt``nohz_full=`` boot argument, those cores are excluded by default.
164457043247SMauro Carvalho ChehabOffline cores can be included in this mask, and if the core is later
164557043247SMauro Carvalho Chehabbrought online, the watchdog will be started based on the mask value.
164657043247SMauro Carvalho Chehab
1647a3cb66a5SStephen KittTypically this value would only be touched in the ``nohz_full`` case
164857043247SMauro Carvalho Chehabto re-enable cores that by default were not running the watchdog,
164957043247SMauro Carvalho Chehabif a kernel lockup was suspected on those cores.
165057043247SMauro Carvalho Chehab
165157043247SMauro Carvalho ChehabThe argument value is the standard cpulist format for cpumasks,
165257043247SMauro Carvalho Chehabso for example to enable the watchdog on cores 0, 2, 3, and 4 you
165357043247SMauro Carvalho Chehabmight say::
165457043247SMauro Carvalho Chehab
165557043247SMauro Carvalho Chehab  echo 0,2-4 > /proc/sys/kernel/watchdog_cpumask
165657043247SMauro Carvalho Chehab
165757043247SMauro Carvalho Chehab
1658a3cb66a5SStephen Kittwatchdog_thresh
1659a3cb66a5SStephen Kitt===============
166057043247SMauro Carvalho Chehab
166157043247SMauro Carvalho ChehabThis value can be used to control the frequency of hrtimer and NMI
166257043247SMauro Carvalho Chehabevents and the soft and hard lockup thresholds. The default threshold
166357043247SMauro Carvalho Chehabis 10 seconds.
166457043247SMauro Carvalho Chehab
1665a3cb66a5SStephen KittThe softlockup threshold is (``2 * watchdog_thresh``). Setting this
166657043247SMauro Carvalho Chehabtunable to zero will disable lockup detection altogether.
1667