680 lines · 23.0 KB · Text
RawDownload
Documentation for /proc/sys/kernel/*	kernel version 2.2.10	(c) 1998, 1999,  Rik van Riel <riel@nl.linux.org>	(c) 2009,        Shen Feng<shen@cn.fujitsu.com> For general info and legal blurb, please look in README. ============================================================== This file contains documentation for the sysctl files in/proc/sys/kernel/ and is valid for Linux kernel version 2.2. The files in this directory can be used to tune and monitormiscellaneous and general things in the operation of the Linuxkernel. Since some of the files _can_ be used to screw up yoursystem, it is advisable to read both documentation and sourcebefore actually making adjustments. Currently, these files might (depending on your configuration)show up in /proc/sys/kernel: - acct- acpi_video_flags- auto_msgmni- bootloader_type	     [ X86 only ]- bootloader_version	     [ X86 only ]- callhome		     [ S390 only ]- cap_last_cap- core_pattern- core_pipe_limit- core_uses_pid- ctrl-alt-del- dmesg_restrict- domainname- hostname- hotplug- kptr_restrict- kstack_depth_to_print       [ X86 only ]- l2cr                        [ PPC only ]- modprobe                    ==> Documentation/debugging-modules.txt- modules_disabled- msg_next_id		      [ sysv ipc ]- msgmax- msgmnb- msgmni- nmi_watchdog- osrelease- ostype- overflowgid- overflowuid- panic- panic_on_oops- panic_on_unrecovered_nmi- panic_on_stackoverflow- pid_max- powersave-nap               [ PPC only ]- printk- printk_delay- printk_ratelimit- printk_ratelimit_burst- randomize_va_space- real-root-dev               ==> Documentation/initrd.txt- reboot-cmd                  [ SPARC only ]- rtsig-max- rtsig-nr- sem- sem_next_id		      [ sysv ipc ]- sg-big-buff                 [ generic SCSI device (sg) ]- shm_next_id		      [ sysv ipc ]- shm_rmid_forced- shmall- shmmax                      [ sysv ipc ]- shmmni- stop-a                      [ SPARC only ]- sysrq                       ==> Documentation/sysrq.txt- tainted- threads-max- unknown_nmi_panic- watchdog_thresh- version ============================================================== acct: highwater lowwater frequency If BSD-style process accounting is enabled these values controlits behaviour. If free space on filesystem where the log livesgoes below <lowwater>% accounting suspends. If free space getsabove <highwater>% accounting resumes. <Frequency> determineshow often do we check the amount of free space (value is inseconds). Default:4 2 30That is, suspend accounting if there left <= 2% free; resume itif we got >=4%; consider information about amount of free spacevalid for 30 seconds. ============================================================== acpi_video_flags: flags See Doc*/kernel/power/video.txt, it allows mode of video boot to beset during run time. ============================================================== auto_msgmni: Enables/Disables automatic recomputing of msgmni upon memory add/removeor upon ipc namespace creation/removal (see the msgmni descriptionabove). Echoing "1" into this file enables msgmni automatic recomputing.Echoing "0" turns it off. auto_msgmni default value is 1.  ============================================================== bootloader_type: x86 bootloader identification This gives the bootloader type number as indicated by the bootloader,shifted left by 4, and OR'd with the low four bits of the bootloaderversion.  The reason for this encoding is that this used to match thetype_of_loader field in the kernel header; the encoding is kept forbackwards compatibility.  That is, if the full bootloader type numberis 0x15 and the full version number is 0x234, this file will containthe value 340 = 0x154. See the type_of_loader and ext_loader_type fields inDocumentation/x86/boot.txt for additional information. ============================================================== bootloader_version: x86 bootloader version The complete bootloader version number.  In the example above, thisfile will contain the value 564 = 0x234. See the type_of_loader and ext_loader_ver fields inDocumentation/x86/boot.txt for additional information. ============================================================== callhome: Controls the kernel's callhome behavior in case of a kernel panic. The s390 hardware allows an operating system to send a notificationto a service organization (callhome) in case of an operating system panic. When the value in this file is 0 (which is the default behavior)nothing happens in case of a kernel panic. If this value is set to "1"the complete kernel oops message is send to the IBM customer serviceorganization in case the mainframe the Linux operating system is runningon has a service contract with IBM. ============================================================== cap_last_cap Highest valid capability of the running kernel.  ExportsCAP_LAST_CAP from the kernel. ============================================================== core_pattern: core_pattern is used to specify a core dumpfile pattern name.. max length 128 characters; default value is "core". core_pattern is used as a pattern template for the output filename;  certain string patterns (beginning with '%') are substituted with  their actual values.. backward compatibility with core_uses_pid:	If core_pattern does not include "%p" (default does not)	and core_uses_pid is set, then .PID will be appended to	the filename.. corename format specifiers:	%<NUL>	'%' is dropped	%%	output one '%'	%p	pid	%u	uid	%g	gid	%d	dump mode, matches PR_SET_DUMPABLE and		/proc/sys/fs/suid_dumpable	%s	signal number	%t	UNIX time of dump	%h	hostname	%e	executable filename (may be shortened)	%E	executable path	%<OTHER> both are dropped. If the first character of the pattern is a '|', the kernel will treat  the rest of the pattern as a command to run.  The core dump will be  written to the standard input of that program instead of to a file. ============================================================== core_pipe_limit: This sysctl is only applicable when core_pattern is configured to pipecore files to a user space helper (when the first character ofcore_pattern is a '|', see above).  When collecting cores via a pipeto an application, it is occasionally useful for the collectingapplication to gather data about the crashing process from its/proc/pid directory.  In order to do this safely, the kernel must waitfor the collecting process to exit, so as not to remove the crashingprocesses proc files prematurely.  This in turn creates thepossibility that a misbehaving userspace collecting process can blockthe reaping of a crashed process simply by never exiting.  This sysctldefends against that.  It defines how many concurrent crashingprocesses may be piped to user space applications in parallel.  Ifthis value is exceeded, then those crashing processes above that valueare noted via the kernel log and their cores are skipped.  0 is aspecial value, indicating that unlimited processes may be captured inparallel, but that no waiting will take place (i.e. the collectingprocess is not guaranteed access to /proc/<crashing pid>/).  Thisvalue defaults to 0. ============================================================== core_uses_pid: The default coredump filename is "core".  By settingcore_uses_pid to 1, the coredump filename becomes core.PID.If core_pattern does not include "%p" (default does not)and core_uses_pid is set, then .PID will be appended tothe filename. ============================================================== ctrl-alt-del: When the value in this file is 0, ctrl-alt-del is trapped andsent to the init(1) program to handle a graceful restart.When, however, the value is > 0, Linux's reaction to a VulcanNerve Pinch (tm) will be an immediate reboot, without evensyncing its dirty buffers. Note: when a program (like dosemu) has the keyboard in 'raw'mode, the ctrl-alt-del is intercepted by the program before itever reaches the kernel tty layer, and it's up to the programto decide what to do with it. ============================================================== dmesg_restrict: This toggle indicates whether unprivileged users are preventedfrom using dmesg(8) to view messages from the kernel's log buffer.When dmesg_restrict is set to (0) there are no restrictions. Whendmesg_restrict is set set to (1), users must have CAP_SYSLOG to usedmesg(8). The kernel config option CONFIG_SECURITY_DMESG_RESTRICT sets thedefault value of dmesg_restrict. ============================================================== domainname & hostname: These files can be used to set the NIS/YP domainname and thehostname of your box in exactly the same way as the commandsdomainname and hostname, i.e.:# echo "darkstar" > /proc/sys/kernel/hostname# echo "mydomain" > /proc/sys/kernel/domainnamehas the same effect as# hostname "darkstar"# domainname "mydomain" Note, however, that the classic darkstar.frop.org has thehostname "darkstar" and DNS (Internet Domain Name Server)domainname "frop.org", not to be confused with the NIS (NetworkInformation Service) or YP (Yellow Pages) domainname. These twodomain names are in general different. For a detailed discussionsee the hostname(1) man page. ============================================================== hotplug: Path for the hotplug policy agent.Default value is "/sbin/hotplug". ============================================================== kptr_restrict: This toggle indicates whether restrictions are placed onexposing kernel addresses via /proc and other interfaces.  Whenkptr_restrict is set to (0), there are no restrictions.  Whenkptr_restrict is set to (1), the default, kernel pointersprinted using the %pK format specifier will be replaced with 0'sunless the user has CAP_SYSLOG.  When kptr_restrict is set to(2), kernel pointers printed using %pK will be replaced with 0'sregardless of privileges. ============================================================== kstack_depth_to_print: (X86 only) Controls the number of words to print when dumping the rawkernel stack. ============================================================== l2cr: (PPC only) This flag controls the L2 cache of G3 processor boards. If0, the cache is disabled. Enabled if nonzero. ============================================================== modules_disabled: A toggle value indicating if modules are allowed to be loadedin an otherwise modular kernel.  This toggle defaults to off(0), but can be set true (1).  Once true, modules can beneither loaded nor unloaded, and the toggle cannot be set backto false. ============================================================== msg_next_id, sem_next_id, and shm_next_id: These three toggles allows to specify desired id for next allocated IPCobject: message, semaphore or shared memory respectively. By default they are equal to -1, which means generic allocation logic.Possible values to set are in range {0..INT_MAX}. Notes:1) kernel doesn't guarantee, that new object will have desired id. So,it's up to userspace, how to handle an object with "wrong" id.2) Toggle with non-default value will be set back to -1 by kernel aftersuccessful IPC object allocation. ============================================================== nmi_watchdog: Enables/Disables the NMI watchdog on x86 systems. When the value isnon-zero the NMI watchdog is enabled and will continuously test allonline cpus to determine whether or not they are still functioningproperly. Currently, passing "nmi_watchdog=" parameter at boot time isrequired for this function to work. If LAPIC NMI watchdog method is in use (nmi_watchdog=2 kernelparameter), the NMI watchdog shares registers with oprofile. Bydisabling the NMI watchdog, oprofile may have more registers toutilize. ============================================================== osrelease, ostype & version: # cat osrelease2.1.88# cat ostypeLinux# cat version#5 Wed Feb 25 21:49:24 MET 1998 The files osrelease and ostype should be clear enough. Versionneeds a little more clarification however. The '#5' means thatthis is the fifth kernel built from this source base and thedate behind it indicates the time the kernel was built.The only way to tune these values is to rebuild the kernel :-) ============================================================== overflowgid & overflowuid: if your architecture did not always support 32-bit UIDs (i.e. arm,i386, m68k, sh, and sparc32), a fixed UID and GID will be returned toapplications that use the old 16-bit UID/GID system calls, if theactual UID or GID would exceed 65535. These sysctls allow you to change the value of the fixed UID and GID.The default is 65534. ============================================================== panic: The value in this file represents the number of seconds the kernelwaits before rebooting on a panic. When you use the software watchdog,the recommended setting is 60. ============================================================== panic_on_unrecovered_nmi: The default Linux behaviour on an NMI of either memory or unknown isto continue operation. For many environments such as scientificcomputing it is preferable that the box is taken out and the errordealt with than an uncorrected parity/ECC error get propagated. A small number of systems do generate NMI's for bizarre random reasonssuch as power management so the default is off. That sysctl works likethe existing panic controls already in that directory. ============================================================== panic_on_oops: Controls the kernel's behaviour when an oops or BUG is encountered. 0: try to continue operation 1: panic immediately.  If the `panic' sysctl is also non-zero then the   machine will be rebooted. ============================================================== panic_on_stackoverflow: Controls the kernel's behavior when detecting the overflows ofkernel, IRQ and exception stacks except a user stack.This file shows up if CONFIG_DEBUG_STACKOVERFLOW is enabled. 0: try to continue operation. 1: panic immediately. ============================================================== perf_cpu_time_max_percent: Hints to the kernel how much CPU time it should be allowed touse to handle perf sampling events.  If the perf subsystemis informed that its samples are exceeding this limit, itwill drop its sampling frequency to attempt to reduce its CPUusage. Some perf sampling happens in NMIs.  If these samplesunexpectedly take too long to execute, the NMIs can becomestacked up next to each other so much that nothing else isallowed to execute. 0: disable the mechanism.  Do not monitor or correct perf's   sampling rate no matter how CPU time it takes. 1-100: attempt to throttle perf's sample rate to this   percentage of CPU.  Note: the kernel calculates an   "expected" length of each sample event.  100 here means   100% of that expected length.  Even if this is set to   100, you may still see sample throttling if this   length is exceeded.  Set to 0 if you truly do not care   how much CPU is consumed. ==============================================================  pid_max: PID allocation wrap value.  When the kernel's next PID valuereaches this value, it wraps back to a minimum PID value.PIDs of value pid_max or larger are not allocated. ============================================================== ns_last_pid: The last pid allocated in the current (the one task using this sysctllives in) pid namespace. When selecting a pid for a next task on forkkernel tries to allocate a number starting from this one. ============================================================== powersave-nap: (PPC only) If set, Linux-PPC will use the 'nap' mode of powersaving,otherwise the 'doze' mode will be used. ============================================================== printk: The four values in printk denote: console_loglevel,default_message_loglevel, minimum_console_loglevel anddefault_console_loglevel respectively. These values influence printk() behavior when printing orlogging error messages. See 'man 2 syslog' for more info onthe different loglevels. - console_loglevel: messages with a higher priority than  this will be printed to the console- default_message_loglevel: messages without an explicit priority  will be printed with this priority- minimum_console_loglevel: minimum (highest) value to which  console_loglevel can be set- default_console_loglevel: default value for console_loglevel ============================================================== printk_delay:

Lines 1–500 of 680.