18c2ecf20Sopenharmony_ci===================================
28c2ecf20Sopenharmony_ciDocumentation for /proc/sys/kernel/
38c2ecf20Sopenharmony_ci===================================
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci.. See scripts/check-sysctl-docs to keep this up to date
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ciCopyright (c) 1998, 1999,  Rik van Riel <riel@nl.linux.org>
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciCopyright (c) 2009,        Shen Feng<shen@cn.fujitsu.com>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ciFor general info and legal blurb, please look in :doc:`index`.
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci------------------------------------------------------------------------------
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ciThis file contains documentation for the sysctl files in
178c2ecf20Sopenharmony_ci``/proc/sys/kernel/`` and is valid for Linux kernel version 2.2.
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ciThe files in this directory can be used to tune and monitor
208c2ecf20Sopenharmony_cimiscellaneous and general things in the operation of the Linux
218c2ecf20Sopenharmony_cikernel. Since some of the files *can* be used to screw up your
228c2ecf20Sopenharmony_cisystem, it is advisable to read both documentation and source
238c2ecf20Sopenharmony_cibefore actually making adjustments.
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ciCurrently, these files might (depending on your configuration)
268c2ecf20Sopenharmony_cishow up in ``/proc/sys/kernel``:
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci.. contents:: :local:
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ciacct
328c2ecf20Sopenharmony_ci====
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci::
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci    highwater lowwater frequency
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ciIf BSD-style process accounting is enabled these values control
398c2ecf20Sopenharmony_ciits behaviour. If free space on filesystem where the log lives
408c2ecf20Sopenharmony_cigoes below ``lowwater``% accounting suspends. If free space gets
418c2ecf20Sopenharmony_ciabove ``highwater``% accounting resumes. ``frequency`` determines
428c2ecf20Sopenharmony_cihow often do we check the amount of free space (value is in
438c2ecf20Sopenharmony_ciseconds). Default:
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci::
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci    4 2 30
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ciThat is, suspend accounting if free space drops below 2%; resume it
508c2ecf20Sopenharmony_ciif it increases to at least 4%; consider information about amount of
518c2ecf20Sopenharmony_cifree space valid for 30 seconds.
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ciacpi_video_flags
558c2ecf20Sopenharmony_ci================
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ciSee :doc:`/power/video`. This allows the video resume mode to be set,
588c2ecf20Sopenharmony_ciin a similar fashion to the ``acpi_sleep`` kernel parameter, by
598c2ecf20Sopenharmony_cicombining the following values:
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci= =======
628c2ecf20Sopenharmony_ci1 s3_bios
638c2ecf20Sopenharmony_ci2 s3_mode
648c2ecf20Sopenharmony_ci4 s3_beep
658c2ecf20Sopenharmony_ci= =======
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ciauto_msgmni
698c2ecf20Sopenharmony_ci===========
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ciThis variable has no effect and may be removed in future kernel
728c2ecf20Sopenharmony_cireleases. Reading it always returns 0.
738c2ecf20Sopenharmony_ciUp to Linux 3.17, it enabled/disabled automatic recomputing of
748c2ecf20Sopenharmony_ci`msgmni`_
758c2ecf20Sopenharmony_ciupon memory add/remove or upon IPC namespace creation/removal.
768c2ecf20Sopenharmony_ciEchoing "1" into this file enabled msgmni automatic recomputing.
778c2ecf20Sopenharmony_ciEchoing "0" turned it off. The default value was 1.
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_cibootloader_type (x86 only)
818c2ecf20Sopenharmony_ci==========================
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ciThis gives the bootloader type number as indicated by the bootloader,
848c2ecf20Sopenharmony_cishifted left by 4, and OR'd with the low four bits of the bootloader
858c2ecf20Sopenharmony_civersion.  The reason for this encoding is that this used to match the
868c2ecf20Sopenharmony_ci``type_of_loader`` field in the kernel header; the encoding is kept for
878c2ecf20Sopenharmony_cibackwards compatibility.  That is, if the full bootloader type number
888c2ecf20Sopenharmony_ciis 0x15 and the full version number is 0x234, this file will contain
898c2ecf20Sopenharmony_cithe value 340 = 0x154.
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ciSee the ``type_of_loader`` and ``ext_loader_type`` fields in
928c2ecf20Sopenharmony_ci:doc:`/x86/boot` for additional information.
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_cibootloader_version (x86 only)
968c2ecf20Sopenharmony_ci=============================
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ciThe complete bootloader version number.  In the example above, this
998c2ecf20Sopenharmony_cifile will contain the value 564 = 0x234.
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ciSee the ``type_of_loader`` and ``ext_loader_ver`` fields in
1028c2ecf20Sopenharmony_ci:doc:`/x86/boot` for additional information.
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_cibpf_stats_enabled
1068c2ecf20Sopenharmony_ci=================
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ciControls whether the kernel should collect statistics on BPF programs
1098c2ecf20Sopenharmony_ci(total time spent running, number of times run...). Enabling
1108c2ecf20Sopenharmony_cistatistics causes a slight reduction in performance on each program
1118c2ecf20Sopenharmony_cirun. The statistics can be seen using ``bpftool``.
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci= ===================================
1148c2ecf20Sopenharmony_ci0 Don't collect statistics (default).
1158c2ecf20Sopenharmony_ci1 Collect statistics.
1168c2ecf20Sopenharmony_ci= ===================================
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_cicad_pid
1208c2ecf20Sopenharmony_ci=======
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ciThis is the pid which will be signalled on reboot (notably, by
1238c2ecf20Sopenharmony_ciCtrl-Alt-Delete). Writing a value to this file which doesn't
1248c2ecf20Sopenharmony_cicorrespond to a running process will result in ``-ESRCH``.
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ciSee also `ctrl-alt-del`_.
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_cicap_last_cap
1308c2ecf20Sopenharmony_ci============
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ciHighest valid capability of the running kernel.  Exports
1338c2ecf20Sopenharmony_ci``CAP_LAST_CAP`` from the kernel.
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_cicore_pattern
1378c2ecf20Sopenharmony_ci============
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci``core_pattern`` is used to specify a core dumpfile pattern name.
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci* max length 127 characters; default value is "core"
1428c2ecf20Sopenharmony_ci* ``core_pattern`` is used as a pattern template for the output
1438c2ecf20Sopenharmony_ci  filename; certain string patterns (beginning with '%') are
1448c2ecf20Sopenharmony_ci  substituted with their actual values.
1458c2ecf20Sopenharmony_ci* backward compatibility with ``core_uses_pid``:
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci	If ``core_pattern`` does not include "%p" (default does not)
1488c2ecf20Sopenharmony_ci	and ``core_uses_pid`` is set, then .PID will be appended to
1498c2ecf20Sopenharmony_ci	the filename.
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci* corename format specifiers
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci	========	==========================================
1548c2ecf20Sopenharmony_ci	%<NUL>		'%' is dropped
1558c2ecf20Sopenharmony_ci	%%		output one '%'
1568c2ecf20Sopenharmony_ci	%p		pid
1578c2ecf20Sopenharmony_ci	%P		global pid (init PID namespace)
1588c2ecf20Sopenharmony_ci	%i		tid
1598c2ecf20Sopenharmony_ci	%I		global tid (init PID namespace)
1608c2ecf20Sopenharmony_ci	%u		uid (in initial user namespace)
1618c2ecf20Sopenharmony_ci	%g		gid (in initial user namespace)
1628c2ecf20Sopenharmony_ci	%d		dump mode, matches ``PR_SET_DUMPABLE`` and
1638c2ecf20Sopenharmony_ci			``/proc/sys/fs/suid_dumpable``
1648c2ecf20Sopenharmony_ci	%s		signal number
1658c2ecf20Sopenharmony_ci	%t		UNIX time of dump
1668c2ecf20Sopenharmony_ci	%h		hostname
1678c2ecf20Sopenharmony_ci	%e		executable filename (may be shortened, could be changed by prctl etc)
1688c2ecf20Sopenharmony_ci	%f      	executable filename
1698c2ecf20Sopenharmony_ci	%E		executable path
1708c2ecf20Sopenharmony_ci	%c		maximum size of core file by resource limit RLIMIT_CORE
1718c2ecf20Sopenharmony_ci	%<OTHER>	both are dropped
1728c2ecf20Sopenharmony_ci	========	==========================================
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci* If the first character of the pattern is a '|', the kernel will treat
1758c2ecf20Sopenharmony_ci  the rest of the pattern as a command to run.  The core dump will be
1768c2ecf20Sopenharmony_ci  written to the standard input of that program instead of to a file.
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_cicore_pipe_limit
1808c2ecf20Sopenharmony_ci===============
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ciThis sysctl is only applicable when `core_pattern`_ is configured to
1838c2ecf20Sopenharmony_cipipe core files to a user space helper (when the first character of
1848c2ecf20Sopenharmony_ci``core_pattern`` is a '|', see above).
1858c2ecf20Sopenharmony_ciWhen collecting cores via a pipe to an application, it is occasionally
1868c2ecf20Sopenharmony_ciuseful for the collecting application to gather data about the
1878c2ecf20Sopenharmony_cicrashing process from its ``/proc/pid`` directory.
1888c2ecf20Sopenharmony_ciIn order to do this safely, the kernel must wait for the collecting
1898c2ecf20Sopenharmony_ciprocess to exit, so as not to remove the crashing processes proc files
1908c2ecf20Sopenharmony_ciprematurely.
1918c2ecf20Sopenharmony_ciThis in turn creates the possibility that a misbehaving userspace
1928c2ecf20Sopenharmony_cicollecting process can block the reaping of a crashed process simply
1938c2ecf20Sopenharmony_ciby never exiting.
1948c2ecf20Sopenharmony_ciThis sysctl defends against that.
1958c2ecf20Sopenharmony_ciIt defines how many concurrent crashing processes may be piped to user
1968c2ecf20Sopenharmony_cispace applications in parallel.
1978c2ecf20Sopenharmony_ciIf this value is exceeded, then those crashing processes above that
1988c2ecf20Sopenharmony_civalue are noted via the kernel log and their cores are skipped.
1998c2ecf20Sopenharmony_ci0 is a special value, indicating that unlimited processes may be
2008c2ecf20Sopenharmony_cicaptured in parallel, but that no waiting will take place (i.e. the
2018c2ecf20Sopenharmony_cicollecting process is not guaranteed access to ``/proc/<crashing
2028c2ecf20Sopenharmony_cipid>/``).
2038c2ecf20Sopenharmony_ciThis value defaults to 0.
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_cicore_uses_pid
2078c2ecf20Sopenharmony_ci=============
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ciThe default coredump filename is "core".  By setting
2108c2ecf20Sopenharmony_ci``core_uses_pid`` to 1, the coredump filename becomes core.PID.
2118c2ecf20Sopenharmony_ciIf `core_pattern`_ does not include "%p" (default does not)
2128c2ecf20Sopenharmony_ciand ``core_uses_pid`` is set, then .PID will be appended to
2138c2ecf20Sopenharmony_cithe filename.
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_cictrl-alt-del
2178c2ecf20Sopenharmony_ci============
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ciWhen the value in this file is 0, ctrl-alt-del is trapped and
2208c2ecf20Sopenharmony_cisent to the ``init(1)`` program to handle a graceful restart.
2218c2ecf20Sopenharmony_ciWhen, however, the value is > 0, Linux's reaction to a Vulcan
2228c2ecf20Sopenharmony_ciNerve Pinch (tm) will be an immediate reboot, without even
2238c2ecf20Sopenharmony_cisyncing its dirty buffers.
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_ciNote:
2268c2ecf20Sopenharmony_ci  when a program (like dosemu) has the keyboard in 'raw'
2278c2ecf20Sopenharmony_ci  mode, the ctrl-alt-del is intercepted by the program before it
2288c2ecf20Sopenharmony_ci  ever reaches the kernel tty layer, and it's up to the program
2298c2ecf20Sopenharmony_ci  to decide what to do with it.
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci
2328c2ecf20Sopenharmony_cidmesg_restrict
2338c2ecf20Sopenharmony_ci==============
2348c2ecf20Sopenharmony_ci
2358c2ecf20Sopenharmony_ciThis toggle indicates whether unprivileged users are prevented
2368c2ecf20Sopenharmony_cifrom using ``dmesg(8)`` to view messages from the kernel's log
2378c2ecf20Sopenharmony_cibuffer.
2388c2ecf20Sopenharmony_ciWhen ``dmesg_restrict`` is set to 0 there are no restrictions.
2398c2ecf20Sopenharmony_ciWhen ``dmesg_restrict`` is set to 1, users must have
2408c2ecf20Sopenharmony_ci``CAP_SYSLOG`` to use ``dmesg(8)``.
2418c2ecf20Sopenharmony_ci
2428c2ecf20Sopenharmony_ciThe kernel config option ``CONFIG_SECURITY_DMESG_RESTRICT`` sets the
2438c2ecf20Sopenharmony_cidefault value of ``dmesg_restrict``.
2448c2ecf20Sopenharmony_ci
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_cidomainname & hostname
2478c2ecf20Sopenharmony_ci=====================
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_ciThese files can be used to set the NIS/YP domainname and the
2508c2ecf20Sopenharmony_cihostname of your box in exactly the same way as the commands
2518c2ecf20Sopenharmony_cidomainname and hostname, i.e.::
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_ci	# echo "darkstar" > /proc/sys/kernel/hostname
2548c2ecf20Sopenharmony_ci	# echo "mydomain" > /proc/sys/kernel/domainname
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_cihas the same effect as::
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ci	# hostname "darkstar"
2598c2ecf20Sopenharmony_ci	# domainname "mydomain"
2608c2ecf20Sopenharmony_ci
2618c2ecf20Sopenharmony_ciNote, however, that the classic darkstar.frop.org has the
2628c2ecf20Sopenharmony_cihostname "darkstar" and DNS (Internet Domain Name Server)
2638c2ecf20Sopenharmony_cidomainname "frop.org", not to be confused with the NIS (Network
2648c2ecf20Sopenharmony_ciInformation Service) or YP (Yellow Pages) domainname. These two
2658c2ecf20Sopenharmony_cidomain names are in general different. For a detailed discussion
2668c2ecf20Sopenharmony_cisee the ``hostname(1)`` man page.
2678c2ecf20Sopenharmony_ci
2688c2ecf20Sopenharmony_ci
2698c2ecf20Sopenharmony_cifirmware_config
2708c2ecf20Sopenharmony_ci===============
2718c2ecf20Sopenharmony_ci
2728c2ecf20Sopenharmony_ciSee :doc:`/driver-api/firmware/fallback-mechanisms`.
2738c2ecf20Sopenharmony_ci
2748c2ecf20Sopenharmony_ciThe entries in this directory allow the firmware loader helper
2758c2ecf20Sopenharmony_cifallback to be controlled:
2768c2ecf20Sopenharmony_ci
2778c2ecf20Sopenharmony_ci* ``force_sysfs_fallback``, when set to 1, forces the use of the
2788c2ecf20Sopenharmony_ci  fallback;
2798c2ecf20Sopenharmony_ci* ``ignore_sysfs_fallback``, when set to 1, ignores any fallback.
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_ci
2828c2ecf20Sopenharmony_ciftrace_dump_on_oops
2838c2ecf20Sopenharmony_ci===================
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_ciDetermines whether ``ftrace_dump()`` should be called on an oops (or
2868c2ecf20Sopenharmony_cikernel panic). This will output the contents of the ftrace buffers to
2878c2ecf20Sopenharmony_cithe console.  This is very useful for capturing traces that lead to
2888c2ecf20Sopenharmony_cicrashes and outputting them to a serial console.
2898c2ecf20Sopenharmony_ci
2908c2ecf20Sopenharmony_ci= ===================================================
2918c2ecf20Sopenharmony_ci0 Disabled (default).
2928c2ecf20Sopenharmony_ci1 Dump buffers of all CPUs.
2938c2ecf20Sopenharmony_ci2 Dump the buffer of the CPU that triggered the oops.
2948c2ecf20Sopenharmony_ci= ===================================================
2958c2ecf20Sopenharmony_ci
2968c2ecf20Sopenharmony_ci
2978c2ecf20Sopenharmony_ciftrace_enabled, stack_tracer_enabled
2988c2ecf20Sopenharmony_ci====================================
2998c2ecf20Sopenharmony_ci
3008c2ecf20Sopenharmony_ciSee :doc:`/trace/ftrace`.
3018c2ecf20Sopenharmony_ci
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_cihardlockup_all_cpu_backtrace
3048c2ecf20Sopenharmony_ci============================
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ciThis value controls the hard lockup detector behavior when a hard
3078c2ecf20Sopenharmony_cilockup condition is detected as to whether or not to gather further
3088c2ecf20Sopenharmony_cidebug information. If enabled, arch-specific all-CPU stack dumping
3098c2ecf20Sopenharmony_ciwill be initiated.
3108c2ecf20Sopenharmony_ci
3118c2ecf20Sopenharmony_ci= ============================================
3128c2ecf20Sopenharmony_ci0 Do nothing. This is the default behavior.
3138c2ecf20Sopenharmony_ci1 On detection capture more debug information.
3148c2ecf20Sopenharmony_ci= ============================================
3158c2ecf20Sopenharmony_ci
3168c2ecf20Sopenharmony_ci
3178c2ecf20Sopenharmony_cihardlockup_panic
3188c2ecf20Sopenharmony_ci================
3198c2ecf20Sopenharmony_ci
3208c2ecf20Sopenharmony_ciThis parameter can be used to control whether the kernel panics
3218c2ecf20Sopenharmony_ciwhen a hard lockup is detected.
3228c2ecf20Sopenharmony_ci
3238c2ecf20Sopenharmony_ci= ===========================
3248c2ecf20Sopenharmony_ci0 Don't panic on hard lockup.
3258c2ecf20Sopenharmony_ci1 Panic on hard lockup.
3268c2ecf20Sopenharmony_ci= ===========================
3278c2ecf20Sopenharmony_ci
3288c2ecf20Sopenharmony_ciSee :doc:`/admin-guide/lockup-watchdogs` for more information.
3298c2ecf20Sopenharmony_ciThis can also be set using the nmi_watchdog kernel parameter.
3308c2ecf20Sopenharmony_ci
3318c2ecf20Sopenharmony_ci
3328c2ecf20Sopenharmony_cihotplug
3338c2ecf20Sopenharmony_ci=======
3348c2ecf20Sopenharmony_ci
3358c2ecf20Sopenharmony_ciPath for the hotplug policy agent.
3368c2ecf20Sopenharmony_ciDefault value is "``/sbin/hotplug``".
3378c2ecf20Sopenharmony_ci
3388c2ecf20Sopenharmony_ci
3398c2ecf20Sopenharmony_cihung_task_all_cpu_backtrace
3408c2ecf20Sopenharmony_ci===========================
3418c2ecf20Sopenharmony_ci
3428c2ecf20Sopenharmony_ciIf this option is set, the kernel will send an NMI to all CPUs to dump
3438c2ecf20Sopenharmony_citheir backtraces when a hung task is detected. This file shows up if
3448c2ecf20Sopenharmony_ciCONFIG_DETECT_HUNG_TASK and CONFIG_SMP are enabled.
3458c2ecf20Sopenharmony_ci
3468c2ecf20Sopenharmony_ci0: Won't show all CPUs backtraces when a hung task is detected.
3478c2ecf20Sopenharmony_ciThis is the default behavior.
3488c2ecf20Sopenharmony_ci
3498c2ecf20Sopenharmony_ci1: Will non-maskably interrupt all CPUs and dump their backtraces when
3508c2ecf20Sopenharmony_cia hung task is detected.
3518c2ecf20Sopenharmony_ci
3528c2ecf20Sopenharmony_ci
3538c2ecf20Sopenharmony_cihung_task_panic
3548c2ecf20Sopenharmony_ci===============
3558c2ecf20Sopenharmony_ci
3568c2ecf20Sopenharmony_ciControls the kernel's behavior when a hung task is detected.
3578c2ecf20Sopenharmony_ciThis file shows up if ``CONFIG_DETECT_HUNG_TASK`` is enabled.
3588c2ecf20Sopenharmony_ci
3598c2ecf20Sopenharmony_ci= =================================================
3608c2ecf20Sopenharmony_ci0 Continue operation. This is the default behavior.
3618c2ecf20Sopenharmony_ci1 Panic immediately.
3628c2ecf20Sopenharmony_ci= =================================================
3638c2ecf20Sopenharmony_ci
3648c2ecf20Sopenharmony_ci
3658c2ecf20Sopenharmony_cihung_task_check_count
3668c2ecf20Sopenharmony_ci=====================
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_ciThe upper bound on the number of tasks that are checked.
3698c2ecf20Sopenharmony_ciThis file shows up if ``CONFIG_DETECT_HUNG_TASK`` is enabled.
3708c2ecf20Sopenharmony_ci
3718c2ecf20Sopenharmony_ci
3728c2ecf20Sopenharmony_cihung_task_timeout_secs
3738c2ecf20Sopenharmony_ci======================
3748c2ecf20Sopenharmony_ci
3758c2ecf20Sopenharmony_ciWhen a task in D state did not get scheduled
3768c2ecf20Sopenharmony_cifor more than this value report a warning.
3778c2ecf20Sopenharmony_ciThis file shows up if ``CONFIG_DETECT_HUNG_TASK`` is enabled.
3788c2ecf20Sopenharmony_ci
3798c2ecf20Sopenharmony_ci0 means infinite timeout, no checking is done.
3808c2ecf20Sopenharmony_ci
3818c2ecf20Sopenharmony_ciPossible values to set are in range {0:``LONG_MAX``/``HZ``}.
3828c2ecf20Sopenharmony_ci
3838c2ecf20Sopenharmony_ci
3848c2ecf20Sopenharmony_cihung_task_check_interval_secs
3858c2ecf20Sopenharmony_ci=============================
3868c2ecf20Sopenharmony_ci
3878c2ecf20Sopenharmony_ciHung task check interval. If hung task checking is enabled
3888c2ecf20Sopenharmony_ci(see `hung_task_timeout_secs`_), the check is done every
3898c2ecf20Sopenharmony_ci``hung_task_check_interval_secs`` seconds.
3908c2ecf20Sopenharmony_ciThis file shows up if ``CONFIG_DETECT_HUNG_TASK`` is enabled.
3918c2ecf20Sopenharmony_ci
3928c2ecf20Sopenharmony_ci0 (default) means use ``hung_task_timeout_secs`` as checking
3938c2ecf20Sopenharmony_ciinterval.
3948c2ecf20Sopenharmony_ci
3958c2ecf20Sopenharmony_ciPossible values to set are in range {0:``LONG_MAX``/``HZ``}.
3968c2ecf20Sopenharmony_ci
3978c2ecf20Sopenharmony_ci
3988c2ecf20Sopenharmony_cihung_task_warnings
3998c2ecf20Sopenharmony_ci==================
4008c2ecf20Sopenharmony_ci
4018c2ecf20Sopenharmony_ciThe maximum number of warnings to report. During a check interval
4028c2ecf20Sopenharmony_ciif a hung task is detected, this value is decreased by 1.
4038c2ecf20Sopenharmony_ciWhen this value reaches 0, no more warnings will be reported.
4048c2ecf20Sopenharmony_ciThis file shows up if ``CONFIG_DETECT_HUNG_TASK`` is enabled.
4058c2ecf20Sopenharmony_ci
4068c2ecf20Sopenharmony_ci-1: report an infinite number of warnings.
4078c2ecf20Sopenharmony_ci
4088c2ecf20Sopenharmony_ci
4098c2ecf20Sopenharmony_cihyperv_record_panic_msg
4108c2ecf20Sopenharmony_ci=======================
4118c2ecf20Sopenharmony_ci
4128c2ecf20Sopenharmony_ciControls whether the panic kmsg data should be reported to Hyper-V.
4138c2ecf20Sopenharmony_ci
4148c2ecf20Sopenharmony_ci= =========================================================
4158c2ecf20Sopenharmony_ci0 Do not report panic kmsg data.
4168c2ecf20Sopenharmony_ci1 Report the panic kmsg data. This is the default behavior.
4178c2ecf20Sopenharmony_ci= =========================================================
4188c2ecf20Sopenharmony_ci
4198c2ecf20Sopenharmony_ci
4208c2ecf20Sopenharmony_ciignore-unaligned-usertrap
4218c2ecf20Sopenharmony_ci=========================
4228c2ecf20Sopenharmony_ci
4238c2ecf20Sopenharmony_ciOn architectures where unaligned accesses cause traps, and where this
4248c2ecf20Sopenharmony_cifeature is supported (``CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN``;
4258c2ecf20Sopenharmony_cicurrently, ``arc``, ``ia64`` and ``loongarch``), controls whether all
4268c2ecf20Sopenharmony_ciunaligned traps are logged.
4278c2ecf20Sopenharmony_ci
4288c2ecf20Sopenharmony_ci= =============================================================
4298c2ecf20Sopenharmony_ci0 Log all unaligned accesses.
4308c2ecf20Sopenharmony_ci1 Only warn the first time a process traps. This is the default
4318c2ecf20Sopenharmony_ci  setting.
4328c2ecf20Sopenharmony_ci= =============================================================
4338c2ecf20Sopenharmony_ci
4348c2ecf20Sopenharmony_ciSee also `unaligned-trap`_ and `unaligned-dump-stack`_. On ``ia64``,
4358c2ecf20Sopenharmony_cithis allows system administrators to override the
4368c2ecf20Sopenharmony_ci``IA64_THREAD_UAC_NOPRINT`` ``prctl`` and avoid logs being flooded.
4378c2ecf20Sopenharmony_ci
4388c2ecf20Sopenharmony_ci
4398c2ecf20Sopenharmony_cikexec_load_disabled
4408c2ecf20Sopenharmony_ci===================
4418c2ecf20Sopenharmony_ci
4428c2ecf20Sopenharmony_ciA toggle indicating if the ``kexec_load`` syscall has been disabled.
4438c2ecf20Sopenharmony_ciThis value defaults to 0 (false: ``kexec_load`` enabled), but can be
4448c2ecf20Sopenharmony_ciset to 1 (true: ``kexec_load`` disabled).
4458c2ecf20Sopenharmony_ciOnce true, kexec can no longer be used, and the toggle cannot be set
4468c2ecf20Sopenharmony_ciback to false.
4478c2ecf20Sopenharmony_ciThis allows a kexec image to be loaded before disabling the syscall,
4488c2ecf20Sopenharmony_ciallowing a system to set up (and later use) an image without it being
4498c2ecf20Sopenharmony_cialtered.
4508c2ecf20Sopenharmony_ciGenerally used together with the `modules_disabled`_ sysctl.
4518c2ecf20Sopenharmony_ci
4528c2ecf20Sopenharmony_ci
4538c2ecf20Sopenharmony_cikptr_restrict
4548c2ecf20Sopenharmony_ci=============
4558c2ecf20Sopenharmony_ci
4568c2ecf20Sopenharmony_ciThis toggle indicates whether restrictions are placed on
4578c2ecf20Sopenharmony_ciexposing kernel addresses via ``/proc`` and other interfaces.
4588c2ecf20Sopenharmony_ci
4598c2ecf20Sopenharmony_ciWhen ``kptr_restrict`` is set to 0 (the default) the address is hashed
4608c2ecf20Sopenharmony_cibefore printing.
4618c2ecf20Sopenharmony_ci(This is the equivalent to %p.)
4628c2ecf20Sopenharmony_ci
4638c2ecf20Sopenharmony_ciWhen ``kptr_restrict`` is set to 1, kernel pointers printed using the
4648c2ecf20Sopenharmony_ci%pK format specifier will be replaced with 0s unless the user has
4658c2ecf20Sopenharmony_ci``CAP_SYSLOG`` and effective user and group ids are equal to the real
4668c2ecf20Sopenharmony_ciids.
4678c2ecf20Sopenharmony_ciThis is because %pK checks are done at read() time rather than open()
4688c2ecf20Sopenharmony_citime, so if permissions are elevated between the open() and the read()
4698c2ecf20Sopenharmony_ci(e.g via a setuid binary) then %pK will not leak kernel pointers to
4708c2ecf20Sopenharmony_ciunprivileged users.
4718c2ecf20Sopenharmony_ciNote, this is a temporary solution only.
4728c2ecf20Sopenharmony_ciThe correct long-term solution is to do the permission checks at
4738c2ecf20Sopenharmony_ciopen() time.
4748c2ecf20Sopenharmony_ciConsider removing world read permissions from files that use %pK, and
4758c2ecf20Sopenharmony_ciusing `dmesg_restrict`_ to protect against uses of %pK in ``dmesg(8)``
4768c2ecf20Sopenharmony_ciif leaking kernel pointer values to unprivileged users is a concern.
4778c2ecf20Sopenharmony_ci
4788c2ecf20Sopenharmony_ciWhen ``kptr_restrict`` is set to 2, kernel pointers printed using
4798c2ecf20Sopenharmony_ci%pK will be replaced with 0s regardless of privileges.
4808c2ecf20Sopenharmony_ci
4818c2ecf20Sopenharmony_ci
4828c2ecf20Sopenharmony_cimodprobe
4838c2ecf20Sopenharmony_ci========
4848c2ecf20Sopenharmony_ci
4858c2ecf20Sopenharmony_ciThe full path to the usermode helper for autoloading kernel modules,
4868c2ecf20Sopenharmony_ciby default "/sbin/modprobe".  This binary is executed when the kernel
4878c2ecf20Sopenharmony_cirequests a module.  For example, if userspace passes an unknown
4888c2ecf20Sopenharmony_cifilesystem type to mount(), then the kernel will automatically request
4898c2ecf20Sopenharmony_cithe corresponding filesystem module by executing this usermode helper.
4908c2ecf20Sopenharmony_ciThis usermode helper should insert the needed module into the kernel.
4918c2ecf20Sopenharmony_ci
4928c2ecf20Sopenharmony_ciThis sysctl only affects module autoloading.  It has no effect on the
4938c2ecf20Sopenharmony_ciability to explicitly insert modules.
4948c2ecf20Sopenharmony_ci
4958c2ecf20Sopenharmony_ciThis sysctl can be used to debug module loading requests::
4968c2ecf20Sopenharmony_ci
4978c2ecf20Sopenharmony_ci    echo '#! /bin/sh' > /tmp/modprobe
4988c2ecf20Sopenharmony_ci    echo 'echo "$@" >> /tmp/modprobe.log' >> /tmp/modprobe
4998c2ecf20Sopenharmony_ci    echo 'exec /sbin/modprobe "$@"' >> /tmp/modprobe
5008c2ecf20Sopenharmony_ci    chmod a+x /tmp/modprobe
5018c2ecf20Sopenharmony_ci    echo /tmp/modprobe > /proc/sys/kernel/modprobe
5028c2ecf20Sopenharmony_ci
5038c2ecf20Sopenharmony_ciAlternatively, if this sysctl is set to the empty string, then module
5048c2ecf20Sopenharmony_ciautoloading is completely disabled.  The kernel will not try to
5058c2ecf20Sopenharmony_ciexecute a usermode helper at all, nor will it call the
5068c2ecf20Sopenharmony_cikernel_module_request LSM hook.
5078c2ecf20Sopenharmony_ci
5088c2ecf20Sopenharmony_ciIf CONFIG_STATIC_USERMODEHELPER=y is set in the kernel configuration,
5098c2ecf20Sopenharmony_cithen the configured static usermode helper overrides this sysctl,
5108c2ecf20Sopenharmony_ciexcept that the empty string is still accepted to completely disable
5118c2ecf20Sopenharmony_cimodule autoloading as described above.
5128c2ecf20Sopenharmony_ci
5138c2ecf20Sopenharmony_cimodules_disabled
5148c2ecf20Sopenharmony_ci================
5158c2ecf20Sopenharmony_ci
5168c2ecf20Sopenharmony_ciA toggle value indicating if modules are allowed to be loaded
5178c2ecf20Sopenharmony_ciin an otherwise modular kernel.  This toggle defaults to off
5188c2ecf20Sopenharmony_ci(0), but can be set true (1).  Once true, modules can be
5198c2ecf20Sopenharmony_cineither loaded nor unloaded, and the toggle cannot be set back
5208c2ecf20Sopenharmony_cito false.  Generally used with the `kexec_load_disabled`_ toggle.
5218c2ecf20Sopenharmony_ci
5228c2ecf20Sopenharmony_ci
5238c2ecf20Sopenharmony_ci.. _msgmni:
5248c2ecf20Sopenharmony_ci
5258c2ecf20Sopenharmony_cimsgmax, msgmnb, and msgmni
5268c2ecf20Sopenharmony_ci==========================
5278c2ecf20Sopenharmony_ci
5288c2ecf20Sopenharmony_ci``msgmax`` is the maximum size of an IPC message, in bytes. 8192 by
5298c2ecf20Sopenharmony_cidefault (``MSGMAX``).
5308c2ecf20Sopenharmony_ci
5318c2ecf20Sopenharmony_ci``msgmnb`` is the maximum size of an IPC queue, in bytes. 16384 by
5328c2ecf20Sopenharmony_cidefault (``MSGMNB``).
5338c2ecf20Sopenharmony_ci
5348c2ecf20Sopenharmony_ci``msgmni`` is the maximum number of IPC queues. 32000 by default
5358c2ecf20Sopenharmony_ci(``MSGMNI``).
5368c2ecf20Sopenharmony_ci
5378c2ecf20Sopenharmony_ci
5388c2ecf20Sopenharmony_cimsg_next_id, sem_next_id, and shm_next_id (System V IPC)
5398c2ecf20Sopenharmony_ci========================================================
5408c2ecf20Sopenharmony_ci
5418c2ecf20Sopenharmony_ciThese three toggles allows to specify desired id for next allocated IPC
5428c2ecf20Sopenharmony_ciobject: message, semaphore or shared memory respectively.
5438c2ecf20Sopenharmony_ci
5448c2ecf20Sopenharmony_ciBy default they are equal to -1, which means generic allocation logic.
5458c2ecf20Sopenharmony_ciPossible values to set are in range {0:``INT_MAX``}.
5468c2ecf20Sopenharmony_ci
5478c2ecf20Sopenharmony_ciNotes:
5488c2ecf20Sopenharmony_ci  1) kernel doesn't guarantee, that new object will have desired id. So,
5498c2ecf20Sopenharmony_ci     it's up to userspace, how to handle an object with "wrong" id.
5508c2ecf20Sopenharmony_ci  2) Toggle with non-default value will be set back to -1 by kernel after
5518c2ecf20Sopenharmony_ci     successful IPC object allocation. If an IPC object allocation syscall
5528c2ecf20Sopenharmony_ci     fails, it is undefined if the value remains unmodified or is reset to -1.
5538c2ecf20Sopenharmony_ci
5548c2ecf20Sopenharmony_ci
5558c2ecf20Sopenharmony_cingroups_max
5568c2ecf20Sopenharmony_ci===========
5578c2ecf20Sopenharmony_ci
5588c2ecf20Sopenharmony_ciMaximum number of supplementary groups, _i.e._ the maximum size which
5598c2ecf20Sopenharmony_ci``setgroups`` will accept. Exports ``NGROUPS_MAX`` from the kernel.
5608c2ecf20Sopenharmony_ci
5618c2ecf20Sopenharmony_ci
5628c2ecf20Sopenharmony_ci
5638c2ecf20Sopenharmony_cinmi_watchdog
5648c2ecf20Sopenharmony_ci============
5658c2ecf20Sopenharmony_ci
5668c2ecf20Sopenharmony_ciThis parameter can be used to control the NMI watchdog
5678c2ecf20Sopenharmony_ci(i.e. the hard lockup detector) on x86 systems.
5688c2ecf20Sopenharmony_ci
5698c2ecf20Sopenharmony_ci= =================================
5708c2ecf20Sopenharmony_ci0 Disable the hard lockup detector.
5718c2ecf20Sopenharmony_ci1 Enable the hard lockup detector.
5728c2ecf20Sopenharmony_ci= =================================
5738c2ecf20Sopenharmony_ci
5748c2ecf20Sopenharmony_ciThe hard lockup detector monitors each CPU for its ability to respond to
5758c2ecf20Sopenharmony_citimer interrupts. The mechanism utilizes CPU performance counter registers
5768c2ecf20Sopenharmony_cithat are programmed to generate Non-Maskable Interrupts (NMIs) periodically
5778c2ecf20Sopenharmony_ciwhile a CPU is busy. Hence, the alternative name 'NMI watchdog'.
5788c2ecf20Sopenharmony_ci
5798c2ecf20Sopenharmony_ciThe NMI watchdog is disabled by default if the kernel is running as a guest
5808c2ecf20Sopenharmony_ciin a KVM virtual machine. This default can be overridden by adding::
5818c2ecf20Sopenharmony_ci
5828c2ecf20Sopenharmony_ci   nmi_watchdog=1
5838c2ecf20Sopenharmony_ci
5848c2ecf20Sopenharmony_cito the guest kernel command line (see :doc:`/admin-guide/kernel-parameters`).
5858c2ecf20Sopenharmony_ci
5868c2ecf20Sopenharmony_ci
5878c2ecf20Sopenharmony_cinuma_balancing
5888c2ecf20Sopenharmony_ci==============
5898c2ecf20Sopenharmony_ci
5908c2ecf20Sopenharmony_ciEnables/disables automatic page fault based NUMA memory
5918c2ecf20Sopenharmony_cibalancing. Memory is moved automatically to nodes
5928c2ecf20Sopenharmony_cithat access it often.
5938c2ecf20Sopenharmony_ci
5948c2ecf20Sopenharmony_ciEnables/disables automatic NUMA memory balancing. On NUMA machines, there
5958c2ecf20Sopenharmony_ciis a performance penalty if remote memory is accessed by a CPU. When this
5968c2ecf20Sopenharmony_cifeature is enabled the kernel samples what task thread is accessing memory
5978c2ecf20Sopenharmony_ciby periodically unmapping pages and later trapping a page fault. At the
5988c2ecf20Sopenharmony_citime of the page fault, it is determined if the data being accessed should
5998c2ecf20Sopenharmony_cibe migrated to a local memory node.
6008c2ecf20Sopenharmony_ci
6018c2ecf20Sopenharmony_ciThe unmapping of pages and trapping faults incur additional overhead that
6028c2ecf20Sopenharmony_ciideally is offset by improved memory locality but there is no universal
6038c2ecf20Sopenharmony_ciguarantee. If the target workload is already bound to NUMA nodes then this
6048c2ecf20Sopenharmony_cifeature should be disabled. Otherwise, if the system overhead from the
6058c2ecf20Sopenharmony_cifeature is too high then the rate the kernel samples for NUMA hinting
6068c2ecf20Sopenharmony_cifaults may be controlled by the `numa_balancing_scan_period_min_ms,
6078c2ecf20Sopenharmony_cinuma_balancing_scan_delay_ms, numa_balancing_scan_period_max_ms,
6088c2ecf20Sopenharmony_cinuma_balancing_scan_size_mb`_, and numa_balancing_settle_count sysctls.
6098c2ecf20Sopenharmony_ci
6108c2ecf20Sopenharmony_ci
6118c2ecf20Sopenharmony_cinuma_balancing_scan_period_min_ms, numa_balancing_scan_delay_ms, numa_balancing_scan_period_max_ms, numa_balancing_scan_size_mb
6128c2ecf20Sopenharmony_ci===============================================================================================================================
6138c2ecf20Sopenharmony_ci
6148c2ecf20Sopenharmony_ci
6158c2ecf20Sopenharmony_ciAutomatic NUMA balancing scans tasks address space and unmaps pages to
6168c2ecf20Sopenharmony_cidetect if pages are properly placed or if the data should be migrated to a
6178c2ecf20Sopenharmony_cimemory node local to where the task is running.  Every "scan delay" the task
6188c2ecf20Sopenharmony_ciscans the next "scan size" number of pages in its address space. When the
6198c2ecf20Sopenharmony_ciend of the address space is reached the scanner restarts from the beginning.
6208c2ecf20Sopenharmony_ci
6218c2ecf20Sopenharmony_ciIn combination, the "scan delay" and "scan size" determine the scan rate.
6228c2ecf20Sopenharmony_ciWhen "scan delay" decreases, the scan rate increases.  The scan delay and
6238c2ecf20Sopenharmony_cihence the scan rate of every task is adaptive and depends on historical
6248c2ecf20Sopenharmony_cibehaviour. If pages are properly placed then the scan delay increases,
6258c2ecf20Sopenharmony_ciotherwise the scan delay decreases.  The "scan size" is not adaptive but
6268c2ecf20Sopenharmony_cithe higher the "scan size", the higher the scan rate.
6278c2ecf20Sopenharmony_ci
6288c2ecf20Sopenharmony_ciHigher scan rates incur higher system overhead as page faults must be
6298c2ecf20Sopenharmony_citrapped and potentially data must be migrated. However, the higher the scan
6308c2ecf20Sopenharmony_cirate, the more quickly a tasks memory is migrated to a local node if the
6318c2ecf20Sopenharmony_ciworkload pattern changes and minimises performance impact due to remote
6328c2ecf20Sopenharmony_cimemory accesses. These sysctls control the thresholds for scan delays and
6338c2ecf20Sopenharmony_cithe number of pages scanned.
6348c2ecf20Sopenharmony_ci
6358c2ecf20Sopenharmony_ci``numa_balancing_scan_period_min_ms`` is the minimum time in milliseconds to
6368c2ecf20Sopenharmony_ciscan a tasks virtual memory. It effectively controls the maximum scanning
6378c2ecf20Sopenharmony_cirate for each task.
6388c2ecf20Sopenharmony_ci
6398c2ecf20Sopenharmony_ci``numa_balancing_scan_delay_ms`` is the starting "scan delay" used for a task
6408c2ecf20Sopenharmony_ciwhen it initially forks.
6418c2ecf20Sopenharmony_ci
6428c2ecf20Sopenharmony_ci``numa_balancing_scan_period_max_ms`` is the maximum time in milliseconds to
6438c2ecf20Sopenharmony_ciscan a tasks virtual memory. It effectively controls the minimum scanning
6448c2ecf20Sopenharmony_cirate for each task.
6458c2ecf20Sopenharmony_ci
6468c2ecf20Sopenharmony_ci``numa_balancing_scan_size_mb`` is how many megabytes worth of pages are
6478c2ecf20Sopenharmony_ciscanned for a given scan.
6488c2ecf20Sopenharmony_ci
6498c2ecf20Sopenharmony_ci
6508c2ecf20Sopenharmony_cioops_all_cpu_backtrace
6518c2ecf20Sopenharmony_ci======================
6528c2ecf20Sopenharmony_ci
6538c2ecf20Sopenharmony_ciIf this option is set, the kernel will send an NMI to all CPUs to dump
6548c2ecf20Sopenharmony_citheir backtraces when an oops event occurs. It should be used as a last
6558c2ecf20Sopenharmony_ciresort in case a panic cannot be triggered (to protect VMs running, for
6568c2ecf20Sopenharmony_ciexample) or kdump can't be collected. This file shows up if CONFIG_SMP
6578c2ecf20Sopenharmony_ciis enabled.
6588c2ecf20Sopenharmony_ci
6598c2ecf20Sopenharmony_ci0: Won't show all CPUs backtraces when an oops is detected.
6608c2ecf20Sopenharmony_ciThis is the default behavior.
6618c2ecf20Sopenharmony_ci
6628c2ecf20Sopenharmony_ci1: Will non-maskably interrupt all CPUs and dump their backtraces when
6638c2ecf20Sopenharmony_cian oops event is detected.
6648c2ecf20Sopenharmony_ci
6658c2ecf20Sopenharmony_ci
6668c2ecf20Sopenharmony_cioops_limit
6678c2ecf20Sopenharmony_ci==========
6688c2ecf20Sopenharmony_ci
6698c2ecf20Sopenharmony_ciNumber of kernel oopses after which the kernel should panic when
6708c2ecf20Sopenharmony_ci``panic_on_oops`` is not set. Setting this to 0 disables checking
6718c2ecf20Sopenharmony_cithe count. Setting this to  1 has the same effect as setting
6728c2ecf20Sopenharmony_ci``panic_on_oops=1``. The default value is 10000.
6738c2ecf20Sopenharmony_ci
6748c2ecf20Sopenharmony_ci
6758c2ecf20Sopenharmony_ciosrelease, ostype & version
6768c2ecf20Sopenharmony_ci===========================
6778c2ecf20Sopenharmony_ci
6788c2ecf20Sopenharmony_ci::
6798c2ecf20Sopenharmony_ci
6808c2ecf20Sopenharmony_ci  # cat osrelease
6818c2ecf20Sopenharmony_ci  2.1.88
6828c2ecf20Sopenharmony_ci  # cat ostype
6838c2ecf20Sopenharmony_ci  Linux
6848c2ecf20Sopenharmony_ci  # cat version
6858c2ecf20Sopenharmony_ci  #5 Wed Feb 25 21:49:24 MET 1998
6868c2ecf20Sopenharmony_ci
6878c2ecf20Sopenharmony_ciThe files ``osrelease`` and ``ostype`` should be clear enough.
6888c2ecf20Sopenharmony_ci``version``
6898c2ecf20Sopenharmony_cineeds a little more clarification however. The '#5' means that
6908c2ecf20Sopenharmony_cithis is the fifth kernel built from this source base and the
6918c2ecf20Sopenharmony_cidate behind it indicates the time the kernel was built.
6928c2ecf20Sopenharmony_ciThe only way to tune these values is to rebuild the kernel :-)
6938c2ecf20Sopenharmony_ci
6948c2ecf20Sopenharmony_ci
6958c2ecf20Sopenharmony_cioverflowgid & overflowuid
6968c2ecf20Sopenharmony_ci=========================
6978c2ecf20Sopenharmony_ci
6988c2ecf20Sopenharmony_ciif your architecture did not always support 32-bit UIDs (i.e. arm,
6998c2ecf20Sopenharmony_cii386, m68k, sh, and sparc32), a fixed UID and GID will be returned to
7008c2ecf20Sopenharmony_ciapplications that use the old 16-bit UID/GID system calls, if the
7018c2ecf20Sopenharmony_ciactual UID or GID would exceed 65535.
7028c2ecf20Sopenharmony_ci
7038c2ecf20Sopenharmony_ciThese sysctls allow you to change the value of the fixed UID and GID.
7048c2ecf20Sopenharmony_ciThe default is 65534.
7058c2ecf20Sopenharmony_ci
7068c2ecf20Sopenharmony_ci
7078c2ecf20Sopenharmony_cipanic
7088c2ecf20Sopenharmony_ci=====
7098c2ecf20Sopenharmony_ci
7108c2ecf20Sopenharmony_ciThe value in this file determines the behaviour of the kernel on a
7118c2ecf20Sopenharmony_cipanic:
7128c2ecf20Sopenharmony_ci
7138c2ecf20Sopenharmony_ci* if zero, the kernel will loop forever;
7148c2ecf20Sopenharmony_ci* if negative, the kernel will reboot immediately;
7158c2ecf20Sopenharmony_ci* if positive, the kernel will reboot after the corresponding number
7168c2ecf20Sopenharmony_ci  of seconds.
7178c2ecf20Sopenharmony_ci
7188c2ecf20Sopenharmony_ciWhen you use the software watchdog, the recommended setting is 60.
7198c2ecf20Sopenharmony_ci
7208c2ecf20Sopenharmony_ci
7218c2ecf20Sopenharmony_cipanic_on_io_nmi
7228c2ecf20Sopenharmony_ci===============
7238c2ecf20Sopenharmony_ci
7248c2ecf20Sopenharmony_ciControls the kernel's behavior when a CPU receives an NMI caused by
7258c2ecf20Sopenharmony_cian IO error.
7268c2ecf20Sopenharmony_ci
7278c2ecf20Sopenharmony_ci= ==================================================================
7288c2ecf20Sopenharmony_ci0 Try to continue operation (default).
7298c2ecf20Sopenharmony_ci1 Panic immediately. The IO error triggered an NMI. This indicates a
7308c2ecf20Sopenharmony_ci  serious system condition which could result in IO data corruption.
7318c2ecf20Sopenharmony_ci  Rather than continuing, panicking might be a better choice. Some
7328c2ecf20Sopenharmony_ci  servers issue this sort of NMI when the dump button is pushed,
7338c2ecf20Sopenharmony_ci  and you can use this option to take a crash dump.
7348c2ecf20Sopenharmony_ci= ==================================================================
7358c2ecf20Sopenharmony_ci
7368c2ecf20Sopenharmony_ci
7378c2ecf20Sopenharmony_cipanic_on_oops
7388c2ecf20Sopenharmony_ci=============
7398c2ecf20Sopenharmony_ci
7408c2ecf20Sopenharmony_ciControls the kernel's behaviour when an oops or BUG is encountered.
7418c2ecf20Sopenharmony_ci
7428c2ecf20Sopenharmony_ci= ===================================================================
7438c2ecf20Sopenharmony_ci0 Try to continue operation.
7448c2ecf20Sopenharmony_ci1 Panic immediately.  If the `panic` sysctl is also non-zero then the
7458c2ecf20Sopenharmony_ci  machine will be rebooted.
7468c2ecf20Sopenharmony_ci= ===================================================================
7478c2ecf20Sopenharmony_ci
7488c2ecf20Sopenharmony_ci
7498c2ecf20Sopenharmony_cipanic_on_stackoverflow
7508c2ecf20Sopenharmony_ci======================
7518c2ecf20Sopenharmony_ci
7528c2ecf20Sopenharmony_ciControls the kernel's behavior when detecting the overflows of
7538c2ecf20Sopenharmony_cikernel, IRQ and exception stacks except a user stack.
7548c2ecf20Sopenharmony_ciThis file shows up if ``CONFIG_DEBUG_STACKOVERFLOW`` is enabled.
7558c2ecf20Sopenharmony_ci
7568c2ecf20Sopenharmony_ci= ==========================
7578c2ecf20Sopenharmony_ci0 Try to continue operation.
7588c2ecf20Sopenharmony_ci1 Panic immediately.
7598c2ecf20Sopenharmony_ci= ==========================
7608c2ecf20Sopenharmony_ci
7618c2ecf20Sopenharmony_ci
7628c2ecf20Sopenharmony_cipanic_on_unrecovered_nmi
7638c2ecf20Sopenharmony_ci========================
7648c2ecf20Sopenharmony_ci
7658c2ecf20Sopenharmony_ciThe default Linux behaviour on an NMI of either memory or unknown is
7668c2ecf20Sopenharmony_cito continue operation. For many environments such as scientific
7678c2ecf20Sopenharmony_cicomputing it is preferable that the box is taken out and the error
7688c2ecf20Sopenharmony_cidealt with than an uncorrected parity/ECC error get propagated.
7698c2ecf20Sopenharmony_ci
7708c2ecf20Sopenharmony_ciA small number of systems do generate NMIs for bizarre random reasons
7718c2ecf20Sopenharmony_cisuch as power management so the default is off. That sysctl works like
7728c2ecf20Sopenharmony_cithe existing panic controls already in that directory.
7738c2ecf20Sopenharmony_ci
7748c2ecf20Sopenharmony_ci
7758c2ecf20Sopenharmony_cipanic_on_warn
7768c2ecf20Sopenharmony_ci=============
7778c2ecf20Sopenharmony_ci
7788c2ecf20Sopenharmony_ciCalls panic() in the WARN() path when set to 1.  This is useful to avoid
7798c2ecf20Sopenharmony_cia kernel rebuild when attempting to kdump at the location of a WARN().
7808c2ecf20Sopenharmony_ci
7818c2ecf20Sopenharmony_ci= ================================================
7828c2ecf20Sopenharmony_ci0 Only WARN(), default behaviour.
7838c2ecf20Sopenharmony_ci1 Call panic() after printing out WARN() location.
7848c2ecf20Sopenharmony_ci= ================================================
7858c2ecf20Sopenharmony_ci
7868c2ecf20Sopenharmony_ci
7878c2ecf20Sopenharmony_cipanic_print
7888c2ecf20Sopenharmony_ci===========
7898c2ecf20Sopenharmony_ci
7908c2ecf20Sopenharmony_ciBitmask for printing system info when panic happens. User can chose
7918c2ecf20Sopenharmony_cicombination of the following bits:
7928c2ecf20Sopenharmony_ci
7938c2ecf20Sopenharmony_ci=====  ============================================
7948c2ecf20Sopenharmony_cibit 0  print all tasks info
7958c2ecf20Sopenharmony_cibit 1  print system memory info
7968c2ecf20Sopenharmony_cibit 2  print timer info
7978c2ecf20Sopenharmony_cibit 3  print locks info if ``CONFIG_LOCKDEP`` is on
7988c2ecf20Sopenharmony_cibit 4  print ftrace buffer
7998c2ecf20Sopenharmony_cibit 5  print all printk messages in buffer
8008c2ecf20Sopenharmony_ci=====  ============================================
8018c2ecf20Sopenharmony_ci
8028c2ecf20Sopenharmony_ciSo for example to print tasks and memory info on panic, user can::
8038c2ecf20Sopenharmony_ci
8048c2ecf20Sopenharmony_ci  echo 3 > /proc/sys/kernel/panic_print
8058c2ecf20Sopenharmony_ci
8068c2ecf20Sopenharmony_ci
8078c2ecf20Sopenharmony_cipanic_on_rcu_stall
8088c2ecf20Sopenharmony_ci==================
8098c2ecf20Sopenharmony_ci
8108c2ecf20Sopenharmony_ciWhen set to 1, calls panic() after RCU stall detection messages. This
8118c2ecf20Sopenharmony_ciis useful to define the root cause of RCU stalls using a vmcore.
8128c2ecf20Sopenharmony_ci
8138c2ecf20Sopenharmony_ci= ============================================================
8148c2ecf20Sopenharmony_ci0 Do not panic() when RCU stall takes place, default behavior.
8158c2ecf20Sopenharmony_ci1 panic() after printing RCU stall messages.
8168c2ecf20Sopenharmony_ci= ============================================================
8178c2ecf20Sopenharmony_ci
8188c2ecf20Sopenharmony_ci
8198c2ecf20Sopenharmony_ciperf_cpu_time_max_percent
8208c2ecf20Sopenharmony_ci=========================
8218c2ecf20Sopenharmony_ci
8228c2ecf20Sopenharmony_ciHints to the kernel how much CPU time it should be allowed to
8238c2ecf20Sopenharmony_ciuse to handle perf sampling events.  If the perf subsystem
8248c2ecf20Sopenharmony_ciis informed that its samples are exceeding this limit, it
8258c2ecf20Sopenharmony_ciwill drop its sampling frequency to attempt to reduce its CPU
8268c2ecf20Sopenharmony_ciusage.
8278c2ecf20Sopenharmony_ci
8288c2ecf20Sopenharmony_ciSome perf sampling happens in NMIs.  If these samples
8298c2ecf20Sopenharmony_ciunexpectedly take too long to execute, the NMIs can become
8308c2ecf20Sopenharmony_cistacked up next to each other so much that nothing else is
8318c2ecf20Sopenharmony_ciallowed to execute.
8328c2ecf20Sopenharmony_ci
8338c2ecf20Sopenharmony_ci===== ========================================================
8348c2ecf20Sopenharmony_ci0     Disable the mechanism.  Do not monitor or correct perf's
8358c2ecf20Sopenharmony_ci      sampling rate no matter how CPU time it takes.
8368c2ecf20Sopenharmony_ci
8378c2ecf20Sopenharmony_ci1-100 Attempt to throttle perf's sample rate to this
8388c2ecf20Sopenharmony_ci      percentage of CPU.  Note: the kernel calculates an
8398c2ecf20Sopenharmony_ci      "expected" length of each sample event.  100 here means
8408c2ecf20Sopenharmony_ci      100% of that expected length.  Even if this is set to
8418c2ecf20Sopenharmony_ci      100, you may still see sample throttling if this
8428c2ecf20Sopenharmony_ci      length is exceeded.  Set to 0 if you truly do not care
8438c2ecf20Sopenharmony_ci      how much CPU is consumed.
8448c2ecf20Sopenharmony_ci===== ========================================================
8458c2ecf20Sopenharmony_ci
8468c2ecf20Sopenharmony_ci
8478c2ecf20Sopenharmony_ciperf_event_paranoid
8488c2ecf20Sopenharmony_ci===================
8498c2ecf20Sopenharmony_ci
8508c2ecf20Sopenharmony_ciControls use of the performance events system by unprivileged
8518c2ecf20Sopenharmony_ciusers (without CAP_PERFMON).  The default value is 2.
8528c2ecf20Sopenharmony_ci
8538c2ecf20Sopenharmony_ciFor backward compatibility reasons access to system performance
8548c2ecf20Sopenharmony_cimonitoring and observability remains open for CAP_SYS_ADMIN
8558c2ecf20Sopenharmony_ciprivileged processes but CAP_SYS_ADMIN usage for secure system
8568c2ecf20Sopenharmony_ciperformance monitoring and observability operations is discouraged
8578c2ecf20Sopenharmony_ciwith respect to CAP_PERFMON use cases.
8588c2ecf20Sopenharmony_ci
8598c2ecf20Sopenharmony_ci===  ==================================================================
8608c2ecf20Sopenharmony_ci -1  Allow use of (almost) all events by all users.
8618c2ecf20Sopenharmony_ci
8628c2ecf20Sopenharmony_ci     Ignore mlock limit after perf_event_mlock_kb without
8638c2ecf20Sopenharmony_ci     ``CAP_IPC_LOCK``.
8648c2ecf20Sopenharmony_ci
8658c2ecf20Sopenharmony_ci>=0  Disallow ftrace function tracepoint by users without
8668c2ecf20Sopenharmony_ci     ``CAP_PERFMON``.
8678c2ecf20Sopenharmony_ci
8688c2ecf20Sopenharmony_ci     Disallow raw tracepoint access by users without ``CAP_PERFMON``.
8698c2ecf20Sopenharmony_ci
8708c2ecf20Sopenharmony_ci>=1  Disallow CPU event access by users without ``CAP_PERFMON``.
8718c2ecf20Sopenharmony_ci
8728c2ecf20Sopenharmony_ci>=2  Disallow kernel profiling by users without ``CAP_PERFMON``.
8738c2ecf20Sopenharmony_ci===  ==================================================================
8748c2ecf20Sopenharmony_ci
8758c2ecf20Sopenharmony_ci
8768c2ecf20Sopenharmony_ciperf_event_max_stack
8778c2ecf20Sopenharmony_ci====================
8788c2ecf20Sopenharmony_ci
8798c2ecf20Sopenharmony_ciControls maximum number of stack frames to copy for (``attr.sample_type &
8808c2ecf20Sopenharmony_ciPERF_SAMPLE_CALLCHAIN``) configured events, for instance, when using
8818c2ecf20Sopenharmony_ci'``perf record -g``' or '``perf trace --call-graph fp``'.
8828c2ecf20Sopenharmony_ci
8838c2ecf20Sopenharmony_ciThis can only be done when no events are in use that have callchains
8848c2ecf20Sopenharmony_cienabled, otherwise writing to this file will return ``-EBUSY``.
8858c2ecf20Sopenharmony_ci
8868c2ecf20Sopenharmony_ciThe default value is 127.
8878c2ecf20Sopenharmony_ci
8888c2ecf20Sopenharmony_ci
8898c2ecf20Sopenharmony_ciperf_event_mlock_kb
8908c2ecf20Sopenharmony_ci===================
8918c2ecf20Sopenharmony_ci
8928c2ecf20Sopenharmony_ciControl size of per-cpu ring buffer not counted agains mlock limit.
8938c2ecf20Sopenharmony_ci
8948c2ecf20Sopenharmony_ciThe default value is 512 + 1 page
8958c2ecf20Sopenharmony_ci
8968c2ecf20Sopenharmony_ci
8978c2ecf20Sopenharmony_ciperf_event_max_contexts_per_stack
8988c2ecf20Sopenharmony_ci=================================
8998c2ecf20Sopenharmony_ci
9008c2ecf20Sopenharmony_ciControls maximum number of stack frame context entries for
9018c2ecf20Sopenharmony_ci(``attr.sample_type & PERF_SAMPLE_CALLCHAIN``) configured events, for
9028c2ecf20Sopenharmony_ciinstance, when using '``perf record -g``' or '``perf trace --call-graph fp``'.
9038c2ecf20Sopenharmony_ci
9048c2ecf20Sopenharmony_ciThis can only be done when no events are in use that have callchains
9058c2ecf20Sopenharmony_cienabled, otherwise writing to this file will return ``-EBUSY``.
9068c2ecf20Sopenharmony_ci
9078c2ecf20Sopenharmony_ciThe default value is 8.
9088c2ecf20Sopenharmony_ci
9098c2ecf20Sopenharmony_ci
9108c2ecf20Sopenharmony_cipid_max
9118c2ecf20Sopenharmony_ci=======
9128c2ecf20Sopenharmony_ci
9138c2ecf20Sopenharmony_ciPID allocation wrap value.  When the kernel's next PID value
9148c2ecf20Sopenharmony_cireaches this value, it wraps back to a minimum PID value.
9158c2ecf20Sopenharmony_ciPIDs of value ``pid_max`` or larger are not allocated.
9168c2ecf20Sopenharmony_ci
9178c2ecf20Sopenharmony_ci
9188c2ecf20Sopenharmony_cins_last_pid
9198c2ecf20Sopenharmony_ci===========
9208c2ecf20Sopenharmony_ci
9218c2ecf20Sopenharmony_ciThe last pid allocated in the current (the one task using this sysctl
9228c2ecf20Sopenharmony_cilives in) pid namespace. When selecting a pid for a next task on fork
9238c2ecf20Sopenharmony_cikernel tries to allocate a number starting from this one.
9248c2ecf20Sopenharmony_ci
9258c2ecf20Sopenharmony_ci
9268c2ecf20Sopenharmony_cipowersave-nap (PPC only)
9278c2ecf20Sopenharmony_ci========================
9288c2ecf20Sopenharmony_ci
9298c2ecf20Sopenharmony_ciIf set, Linux-PPC will use the 'nap' mode of powersaving,
9308c2ecf20Sopenharmony_ciotherwise the 'doze' mode will be used.
9318c2ecf20Sopenharmony_ci
9328c2ecf20Sopenharmony_ci
9338c2ecf20Sopenharmony_ci==============================================================
9348c2ecf20Sopenharmony_ci
9358c2ecf20Sopenharmony_ciprintk
9368c2ecf20Sopenharmony_ci======
9378c2ecf20Sopenharmony_ci
9388c2ecf20Sopenharmony_ciThe four values in printk denote: ``console_loglevel``,
9398c2ecf20Sopenharmony_ci``default_message_loglevel``, ``minimum_console_loglevel`` and
9408c2ecf20Sopenharmony_ci``default_console_loglevel`` respectively.
9418c2ecf20Sopenharmony_ci
9428c2ecf20Sopenharmony_ciThese values influence printk() behavior when printing or
9438c2ecf20Sopenharmony_cilogging error messages. See '``man 2 syslog``' for more info on
9448c2ecf20Sopenharmony_cithe different loglevels.
9458c2ecf20Sopenharmony_ci
9468c2ecf20Sopenharmony_ci======================== =====================================
9478c2ecf20Sopenharmony_ciconsole_loglevel         messages with a higher priority than
9488c2ecf20Sopenharmony_ci                         this will be printed to the console
9498c2ecf20Sopenharmony_cidefault_message_loglevel messages without an explicit priority
9508c2ecf20Sopenharmony_ci                         will be printed with this priority
9518c2ecf20Sopenharmony_ciminimum_console_loglevel minimum (highest) value to which
9528c2ecf20Sopenharmony_ci                         console_loglevel can be set
9538c2ecf20Sopenharmony_cidefault_console_loglevel default value for console_loglevel
9548c2ecf20Sopenharmony_ci======================== =====================================
9558c2ecf20Sopenharmony_ci
9568c2ecf20Sopenharmony_ci
9578c2ecf20Sopenharmony_ciprintk_delay
9588c2ecf20Sopenharmony_ci============
9598c2ecf20Sopenharmony_ci
9608c2ecf20Sopenharmony_ciDelay each printk message in ``printk_delay`` milliseconds
9618c2ecf20Sopenharmony_ci
9628c2ecf20Sopenharmony_ciValue from 0 - 10000 is allowed.
9638c2ecf20Sopenharmony_ci
9648c2ecf20Sopenharmony_ci
9658c2ecf20Sopenharmony_ciprintk_ratelimit
9668c2ecf20Sopenharmony_ci================
9678c2ecf20Sopenharmony_ci
9688c2ecf20Sopenharmony_ciSome warning messages are rate limited. ``printk_ratelimit`` specifies
9698c2ecf20Sopenharmony_cithe minimum length of time between these messages (in seconds).
9708c2ecf20Sopenharmony_ciThe default value is 5 seconds.
9718c2ecf20Sopenharmony_ci
9728c2ecf20Sopenharmony_ciA value of 0 will disable rate limiting.
9738c2ecf20Sopenharmony_ci
9748c2ecf20Sopenharmony_ci
9758c2ecf20Sopenharmony_ciprintk_ratelimit_burst
9768c2ecf20Sopenharmony_ci======================
9778c2ecf20Sopenharmony_ci
9788c2ecf20Sopenharmony_ciWhile long term we enforce one message per `printk_ratelimit`_
9798c2ecf20Sopenharmony_ciseconds, we do allow a burst of messages to pass through.
9808c2ecf20Sopenharmony_ci``printk_ratelimit_burst`` specifies the number of messages we can
9818c2ecf20Sopenharmony_cisend before ratelimiting kicks in.
9828c2ecf20Sopenharmony_ci
9838c2ecf20Sopenharmony_ciThe default value is 10 messages.
9848c2ecf20Sopenharmony_ci
9858c2ecf20Sopenharmony_ci
9868c2ecf20Sopenharmony_ciprintk_devkmsg
9878c2ecf20Sopenharmony_ci==============
9888c2ecf20Sopenharmony_ci
9898c2ecf20Sopenharmony_ciControl the logging to ``/dev/kmsg`` from userspace:
9908c2ecf20Sopenharmony_ci
9918c2ecf20Sopenharmony_ci========= =============================================
9928c2ecf20Sopenharmony_ciratelimit default, ratelimited
9938c2ecf20Sopenharmony_cion        unlimited logging to /dev/kmsg from userspace
9948c2ecf20Sopenharmony_cioff       logging to /dev/kmsg disabled
9958c2ecf20Sopenharmony_ci========= =============================================
9968c2ecf20Sopenharmony_ci
9978c2ecf20Sopenharmony_ciThe kernel command line parameter ``printk.devkmsg=`` overrides this and is
9988c2ecf20Sopenharmony_cia one-time setting until next reboot: once set, it cannot be changed by
9998c2ecf20Sopenharmony_cithis sysctl interface anymore.
10008c2ecf20Sopenharmony_ci
10018c2ecf20Sopenharmony_ci==============================================================
10028c2ecf20Sopenharmony_ci
10038c2ecf20Sopenharmony_ci
10048c2ecf20Sopenharmony_cipty
10058c2ecf20Sopenharmony_ci===
10068c2ecf20Sopenharmony_ci
10078c2ecf20Sopenharmony_ciSee Documentation/filesystems/devpts.rst.
10088c2ecf20Sopenharmony_ci
10098c2ecf20Sopenharmony_ci
10108c2ecf20Sopenharmony_cirandom
10118c2ecf20Sopenharmony_ci======
10128c2ecf20Sopenharmony_ci
10138c2ecf20Sopenharmony_ciThis is a directory, with the following entries:
10148c2ecf20Sopenharmony_ci
10158c2ecf20Sopenharmony_ci* ``boot_id``: a UUID generated the first time this is retrieved, and
10168c2ecf20Sopenharmony_ci  unvarying after that;
10178c2ecf20Sopenharmony_ci
10188c2ecf20Sopenharmony_ci* ``uuid``: a UUID generated every time this is retrieved (this can
10198c2ecf20Sopenharmony_ci  thus be used to generate UUIDs at will);
10208c2ecf20Sopenharmony_ci
10218c2ecf20Sopenharmony_ci* ``entropy_avail``: the pool's entropy count, in bits;
10228c2ecf20Sopenharmony_ci
10238c2ecf20Sopenharmony_ci* ``poolsize``: the entropy pool size, in bits;
10248c2ecf20Sopenharmony_ci
10258c2ecf20Sopenharmony_ci* ``urandom_min_reseed_secs``: obsolete (used to determine the minimum
10268c2ecf20Sopenharmony_ci  number of seconds between urandom pool reseeding). This file is
10278c2ecf20Sopenharmony_ci  writable for compatibility purposes, but writing to it has no effect
10288c2ecf20Sopenharmony_ci  on any RNG behavior;
10298c2ecf20Sopenharmony_ci
10308c2ecf20Sopenharmony_ci* ``write_wakeup_threshold``: when the entropy count drops below this
10318c2ecf20Sopenharmony_ci  (as a number of bits), processes waiting to write to ``/dev/random``
10328c2ecf20Sopenharmony_ci  are woken up. This file is writable for compatibility purposes, but
10338c2ecf20Sopenharmony_ci  writing to it has no effect on any RNG behavior.
10348c2ecf20Sopenharmony_ci
10358c2ecf20Sopenharmony_ci
10368c2ecf20Sopenharmony_cirandomize_va_space
10378c2ecf20Sopenharmony_ci==================
10388c2ecf20Sopenharmony_ci
10398c2ecf20Sopenharmony_ciThis option can be used to select the type of process address
10408c2ecf20Sopenharmony_cispace randomization that is used in the system, for architectures
10418c2ecf20Sopenharmony_cithat support this feature.
10428c2ecf20Sopenharmony_ci
10438c2ecf20Sopenharmony_ci==  ===========================================================================
10448c2ecf20Sopenharmony_ci0   Turn the process address space randomization off.  This is the
10458c2ecf20Sopenharmony_ci    default for architectures that do not support this feature anyways,
10468c2ecf20Sopenharmony_ci    and kernels that are booted with the "norandmaps" parameter.
10478c2ecf20Sopenharmony_ci
10488c2ecf20Sopenharmony_ci1   Make the addresses of mmap base, stack and VDSO page randomized.
10498c2ecf20Sopenharmony_ci    This, among other things, implies that shared libraries will be
10508c2ecf20Sopenharmony_ci    loaded to random addresses.  Also for PIE-linked binaries, the
10518c2ecf20Sopenharmony_ci    location of code start is randomized.  This is the default if the
10528c2ecf20Sopenharmony_ci    ``CONFIG_COMPAT_BRK`` option is enabled.
10538c2ecf20Sopenharmony_ci
10548c2ecf20Sopenharmony_ci2   Additionally enable heap randomization.  This is the default if
10558c2ecf20Sopenharmony_ci    ``CONFIG_COMPAT_BRK`` is disabled.
10568c2ecf20Sopenharmony_ci
10578c2ecf20Sopenharmony_ci    There are a few legacy applications out there (such as some ancient
10588c2ecf20Sopenharmony_ci    versions of libc.so.5 from 1996) that assume that brk area starts
10598c2ecf20Sopenharmony_ci    just after the end of the code+bss.  These applications break when
10608c2ecf20Sopenharmony_ci    start of the brk area is randomized.  There are however no known
10618c2ecf20Sopenharmony_ci    non-legacy applications that would be broken this way, so for most
10628c2ecf20Sopenharmony_ci    systems it is safe to choose full randomization.
10638c2ecf20Sopenharmony_ci
10648c2ecf20Sopenharmony_ci    Systems with ancient and/or broken binaries should be configured
10658c2ecf20Sopenharmony_ci    with ``CONFIG_COMPAT_BRK`` enabled, which excludes the heap from process
10668c2ecf20Sopenharmony_ci    address space randomization.
10678c2ecf20Sopenharmony_ci==  ===========================================================================
10688c2ecf20Sopenharmony_ci
10698c2ecf20Sopenharmony_ci
10708c2ecf20Sopenharmony_cireal-root-dev
10718c2ecf20Sopenharmony_ci=============
10728c2ecf20Sopenharmony_ci
10738c2ecf20Sopenharmony_ciSee :doc:`/admin-guide/initrd`.
10748c2ecf20Sopenharmony_ci
10758c2ecf20Sopenharmony_ci
10768c2ecf20Sopenharmony_cireboot-cmd (SPARC only)
10778c2ecf20Sopenharmony_ci=======================
10788c2ecf20Sopenharmony_ci
10798c2ecf20Sopenharmony_ci??? This seems to be a way to give an argument to the Sparc
10808c2ecf20Sopenharmony_ciROM/Flash boot loader. Maybe to tell it what to do after
10818c2ecf20Sopenharmony_cirebooting. ???
10828c2ecf20Sopenharmony_ci
10838c2ecf20Sopenharmony_ci
10848c2ecf20Sopenharmony_cisched_energy_aware
10858c2ecf20Sopenharmony_ci==================
10868c2ecf20Sopenharmony_ci
10878c2ecf20Sopenharmony_ciEnables/disables Energy Aware Scheduling (EAS). EAS starts
10888c2ecf20Sopenharmony_ciautomatically on platforms where it can run (that is,
10898c2ecf20Sopenharmony_ciplatforms with asymmetric CPU topologies and having an Energy
10908c2ecf20Sopenharmony_ciModel available). If your platform happens to meet the
10918c2ecf20Sopenharmony_cirequirements for EAS but you do not want to use it, change
10928c2ecf20Sopenharmony_cithis value to 0.
10938c2ecf20Sopenharmony_ci
10948c2ecf20Sopenharmony_ci
10958c2ecf20Sopenharmony_cisched_schedstats
10968c2ecf20Sopenharmony_ci================
10978c2ecf20Sopenharmony_ci
10988c2ecf20Sopenharmony_ciEnables/disables scheduler statistics. Enabling this feature
10998c2ecf20Sopenharmony_ciincurs a small amount of overhead in the scheduler but is
11008c2ecf20Sopenharmony_ciuseful for debugging and performance tuning.
11018c2ecf20Sopenharmony_ci
11028c2ecf20Sopenharmony_cisched_util_clamp_min:
11038c2ecf20Sopenharmony_ci=====================
11048c2ecf20Sopenharmony_ci
11058c2ecf20Sopenharmony_ciMax allowed *minimum* utilization.
11068c2ecf20Sopenharmony_ci
11078c2ecf20Sopenharmony_ciDefault value is 1024, which is the maximum possible value.
11088c2ecf20Sopenharmony_ci
11098c2ecf20Sopenharmony_ciIt means that any requested uclamp.min value cannot be greater than
11108c2ecf20Sopenharmony_cisched_util_clamp_min, i.e., it is restricted to the range
11118c2ecf20Sopenharmony_ci[0:sched_util_clamp_min].
11128c2ecf20Sopenharmony_ci
11138c2ecf20Sopenharmony_cisched_util_clamp_max:
11148c2ecf20Sopenharmony_ci=====================
11158c2ecf20Sopenharmony_ci
11168c2ecf20Sopenharmony_ciMax allowed *maximum* utilization.
11178c2ecf20Sopenharmony_ci
11188c2ecf20Sopenharmony_ciDefault value is 1024, which is the maximum possible value.
11198c2ecf20Sopenharmony_ci
11208c2ecf20Sopenharmony_ciIt means that any requested uclamp.max value cannot be greater than
11218c2ecf20Sopenharmony_cisched_util_clamp_max, i.e., it is restricted to the range
11228c2ecf20Sopenharmony_ci[0:sched_util_clamp_max].
11238c2ecf20Sopenharmony_ci
11248c2ecf20Sopenharmony_cisched_util_clamp_min_rt_default:
11258c2ecf20Sopenharmony_ci================================
11268c2ecf20Sopenharmony_ci
11278c2ecf20Sopenharmony_ciBy default Linux is tuned for performance. Which means that RT tasks always run
11288c2ecf20Sopenharmony_ciat the highest frequency and most capable (highest capacity) CPU (in
11298c2ecf20Sopenharmony_ciheterogeneous systems).
11308c2ecf20Sopenharmony_ci
11318c2ecf20Sopenharmony_ciUclamp achieves this by setting the requested uclamp.min of all RT tasks to
11328c2ecf20Sopenharmony_ci1024 by default, which effectively boosts the tasks to run at the highest
11338c2ecf20Sopenharmony_cifrequency and biases them to run on the biggest CPU.
11348c2ecf20Sopenharmony_ci
11358c2ecf20Sopenharmony_ciThis knob allows admins to change the default behavior when uclamp is being
11368c2ecf20Sopenharmony_ciused. In battery powered devices particularly, running at the maximum
11378c2ecf20Sopenharmony_cicapacity and frequency will increase energy consumption and shorten the battery
11388c2ecf20Sopenharmony_cilife.
11398c2ecf20Sopenharmony_ci
11408c2ecf20Sopenharmony_ciThis knob is only effective for RT tasks which the user hasn't modified their
11418c2ecf20Sopenharmony_cirequested uclamp.min value via sched_setattr() syscall.
11428c2ecf20Sopenharmony_ci
11438c2ecf20Sopenharmony_ciThis knob will not escape the range constraint imposed by sched_util_clamp_min
11448c2ecf20Sopenharmony_cidefined above.
11458c2ecf20Sopenharmony_ci
11468c2ecf20Sopenharmony_ciFor example if
11478c2ecf20Sopenharmony_ci
11488c2ecf20Sopenharmony_ci	sched_util_clamp_min_rt_default = 800
11498c2ecf20Sopenharmony_ci	sched_util_clamp_min = 600
11508c2ecf20Sopenharmony_ci
11518c2ecf20Sopenharmony_ciThen the boost will be clamped to 600 because 800 is outside of the permissible
11528c2ecf20Sopenharmony_cirange of [0:600]. This could happen for instance if a powersave mode will
11538c2ecf20Sopenharmony_cirestrict all boosts temporarily by modifying sched_util_clamp_min. As soon as
11548c2ecf20Sopenharmony_cithis restriction is lifted, the requested sched_util_clamp_min_rt_default
11558c2ecf20Sopenharmony_ciwill take effect.
11568c2ecf20Sopenharmony_ci
11578c2ecf20Sopenharmony_ciseccomp
11588c2ecf20Sopenharmony_ci=======
11598c2ecf20Sopenharmony_ci
11608c2ecf20Sopenharmony_ciSee :doc:`/userspace-api/seccomp_filter`.
11618c2ecf20Sopenharmony_ci
11628c2ecf20Sopenharmony_ci
11638c2ecf20Sopenharmony_cisg-big-buff
11648c2ecf20Sopenharmony_ci===========
11658c2ecf20Sopenharmony_ci
11668c2ecf20Sopenharmony_ciThis file shows the size of the generic SCSI (sg) buffer.
11678c2ecf20Sopenharmony_ciYou can't tune it just yet, but you could change it on
11688c2ecf20Sopenharmony_cicompile time by editing ``include/scsi/sg.h`` and changing
11698c2ecf20Sopenharmony_cithe value of ``SG_BIG_BUFF``.
11708c2ecf20Sopenharmony_ci
11718c2ecf20Sopenharmony_ciThere shouldn't be any reason to change this value. If
11728c2ecf20Sopenharmony_ciyou can come up with one, you probably know what you
11738c2ecf20Sopenharmony_ciare doing anyway :)
11748c2ecf20Sopenharmony_ci
11758c2ecf20Sopenharmony_ci
11768c2ecf20Sopenharmony_cishmall
11778c2ecf20Sopenharmony_ci======
11788c2ecf20Sopenharmony_ci
11798c2ecf20Sopenharmony_ciThis parameter sets the total amount of shared memory pages that
11808c2ecf20Sopenharmony_cican be used system wide. Hence, ``shmall`` should always be at least
11818c2ecf20Sopenharmony_ci``ceil(shmmax/PAGE_SIZE)``.
11828c2ecf20Sopenharmony_ci
11838c2ecf20Sopenharmony_ciIf you are not sure what the default ``PAGE_SIZE`` is on your Linux
11848c2ecf20Sopenharmony_cisystem, you can run the following command::
11858c2ecf20Sopenharmony_ci
11868c2ecf20Sopenharmony_ci	# getconf PAGE_SIZE
11878c2ecf20Sopenharmony_ci
11888c2ecf20Sopenharmony_ci
11898c2ecf20Sopenharmony_cishmmax
11908c2ecf20Sopenharmony_ci======
11918c2ecf20Sopenharmony_ci
11928c2ecf20Sopenharmony_ciThis value can be used to query and set the run time limit
11938c2ecf20Sopenharmony_cion the maximum shared memory segment size that can be created.
11948c2ecf20Sopenharmony_ciShared memory segments up to 1Gb are now supported in the
11958c2ecf20Sopenharmony_cikernel.  This value defaults to ``SHMMAX``.
11968c2ecf20Sopenharmony_ci
11978c2ecf20Sopenharmony_ci
11988c2ecf20Sopenharmony_cishmmni
11998c2ecf20Sopenharmony_ci======
12008c2ecf20Sopenharmony_ci
12018c2ecf20Sopenharmony_ciThis value determines the maximum number of shared memory segments.
12028c2ecf20Sopenharmony_ci4096 by default (``SHMMNI``).
12038c2ecf20Sopenharmony_ci
12048c2ecf20Sopenharmony_ci
12058c2ecf20Sopenharmony_cishm_rmid_forced
12068c2ecf20Sopenharmony_ci===============
12078c2ecf20Sopenharmony_ci
12088c2ecf20Sopenharmony_ciLinux lets you set resource limits, including how much memory one
12098c2ecf20Sopenharmony_ciprocess can consume, via ``setrlimit(2)``.  Unfortunately, shared memory
12108c2ecf20Sopenharmony_cisegments are allowed to exist without association with any process, and
12118c2ecf20Sopenharmony_cithus might not be counted against any resource limits.  If enabled,
12128c2ecf20Sopenharmony_cishared memory segments are automatically destroyed when their attach
12138c2ecf20Sopenharmony_cicount becomes zero after a detach or a process termination.  It will
12148c2ecf20Sopenharmony_cialso destroy segments that were created, but never attached to, on exit
12158c2ecf20Sopenharmony_cifrom the process.  The only use left for ``IPC_RMID`` is to immediately
12168c2ecf20Sopenharmony_cidestroy an unattached segment.  Of course, this breaks the way things are
12178c2ecf20Sopenharmony_cidefined, so some applications might stop working.  Note that this
12188c2ecf20Sopenharmony_cifeature will do you no good unless you also configure your resource
12198c2ecf20Sopenharmony_cilimits (in particular, ``RLIMIT_AS`` and ``RLIMIT_NPROC``).  Most systems don't
12208c2ecf20Sopenharmony_cineed this.
12218c2ecf20Sopenharmony_ci
12228c2ecf20Sopenharmony_ciNote that if you change this from 0 to 1, already created segments
12238c2ecf20Sopenharmony_ciwithout users and with a dead originative process will be destroyed.
12248c2ecf20Sopenharmony_ci
12258c2ecf20Sopenharmony_ci
12268c2ecf20Sopenharmony_cisysctl_writes_strict
12278c2ecf20Sopenharmony_ci====================
12288c2ecf20Sopenharmony_ci
12298c2ecf20Sopenharmony_ciControl how file position affects the behavior of updating sysctl values
12308c2ecf20Sopenharmony_civia the ``/proc/sys`` interface:
12318c2ecf20Sopenharmony_ci
12328c2ecf20Sopenharmony_ci  ==   ======================================================================
12338c2ecf20Sopenharmony_ci  -1   Legacy per-write sysctl value handling, with no printk warnings.
12348c2ecf20Sopenharmony_ci       Each write syscall must fully contain the sysctl value to be
12358c2ecf20Sopenharmony_ci       written, and multiple writes on the same sysctl file descriptor
12368c2ecf20Sopenharmony_ci       will rewrite the sysctl value, regardless of file position.
12378c2ecf20Sopenharmony_ci   0   Same behavior as above, but warn about processes that perform writes
12388c2ecf20Sopenharmony_ci       to a sysctl file descriptor when the file position is not 0.
12398c2ecf20Sopenharmony_ci   1   (default) Respect file position when writing sysctl strings. Multiple
12408c2ecf20Sopenharmony_ci       writes will append to the sysctl value buffer. Anything past the max
12418c2ecf20Sopenharmony_ci       length of the sysctl value buffer will be ignored. Writes to numeric
12428c2ecf20Sopenharmony_ci       sysctl entries must always be at file position 0 and the value must
12438c2ecf20Sopenharmony_ci       be fully contained in the buffer sent in the write syscall.
12448c2ecf20Sopenharmony_ci  ==   ======================================================================
12458c2ecf20Sopenharmony_ci
12468c2ecf20Sopenharmony_ci
12478c2ecf20Sopenharmony_cisoftlockup_all_cpu_backtrace
12488c2ecf20Sopenharmony_ci============================
12498c2ecf20Sopenharmony_ci
12508c2ecf20Sopenharmony_ciThis value controls the soft lockup detector thread's behavior
12518c2ecf20Sopenharmony_ciwhen a soft lockup condition is detected as to whether or not
12528c2ecf20Sopenharmony_cito gather further debug information. If enabled, each cpu will
12538c2ecf20Sopenharmony_cibe issued an NMI and instructed to capture stack trace.
12548c2ecf20Sopenharmony_ci
12558c2ecf20Sopenharmony_ciThis feature is only applicable for architectures which support
12568c2ecf20Sopenharmony_ciNMI.
12578c2ecf20Sopenharmony_ci
12588c2ecf20Sopenharmony_ci= ============================================
12598c2ecf20Sopenharmony_ci0 Do nothing. This is the default behavior.
12608c2ecf20Sopenharmony_ci1 On detection capture more debug information.
12618c2ecf20Sopenharmony_ci= ============================================
12628c2ecf20Sopenharmony_ci
12638c2ecf20Sopenharmony_ci
12648c2ecf20Sopenharmony_cisoftlockup_panic
12658c2ecf20Sopenharmony_ci=================
12668c2ecf20Sopenharmony_ci
12678c2ecf20Sopenharmony_ciThis parameter can be used to control whether the kernel panics
12688c2ecf20Sopenharmony_ciwhen a soft lockup is detected.
12698c2ecf20Sopenharmony_ci
12708c2ecf20Sopenharmony_ci= ============================================
12718c2ecf20Sopenharmony_ci0 Don't panic on soft lockup.
12728c2ecf20Sopenharmony_ci1 Panic on soft lockup.
12738c2ecf20Sopenharmony_ci= ============================================
12748c2ecf20Sopenharmony_ci
12758c2ecf20Sopenharmony_ciThis can also be set using the softlockup_panic kernel parameter.
12768c2ecf20Sopenharmony_ci
12778c2ecf20Sopenharmony_ci
12788c2ecf20Sopenharmony_cisoft_watchdog
12798c2ecf20Sopenharmony_ci=============
12808c2ecf20Sopenharmony_ci
12818c2ecf20Sopenharmony_ciThis parameter can be used to control the soft lockup detector.
12828c2ecf20Sopenharmony_ci
12838c2ecf20Sopenharmony_ci= =================================
12848c2ecf20Sopenharmony_ci0 Disable the soft lockup detector.
12858c2ecf20Sopenharmony_ci1 Enable the soft lockup detector.
12868c2ecf20Sopenharmony_ci= =================================
12878c2ecf20Sopenharmony_ci
12888c2ecf20Sopenharmony_ciThe soft lockup detector monitors CPUs for threads that are hogging the CPUs
12898c2ecf20Sopenharmony_ciwithout rescheduling voluntarily, and thus prevent the 'watchdog/N' threads
12908c2ecf20Sopenharmony_cifrom running. The mechanism depends on the CPUs ability to respond to timer
12918c2ecf20Sopenharmony_ciinterrupts which are needed for the 'watchdog/N' threads to be woken up by
12928c2ecf20Sopenharmony_cithe watchdog timer function, otherwise the NMI watchdog — if enabled — can
12938c2ecf20Sopenharmony_cidetect a hard lockup condition.
12948c2ecf20Sopenharmony_ci
12958c2ecf20Sopenharmony_ci
12968c2ecf20Sopenharmony_cistack_erasing
12978c2ecf20Sopenharmony_ci=============
12988c2ecf20Sopenharmony_ci
12998c2ecf20Sopenharmony_ciThis parameter can be used to control kernel stack erasing at the end
13008c2ecf20Sopenharmony_ciof syscalls for kernels built with ``CONFIG_GCC_PLUGIN_STACKLEAK``.
13018c2ecf20Sopenharmony_ci
13028c2ecf20Sopenharmony_ciThat erasing reduces the information which kernel stack leak bugs
13038c2ecf20Sopenharmony_cican reveal and blocks some uninitialized stack variable attacks.
13048c2ecf20Sopenharmony_ciThe tradeoff is the performance impact: on a single CPU system kernel
13058c2ecf20Sopenharmony_cicompilation sees a 1% slowdown, other systems and workloads may vary.
13068c2ecf20Sopenharmony_ci
13078c2ecf20Sopenharmony_ci= ====================================================================
13088c2ecf20Sopenharmony_ci0 Kernel stack erasing is disabled, STACKLEAK_METRICS are not updated.
13098c2ecf20Sopenharmony_ci1 Kernel stack erasing is enabled (default), it is performed before
13108c2ecf20Sopenharmony_ci  returning to the userspace at the end of syscalls.
13118c2ecf20Sopenharmony_ci= ====================================================================
13128c2ecf20Sopenharmony_ci
13138c2ecf20Sopenharmony_ci
13148c2ecf20Sopenharmony_cistop-a (SPARC only)
13158c2ecf20Sopenharmony_ci===================
13168c2ecf20Sopenharmony_ci
13178c2ecf20Sopenharmony_ciControls Stop-A:
13188c2ecf20Sopenharmony_ci
13198c2ecf20Sopenharmony_ci= ====================================
13208c2ecf20Sopenharmony_ci0 Stop-A has no effect.
13218c2ecf20Sopenharmony_ci1 Stop-A breaks to the PROM (default).
13228c2ecf20Sopenharmony_ci= ====================================
13238c2ecf20Sopenharmony_ci
13248c2ecf20Sopenharmony_ciStop-A is always enabled on a panic, so that the user can return to
13258c2ecf20Sopenharmony_cithe boot PROM.
13268c2ecf20Sopenharmony_ci
13278c2ecf20Sopenharmony_ci
13288c2ecf20Sopenharmony_cisysrq
13298c2ecf20Sopenharmony_ci=====
13308c2ecf20Sopenharmony_ci
13318c2ecf20Sopenharmony_ciSee :doc:`/admin-guide/sysrq`.
13328c2ecf20Sopenharmony_ci
13338c2ecf20Sopenharmony_ci
13348c2ecf20Sopenharmony_citainted
13358c2ecf20Sopenharmony_ci=======
13368c2ecf20Sopenharmony_ci
13378c2ecf20Sopenharmony_ciNon-zero if the kernel has been tainted. Numeric values, which can be
13388c2ecf20Sopenharmony_ciORed together. The letters are seen in "Tainted" line of Oops reports.
13398c2ecf20Sopenharmony_ci
13408c2ecf20Sopenharmony_ci======  =====  ==============================================================
13418c2ecf20Sopenharmony_ci     1  `(P)`  proprietary module was loaded
13428c2ecf20Sopenharmony_ci     2  `(F)`  module was force loaded
13438c2ecf20Sopenharmony_ci     4  `(S)`  SMP kernel oops on an officially SMP incapable processor
13448c2ecf20Sopenharmony_ci     8  `(R)`  module was force unloaded
13458c2ecf20Sopenharmony_ci    16  `(M)`  processor reported a Machine Check Exception (MCE)
13468c2ecf20Sopenharmony_ci    32  `(B)`  bad page referenced or some unexpected page flags
13478c2ecf20Sopenharmony_ci    64  `(U)`  taint requested by userspace application
13488c2ecf20Sopenharmony_ci   128  `(D)`  kernel died recently, i.e. there was an OOPS or BUG
13498c2ecf20Sopenharmony_ci   256  `(A)`  an ACPI table was overridden by user
13508c2ecf20Sopenharmony_ci   512  `(W)`  kernel issued warning
13518c2ecf20Sopenharmony_ci  1024  `(C)`  staging driver was loaded
13528c2ecf20Sopenharmony_ci  2048  `(I)`  workaround for bug in platform firmware applied
13538c2ecf20Sopenharmony_ci  4096  `(O)`  externally-built ("out-of-tree") module was loaded
13548c2ecf20Sopenharmony_ci  8192  `(E)`  unsigned module was loaded
13558c2ecf20Sopenharmony_ci 16384  `(L)`  soft lockup occurred
13568c2ecf20Sopenharmony_ci 32768  `(K)`  kernel has been live patched
13578c2ecf20Sopenharmony_ci 65536  `(X)`  Auxiliary taint, defined and used by for distros
13588c2ecf20Sopenharmony_ci131072  `(T)`  The kernel was built with the struct randomization plugin
13598c2ecf20Sopenharmony_ci======  =====  ==============================================================
13608c2ecf20Sopenharmony_ci
13618c2ecf20Sopenharmony_ciSee :doc:`/admin-guide/tainted-kernels` for more information.
13628c2ecf20Sopenharmony_ci
13638c2ecf20Sopenharmony_ciNote:
13648c2ecf20Sopenharmony_ci  writes to this sysctl interface will fail with ``EINVAL`` if the kernel is
13658c2ecf20Sopenharmony_ci  booted with the command line option ``panic_on_taint=<bitmask>,nousertaint``
13668c2ecf20Sopenharmony_ci  and any of the ORed together values being written to ``tainted`` match with
13678c2ecf20Sopenharmony_ci  the bitmask declared on panic_on_taint.
13688c2ecf20Sopenharmony_ci  See :doc:`/admin-guide/kernel-parameters` for more details on that particular
13698c2ecf20Sopenharmony_ci  kernel command line option and its optional ``nousertaint`` switch.
13708c2ecf20Sopenharmony_ci
13718c2ecf20Sopenharmony_cithreads-max
13728c2ecf20Sopenharmony_ci===========
13738c2ecf20Sopenharmony_ci
13748c2ecf20Sopenharmony_ciThis value controls the maximum number of threads that can be created
13758c2ecf20Sopenharmony_ciusing ``fork()``.
13768c2ecf20Sopenharmony_ci
13778c2ecf20Sopenharmony_ciDuring initialization the kernel sets this value such that even if the
13788c2ecf20Sopenharmony_cimaximum number of threads is created, the thread structures occupy only
13798c2ecf20Sopenharmony_cia part (1/8th) of the available RAM pages.
13808c2ecf20Sopenharmony_ci
13818c2ecf20Sopenharmony_ciThe minimum value that can be written to ``threads-max`` is 1.
13828c2ecf20Sopenharmony_ci
13838c2ecf20Sopenharmony_ciThe maximum value that can be written to ``threads-max`` is given by the
13848c2ecf20Sopenharmony_ciconstant ``FUTEX_TID_MASK`` (0x3fffffff).
13858c2ecf20Sopenharmony_ci
13868c2ecf20Sopenharmony_ciIf a value outside of this range is written to ``threads-max`` an
13878c2ecf20Sopenharmony_ci``EINVAL`` error occurs.
13888c2ecf20Sopenharmony_ci
13898c2ecf20Sopenharmony_ci
13908c2ecf20Sopenharmony_citraceoff_on_warning
13918c2ecf20Sopenharmony_ci===================
13928c2ecf20Sopenharmony_ci
13938c2ecf20Sopenharmony_ciWhen set, disables tracing (see :doc:`/trace/ftrace`) when a
13948c2ecf20Sopenharmony_ci``WARN()`` is hit.
13958c2ecf20Sopenharmony_ci
13968c2ecf20Sopenharmony_ci
13978c2ecf20Sopenharmony_citracepoint_printk
13988c2ecf20Sopenharmony_ci=================
13998c2ecf20Sopenharmony_ci
14008c2ecf20Sopenharmony_ciWhen tracepoints are sent to printk() (enabled by the ``tp_printk``
14018c2ecf20Sopenharmony_ciboot parameter), this entry provides runtime control::
14028c2ecf20Sopenharmony_ci
14038c2ecf20Sopenharmony_ci    echo 0 > /proc/sys/kernel/tracepoint_printk
14048c2ecf20Sopenharmony_ci
14058c2ecf20Sopenharmony_ciwill stop tracepoints from being sent to printk(), and::
14068c2ecf20Sopenharmony_ci
14078c2ecf20Sopenharmony_ci    echo 1 > /proc/sys/kernel/tracepoint_printk
14088c2ecf20Sopenharmony_ci
14098c2ecf20Sopenharmony_ciwill send them to printk() again.
14108c2ecf20Sopenharmony_ci
14118c2ecf20Sopenharmony_ciThis only works if the kernel was booted with ``tp_printk`` enabled.
14128c2ecf20Sopenharmony_ci
14138c2ecf20Sopenharmony_ciSee :doc:`/admin-guide/kernel-parameters` and
14148c2ecf20Sopenharmony_ci:doc:`/trace/boottime-trace`.
14158c2ecf20Sopenharmony_ci
14168c2ecf20Sopenharmony_ci
14178c2ecf20Sopenharmony_ci.. _unaligned-dump-stack:
14188c2ecf20Sopenharmony_ci
14198c2ecf20Sopenharmony_ciunaligned-dump-stack (ia64)
14208c2ecf20Sopenharmony_ci===========================
14218c2ecf20Sopenharmony_ci
14228c2ecf20Sopenharmony_ciWhen logging unaligned accesses, controls whether the stack is
14238c2ecf20Sopenharmony_cidumped.
14248c2ecf20Sopenharmony_ci
14258c2ecf20Sopenharmony_ci= ===================================================
14268c2ecf20Sopenharmony_ci0 Do not dump the stack. This is the default setting.
14278c2ecf20Sopenharmony_ci1 Dump the stack.
14288c2ecf20Sopenharmony_ci= ===================================================
14298c2ecf20Sopenharmony_ci
14308c2ecf20Sopenharmony_ciSee also `ignore-unaligned-usertrap`_.
14318c2ecf20Sopenharmony_ci
14328c2ecf20Sopenharmony_ci
14338c2ecf20Sopenharmony_ciunaligned-trap
14348c2ecf20Sopenharmony_ci==============
14358c2ecf20Sopenharmony_ci
14368c2ecf20Sopenharmony_ciOn architectures where unaligned accesses cause traps, and where this
14378c2ecf20Sopenharmony_cifeature is supported (``CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW``; currently,
14388c2ecf20Sopenharmony_ci``arc``, ``parisc`` and ``loongarch``), controls whether unaligned traps
14398c2ecf20Sopenharmony_ciare caught and emulated (instead of failing).
14408c2ecf20Sopenharmony_ci
14418c2ecf20Sopenharmony_ci= ========================================================
14428c2ecf20Sopenharmony_ci0 Do not emulate unaligned accesses.
14438c2ecf20Sopenharmony_ci1 Emulate unaligned accesses. This is the default setting.
14448c2ecf20Sopenharmony_ci= ========================================================
14458c2ecf20Sopenharmony_ci
14468c2ecf20Sopenharmony_ciSee also `ignore-unaligned-usertrap`_.
14478c2ecf20Sopenharmony_ci
14488c2ecf20Sopenharmony_ci
14498c2ecf20Sopenharmony_ciunknown_nmi_panic
14508c2ecf20Sopenharmony_ci=================
14518c2ecf20Sopenharmony_ci
14528c2ecf20Sopenharmony_ciThe value in this file affects behavior of handling NMI. When the
14538c2ecf20Sopenharmony_civalue is non-zero, unknown NMI is trapped and then panic occurs. At
14548c2ecf20Sopenharmony_cithat time, kernel debugging information is displayed on console.
14558c2ecf20Sopenharmony_ci
14568c2ecf20Sopenharmony_ciNMI switch that most IA32 servers have fires unknown NMI up, for
14578c2ecf20Sopenharmony_ciexample.  If a system hangs up, try pressing the NMI switch.
14588c2ecf20Sopenharmony_ci
14598c2ecf20Sopenharmony_ci
14608c2ecf20Sopenharmony_ciunprivileged_bpf_disabled
14618c2ecf20Sopenharmony_ci=========================
14628c2ecf20Sopenharmony_ci
14638c2ecf20Sopenharmony_ciWriting 1 to this entry will disable unprivileged calls to ``bpf()``;
14648c2ecf20Sopenharmony_cionce disabled, calling ``bpf()`` without ``CAP_SYS_ADMIN`` or ``CAP_BPF``
14658c2ecf20Sopenharmony_ciwill return ``-EPERM``. Once set to 1, this can't be cleared from the
14668c2ecf20Sopenharmony_cirunning kernel anymore.
14678c2ecf20Sopenharmony_ci
14688c2ecf20Sopenharmony_ciWriting 2 to this entry will also disable unprivileged calls to ``bpf()``,
14698c2ecf20Sopenharmony_cihowever, an admin can still change this setting later on, if needed, by
14708c2ecf20Sopenharmony_ciwriting 0 or 1 to this entry.
14718c2ecf20Sopenharmony_ci
14728c2ecf20Sopenharmony_ciIf ``BPF_UNPRIV_DEFAULT_OFF`` is enabled in the kernel config, then this
14738c2ecf20Sopenharmony_cientry will default to 2 instead of 0.
14748c2ecf20Sopenharmony_ci
14758c2ecf20Sopenharmony_ci= =============================================================
14768c2ecf20Sopenharmony_ci0 Unprivileged calls to ``bpf()`` are enabled
14778c2ecf20Sopenharmony_ci1 Unprivileged calls to ``bpf()`` are disabled without recovery
14788c2ecf20Sopenharmony_ci2 Unprivileged calls to ``bpf()`` are disabled
14798c2ecf20Sopenharmony_ci= =============================================================
14808c2ecf20Sopenharmony_ci
14818c2ecf20Sopenharmony_ci
14828c2ecf20Sopenharmony_ciwarn_limit
14838c2ecf20Sopenharmony_ci==========
14848c2ecf20Sopenharmony_ci
14858c2ecf20Sopenharmony_ciNumber of kernel warnings after which the kernel should panic when
14868c2ecf20Sopenharmony_ci``panic_on_warn`` is not set. Setting this to 0 disables checking
14878c2ecf20Sopenharmony_cithe warning count. Setting this to 1 has the same effect as setting
14888c2ecf20Sopenharmony_ci``panic_on_warn=1``. The default value is 0.
14898c2ecf20Sopenharmony_ci
14908c2ecf20Sopenharmony_ci
14918c2ecf20Sopenharmony_ciwatchdog
14928c2ecf20Sopenharmony_ci========
14938c2ecf20Sopenharmony_ci
14948c2ecf20Sopenharmony_ciThis parameter can be used to disable or enable the soft lockup detector
14958c2ecf20Sopenharmony_ci*and* the NMI watchdog (i.e. the hard lockup detector) at the same time.
14968c2ecf20Sopenharmony_ci
14978c2ecf20Sopenharmony_ci= ==============================
14988c2ecf20Sopenharmony_ci0 Disable both lockup detectors.
14998c2ecf20Sopenharmony_ci1 Enable both lockup detectors.
15008c2ecf20Sopenharmony_ci= ==============================
15018c2ecf20Sopenharmony_ci
15028c2ecf20Sopenharmony_ciThe soft lockup detector and the NMI watchdog can also be disabled or
15038c2ecf20Sopenharmony_cienabled individually, using the ``soft_watchdog`` and ``nmi_watchdog``
15048c2ecf20Sopenharmony_ciparameters.
15058c2ecf20Sopenharmony_ciIf the ``watchdog`` parameter is read, for example by executing::
15068c2ecf20Sopenharmony_ci
15078c2ecf20Sopenharmony_ci   cat /proc/sys/kernel/watchdog
15088c2ecf20Sopenharmony_ci
15098c2ecf20Sopenharmony_cithe output of this command (0 or 1) shows the logical OR of
15108c2ecf20Sopenharmony_ci``soft_watchdog`` and ``nmi_watchdog``.
15118c2ecf20Sopenharmony_ci
15128c2ecf20Sopenharmony_ci
15138c2ecf20Sopenharmony_ciwatchdog_cpumask
15148c2ecf20Sopenharmony_ci================
15158c2ecf20Sopenharmony_ci
15168c2ecf20Sopenharmony_ciThis value can be used to control on which cpus the watchdog may run.
15178c2ecf20Sopenharmony_ciThe default cpumask is all possible cores, but if ``NO_HZ_FULL`` is
15188c2ecf20Sopenharmony_cienabled in the kernel config, and cores are specified with the
15198c2ecf20Sopenharmony_ci``nohz_full=`` boot argument, those cores are excluded by default.
15208c2ecf20Sopenharmony_ciOffline cores can be included in this mask, and if the core is later
15218c2ecf20Sopenharmony_cibrought online, the watchdog will be started based on the mask value.
15228c2ecf20Sopenharmony_ci
15238c2ecf20Sopenharmony_ciTypically this value would only be touched in the ``nohz_full`` case
15248c2ecf20Sopenharmony_cito re-enable cores that by default were not running the watchdog,
15258c2ecf20Sopenharmony_ciif a kernel lockup was suspected on those cores.
15268c2ecf20Sopenharmony_ci
15278c2ecf20Sopenharmony_ciThe argument value is the standard cpulist format for cpumasks,
15288c2ecf20Sopenharmony_ciso for example to enable the watchdog on cores 0, 2, 3, and 4 you
15298c2ecf20Sopenharmony_cimight say::
15308c2ecf20Sopenharmony_ci
15318c2ecf20Sopenharmony_ci  echo 0,2-4 > /proc/sys/kernel/watchdog_cpumask
15328c2ecf20Sopenharmony_ci
15338c2ecf20Sopenharmony_ci
15348c2ecf20Sopenharmony_ciwatchdog_thresh
15358c2ecf20Sopenharmony_ci===============
15368c2ecf20Sopenharmony_ci
15378c2ecf20Sopenharmony_ciThis value can be used to control the frequency of hrtimer and NMI
15388c2ecf20Sopenharmony_cievents and the soft and hard lockup thresholds. The default threshold
15398c2ecf20Sopenharmony_ciis 10 seconds.
15408c2ecf20Sopenharmony_ci
15418c2ecf20Sopenharmony_ciThe softlockup threshold is (``2 * watchdog_thresh``). Setting this
15428c2ecf20Sopenharmony_citunable to zero will disable lockup detection altogether.
1543