OSDN Git Service

(split) LDP: Update original to LDP v3.52.
[linuxjm/LDP_man-pages.git] / original / man5 / proc.5
1 .\" Copyright (C) 1994, 1995 by Daniel Quinlan (quinlan@yggdrasil.com)
2 .\" and Copyright (C) 2002-2008 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" with networking additions from Alan Cox (A.Cox@swansea.ac.uk)
4 .\" and scsi additions from Michael Neuffer (neuffer@mail.uni-mainz.de)
5 .\" and sysctl additions from Andries Brouwer (aeb@cwi.nl)
6 .\" and System V IPC (as well as various other) additions from
7 .\" Michael Kerrisk <mtk.manpages@gmail.com>
8 .\"
9 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
10 .\" This is free documentation; you can redistribute it and/or
11 .\" modify it under the terms of the GNU General Public License as
12 .\" published by the Free Software Foundation; either version 2 of
13 .\" the License, or (at your option) any later version.
14 .\"
15 .\" The GNU General Public License's references to "object code"
16 .\" and "executables" are to be interpreted as the output of any
17 .\" document formatting or typesetting system, including
18 .\" intermediate and printed output.
19 .\"
20 .\" This manual is distributed in the hope that it will be useful,
21 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
22 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23 .\" GNU General Public License for more details.
24 .\"
25 .\" You should have received a copy of the GNU General Public
26 .\" License along with this manual; if not, see
27 .\" <http://www.gnu.org/licenses/>.
28 .\" %%%LICENSE_END
29 .\"
30 .\" Modified 1995-05-17 by faith@cs.unc.edu
31 .\" Minor changes by aeb and Marty Leisner (leisner@sdsp.mc.xerox.com).
32 .\" Modified 1996-04-13, 1996-07-22 by aeb@cwi.nl
33 .\" Modified 2001-12-16 by rwhron@earthlink.net
34 .\" Modified 2002-07-13 by jbelton@shaw.ca
35 .\" Modified 2002-07-22, 2003-05-27, 2004-04-06, 2004-05-25
36 .\"    by Michael Kerrisk <mtk.manpages@gmail.com>
37 .\" 2004-11-17, mtk -- updated notes on /proc/loadavg
38 .\" 2004-12-01, mtk, rtsig-max and rtsig-nr went away in 2.6.8
39 .\" 2004-12-14, mtk, updated 'statm', and fixed error in order of list
40 .\" 2005-05-12, mtk, updated 'stat'
41 .\" 2005-07-13, mtk, added /proc/sys/fs/mqueue/*
42 .\" 2005-09-16, mtk, Added /proc/sys/fs/suid_dumpable
43 .\" 2005-09-19, mtk, added /proc/zoneinfo
44 .\" 2005-03-01, mtk, moved /proc/sys/fs/mqueue/* material to mq_overview.7.
45 .\" 2008-06-05, mtk, Added /proc/[pid]/oom_score, /proc/[pid]/oom_adj,
46 .\"     /proc/[pid]/limits, /proc/[pid]/mountinfo, /proc/[pid]/mountstats,
47 .\"     and /proc/[pid]/fdinfo/*.
48 .\" 2008-06-19, mtk, Documented /proc/[pid]/status.
49 .\" 2008-07-15, mtk, added /proc/config.gz
50 .\"
51 .\" FIXME 2.6.13 seems to have /proc/vmcore implemented
52 .\" in the source code, but there is no option available under
53 .\" 'make xconfig'; eventually this should be fixed, and then info
54 .\" from the patch-2.6.13 and change log could be used to write an
55 .\" entry in this man page.
56 .\" Needs CONFIG_VMCORE
57 .\"
58 .\" FIXME cross check against Documentation/filesystems/proc.txt
59 .\" to see what information could be imported from that file
60 .\" into this file.
61 .\"
62 .TH PROC 5 2013-06-27 "Linux" "Linux Programmer's Manual"
63 .SH NAME
64 proc \- process information pseudo-file system
65 .SH DESCRIPTION
66 The
67 .I proc
68 file system is a pseudo-file system which is used as an interface to
69 kernel data structures.
70 It is commonly mounted at
71 .IR /proc .
72 Most of it is read-only, but some files allow kernel variables to be
73 changed.
74 .LP
75 The following outline gives a quick tour through the
76 .I /proc
77 hierarchy.
78 .PD 1
79 .TP
80 .I /proc/[pid]
81 There is a numerical subdirectory for each running process; the
82 subdirectory is named by the process ID.
83 Each such subdirectory contains the following
84 pseudo-files and directories.
85 .\" FIXME Describe /proc/[pid]/attr and
86 .\"       /proc/[pid]/task/[tid]/attr
87 .\"       This is a directory
88 .\"       Added in ???
89 .\"       CONFIG_SECURITY
90 .\"
91 .TP
92 .IR /proc/[pid]/auxv " (since 2.6.0-test7)"
93 This contains the contents of the ELF interpreter information passed
94 to the process at exec time.
95 The format is one \fIunsigned long\fP ID
96 plus one \fIunsigned long\fP value for each entry.
97 The last entry contains two zeros.
98 .TP
99 .IR /proc/[pid]/cgroup " (since Linux 2.6.24)"
100 .\"       Info in Documentation/cgroups/cgroups.txt
101 This file describes control groups to which the process/task belongs.
102 For each cgroup hierarchy there is one entry containing
103 colon-separated fields of the form:
104 .nf
105 .ft CW
106
107     5:cpuacct,cpu,cpuset:/daemons
108 .ft
109 .fi
110 .IP
111 The colon-separated fields are, from left to right:
112 .RS 11
113 .IP 1. 3
114 hierarchy ID number
115 .IP 2.
116 set of subsystems bound to the hierarchy
117 .IP 3.
118 control group in the hierarchy to which the process belongs
119 .RE
120 .IP
121 This file is present only if the
122 .B CONFIG_CGROUPS
123 kernel configuration option is enabled.
124 .\"
125 .\" FIXME Describe /proc/[pid]/clear_refs
126 .\"       Added in 2.6.22
127 .\"       "Clears page referenced bits shown in smaps output"
128 .\"       write-only
129 .\"       CONFIG_PROC_PAGE_MONITOR
130 .TP
131 .I /proc/[pid]/cmdline
132 This holds the complete command line for the process,
133 unless the process is a zombie.
134 .\" In 2.3.26, this also used to be true if the process was swapped out.
135 In the latter case, there is nothing in this file:
136 that is, a read on this file will return 0 characters.
137 The command-line arguments appear in this file as a set of
138 strings separated by null bytes (\(aq\\0\(aq),
139 with a further null byte after the last string.
140 .TP
141 .IR /proc/[pid]/coredump_filter " (since kernel 2.6.23)"
142 See
143 .BR core (5).
144 .TP
145 .IR /proc/[pid]/cpuset " (since kernel 2.6.12)"
146 .\" and/proc/[pid]/task/[tid]/cpuset
147 See
148 .BR cpuset (7).
149 .TP
150 .I /proc/[pid]/cwd
151 This is a symbolic link to the current working directory of the process.
152 To find out the current working directory of process 20,
153 for instance, you can do this:
154
155 .in +4n
156 .nf
157 .RB "$" " cd /proc/20/cwd; /bin/pwd"
158 .fi
159 .in
160
161 Note that the
162 .I pwd
163 command is often a shell built-in, and might
164 not work properly.
165 In
166 .BR bash (1),
167 you may use
168 .IR "pwd\ \-P" .
169
170 .\" The following was still true as at kernel 2.6.13
171 In a multithreaded process, the contents of this symbolic link
172 are not available if the main thread has already terminated
173 (typically by calling
174 .BR pthread_exit (3)).
175 .TP
176 .I /proc/[pid]/environ
177 This file contains the environment for the process.
178 The entries are separated by null bytes (\(aq\\0\(aq),
179 and there may be a null byte at the end.
180 Thus, to print out the environment of process 1, you would do:
181 .in +4n
182 .nf
183
184 .ft CW
185 .RB "$" " strings /proc/1/environ"
186 .fi
187 .ft P
188 .in
189 .TP
190 .I /proc/[pid]/exe
191 Under Linux 2.2 and later, this file is a symbolic link
192 containing the actual pathname of the executed command.
193 This symbolic link can be dereferenced normally; attempting to open
194 it will open the executable.
195 You can even type
196 .I /proc/[pid]/exe
197 to run another copy of the same executable as is being run by
198 process [pid].
199 .\" The following was still true as at kernel 2.6.13
200 In a multithreaded process, the contents of this symbolic link
201 are not available if the main thread has already terminated
202 (typically by calling
203 .BR pthread_exit (3)).
204
205 Under Linux 2.0 and earlier
206 .I /proc/[pid]/exe
207 is a pointer to the binary which was executed,
208 and appears as a symbolic link.
209 A
210 .BR readlink (2)
211 call on this file under Linux 2.0 returns a string in the format:
212
213     [device]:inode
214
215 For example, [0301]:1502 would be inode 1502 on device major 03 (IDE,
216 MFM, etc. drives) minor 01 (first partition on the first drive).
217
218 .BR find (1)
219 with the
220 .I \-inum
221 option can be used to locate the file.
222 .TP
223 .I /proc/[pid]/fd/
224 This is a subdirectory containing one entry for each file which the
225 process has open, named by its file descriptor, and which is a
226 symbolic link to the actual file.
227 Thus, 0 is standard input, 1 standard output, 2 standard error, etc.
228
229 For file descriptors for pipes and sockets,
230 the entries will be symbolic links whose content is the
231 file type with the inode.
232 A
233 .BR readlink (2)
234 call on this file returns a string in the format:
235
236     type:[inode]
237
238 For example,
239 .I socket:[2248868]
240 will be a socket and its inode is 2248868.
241 For sockets, that inode can be used to find more information
242 in one of the files under
243 .IR /proc/net/ .
244
245 For file descriptors that have no corresponding inode
246 (e.g., file descriptors produced by
247 .BR epoll_create (2),
248 .BR eventfd (2),
249 .BR inotify_init (2),
250 .BR signalfd (2),
251 and
252 .BR timerfd (2)),
253 the entry will be a symbolic link with contents of the form
254
255     anon_inode:<file-type>
256
257 In some cases, the
258 .I file-type
259 is surrounded by square brackets.
260
261 For example, an epoll file descriptor will have a symbolic link
262 whose content is the string
263 .IR "anon_inode:[eventpoll]" .
264
265 .\"The following was still true as at kernel 2.6.13
266 In a multithreaded process, the contents of this directory
267 are not available if the main thread has already terminated
268 (typically by calling
269 .BR pthread_exit (3)).
270
271 Programs that will take a filename as a command-line argument,
272 but will not take input from standard input if no argument is supplied,
273 or that write to a file named as a command-line argument,
274 but will not send their output to standard output
275 if no argument is supplied, can nevertheless be made to use
276 standard input or standard out using
277 .IR /proc/[pid]/fd .
278 For example, assuming that
279 .I \-i
280 is the flag designating an input file and
281 .I \-o
282 is the flag designating an output file:
283 .in +4n
284 .nf
285
286 .RB "$" " foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ..."
287 .fi
288 .in
289
290 and you have a working filter.
291 .\" The following is not true in my tests (MTK):
292 .\" Note that this will not work for
293 .\" programs that seek on their files, as the files in the fd directory
294 .\" are not seekable.
295
296 .I /proc/self/fd/N
297 is approximately the same as
298 .I /dev/fd/N
299 in some UNIX and UNIX-like systems.
300 Most Linux MAKEDEV scripts symbolically link
301 .I /dev/fd
302 to
303 .IR /proc/self/fd ,
304 in fact.
305
306 Most systems provide symbolic links
307 .IR /dev/stdin ,
308 .IR /dev/stdout ,
309 and
310 .IR /dev/stderr ,
311 which respectively link to the files
312 .IR 0 ,
313 .IR 1 ,
314 and
315 .IR 2
316 in
317 .IR /proc/self/fd .
318 Thus the example command above could be written as:
319 .in +4n
320 .nf
321
322 .RB "$" " foobar \-i /dev/stdin \-o /dev/stdout ..."
323 .fi
324 .in
325 .\" FIXME Describe /proc/[pid]/loginuid
326 .\"       Added in 2.6.11; updating requires CAP_AUDIT_CONTROL
327 .\"       CONFIG_AUDITSYSCALL
328 .TP
329 .IR /proc/[pid]/fdinfo/ " (since kernel 2.6.22)"
330 This is a subdirectory containing one entry for each file which the
331 process has open, named by its file descriptor.
332 The contents of each file can be read to obtain information
333 about the corresponding file descriptor, for example:
334 .in +4n
335 .nf
336
337 .RB "$" " cat /proc/12015/fdinfo/4"
338 pos:    1000
339 flags:  01002002
340 .fi
341 .in
342
343 The
344 .I pos
345 field is a decimal number showing the current file offset.
346 The
347 .I flags
348 field is an octal number that displays the
349 file access mode and file status flags (see
350 .BR open (2)).
351
352 The files in this directory are readable only by the owner of the process.
353 .\" FIXME document /proc/[pid]/io
354 .\" .TP
355 .\" .IR /proc/[pid]/io " (since kernel 2.6.20)"
356 .TP
357 .IR /proc/[pid]/limits " (since kernel 2.6.24)"
358 This file displays the soft limit, hard limit, and units of measurement
359 for each of the process's resource limits (see
360 .BR getrlimit (2)).
361 Up to and including Linux 2.6.35,
362 this file is protected to allow reading only by the real UID of the process.
363 Since Linux 2.6.36,
364 .\" commit 3036e7b490bf7878c6dae952eec5fb87b1106589
365 this file is readable by all users on the system.
366 .TP
367 .IR /proc/[pid]/map_files/ " (since kernel 3.3)
368 .\" commit 640708a2cff7f81e246243b0073c66e6ece7e53e
369 This subdirectory contains entries corresponding to memory-mapped
370 files (see
371 .BR mmap (2)).
372 Entries are named by memory region start and end
373 address pair (expressed as hexadecimal numbers),
374 and are symbolic links to the mapped files themselves.
375 Here is an example, with the output wrapped and reformatted to fit on an 80-column display:
376 .in +4n
377 .nf
378
379 .RB "$" " ls -l /proc/self/map_files/"
380 lr\-\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:31
381             3252e00000\-3252e20000 \-> /usr/lib64/ld-2.15.so
382 \&...
383 .fi
384 .in
385
386 Although these entries are present for memory regions that were
387 mapped with  the
388 .BR MAP_FILE
389 flag, the way anonymous shared memory (regions created with the
390 .B MAP_ANON | MAP_SHARED
391 flags)
392 is implemented in Linux
393 means that such regions also appear on this directory.
394 Here is an example where the target file is the deleted
395 .I /dev/zero
396 one:
397 .in +4n
398 .nf
399
400 .RB
401 lrw\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:33
402             7fc075d2f000\-7fc075e6f000 \-> /dev/zero (deleted)
403 .fi
404 .in
405
406 This directory appears only if the
407 .B CONFIG_CHECKPOINT_RESTORE
408 kernel configuration option is enabled.
409 .TP
410 .I /proc/[pid]/maps
411 A file containing the currently mapped memory regions and their access
412 permissions.
413 See
414 .BR mmap (2)
415 for some further information about memory mappings.
416
417 The format of the file is:
418
419 .in -7n
420 .nf
421 .ft CW
422 .ft
423 .I "address           perms offset  dev   inode       pathname"
424 00400000-00452000 r-xp 00000000 08:02 173521      /usr/bin/dbus-daemon
425 00651000-00652000 r--p 00051000 08:02 173521      /usr/bin/dbus-daemon
426 00652000-00655000 rw-p 00052000 08:02 173521      /usr/bin/dbus-daemon
427 00e03000-00e24000 rw-p 00000000 00:00 0           [heap]
428 00e24000-011f7000 rw-p 00000000 00:00 0           [heap]
429 \&...
430 35b1800000-35b1820000 r-xp 00000000 08:02 135522  /usr/lib64/ld-2.15.so
431 35b1a1f000-35b1a20000 r--p 0001f000 08:02 135522  /usr/lib64/ld-2.15.so
432 35b1a20000-35b1a21000 rw-p 00020000 08:02 135522  /usr/lib64/ld-2.15.so
433 35b1a21000-35b1a22000 rw-p 00000000 00:00 0
434 35b1c00000-35b1dac000 r-xp 00000000 08:02 135870  /usr/lib64/libc-2.15.so
435 35b1dac000-35b1fac000 ---p 001ac000 08:02 135870  /usr/lib64/libc-2.15.so
436 35b1fac000-35b1fb0000 r--p 001ac000 08:02 135870  /usr/lib64/libc-2.15.so
437 35b1fb0000-35b1fb2000 rw-p 001b0000 08:02 135870  /usr/lib64/libc-2.15.so
438 \&...
439 f2c6ff8c000-7f2c7078c000 rw-p 00000000 00:00 0    [stack:986]
440 \&...
441 7fffb2c0d000-7fffb2c2e000 rw-p 00000000 00:00 0   [stack]
442 7fffb2d48000-7fffb2d49000 r-xp 00000000 00:00 0   [vdso]
443 .fi
444 .in
445
446 The
447 .I address
448 field is the address space in the process that the mapping occupies.
449 The
450 .I perms
451 field is a set of permissions:
452
453 .nf
454 .in +5
455 r = read
456 w = write
457 x = execute
458 s = shared
459 p = private (copy on write)
460 .fi
461 .in
462
463 The
464 .I offset
465 field is the offset into the file/whatever;
466 .I dev
467 is the device
468 (major:minor);
469 .I inode
470 is the inode on that device.
471 0 indicates that no inode is associated with the memory region,
472 as would be the case with BSS (uninitialized data).
473
474 The
475 .I pathname
476 field will usually be the file that is backing the mapping.
477 For ELF files,
478 you can easily coordinate with the
479 .I offset
480 field by looking at the
481 Offset field in the ELF program headers
482 .RI ( "readelf\ \-l" ).
483
484 There are additional helpful pseudo-paths:
485 .RS 12
486 .TP
487 .IR [stack]
488 The initial process's (also known as the main thread's) stack.
489 .TP
490 .IR [stack:<tid>] " (since Linux 3.4)"
491 .\" commit b76437579d1344b612cf1851ae610c636cec7db0
492 A thread's stack (where the
493 .IR <tid>
494 is a thread ID).
495 It corresponds to the
496 .IR /proc/[pid]/task/[tid]/
497 path.
498 .TP
499 .IR [vdso]
500 The virtual dynamically linked shared object.
501 .TP
502 .IR [heap]
503 The process's heap.
504 .in
505 .fi
506 .RE
507 .IP
508 If the
509 .I pathname
510 field is blank,
511 this is an anonymous mapping as obtained via the
512 .BR mmap (2)
513 function.
514 There is no easy way to coordinate this back to a process's source,
515 short of running it through
516 .BR gdb (1),
517 .BR strace (1),
518 or similar.
519
520 Under Linux 2.0 there is no field giving pathname.
521 .TP
522 .I /proc/[pid]/mem
523 This file can be used to access the pages of a process's memory through
524 .BR open (2),
525 .BR read (2),
526 and
527 .BR lseek (2).
528 .TP
529 .IR /proc/[pid]/mountinfo " (since Linux 2.6.26)"
530 .\" This info adapted from Documentation/filesystems/proc.txt
531 This file contains information about mount points.
532 It contains lines of the form:
533 .nf
534 .ft CW
535
536 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue
537 (1)(2)(3)   (4)   (5)      (6)      (7)   (8) (9)   (10)         (11)
538 .ft
539 .fi
540 .IP
541 The numbers in parentheses are labels for the descriptions below:
542 .RS 7
543 .TP 5
544 (1)
545 mount ID: unique identifier of the mount (may be reused after
546 .BR umount (2)).
547 .TP
548 (2)
549 parent ID: ID of parent mount (or of self for the top of the mount tree).
550 .TP
551 (3)
552 major:minor: value of
553 .I st_dev
554 for files on file system (see
555 .BR stat (2)).
556 .TP
557 (4)
558 root: root of the mount within the file system.
559 .TP
560 (5)
561 mount point: mount point relative to the process's root.
562 .TP
563 (6)
564 mount options: per-mount options.
565 .TP
566 (7)
567 optional fields: zero or more fields of the form "tag[:value]".
568 .TP
569 (8)
570 separator: marks the end of the optional fields.
571 .TP
572 (9)
573 file system type: name of file system in the form "type[.subtype]".
574 .TP
575 (10)
576 mount source: file system-specific information or "none".
577 .TP
578 (11)
579 super options: per-super block options.
580 .RE
581 .IP
582 Parsers should ignore all unrecognized optional fields.
583 Currently the possible optional fields are:
584 .RS 12
585 .TP 18
586 shared:X
587 mount is shared in peer group X
588 .TP
589 master:X
590 mount is slave to peer group X
591 .TP
592 propagate_from:X
593 mount is slave and receives propagation from peer group X (*)
594 .TP
595 unbindable
596 mount is unbindable
597 .RE
598 .IP
599 (*) X is the closest dominant peer group under the process's root.
600 If X is the immediate master of the mount,
601 or if there is no dominant peer group under the same root,
602 then only the "master:X" field is present
603 and not the "propagate_from:X" field.
604
605 For more information on mount propagation see:
606 .I Documentation/filesystems/sharedsubtree.txt
607 in the Linux kernel source tree.
608 .TP
609 .IR /proc/[pid]/mounts " (since Linux 2.4.19)"
610 This is a list of all the file systems currently mounted in the
611 process's mount namespace.
612 The format of this file is documented in
613 .BR fstab (5).
614 Since kernel version 2.6.15, this file is pollable:
615 after opening the file for reading, a change in this file
616 (i.e., a file system mount or unmount) causes
617 .BR select (2)
618 to mark the file descriptor as readable, and
619 .BR poll (2)
620 and
621 .BR epoll_wait (2)
622 mark the file as having an error condition.
623 .TP
624 .IR /proc/[pid]/mountstats " (since Linux 2.6.17)"
625 This file exports information (statistics, configuration information)
626 about the mount points in the process's name space.
627 Lines in this file have the form:
628 .nf
629
630 device /dev/sda7 mounted on /home with fstype ext3 [statistics]
631 (       1      )            ( 2 )             (3 ) (4)
632 .fi
633 .IP
634 The fields in each line are:
635 .RS 7
636 .TP 5
637 (1)
638 The name of the mounted device
639 (or "nodevice" if there is no corresponding device).
640 .TP
641 (2)
642 The mount point within the file system tree.
643 .TP
644 (3)
645 The file system type.
646 .TP
647 (4)
648 Optional statistics and configuration information.
649 Currently (as at Linux 2.6.26), only NFS file systems export
650 information via this field.
651 .RE
652 .IP
653 This file is readable only by the owner of the process.
654 .TP
655 .IR /proc/[pid]/ns/ " (since Linux 3.0)"
656 .\" See commit 6b4e306aa3dc94a0545eb9279475b1ab6209a31f
657 This is a subdirectory containing one entry for each namespace that
658 supports being manipulated by
659 .BR setns (2).
660 For information about namespaces, see
661 .BR clone (2).
662 .TP
663 .IR /proc/[pid]/ns/ipc " (since Linux 3.0)"
664 Bind mounting this file (see
665 .BR mount (2))
666 to somewhere else in the filesystem keeps
667 the IPC namespace of the process specified by
668 .I pid
669 alive even if all processes currently in the namespace terminate.
670
671 Opening this file returns a file handle for the IPC namespace
672 of the process specified by
673 .IR pid .
674 As long as this file descriptor remains open,
675 the IPC namespace will remain alive,
676 even if all processes in the namespace terminate.
677 The file descriptor can be passed to
678 .BR setns (2).
679 .TP
680 .IR /proc/[pid]/ns/net " (since Linux 3.0)"
681 Bind mounting this file (see
682 .BR mount (2))
683 to somewhere else in the filesystem keeps
684 the network namespace of the process specified by
685 .I pid
686 alive even if all processes in the namespace terminate.
687
688 Opening this file returns a file handle for the network namespace
689 of the process specified by
690 .IR pid .
691 As long as this file descriptor remains open,
692 the network namespace will remain alive,
693 even if all processes in the namespace terminate.
694 The file descriptor can be passed to
695 .BR setns (2).
696 .TP
697 .IR /proc/[pid]/ns/uts " (since Linux 3.0)"
698 Bind mounting this file (see
699 .BR mount (2))
700 to somewhere else in the filesystem keeps
701 the UTS namespace of the process specified by
702 .I pid
703 alive even if all processes currently in the namespace terminate.
704
705 Opening this file returns a file handle for the UTS namespace
706 of the process specified by
707 .IR pid .
708 As long as this file descriptor remains open,
709 the UTS namespace will remain alive,
710 even if all processes in the namespace terminate.
711 The file descriptor can be passed to
712 .BR setns (2).
713 .TP
714 .IR /proc/[pid]/numa_maps " (since Linux 2.6.14)"
715 See
716 .BR numa (7).
717 .TP
718 .IR /proc/[pid]/oom_adj " (since Linux 2.6.11)"
719 This file can be used to adjust the score used to select which process
720 should be killed in an out-of-memory (OOM) situation.
721 The kernel uses this value for a bit-shift operation of the process's
722 .IR oom_score
723 value:
724 valid values are in the range \-16 to +15,
725 plus the special value \-17,
726 which disables OOM-killing altogether for this process.
727 A positive score increases the likelihood of this
728 process being killed by the OOM-killer;
729 a negative score decreases the likelihood.
730 .IP
731 The default value for this file is 0;
732 a new process inherits its parent's
733 .I oom_adj
734 setting.
735 A process must be privileged
736 .RB ( CAP_SYS_RESOURCE )
737 to update this file.
738 .IP
739 Since Linux 2.6.36, use of this file is deprecated in favor of
740 .IR /proc/[pid]/oom_score_adj .
741 .TP
742 .IR /proc/[pid]/oom_score " (since Linux 2.6.11)"
743 .\" See mm/oom_kill.c::badness() in the 2.6.25 sources
744 This file displays the current score that the kernel gives to
745 this process for the purpose of selecting a process
746 for the OOM-killer.
747 A higher score means that the process is more likely to be
748 selected by the OOM-killer.
749 The basis for this score is the amount of memory used by the process,
750 with increases (+) or decreases (\-) for factors including:
751 .\" See mm/oom_kill.c::badness() in the 2.6.25 sources
752 .RS
753 .IP * 2
754 whether the process creates a lot of children using
755 .BR fork (2)
756 (+);
757 .IP *
758 whether the process has been running a long time,
759 or has used a lot of CPU time (\-);
760 .IP *
761 whether the process has a low nice value (i.e., > 0) (+);
762 .IP *
763 whether the process is privileged (\-); and
764 .\" More precisely, if it has CAP_SYS_ADMIN or CAP_SYS_RESOURCE
765 .IP *
766 whether the process is making direct hardware access (\-).
767 .\" More precisely, if it has CAP_SYS_RAWIO
768 .RE
769 .IP
770 The
771 .I oom_score
772 also reflects the adjustment specified by the
773 .I oom_score_adj
774 or
775 .I oom_adj
776 setting for the process.
777 .TP
778 .IR /proc/[pid]/oom_score_adj " (since Linux 2.6.36)"
779 .\" Text taken from 3.7 Documentation/filesystems/proc.txt
780 This file can be used to adjust the badness heuristic used to select which
781 process gets killed in out-of-memory conditions.
782
783 The badness heuristic assigns a value to each candidate task ranging from 0
784 (never kill) to 1000 (always kill) to determine which process is targeted.
785 The units are roughly a proportion along that range of
786 allowed memory the process may allocate from,
787 based on an estimation of its current memory and swap use.
788 For example, if a task is using all allowed memory,
789 its badness score will be 1000.
790 If it is using half of its allowed memory, its score will be 500.
791
792 There is an additional factor included in the badness score: root
793 processes are given 3% extra memory over other tasks.
794
795 The amount of "allowed" memory depends on the context
796 in which the OOM-killer was called.
797 If it is due to the memory assigned to the allocating task's cpuset
798 being exhausted,
799 the allowed memory represents the set of mems assigned to that
800 cpuset (see
801 .BR cpuset (7)).
802 If it is due to a mempolicy's node(s) being exhausted,
803 the allowed memory represents the set of mempolicy nodes.
804 If it is due to a memory limit (or swap limit) being reached,
805 the allowed memory is that configured limit.
806 Finally, if it is due to the entire system being out of memory, the
807 allowed memory represents all allocatable resources.
808
809 The value of
810 .I oom_score_adj
811 is added to the badness score before it
812 is used to determine which task to kill.
813 Acceptable values range from \-1000
814 (OOM_SCORE_ADJ_MIN) to +1000 (OOM_SCORE_ADJ_MAX).
815 This allows user space to control the preference for OOM-killing,
816 ranging from always preferring a certain
817 task or completely disabling it from OOM-killing.
818 The lowest possible value, \-1000, is
819 equivalent to disabling OOM-killing entirely for that task,
820 since it will always report a badness score of 0.
821
822 Consequently, it is very simple for user space to define
823 the amount of memory to consider for each task.
824 Setting a
825 .I oom_score_adj
826 value of +500, for example,
827 is roughly equivalent to allowing the remainder of tasks sharing the
828 same system, cpuset, mempolicy, or memory controller resources
829 to use at least 50% more memory.
830 A value of \-500, on the other hand, would be roughly
831 equivalent to discounting 50% of the task's
832 allowed memory from being considered as scoring against the task.
833
834 For backward compatibility with previous kernels,
835 .I /proc/[pid]/oom_adj
836 can still be used to tune the badness score.
837 Its value is
838 scaled linearly with
839 .IR oom_score_adj .
840
841 Writing to
842 .IR /proc/[pid]/oom_score_adj
843 or
844 .IR /proc/[pid]/oom_adj
845 will change the other with its scaled value.
846 .\" FIXME Describe /proc/[pid]/pagemap
847 .\"       Added in 2.6.25
848 .\"       CONFIG_PROC_PAGE_MONITOR
849 .TP
850 .I /proc/[pid]/root
851 UNIX and Linux support the idea of a per-process root of the
852 file system, set by the
853 .BR chroot (2)
854 system call.
855 This file is a symbolic link that points to the process's
856 root directory, and behaves as exe, fd/*, etc. do.
857
858 .\" The following was still true as at kernel 2.6.13
859 In a multithreaded process, the contents of this symbolic link
860 are not available if the main thread has already terminated
861 (typically by calling
862 .BR pthread_exit (3)).
863 .\" FIXME Describe /proc/[pid]/seccomp
864 .\"       Added in 2.6.12
865 .\" FIXME Describe /proc/[pid]/sessionid
866 .\"       Added in 2.6.25; read-only; only readable by real UID
867 .\"       CONFIG_AUDITSYSCALL
868 .\" FIXME Describe /proc/[pid]/sched
869 .\"       Added in 2.6.23
870 .\"       CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS
871 .\"       Displays various scheduling parameters
872 .\"       This file can be written, to reset stats
873 .\" FIXME Describe /proc/[pid]/schedstats and
874 .\"       /proc/[pid]/task/[tid]/schedstats
875 .\"       Added in 2.6.9
876 .\"       CONFIG_SCHEDSTATS
877 .TP
878 .IR /proc/[pid]/smaps " (since Linux 2.6.14)"
879 .\"       CONFIG_PROC_PAGE_MONITOR
880 This file shows memory consumption for each of the process's mappings.
881 For each of mappings there is a series of lines such as the following:
882 .in +4n
883 .nf
884
885 08048000-080bc000 r-xp 00000000 03:02 13130      /bin/bash
886 Size:               464 kB
887 Rss:                424 kB
888 Shared_Clean:       424 kB
889 Shared_Dirty:         0 kB
890 Private_Clean:        0 kB
891 Private_Dirty:        0 kB
892
893 .fi
894 .in
895 The first of these lines shows the same information as is displayed
896 for the mapping in
897 .IR /proc/[pid]/maps .
898 The remaining lines show the size of the mapping,
899 the amount of the mapping that is currently resident in RAM,
900 the number of clean and dirty shared pages in the mapping,
901 and the number of clean and dirty private pages in the mapping.
902
903 This file is present only if the
904 .B CONFIG_MMU
905 kernel configuration
906 option is enabled.
907 .TP
908 .I /proc/[pid]/stat
909 Status information about the process.
910 This is used by
911 .BR ps (1).
912 It is defined in
913 .IR /usr/src/linux/fs/proc/array.c "."
914
915 The fields, in order, with their proper
916 .BR scanf (3)
917 format specifiers, are:
918 .RS
919 .TP 12
920 \fIpid\fP %d
921 (1) The process ID.
922 .TP
923 \fIcomm\fP %s
924 (2) The filename of the executable, in parentheses.
925 This is visible whether or not the executable is swapped out.
926 .TP
927 \fIstate\fP %c
928 (3) One character from the string "RSDZTW" where R is running, S is
929 sleeping in an interruptible wait, D is waiting in uninterruptible
930 disk sleep, Z is zombie, T is traced or stopped (on a signal),
931 and W is paging.
932 .TP
933 \fIppid\fP %d
934 (4) The PID of the parent.
935 .TP
936 \fIpgrp\fP %d
937 (5) The process group ID of the process.
938 .TP
939 \fIsession\fP %d
940 (6) The session ID of the process.
941 .TP
942 \fItty_nr\fP %d
943 (7) The controlling terminal of the process.
944 (The minor device number is contained in the combination of bits
945 31 to 20 and 7 to 0;
946 the major device number is in bits 15 to 8.)
947 .TP
948 \fItpgid\fP %d
949 .\" This field and following, up to and including wchan added 0.99.1
950 (8) The ID of the foreground process group of the controlling
951 terminal of the process.
952 .TP
953 \fIflags\fP %u (%lu before Linux 2.6.22)
954 (9) The kernel flags word of the process.
955 For bit meanings,
956 see the PF_* defines in the Linux kernel source file
957 .IR include/linux/sched.h .
958 Details depend on the kernel version.
959 .TP
960 \fIminflt\fP %lu
961 (10) The number of minor faults the process has made which have not
962 required loading a memory page from disk.
963 .TP
964 \fIcminflt\fP %lu
965 (11) The number of minor faults that the process's
966 waited-for children have made.
967 .TP
968 \fImajflt\fP %lu
969 (12) The number of major faults the process has made which have
970 required loading a memory page from disk.
971 .TP
972 \fIcmajflt\fP %lu
973 (13) The number of major faults that the process's
974 waited-for children have made.
975 .TP
976 \fIutime\fP %lu
977 (14) Amount of time that this process has been scheduled in user mode,
978 measured in clock ticks (divide by
979 .IR sysconf(_SC_CLK_TCK) ).
980 This includes guest time, \fIguest_time\fP
981 (time spent running a virtual CPU, see below),
982 so that applications that are not aware of the guest time field
983 do not lose that time from their calculations.
984 .TP
985 \fIstime\fP %lu
986 (15) Amount of time that this process has been scheduled in kernel mode,
987 measured in clock ticks (divide by
988 .IR sysconf(_SC_CLK_TCK) ).
989 .TP
990 \fIcutime\fP %ld
991 (16) Amount of time that this process's
992 waited-for children have been scheduled in user mode,
993 measured in clock ticks (divide by
994 .IR sysconf(_SC_CLK_TCK) ).
995 (See also
996 .BR times (2).)
997 This includes guest time, \fIcguest_time\fP
998 (time spent running a virtual CPU, see below).
999 .TP
1000 \fIcstime\fP %ld
1001 (17) Amount of time that this process's
1002 waited-for children have been scheduled in kernel mode,
1003 measured in clock ticks (divide by
1004 .IR sysconf(_SC_CLK_TCK) ).
1005 .TP
1006 \fIpriority\fP %ld
1007 (18) (Explanation for Linux 2.6)
1008 For processes running a real-time scheduling policy
1009 .RI ( policy
1010 below; see
1011 .BR sched_setscheduler (2)),
1012 this is the negated scheduling priority, minus one;
1013 that is, a number in the range \-2 to \-100,
1014 corresponding to real-time priorities 1 to 99.
1015 For processes running under a non-real-time scheduling policy,
1016 this is the raw nice value
1017 .RB ( setpriority (2))
1018 as represented in the kernel.
1019 The kernel stores nice values as numbers
1020 in the range 0 (high) to 39 (low),
1021 corresponding to the user-visible nice range of \-20 to 19.
1022
1023 Before Linux 2.6, this was a scaled value based on
1024 the scheduler weighting given to this process.
1025 .\" And back in kernel 1.2 days things were different again.
1026 .TP
1027 \fInice\fP %ld
1028 (19) The nice value (see
1029 .BR setpriority (2)),
1030 a value in the range 19 (low priority) to \-20 (high priority).
1031 .\" Back in kernel 1.2 days things were different.
1032 .\" .TP
1033 .\" \fIcounter\fP %ld
1034 .\" The current maximum size in jiffies of the process's next timeslice,
1035 .\" or what is currently left of its current timeslice, if it is the
1036 .\" currently running process.
1037 .\" .TP
1038 .\" \fItimeout\fP %u
1039 .\" The time in jiffies of the process's next timeout.
1040 .\" timeout was removed sometime around 2.1/2.2
1041 .TP
1042 \fInum_threads\fP %ld
1043 (20) Number of threads in this process (since Linux 2.6).
1044 Before kernel 2.6, this field was hard coded to 0 as a placeholder
1045 for an earlier removed field.
1046 .TP
1047 \fIitrealvalue\fP %ld
1048 (21) The time in jiffies before the next
1049 .B SIGALRM
1050 is sent to the process due to an interval timer.
1051 Since kernel 2.6.17, this field is no longer maintained,
1052 and is hard coded as 0.
1053 .TP
1054 \fIstarttime\fP %llu (was %lu before Linux 2.6)
1055 (22) The time the process started after system boot.
1056 In kernels before Linux 2.6, this value was expressed in jiffies.
1057 Since Linux 2.6, the value is expressed in clock ticks (divide by
1058 .IR sysconf(_SC_CLK_TCK) ).
1059 .TP
1060 \fIvsize\fP %lu
1061 (23) Virtual memory size in bytes.
1062 .TP
1063 \fIrss\fP %ld
1064 (24) Resident Set Size: number of pages the process has in real memory.
1065 This is just the pages which
1066 count toward text, data, or stack space.
1067 This does not include pages
1068 which have not been demand-loaded in, or which are swapped out.
1069 .TP
1070 \fIrsslim\fP %lu
1071 (25) Current soft limit in bytes on the rss of the process;
1072 see the description of
1073 .B RLIMIT_RSS
1074 in
1075 .BR getrlimit (2).
1076 .TP
1077 \fIstartcode\fP %lu
1078 (26) The address above which program text can run.
1079 .TP
1080 \fIendcode\fP %lu
1081 (27) The address below which program text can run.
1082 .TP
1083 \fIstartstack\fP %lu
1084 (28) The address of the start (i.e., bottom) of the stack.
1085 .TP
1086 \fIkstkesp\fP %lu
1087 (29) The current value of ESP (stack pointer), as found in the
1088 kernel stack page for the process.
1089 .TP
1090 \fIkstkeip\fP %lu
1091 (30) The current EIP (instruction pointer).
1092 .TP
1093 \fIsignal\fP %lu
1094 (31) The bitmap of pending signals, displayed as a decimal number.
1095 Obsolete, because it does not provide information on real-time signals; use
1096 .I /proc/[pid]/status
1097 instead.
1098 .TP
1099 \fIblocked\fP %lu
1100 (32) The bitmap of blocked signals, displayed as a decimal number.
1101 Obsolete, because it does not provide information on real-time signals; use
1102 .I /proc/[pid]/status
1103 instead.
1104 .TP
1105 \fIsigignore\fP %lu
1106 (33) The bitmap of ignored signals, displayed as a decimal number.
1107 Obsolete, because it does not provide information on real-time signals; use
1108 .I /proc/[pid]/status
1109 instead.
1110 .TP
1111 \fIsigcatch\fP %lu
1112 (34) The bitmap of caught signals, displayed as a decimal number.
1113 Obsolete, because it does not provide information on real-time signals; use
1114 .I /proc/[pid]/status
1115 instead.
1116 .TP
1117 \fIwchan\fP %lu
1118 (35) This is the "channel" in which the process is waiting.
1119 It is the
1120 address of a system call, and can be looked up in a namelist if you
1121 need a textual name.
1122 (If you have an up-to-date
1123 .IR /etc/psdatabase ,
1124 then
1125 try \fIps \-l\fP to see the WCHAN field in action.)
1126 .TP
1127 \fInswap\fP %lu
1128 (36)
1129 .\" nswap was added in 2.0
1130 Number of pages swapped (not maintained).
1131 .TP
1132 \fIcnswap\fP %lu
1133 (37)
1134 .\" cnswap was added in 2.0
1135 Cumulative \fInswap\fP for child processes (not maintained).
1136 .TP
1137 \fIexit_signal\fP %d (since Linux 2.1.22)
1138 (38) Signal to be sent to parent when we die.
1139 .TP
1140 \fIprocessor\fP %d (since Linux 2.2.8)
1141 (39) CPU number last executed on.
1142 .TP
1143 \fIrt_priority\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
1144 (40) Real-time scheduling priority, a number in the range 1 to 99 for
1145 processes scheduled under a real-time policy,
1146 or 0, for non-real-time processes (see
1147 .BR sched_setscheduler (2)).
1148 .TP
1149 \fIpolicy\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
1150 (41) Scheduling policy (see
1151 .BR sched_setscheduler (2)).
1152 Decode using the SCHED_* constants in
1153 .IR linux/sched.h .
1154 .TP
1155 \fIdelayacct_blkio_ticks\fP %llu (since Linux 2.6.18)
1156 (42) Aggregated block I/O delays, measured in clock ticks (centiseconds).
1157 .TP
1158 \fIguest_time\fP %lu (since Linux 2.6.24)
1159 (43) Guest time of the process (time spent running a virtual CPU
1160 for a guest operating system), measured in clock ticks (divide by
1161 .IR sysconf(_SC_CLK_TCK) ).
1162 .TP
1163 \fIcguest_time\fP %ld (since Linux 2.6.24)
1164 (44) Guest time of the process's children, measured in clock ticks (divide by
1165 .IR sysconf(_SC_CLK_TCK) ).
1166 .RE
1167 .TP
1168 .I /proc/[pid]/statm
1169 Provides information about memory usage, measured in pages.
1170 The columns are:
1171 .in +4n
1172 .nf
1173
1174 size       (1) total program size
1175            (same as VmSize in \fI/proc/[pid]/status\fP)
1176 resident   (2) resident set size
1177            (same as VmRSS in \fI/proc/[pid]/status\fP)
1178 share      (3) shared pages (i.e., backed by a file)
1179 text       (4) text (code)
1180 .\" (not including libs; broken, includes data segment)
1181 lib        (5) library (unused in Linux 2.6)
1182 data       (6) data + stack
1183 .\" (including libs; broken, includes library text)
1184 dt         (7) dirty pages (unused in Linux 2.6)
1185 .fi
1186 .in
1187 .TP
1188 .I /proc/[pid]/status
1189 Provides much of the information in
1190 .I /proc/[pid]/stat
1191 and
1192 .I /proc/[pid]/statm
1193 in a format that's easier for humans to parse.
1194 Here's an example:
1195 .in +4n
1196 .nf
1197
1198 .RB "$" " cat /proc/$$/status"
1199 Name:   bash
1200 State:  S (sleeping)
1201 Tgid:   3515
1202 Pid:    3515
1203 PPid:   3452
1204 TracerPid:      0
1205 Uid:    1000    1000    1000    1000
1206 Gid:    100     100     100     100
1207 FDSize: 256
1208 Groups: 16 33 100
1209 VmPeak:     9136 kB
1210 VmSize:     7896 kB
1211 VmLck:         0 kB
1212 VmHWM:      7572 kB
1213 VmRSS:      6316 kB
1214 VmData:     5224 kB
1215 VmStk:        88 kB
1216 VmExe:       572 kB
1217 VmLib:      1708 kB
1218 VmPTE:        20 kB
1219 Threads:        1
1220 SigQ:   0/3067
1221 SigPnd: 0000000000000000
1222 ShdPnd: 0000000000000000
1223 SigBlk: 0000000000010000
1224 SigIgn: 0000000000384004
1225 SigCgt: 000000004b813efb
1226 CapInh: 0000000000000000
1227 CapPrm: 0000000000000000
1228 CapEff: 0000000000000000
1229 CapBnd: ffffffffffffffff
1230 Cpus_allowed:   00000001
1231 Cpus_allowed_list:      0
1232 Mems_allowed:   1
1233 Mems_allowed_list:      0
1234 voluntary_ctxt_switches:        150
1235 nonvoluntary_ctxt_switches:     545
1236 .fi
1237 .in
1238 .IP
1239 The fields are as follows:
1240 .RS
1241 .IP * 2
1242 .IR Name :
1243 Command run by this process.
1244 .IP *
1245 .IR State :
1246 Current state of the process.
1247 One of
1248 "R (running)",
1249 "S (sleeping)",
1250 "D (disk sleep)",
1251 "T (stopped)",
1252 "T (tracing stop)",
1253 "Z (zombie)",
1254 or
1255 "X (dead)".
1256 .IP *
1257 .IR Tgid :
1258 Thread group ID (i.e., Process ID).
1259 .IP *
1260 .IR Pid :
1261 Thread ID (see
1262 .BR gettid (2)).
1263 .IP *
1264 .IR PPid :
1265 PID of parent process.
1266 .IP *
1267 .IR TracerPid :
1268 PID of process tracing this process (0 if not being traced).
1269 .IP *
1270 .IR Uid ", " Gid :
1271 Real, effective, saved set, and file system UIDs (GIDs).
1272 .IP *
1273 .IR FDSize :
1274 Number of file descriptor slots currently allocated.
1275 .IP *
1276 .IR Groups :
1277 Supplementary group list.
1278 .IP *
1279 .IR VmPeak :
1280 Peak virtual memory size.
1281 .IP *
1282 .IR VmSize :
1283 Virtual memory size.
1284 .IP *
1285 .IR VmLck :
1286 Locked memory size (see
1287 .BR mlock (3)).
1288 .IP *
1289 .IR VmHWM :
1290 Peak resident set size ("high water mark").
1291 .IP *
1292 .IR VmRSS :
1293 Resident set size.
1294 .IP *
1295 .IR VmData ", " VmStk ", " VmExe :
1296 Size of data, stack, and text segments.
1297 .IP *
1298 .IR VmLib :
1299 Shared library code size.
1300 .IP *
1301 .IR VmPTE :
1302 Page table entries size (since Linux 2.6.10).
1303 .IP *
1304 .IR Threads :
1305 Number of threads in process containing this thread.
1306 .IP *
1307 .IR SigQ :
1308 This field contains two slash-separated numbers that relate to
1309 queued signals for the real user ID of this process.
1310 The first of these is the number of currently queued
1311 signals for this real user ID, and the second is the
1312 resource limit on the number of queued signals for this process
1313 (see the description of
1314 .BR RLIMIT_SIGPENDING
1315 in
1316 .BR getrlimit (2)).
1317 .IP *
1318 .IR SigPnd ", " ShdPnd :
1319 Number of signals pending for thread and for process as a whole (see
1320 .BR pthreads (7)
1321 and
1322 .BR signal (7)).
1323 .IP *
1324 .IR SigBlk ", " SigIgn ", " SigCgt :
1325 Masks indicating signals being blocked, ignored, and caught (see
1326 .BR signal (7)).
1327 .IP *
1328 .IR CapInh ", " CapPrm ", " CapEff :
1329 Masks of capabilities enabled in inheritable, permitted, and effective sets
1330 (see
1331 .BR capabilities (7)).
1332 .IP *
1333 .IR CapBnd :
1334 Capability Bounding set
1335 (since kernel 2.6.26, see
1336 .BR capabilities (7)).
1337 .IP *
1338 .IR Cpus_allowed :
1339 Mask of CPUs on which this process may run
1340 (since Linux 2.6.24, see
1341 .BR cpuset (7)).
1342 .IP *
1343 .IR Cpus_allowed_list :
1344 Same as previous, but in "list format"
1345 (since Linux 2.6.26, see
1346 .BR cpuset (7)).
1347 .IP *
1348 .IR Mems_allowed :
1349 Mask of memory nodes allowed to this process
1350 (since Linux 2.6.24, see
1351 .BR cpuset (7)).
1352 .IP *
1353 .IR Mems_allowed_list :
1354 Same as previous, but in "list format"
1355 (since Linux 2.6.26, see
1356 .BR cpuset (7)).
1357 .IP *
1358 .IR voluntary_context_switches ", " nonvoluntary_context_switches :
1359 Number of voluntary and involuntary context switches (since Linux 2.6.23).
1360 .RE
1361 .TP
1362 .IR /proc/[pid]/task " (since Linux 2.6.0-test6)"
1363 This is a directory that contains one subdirectory
1364 for each thread in the process.
1365 The name of each subdirectory is the numerical thread ID
1366 .RI ( [tid] )
1367 of the thread (see
1368 .BR gettid (2)).
1369 Within each of these subdirectories, there is a set of
1370 files with the same names and contents as under the
1371 .I /proc/[pid]
1372 directories.
1373 For attributes that are shared by all threads, the contents for
1374 each of the files under the
1375 .I task/[tid]
1376 subdirectories will be the same as in the corresponding
1377 file in the parent
1378 .I /proc/[pid]
1379 directory
1380 (e.g., in a multithreaded process, all of the
1381 .I task/[tid]/cwd
1382 files will have the same value as the
1383 .I /proc/[pid]/cwd
1384 file in the parent directory, since all of the threads in a process
1385 share a working directory).
1386 For attributes that are distinct for each thread,
1387 the corresponding files under
1388 .I task/[tid]
1389 may have different values (e.g., various fields in each of the
1390 .I task/[tid]/status
1391 files may be different for each thread).
1392
1393 .\" The following was still true as at kernel 2.6.13
1394 In a multithreaded process, the contents of the
1395 .I /proc/[pid]/task
1396 directory are not available if the main thread has already terminated
1397 (typically by calling
1398 .BR pthread_exit (3)).
1399 .TP
1400 .I /proc/apm
1401 Advanced power management version and battery information when
1402 .B CONFIG_APM
1403 is defined at kernel compilation time.
1404 .TP
1405 .I /proc/bus
1406 Contains subdirectories for installed busses.
1407 .TP
1408 .I /proc/bus/pccard
1409 Subdirectory for PCMCIA devices when
1410 .B CONFIG_PCMCIA
1411 is set at kernel compilation time.
1412 .TP
1413 .I /proc/bus/pccard/drivers
1414 .TP
1415 .I /proc/bus/pci
1416 Contains various bus subdirectories and pseudo-files containing
1417 information about PCI busses, installed devices, and device
1418 drivers.
1419 Some of these files are not ASCII.
1420 .TP
1421 .I /proc/bus/pci/devices
1422 Information about PCI devices.
1423 They may be accessed through
1424 .BR lspci (8)
1425 and
1426 .BR setpci (8).
1427 .TP
1428 .I /proc/cmdline
1429 Arguments passed to the Linux kernel at boot time.
1430 Often done via a boot manager such as
1431 .BR lilo (8)
1432 or
1433 .BR grub (8).
1434 .TP
1435 .IR /proc/config.gz " (since Linux 2.6)"
1436 This file exposes the configuration options that were used
1437 to build the currently running kernel,
1438 in the same format as they would be shown in the
1439 .I .config
1440 file that resulted when configuring the kernel (using
1441 .IR "make xconfig" ,
1442 .IR "make config" ,
1443 or similar).
1444 The file contents are compressed; view or search them using
1445 .BR zcat (1),
1446 .BR zgrep (1),
1447 etc.
1448 As long as no changes have been made to the following file,
1449 the contents of
1450 .I /proc/config.gz
1451 are the same as those provided by :
1452 .in +4n
1453 .nf
1454
1455 cat /lib/modules/$(uname \-r)/build/.config
1456 .fi
1457 .in
1458 .IP
1459 .I /proc/config.gz
1460 is provided only if the kernel is configured with
1461 .BR CONFIG_IKCONFIG_PROC .
1462 .TP
1463 .I /proc/cpuinfo
1464 This is a collection of CPU and system architecture dependent items,
1465 for each supported architecture a different list.
1466 Two common entries are \fIprocessor\fP which gives CPU number and
1467 \fIbogomips\fP; a system constant that is calculated
1468 during kernel initialization.
1469 SMP machines have information for
1470 each CPU.
1471 The
1472 .BR lscpu (1)
1473 command gathers its information from this file.
1474 .TP
1475 .I /proc/devices
1476 Text listing of major numbers and device groups.
1477 This can be used by MAKEDEV scripts for consistency with the kernel.
1478 .TP
1479 .IR /proc/diskstats " (since Linux 2.5.69)"
1480 This file contains disk I/O statistics for each disk device.
1481 See the Linux kernel source file
1482 .I Documentation/iostats.txt
1483 for further information.
1484 .TP
1485 .I /proc/dma
1486 This is a list of the registered \fIISA\fP DMA (direct memory access)
1487 channels in use.
1488 .TP
1489 .I /proc/driver
1490 Empty subdirectory.
1491 .TP
1492 .I /proc/execdomains
1493 List of the execution domains (ABI personalities).
1494 .TP
1495 .I /proc/fb
1496 Frame buffer information when
1497 .B CONFIG_FB
1498 is defined during kernel compilation.
1499 .TP
1500 .I /proc/filesystems
1501 A text listing of the file systems which are supported by the kernel,
1502 namely file systems which were compiled into the kernel or whose kernel
1503 modules are currently loaded.
1504 (See also
1505 .BR filesystems (5).)
1506 If a file system is marked with "nodev",
1507 this means that it does not require a block device to be mounted
1508 (e.g., virtual file system, network file system).
1509
1510 Incidentally, this file may be used by
1511 .BR mount (8)
1512 when no file system is specified and it didn't manage to determine the
1513 file system type.
1514 Then file systems contained in this file are tried
1515 (excepted those that are marked with "nodev").
1516 .TP
1517 .I /proc/fs
1518 Empty subdirectory.
1519 .TP
1520 .I /proc/ide
1521 This directory
1522 exists on systems with the IDE bus.
1523 There are directories for each IDE channel and attached device.
1524 Files include:
1525
1526 .in +4n
1527 .nf
1528 cache              buffer size in KB
1529 capacity           number of sectors
1530 driver             driver version
1531 geometry           physical and logical geometry
1532 identify           in hexadecimal
1533 media              media type
1534 model              manufacturer's model number
1535 settings           drive settings
1536 smart_thresholds   in hexadecimal
1537 smart_values       in hexadecimal
1538 .fi
1539 .in
1540
1541 The
1542 .BR hdparm (8)
1543 utility provides access to this information in a friendly format.
1544 .TP
1545 .I /proc/interrupts
1546 This is used to record the number of interrupts per CPU per IO device.
1547 Since Linux 2.6.24,
1548 for the i386 and x86_64 architectures, at least, this also includes
1549 interrupts internal to the system (that is, not associated with a device
1550 as such), such as NMI (nonmaskable interrupt), LOC (local timer interrupt),
1551 and for SMP systems, TLB (TLB flush interrupt), RES (rescheduling
1552 interrupt), CAL (remote function call interrupt), and possibly others.
1553 Very easy to read formatting, done in ASCII.
1554 .TP
1555 .I /proc/iomem
1556 I/O memory map in Linux 2.4.
1557 .TP
1558 .I /proc/ioports
1559 This is a list of currently registered Input-Output port regions that
1560 are in use.
1561 .TP
1562 .IR /proc/kallsyms " (since Linux 2.5.71)"
1563 This holds the kernel exported symbol definitions used by the
1564 .BR modules (X)
1565 tools to dynamically link and bind loadable modules.
1566 In Linux 2.5.47 and earlier, a similar file with slightly different syntax
1567 was named
1568 .IR ksyms .
1569 .TP
1570 .I /proc/kcore
1571 This file represents the physical memory of the system and is stored
1572 in the ELF core file format.
1573 With this pseudo-file, and an unstripped
1574 kernel
1575 .RI ( /usr/src/linux/vmlinux )
1576 binary, GDB can be used to
1577 examine the current state of any kernel data structures.
1578
1579 The total length of the file is the size of physical memory (RAM) plus
1580 4KB.
1581 .TP
1582 .I /proc/kmsg
1583 This file can be used instead of the
1584 .BR syslog (2)
1585 system call to read kernel messages.
1586 A process must have superuser
1587 privileges to read this file, and only one process should read this
1588 file.
1589 This file should not be read if a syslog process is running
1590 which uses the
1591 .BR syslog (2)
1592 system call facility to log kernel messages.
1593
1594 Information in this file is retrieved with the
1595 .BR dmesg (1)
1596 program.
1597 .TP
1598 .IR /proc/ksyms " (Linux 1.1.23-2.5.47)"
1599 See
1600 .IR /proc/kallsyms .
1601 .TP
1602 .I /proc/loadavg
1603 The first three fields in this file are load average figures
1604 giving the number of jobs in the run queue (state R)
1605 or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes.
1606 They are the same as the load average numbers given by
1607 .BR uptime (1)
1608 and other programs.
1609 The fourth field consists of two numbers separated by a slash (/).
1610 The first of these is the number of currently runnable kernel
1611 scheduling entities (processes, threads).
1612 The value after the slash is the number of kernel scheduling entities
1613 that currently exist on the system.
1614 The fifth field is the PID of the process that was most
1615 recently created on the system.
1616 .TP
1617 .I /proc/locks
1618 This file shows current file locks
1619 .RB ( flock "(2) and " fcntl (2))
1620 and leases
1621 .RB ( fcntl (2)).
1622 .TP
1623 .IR /proc/malloc " (only up to and including Linux 2.2)"
1624 .\" It looks like this only ever did something back in 1.0 days
1625 This file is present only if
1626 .B CONFIG_DEBUG_MALLOC
1627 was defined during compilation.
1628 .TP
1629 .I /proc/meminfo
1630 This file reports statistics about memory usage on the system.
1631 It is used by
1632 .BR free (1)
1633 to report the amount of free and used memory (both physical and swap)
1634 on the system as well as the shared memory and buffers used by the
1635 kernel.
1636 Each line of the file consists of a parameter name, followed by a colon,
1637 the value of the parameter, and an option unit of measurement (e.g., "kB").
1638 The list below describes the parameter names and
1639 the format specifier required to read the field value.
1640 Except as noted below,
1641 all of the fields have been present since at least Linux 2.6.0.
1642 Some fileds are displayed only if the kernel was configured
1643 with various options; those dependencies are noted in the list.
1644 .RS
1645 .TP
1646 .IR MemTotal " %lu"
1647 Total usable RAM (i.e. physical RAM minus a few reserved
1648 bits and the kernel binary code).
1649 .TP
1650 .IR MemFree " %lu"
1651 The sum of
1652 .IR LowFree + HighFree .
1653 .TP
1654 .IR Buffers " %lu"
1655 Relatively temporary storage for raw disk blocks that
1656 shouldn't get tremendously large (20MB or so).
1657 .TP
1658 .IR Cached " %lu"
1659 In-memory cache for files read from the disk (the page cache).
1660 Doesn't include
1661 .IR SwapCached .
1662 .TP
1663 .IR SwapCached " %lu"
1664 Memory that once was swapped out, is swapped back in but
1665 still also is in the swap file.
1666 (If memory pressure is high, these pages
1667 don't need to be swapped out again because they are already
1668 in the swap file.
1669 This saves I/O.)
1670 .TP
1671 .IR Active " %lu"
1672 Memory that has been used more recently and usually not
1673 reclaimed unless absolutely necessary.
1674 .TP
1675 .IR Inactive " %lu"
1676 Memory which has been less recently used.
1677 It is more eligible to be reclaimed for other purposes.
1678 .TP
1679 .IR Active(anon) " %lu (since Linux 2.6.28)"
1680 [To be documented.]
1681 .TP
1682 .IR Inactive(anon) " %lu (since Linux 2.6.28)"
1683 [To be documented.]
1684 .TP
1685 .IR Active(file) " %lu (since Linux 2.6.28)"
1686 [To be documented.]
1687 .TP
1688 .IR Inactive(file) " %lu (since Linux 2.6.28)"
1689 [To be documented.]
1690 .TP
1691 .IR Unevictable " %lu (since Linux 2.6.28)"
1692 (From Linux 2.6.28 to 2.6.30,
1693 \fBCONFIG_UNEVICTABLE_LRU\fP was required.)
1694 [To be documented.]
1695 .TP
1696 .IR Mlocked " %lu (since Linux 2.6.28)"
1697 (From Linux 2.6.28 to 2.6.30,
1698 \fBCONFIG_UNEVICTABLE_LRU\fP was required.)
1699 [To be documented.]
1700 .TP
1701 .IR HighTotal " %lu"
1702 (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1703 Total amount of highmem.
1704 Highmem is all memory above ~860MB of physical memory.
1705 Highmem areas are for use by user-space programs,
1706 or for the page cache.
1707 The kernel must use tricks to access
1708 this memory, making it slower to access than lowmem.
1709 .TP
1710 .IR HighFree " %lu
1711 (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1712 Amount of free highmem.
1713 .TP
1714 .IR LowTotal " %lu
1715 (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1716 Total amount of lowmem.
1717 Lowmem is memory which can be used for everything that
1718 highmem can be used for, but it is also available for the
1719 kernel's use for its own data structures.
1720 Among many other things,
1721 it is where everything from
1722 .I Slab
1723 is allocated.
1724 Bad things happen when you're out of lowmem.
1725 .TP
1726 .IR LowFree " %lu
1727 (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1728 Amount of free lowmem.
1729 .TP
1730 .IR MmapCopy " %lu (since Linux 2.6.29)"
1731 .RB ( CONFIG_MMU
1732 is required.)
1733 [To be documented.]
1734 .TP
1735 .IR SwapTotal " %lu"
1736 Total amount of swap space available.
1737 .TP
1738 .IR SwapFree " %lu"
1739 Amount of swap space that is currently unused.
1740 .TP
1741 .IR Dirty " %lu"
1742 Memory which is waiting to get written back to the disk.
1743 .TP
1744 .IR Writeback " %lu"
1745 Memory which is actively being written back to the disk.
1746 .TP
1747 .IR AnonPages " %lu (since Linux 2.6.18)"
1748 Non-file backed pages mapped into user-space page tables.
1749 .TP
1750 .IR Mapped " %lu"
1751 Files which have been mmaped, such as libraries.
1752 .TP
1753 .IR Shmem " %lu (since Linux 2.6.32)"
1754 [To be documented.]
1755 .TP
1756 .IR Slab " %lu"
1757 In-kernel data structures cache.
1758 .TP
1759 .IR SReclaimable " %lu (since Linux 2.6.19)"
1760 Part of
1761 .IR Slab ,
1762 that might be reclaimed, such as caches.
1763 .TP
1764 .IR SUnreclaim " %lu (since Linux 2.6.19)"
1765 Part of
1766 .IR Slab ,
1767 that cannot be reclaimed on memory pressure.
1768 .TP
1769 .IR KernelStack " %lu (since Linux 2.6.32)"
1770 Amount of memory allocated to kernel stacks.
1771 .TP
1772 .IR PageTables " %lu (since Linux 2.6.18)"
1773 Amount of memory dedicated to the lowest level of page tables.
1774 .TP
1775 .IR Quicklists " %lu (since Linux 2.6.27)"
1776 (\fBCONFIG_QUICKLIST\fP is required.)
1777 [To be documented.]
1778 .TP
1779 .IR NFS_Unstable " %lu (since Linux 2.6.18)"
1780 NFS pages sent to the server, but not yet committed to stable storage.
1781 .TP
1782 .IR Bounce " %lu (since Linux 2.6.18)"
1783 Memory used for block device "bounce buffers".
1784 .TP
1785 .IR WritebackTmp " %lu (since Linux 2.6.26)"
1786 Memory used by FUSE for temporary writeback buffers.
1787 .TP
1788 .IR CommitLimit " %lu (since Linux 2.6.10)"
1789 Based on the overcommit ratio ('vm.overcommit_ratio'),
1790 this is the total amount of  memory currently available to
1791 be allocated on the system.
1792 This limit is adhered to
1793 only if strict overcommit accounting is enabled (mode 2 in
1794 .IR /proc/sys/vm/overcommit_ratio ).
1795 The
1796 .I CommitLimit
1797 is calculated using the following formula:
1798
1799     CommitLimit = (overcommit_ratio * Physical RAM) + Swap
1800
1801 For example, on a system with 1GB of physical RAM and 7GB
1802 of swap with a
1803 .I overcommit_ratio
1804 of 30, this formula yields a
1805 .I CommitLimit
1806 of 7.3GB.
1807 For more details, see the memory overcommit documentation
1808 in the kernel source file
1809 .IR Documentation/vm/overcommit-accounting .
1810 .TP
1811 .IR Committed_AS " %lu"
1812 The amount of memory presently allocated on the system.
1813 The committed memory is a sum of all of the memory which
1814 has been allocated by processes, even if it has not been
1815 "used" by them as of yet.
1816 A process which allocates 1GB of memory (using
1817 .BR malloc (3)
1818 or similar), but touches only 300MB of that memory will show up
1819 as using only 300MB of memory even if it has the address space
1820 allocated for the entire 1GB.
1821 This 1GB is memory which has been "committed" to by the VM
1822 and can be used at any time by the allocating application.
1823 With strict overcommit enabled on the system (mode 2
1824 .IR /proc/sys/vm/overcommit_memory ),
1825 allocations which would exceed the
1826 .I CommitLimit
1827 (detailed above) will not be permitted.
1828 This is useful if one needs to guarantee that processes will not
1829 fail due to lack of memory once that memory has been successfully allocated.
1830 .TP
1831 .IR VmallocTotal " %lu"
1832 Total size of vmalloc memory area.
1833 .TP
1834 .IR VmallocUsed " %lu"
1835 Amount of vmalloc area which is used.
1836 .TP
1837 .IR VmallocChunk " %lu"
1838 Largest contiguous block of vmalloc area which is free.
1839 .TP
1840 .IR HardwareCorrupted " %lu (since Linux 2.6.32)"
1841 (\fBCONFIG_MEMORY_FAILURE\fP is required.)
1842 [To be documented.]
1843 .TP
1844 .IR AnonHugePages " %lu (since Linux 2.6.38)"
1845 (\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.)
1846 Non-file backed huge pages mapped into user-space page tables.
1847 .TP
1848 .IR HugePages_Total " %lu"
1849 (\fBCONFIG_HUGETLB_PAGE\fP is required.)
1850 The size of the pool of huge pages.
1851 .TP
1852 .IR HugePages_Free " %lu"
1853 (\fBCONFIG_HUGETLB_PAGE\fP is required.)
1854 The number of huge pages in the pool that are not yet allocated.
1855 .TP
1856 .IR HugePages_Rsvd " %lu (since Linux 2.6.17)"
1857 (\fBCONFIG_HUGETLB_PAGE\fP is required.)
1858 This is the number of huge pages for
1859 which a commitment to allocate from the pool has been made,
1860 but no allocation has yet been made.
1861 These reserved huge pages
1862 guarantee that an application will be able to allocate a
1863 huge page from the pool of huge pages at fault time.
1864 .TP
1865 .IR HugePages_Surp " %lu (since Linux 2.6.24)"
1866 (\fBCONFIG_HUGETLB_PAGE\fP is required.)
1867 This is the number of huge pages in
1868 the pool above the value in
1869 .IR /proc/sys/vm/nr_hugepages .
1870 The maximum number of surplus huge pages is controlled by
1871 .IR /proc/sys/vm/nr_overcommit_hugepages .
1872 .TP
1873 .IR Hugepagesize " %lu"
1874 (\fBCONFIG_HUGETLB_PAGE\fP is required.)
1875 The size of huge pages.
1876 .RE
1877 .TP
1878 .I /proc/modules
1879 A text list of the modules that have been loaded by the system.
1880 See also
1881 .BR lsmod (8).
1882 .TP
1883 .I /proc/mounts
1884 Before kernel 2.4.19, this file was a list
1885 of all the file systems currently mounted on the system.
1886 With the introduction of per-process mount namespaces in
1887 Linux 2.4.19, this file became a link to
1888 .IR /proc/self/mounts ,
1889 which lists the mount points of the process's own mount namespace.
1890 The format of this file is documented in
1891 .BR fstab (5).
1892 .TP
1893 .I /proc/mtrr
1894 Memory Type Range Registers.
1895 See the Linux kernel source file
1896 .I Documentation/mtrr.txt
1897 for details.
1898 .TP
1899 .I /proc/net
1900 various net pseudo-files, all of which give the status of some part of
1901 the networking layer.
1902 These files contain ASCII structures and are,
1903 therefore, readable with
1904 .BR cat (1).
1905 However, the standard
1906 .BR netstat (8)
1907 suite provides much cleaner access to these files.
1908 .TP
1909 .I /proc/net/arp
1910 This holds an ASCII readable dump of the kernel ARP table used for
1911 address resolutions.
1912 It will show both dynamically learned and preprogrammed ARP entries.
1913 The format is:
1914
1915 .nf
1916 .ft CW
1917 .in 8n
1918 IP address     HW type   Flags     HW address          Mask   Device
1919 192.168.0.50   0x1       0x2       00:50:BF:25:68:F3   *      eth0
1920 192.168.0.250  0x1       0xc       00:00:00:00:00:00   *      eth0
1921 .ft
1922 .fi
1923 .in
1924
1925 Here "IP address" is the IPv4 address of the machine and the "HW type"
1926 is the hardware type of the address from RFC\ 826.
1927 The flags are the internal
1928 flags of the ARP structure (as defined in
1929 .IR /usr/include/linux/if_arp.h )
1930 and
1931 the "HW address" is the data link layer mapping for that IP address if
1932 it is known.
1933 .TP
1934 .I /proc/net/dev
1935 The dev pseudo-file contains network device status information.
1936 This gives
1937 the number of received and sent packets, the number of errors and
1938 collisions
1939 and other basic statistics.
1940 These are used by the
1941 .BR ifconfig (8)
1942 program to report device status.
1943 The format is:
1944
1945 .nf
1946 .ft CW
1947 .in 1n
1948 Inter-|   Receive                                                |  Transmit
1949  face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
1950     lo: 2776770   11307    0    0    0     0          0         0  2776770   11307    0    0    0     0       0          0
1951   eth0: 1215645    2751    0    0    0     0          0         0  1782404    4324    0    0    0   427       0          0
1952   ppp0: 1622270    5552    1    0    0     0          0         0   354130    5669    0    0    0     0       0          0
1953   tap0:    7714      81    0    0    0     0          0         0     7714      81    0    0    0     0       0          0
1954 .in
1955 .ft
1956 .fi
1957 .\" .TP
1958 .\" .I /proc/net/ipx
1959 .\" No information.
1960 .\" .TP
1961 .\" .I /proc/net/ipx_route
1962 .\" No information.
1963 .TP
1964 .I /proc/net/dev_mcast
1965 Defined in
1966 .IR /usr/src/linux/net/core/dev_mcast.c :
1967 .nf
1968 .in +5
1969 indx interface_name  dmi_u dmi_g dmi_address
1970 2    eth0            1     0     01005e000001
1971 3    eth1            1     0     01005e000001
1972 4    eth2            1     0     01005e000001
1973 .in
1974 .fi
1975 .TP
1976 .I /proc/net/igmp
1977 Internet Group Management Protocol.
1978 Defined in
1979 .IR /usr/src/linux/net/core/igmp.c .
1980 .TP
1981 .I /proc/net/rarp
1982 This file uses the same format as the
1983 .I arp
1984 file and contains the current reverse mapping database used to provide
1985 .BR rarp (8)
1986 reverse address lookup services.
1987 If RARP is not configured into the
1988 kernel,
1989 this file will not be present.
1990 .TP
1991 .I /proc/net/raw
1992 Holds a dump of the RAW socket table.
1993 Much of the information is not of
1994 use
1995 apart from debugging.
1996 The "sl" value is the kernel hash slot for the
1997 socket,
1998 the "local_address" is the local address and protocol number pair.
1999 \&"St" is
2000 the internal status of the socket.
2001 The "tx_queue" and "rx_queue" are the
2002 outgoing and incoming data queue in terms of kernel memory usage.
2003 The "tr", "tm\->when", and "rexmits" fields are not used by RAW.
2004 The "uid"
2005 field holds the effective UID of the creator of the socket.
2006 .\" .TP
2007 .\" .I /proc/net/route
2008 .\" No information, but looks similar to
2009 .\" .BR route (8).
2010 .TP
2011 .I /proc/net/snmp
2012 This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP
2013 management
2014 information bases for an SNMP agent.
2015 .TP
2016 .I /proc/net/tcp
2017 Holds a dump of the TCP socket table.
2018 Much of the information is not
2019 of use apart from debugging.
2020 The "sl" value is the kernel hash slot
2021 for the socket, the "local_address" is the local address and port number pair.
2022 The "rem_address" is the remote address and port number pair
2023 (if connected).
2024 \&"St" is the internal status of the socket.
2025 The "tx_queue" and "rx_queue" are the
2026 outgoing and incoming data queue in terms of kernel memory usage.
2027 The "tr", "tm\->when", and "rexmits" fields hold internal information of
2028 the kernel socket state and are only useful for debugging.
2029 The "uid"
2030 field holds the effective UID of the creator of the socket.
2031 .TP
2032 .I /proc/net/udp
2033 Holds a dump of the UDP socket table.
2034 Much of the information is not of
2035 use apart from debugging.
2036 The "sl" value is the kernel hash slot for the
2037 socket, the "local_address" is the local address and port number pair.
2038 The "rem_address" is the remote address and port number pair
2039 (if connected). "St" is the internal status of the socket.
2040 The "tx_queue" and "rx_queue" are the outgoing and incoming data queue
2041 in terms of kernel memory usage.
2042 The "tr", "tm\->when", and "rexmits" fields
2043 are not used by UDP.
2044 The "uid"
2045 field holds the effective UID of the creator of the socket.
2046 The format is:
2047
2048 .nf
2049 .ft CW
2050 .in 1n
2051 sl  local_address rem_address   st tx_queue rx_queue tr rexmits  tm\->when uid
2052  1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0
2053  1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0
2054  1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0
2055 .in
2056 .ft
2057 .fi
2058 .TP
2059 .I /proc/net/unix
2060 Lists the UNIX domain sockets present within the system and their
2061 status.
2062 The format is:
2063 .nf
2064 .sp .5
2065 .ft CW
2066 Num RefCount Protocol Flags    Type St Path
2067  0: 00000002 00000000 00000000 0001 03
2068  1: 00000001 00000000 00010000 0001 01 /dev/printer
2069 .ft
2070 .sp .5
2071 .fi
2072
2073 Here "Num" is the kernel table slot number, "RefCount" is the number
2074 of users of the socket, "Protocol" is currently always 0, "Flags"
2075 represent the internal kernel flags holding the status of the
2076 socket.
2077 Currently, type is always "1" (UNIX domain datagram sockets are
2078 not yet supported in the kernel).
2079 \&"St" is the internal state of the
2080 socket and Path is the bound path (if any) of the socket.
2081 .TP
2082 .I /proc/partitions
2083 Contains major and minor numbers of each partition as well as number
2084 of blocks and partition name.
2085 .TP
2086 .I /proc/pci
2087 This is a listing of all PCI devices found during kernel initialization
2088 and their configuration.
2089
2090 This file has been deprecated in favor of a new
2091 .I /proc
2092 interface for PCI
2093 .RI ( /proc/bus/pci ).
2094 It became optional in Linux 2.2 (available with
2095 .B CONFIG_PCI_OLD_PROC
2096 set at kernel compilation).
2097 It became once more nonoptionally enabled in Linux 2.4.
2098 Next, it was deprecated in Linux 2.6 (still available with
2099 .B CONFIG_PCI_LEGACY_PROC
2100 set), and finally removed altogether since Linux 2.6.17.
2101 .\" FIXME /proc/sched_debug
2102 .\" .TP
2103 .\" .IR /proc/sched_debug " (since Linux 2.6.23)"
2104 .\" See also /proc/[pid]/sched
2105 .TP
2106 .IR /proc/profile " (since Linux 2.4)"
2107 This file is present only if the kernel was booted with the
2108 .I profile=1
2109 command-line option.
2110 It exposes kernel profiling information in a binary format for use by
2111 .BR readprofile (1).
2112 Writing (e.g., an empty string) to this file resets the profiling counters;
2113 on some architectures,
2114 writing a binary integer "profiling multiplier" of size
2115 .IR sizeof(int)
2116 sets the profiling interrupt frequency.
2117 .TP
2118 .I /proc/scsi
2119 A directory with the
2120 .I scsi
2121 mid-level pseudo-file and various SCSI low-level
2122 driver directories,
2123 which contain a file for each SCSI host in this system, all of
2124 which give the status of some part of the SCSI IO subsystem.
2125 These files contain ASCII structures and are, therefore, readable with
2126 .BR cat (1).
2127
2128 You can also write to some of the files to reconfigure the subsystem or
2129 switch certain features on or off.
2130 .TP
2131 .I /proc/scsi/scsi
2132 This is a listing of all SCSI devices known to the kernel.
2133 The listing is similar to the one seen during bootup.
2134 scsi currently supports only the \fIadd-single-device\fP command which
2135 allows root to add a hotplugged device to the list of known devices.
2136
2137 The command
2138 .in +4n
2139 .nf
2140
2141 echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi
2142
2143 .fi
2144 .in
2145 will cause
2146 host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0.
2147 If there
2148 is already a device known on this address or the address is invalid, an
2149 error will be returned.
2150 .TP
2151 .I /proc/scsi/[drivername]
2152 \fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740,
2153 aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic,
2154 scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000.
2155 These directories show up for all drivers that registered at least one
2156 SCSI HBA.
2157 Every directory contains one file per registered host.
2158 Every host-file is named after the number the host was assigned during
2159 initialization.
2160
2161 Reading these files will usually show driver and host configuration,
2162 statistics, etc.
2163
2164 Writing to these files allows different things on different hosts.
2165 For example, with the \fIlatency\fP and \fInolatency\fP commands,
2166 root can switch on and off command latency measurement code in the
2167 eata_dma driver.
2168 With the \fIlockup\fP and \fIunlock\fP commands,
2169 root can control bus lockups simulated by the scsi_debug driver.
2170 .TP
2171 .I /proc/self
2172 This directory refers to the process accessing the
2173 .I /proc
2174 file system,
2175 and is identical to the
2176 .I /proc
2177 directory named by the process ID of the same process.
2178 .TP
2179 .I /proc/slabinfo
2180 Information about kernel caches.
2181 Since Linux 2.6.16 this file is present only if the
2182 .B CONFIG_SLAB
2183 kernel configuration option is enabled.
2184 The columns in
2185 .I /proc/slabinfo
2186 are:
2187 .in +4n
2188 .nf
2189
2190 cache-name
2191 num-active-objs
2192 total-objs
2193 object-size
2194 num-active-slabs
2195 total-slabs
2196 num-pages-per-slab
2197 .fi
2198 .in
2199
2200 See
2201 .BR slabinfo (5)
2202 for details.
2203 .TP
2204 .I /proc/stat
2205 kernel/system statistics.
2206 Varies with architecture.
2207 Common
2208 entries include:
2209 .RS
2210 .TP
2211 \fIcpu  3357 0 4313 1362393\fP
2212 The amount of time, measured in units of
2213 USER_HZ (1/100ths of a second on most architectures, use
2214 .IR sysconf(_SC_CLK_TCK)
2215 to obtain the right value),
2216 .\" 1024 on Alpha and ia64
2217 that the system spent in various states:
2218 .RS
2219 .TP
2220 .I user
2221 (1) Time spent in user mode.
2222 .TP
2223 .I nice
2224 (2) Time spent in user mode with low priority (nice).
2225 .TP
2226 .I system
2227 (3) Time spent in system mode.
2228 .TP
2229 .I idle
2230 (4) Time spent in the idle task.
2231 .\" FIXME Actually, the following info about the /proc/stat 'cpu' field
2232 .\"       does not seem to be quite right (at least in 2.6.12 or 3.6):
2233 .\"       the idle time in /proc/uptime does not quite match this value
2234 This value should be USER_HZ times the
2235 second entry in the
2236 .I /proc/uptime
2237 pseudo-file.
2238 .TP
2239 .IR iowait " (since Linux 2.5.41)"
2240 (5) Time waiting for I/O to complete.
2241 .TP
2242 .IR irq " (since Linux 2.6.0-test4)"
2243 (6) Time servicing interrupts.
2244 .TP
2245 .IR softirq " (since Linux 2.6.0-test4)"
2246 (7) Time servicing softirqs.
2247 .TP
2248 .IR steal " (since Linux 2.6.11)"
2249 (8) Stolen time, which is the time spent in other operating systems when
2250 running in a virtualized environment
2251 .TP
2252 .IR guest " (since Linux 2.6.24)"
2253 (9) Time spent running a virtual CPU for guest
2254 operating systems under the control of the Linux kernel.
2255 .\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de
2256 .TP
2257 .IR guest_nice " (since Linux 2.6.33)"
2258 .\" commit ce0e7b28fb75cb003cfc8d0238613aaf1c55e797
2259 (10) Time spent running a niced guest (virtual CPU for guest
2260 operating systems under the control of the Linux kernel).
2261 .RE
2262 .TP
2263 \fIpage 5741 1808\fP
2264 The number of pages the system paged in and the number that were paged
2265 out (from disk).
2266 .TP
2267 \fIswap 1 0\fP
2268 The number of swap pages that have been brought in and out.
2269 .TP
2270 .\" FIXME The following is not the full picture for the 'intr' of
2271 .\"       /proc/stat on 2.6:
2272 \fIintr 1462898\fP
2273 This line shows counts of interrupts serviced since boot time,
2274 for each of the possible system interrupts.
2275 The first column is the total of all interrupts serviced;
2276 each subsequent column is the total for a particular interrupt.
2277 .TP
2278 \fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP...
2279 (major,disk_idx):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written)
2280 .br
2281 (Linux 2.4 only)
2282 .TP
2283 \fIctxt 115315\fP
2284 The number of context switches that the system underwent.
2285 .TP
2286 \fIbtime 769041601\fP
2287 boot time, in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
2288 .TP
2289 \fIprocesses 86031\fP
2290 Number of forks since boot.
2291 .TP
2292 \fIprocs_running 6\fP
2293 Number of processes in runnable state.
2294 (Linux 2.5.45 onward.)
2295 .TP
2296 \fIprocs_blocked 2\fP
2297 Number of processes blocked waiting for I/O to complete.
2298 (Linux 2.5.45 onward.)
2299 .RE
2300 .TP
2301 .I /proc/swaps
2302 Swap areas in use.
2303 See also
2304 .BR swapon (8).
2305 .TP
2306 .I /proc/sys
2307 This directory (present since 1.3.57) contains a number of files
2308 and subdirectories corresponding to kernel variables.
2309 These variables can be read and sometimes modified using
2310 the \fI/proc\fP file system, and the (deprecated)
2311 .BR sysctl (2)
2312 system call.
2313 .TP
2314 .IR /proc/sys/abi " (since Linux 2.4.10)"
2315 This directory may contain files with application binary information.
2316 .\" On some systems, it is not present.
2317 See the Linux kernel source file
2318 .I Documentation/sysctl/abi.txt
2319 for more information.
2320 .TP
2321 .I /proc/sys/debug
2322 This directory may be empty.
2323 .TP
2324 .I /proc/sys/dev
2325 This directory contains device-specific information (e.g.,
2326 .IR dev/cdrom/info ).
2327 On
2328 some systems, it may be empty.
2329 .TP
2330 .I /proc/sys/fs
2331 This directory contains the files and subdirectories for kernel variables
2332 related to file systems.
2333 .TP
2334 .I /proc/sys/fs/binfmt_misc
2335 Documentation for files in this directory can be found
2336 in the Linux kernel sources in
2337 .IR Documentation/binfmt_misc.txt .
2338 .TP
2339 .IR /proc/sys/fs/dentry-state " (since Linux 2.2)"
2340 This file contains information about the status of the
2341 directory cache (dcache).
2342 The file contains six numbers,
2343 .IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), "
2344 .I want_pages
2345 (pages requested by system) and two dummy values.
2346 .RS
2347 .IP * 2
2348 .I nr_dentry
2349 is the number of allocated dentries (dcache entries).
2350 This field is unused in Linux 2.2.
2351 .IP *
2352 .I nr_unused
2353 is the number of unused dentries.
2354 .IP *
2355 .I age_limit
2356 .\" looks like this is unused in kernels 2.2 to 2.6
2357 is the age in seconds after which dcache entries
2358 can be reclaimed when memory is short.
2359 .IP *
2360 .I want_pages
2361 .\" looks like this is unused in kernels 2.2 to 2.6
2362 is nonzero when the kernel has called shrink_dcache_pages() and the
2363 dcache isn't pruned yet.
2364 .RE
2365 .TP
2366 .I /proc/sys/fs/dir-notify-enable
2367 This file can be used to disable or enable the
2368 .I dnotify
2369 interface described in
2370 .BR fcntl (2)
2371 on a system-wide basis.
2372 A value of 0 in this file disables the interface,
2373 and a value of 1 enables it.
2374 .TP
2375 .I /proc/sys/fs/dquot-max
2376 This file shows the maximum number of cached disk quota entries.
2377 On some (2.4) systems, it is not present.
2378 If the number of free cached disk quota entries is very low and
2379 you have some awesome number of simultaneous system users,
2380 you might want to raise the limit.
2381 .TP
2382 .I /proc/sys/fs/dquot-nr
2383 This file shows the number of allocated disk quota
2384 entries and the number of free disk quota entries.
2385 .TP
2386 .IR /proc/sys/fs/epoll " (since Linux 2.6.28)"
2387 This directory contains the file
2388 .IR max_user_watches ,
2389 which can be used to limit the amount of kernel memory consumed by the
2390 .I epoll
2391 interface.
2392 For further details, see
2393 .BR epoll (7).
2394 .TP
2395 .I /proc/sys/fs/file-max
2396 This file defines
2397 a system-wide limit on the number of open files for all processes.
2398 (See also
2399 .BR setrlimit (2),
2400 which can be used by a process to set the per-process limit,
2401 .BR RLIMIT_NOFILE ,
2402 on the number of files it may open.)
2403 If you get lots
2404 of error messages in the kernel log about running out of file handles
2405 (look for "VFS: file-max limit <number> reached"),
2406 try increasing this value:
2407 .br
2408
2409 .br
2410 .nf
2411 .ft CW
2412     echo 100000 > /proc/sys/fs/file-max
2413 .fi
2414 .ft
2415
2416 The kernel constant
2417 .B NR_OPEN
2418 imposes an upper limit on the value that may be placed in
2419 .IR file-max .
2420
2421 If you increase
2422 .IR /proc/sys/fs/file-max ","
2423 be sure to increase
2424 .I /proc/sys/fs/inode-max
2425 to 3-4 times the new
2426 value of
2427 .IR /proc/sys/fs/file-max ","
2428 or you will run out of inodes.
2429
2430 Privileged processes
2431 .RB ( CAP_SYS_ADMIN )
2432 can override the
2433 .I file-max
2434 limit.
2435 .TP
2436 .I /proc/sys/fs/file-nr
2437 This (read-only) file contains three numbers:
2438 the number of allocated file handles
2439 (i.e., the number of files presently opened);
2440 the number of free file handles;
2441 and the maximum number of file handles (i.e., the same value as
2442 .IR /proc/sys/fs/file-max ).
2443 If the number of allocated file handles is close to the
2444 maximum, you should consider increasing the maximum.
2445 Before Linux 2.6,
2446 the kernel allocated file handles dynamically,
2447 but it didn't free them again.
2448 Instead the free file handles were kept in a list for reallocation;
2449 the "free file handles" value indicates the size of that list.
2450 A large number of free file handles indicates that there was
2451 a past peak in the usage of open file handles.
2452 Since Linux 2.6, the kernel does deallocate freed file handles,
2453 and the "free file handles" value is always zero.
2454 .TP
2455 .I /proc/sys/fs/inode-max
2456 This file contains the maximum number of in-memory inodes.
2457 On some (2.4) systems, it may not be present.
2458 This value should be 3-4 times larger
2459 than the value in
2460 .IR file-max ,
2461 since \fIstdin\fP, \fIstdout\fP
2462 and network sockets also need an inode to handle them.
2463 When you regularly run out of inodes, you need to increase this value.
2464 .TP
2465 .I /proc/sys/fs/inode-nr
2466 This file contains the first two values from
2467 .IR inode-state .
2468 .TP
2469 .I /proc/sys/fs/inode-state
2470 This file
2471 contains seven numbers:
2472 .IR nr_inodes ,
2473 .IR nr_free_inodes ,
2474 .IR preshrink ,
2475 and four dummy values.
2476 .I nr_inodes
2477 is the number of inodes the system has allocated.
2478 This can be slightly more than
2479 .I inode-max
2480 because Linux allocates them one page full at a time.
2481 .I nr_free_inodes
2482 represents the number of free inodes.
2483 .I preshrink
2484 is nonzero when the
2485 .I nr_inodes
2486 >
2487 .I inode-max
2488 and the system needs to prune the inode list instead of allocating more.
2489 .TP
2490 .IR /proc/sys/fs/inotify " (since Linux 2.6.13)"
2491 This directory contains files
2492 .IR max_queued_events ", " max_user_instances ", and " max_user_watches ,
2493 that can be used to limit the amount of kernel memory consumed by the
2494 .I inotify
2495 interface.
2496 For further details, see
2497 .BR inotify (7).
2498 .TP
2499 .I /proc/sys/fs/lease-break-time
2500 This file specifies the grace period that the kernel grants to a process
2501 holding a file lease
2502 .RB ( fcntl (2))
2503 after it has sent a signal to that process notifying it
2504 that another process is waiting to open the file.
2505 If the lease holder does not remove or downgrade the lease within
2506 this grace period, the kernel forcibly breaks the lease.
2507 .TP
2508 .I /proc/sys/fs/leases-enable
2509 This file can be used to enable or disable file leases
2510 .RB ( fcntl (2))
2511 on a system-wide basis.
2512 If this file contains the value 0, leases are disabled.
2513 A nonzero value enables leases.
2514 .TP
2515 .IR /proc/sys/fs/mqueue " (since Linux 2.6.6)"
2516 This directory contains files
2517 .IR msg_max ", " msgsize_max ", and " queues_max ,
2518 controlling the resources used by POSIX message queues.
2519 See
2520 .BR mq_overview (7)
2521 for details.
2522 .TP
2523 .IR /proc/sys/fs/overflowgid " and " /proc/sys/fs/overflowuid
2524 These files
2525 allow you to change the value of the fixed UID and GID.
2526 The default is 65534.
2527 Some file systems support only 16-bit UIDs and GIDs, although in Linux
2528 UIDs and GIDs are 32 bits.
2529 When one of these file systems is mounted
2530 with writes enabled, any UID or GID that would exceed 65535 is translated
2531 to the overflow value before being written to disk.
2532 .TP
2533 .IR /proc/sys/fs/pipe-max-size " (since Linux 2.6.35)"
2534 The value in this file defines an upper limit for raising the capacity
2535 of a pipe using the
2536 .BR fcntl (2)
2537 .B F_SETPIPE_SZ
2538 operation.
2539 This limit applies only to unprivileged processes.
2540 The default value for this file is 1,048,576.
2541 The value assigned to this file may be rounded upward,
2542 to reflect the value actually employed for a convenient implementation.
2543 To determine the rounded-up value,
2544 display the contents of this file after assigning a value to it.
2545 The minimum value that can be assigned to this file is the system page size.
2546 .TP
2547 .IR /proc/sys/fs/protected_hardlinks " (since Linux 3.6)"
2548 .\" commit 800179c9b8a1e796e441674776d11cd4c05d61d7
2549 When the value in this file is 0,
2550 no restrictions are placed on the creation of hard links
2551 (i.e., this is the historical behaviour before Linux 3.6).
2552 When the value in this file is 1,
2553 a hard link can be created to a target file
2554 only if one of the following conditions is true:
2555 .RS
2556 .IP * 3
2557 The caller has the
2558 .BR CAP_FOWNER
2559 capability.
2560 .IP *
2561 The file system UID of the process creating the link matches
2562 the owner (UID) of the target file
2563 (as described in
2564 .BR credentials (7),
2565 a process's file system UID is normally the same as its effective UID).
2566 .IP *
2567 All of the following conditions are true:
2568 .RS 4
2569 .IP \(bu 3
2570 the target is a regular file;
2571 .IP \(bu
2572 the target file does not have its set-user-ID permission bit enabled;
2573 .IP \(bu
2574 the target file does not have both its set-group-ID and
2575 group-executable permission bits enabled; and
2576 .IP \(bu
2577 the caller has permission to read and write the target file
2578 (either via the file's permissions mask or because it has
2579 suitable capabilities).
2580 .RE
2581 .RE
2582 .IP
2583 The default value in this file is 0.
2584 Setting the value to 1
2585 prevents a longstanding class of security issues caused by
2586 hard-link-based time-of-check, time-of-use races,
2587 most commonly seen in world-writable directories such as
2588 .IR /tmp .
2589 The common method of exploiting this flaw
2590 is to cross privilege boundaries when following a given hard link
2591 (i.e., a root process follows a hard link created by another user).
2592 Additionally, on systems without separated partitions,
2593 this stops unauthorized users from "pinning" vulnerable set-user-ID and
2594 set-group-ID files against being upgraded by
2595 the administrator, or linking to special files.
2596 .TP
2597 .IR /proc/sys/fs/protected_symlinks " (since Linux 3.6)"
2598 .\" commit 800179c9b8a1e796e441674776d11cd4c05d61d7
2599 When the value in this file is 0,
2600 no restrictions are placed on following symbolic links
2601 (i.e., this is the historical behaviour before Linux 3.6).
2602 When the value in this file is 1, symbolic links are followed only
2603 in the following circumstances:
2604 .RS
2605 .IP * 3
2606 the file system UID of the process following the link matches
2607 the owner (UID) of the symbolic link
2608 (as described in
2609 .BR credentials (7),
2610 a process's file system UID is normally the same as its effective UID);
2611 .IP *
2612 the link is not in a sticky world-writable directory; or
2613 .IP *
2614 the symbolic link and and its parent directory have the same owner (UID)
2615 .RE
2616 .IP
2617 A system call that fails to follow a symbolic link
2618 because of the above restrictions returns the error
2619 .BR EACCES
2620 in
2621 .IR errno .
2622 .IP
2623 The default value in this file is 0.
2624 Setting the value to 1 avoids a longstanding class of security issues
2625 based on time-of-check, time-of-use races when accessing symbolic links.
2626 .TP
2627 .IR /proc/sys/fs/suid_dumpable " (since Linux 2.6.13)"
2628 .\" The following is based on text from Documentation/sysctl/kernel.txt
2629 The value in this file determines whether core dump files are
2630 produced for set-user-ID or otherwise protected/tainted binaries.
2631 Three different integer values can be specified:
2632 .RS
2633 .TP
2634 \fI0\ (default)\fP
2635 This provides the traditional (pre-Linux 2.6.13) behavior.
2636 A core dump will not be produced for a process which has
2637 changed credentials (by calling
2638 .BR seteuid (2),
2639 .BR setgid (2),
2640 or similar, or by executing a set-user-ID or set-group-ID program)
2641 or whose binary does not have read permission enabled.
2642 .TP
2643 \fI1\ ("debug")\fP
2644 All processes dump core when possible.
2645 The core dump is owned by the file system user ID of the dumping process
2646 and no security is applied.
2647 This is intended for system debugging situations only.
2648 Ptrace is unchecked.
2649 .TP
2650 \fI2\ ("suidsafe")\fP
2651 Any binary which normally would not be dumped (see "0" above)
2652 is dumped readable by root only.
2653 This allows the user to remove the core dump file but not to read it.
2654 For security reasons core dumps in this mode will not overwrite one
2655 another or other files.
2656 This mode is appropriate when administrators are
2657 attempting to debug problems in a normal environment.
2658 .IP
2659 Additionally, since Linux 3.6,
2660 .\" 9520628e8ceb69fa9a4aee6b57f22675d9e1b709
2661 .I /proc/sys/kernel/core_pattern
2662 must either be an absolute pathname
2663 or a pipe command, as detailed in
2664 .BR core (5).
2665 Warnings will be written to the kernel log if
2666 .I core_pattern
2667 does not follow these rules, and no core dump will be produced.
2668 .\" 54b501992dd2a839e94e76aa392c392b55080ce8
2669 .RE
2670 .TP
2671 .I /proc/sys/fs/super-max
2672 This file
2673 controls the maximum number of superblocks, and
2674 thus the maximum number of mounted file systems the kernel
2675 can have.
2676 You need increase only
2677 .I super-max
2678 if you need to mount more file systems than the current value in
2679 .I super-max
2680 allows you to.
2681 .TP
2682 .I /proc/sys/fs/super-nr
2683 This file
2684 contains the number of file systems currently mounted.
2685 .TP
2686 .I /proc/sys/kernel
2687 This directory contains files controlling a range of kernel parameters,
2688 as described below.
2689 .TP
2690 .I /proc/sys/kernel/acct
2691 This file
2692 contains three numbers:
2693 .IR highwater ,
2694 .IR lowwater ,
2695 and
2696 .IR frequency .
2697 If BSD-style process accounting is enabled these values control
2698 its behavior.
2699 If free space on file system where the log lives goes below
2700 .I lowwater
2701 percent accounting suspends.
2702 If free space gets above
2703 .I highwater
2704 percent accounting resumes.
2705 .I frequency
2706 determines
2707 how often the kernel checks the amount of free space (value is in
2708 seconds).
2709 Default values are 4, 2 and 30.
2710 That is, suspend accounting if 2% or less space is free; resume it
2711 if 4% or more space is free; consider information about amount of free space
2712 valid for 30 seconds.
2713 .TP
2714 .IR /proc/sys/kernel/cap_last_cap " (since Linux 3.2)"
2715 See
2716 .BR capabilities (7).
2717 .TP
2718 .IR /proc/sys/kernel/cap-bound " (from Linux 2.2 to 2.6.24)"
2719 This file holds the value of the kernel
2720 .I "capability bounding set"
2721 (expressed as a signed decimal number).
2722 This set is ANDed against the capabilities permitted to a process
2723 during
2724 .BR execve (2).
2725 Starting with Linux 2.6.25,
2726 the system-wide capability bounding set disappeared,
2727 and was replaced by a per-thread bounding set; see
2728 .BR capabilities (7).
2729 .TP
2730 .I /proc/sys/kernel/core_pattern
2731 See
2732 .BR core (5).
2733 .TP
2734 .I /proc/sys/kernel/core_uses_pid
2735 See
2736 .BR core (5).
2737 .TP
2738 .I /proc/sys/kernel/ctrl-alt-del
2739 This file
2740 controls the handling of Ctrl-Alt-Del from the keyboard.
2741 When the value in this file is 0, Ctrl-Alt-Del is trapped and
2742 sent to the
2743 .BR init (8)
2744 program to handle a graceful restart.
2745 When the value is greater than zero, Linux's reaction to a Vulcan
2746 Nerve Pinch (tm) will be an immediate reboot, without even
2747 syncing its dirty buffers.
2748 Note: when a program (like dosemu) has the keyboard in "raw"
2749 mode, the ctrl-alt-del is intercepted by the program before it
2750 ever reaches the kernel tty layer, and it's up to the program
2751 to decide what to do with it.
2752 .TP
2753 .IR /proc/sys/kernel/dmesg_restrict " (since Linux 2.6.37)"
2754 The value in this file determines who can see kernel syslog contents.
2755 A value of 0 in this file imposes no restrictions.
2756 If the value is 1, only privileged users can read the kernel syslog.
2757 (See
2758 .BR syslog (2)
2759 for more details.)
2760 Since Linux 3.4,
2761 .\" commit 620f6e8e855d6d447688a5f67a4e176944a084e8
2762 only users with the
2763 .BR CAP_SYS_ADMIN
2764 capability may change the value in this file.
2765 .TP
2766 .IR /proc/sys/kernel/domainname " and " /proc/sys/kernel/hostname
2767 can be used to set the NIS/YP domainname and the
2768 hostname of your box in exactly the same way as the commands
2769 .BR domainname (1)
2770 and
2771 .BR hostname (1),
2772 that is:
2773
2774 .in +4n
2775 .nf
2776 .RB "#" " echo \(aqdarkstar\(aq > /proc/sys/kernel/hostname"
2777 .RB "#" " echo \(aqmydomain\(aq > /proc/sys/kernel/domainname"
2778 .fi
2779 .in
2780
2781 has the same effect as
2782
2783 .in +4n
2784 .nf
2785 .RB "#" " hostname \(aqdarkstar\(aq"
2786 .RB "#" " domainname \(aqmydomain\(aq"
2787 .fi
2788 .in
2789
2790 Note, however, that the classic darkstar.frop.org has the
2791 hostname "darkstar" and DNS (Internet Domain Name Server)
2792 domainname "frop.org", not to be confused with the NIS (Network
2793 Information Service) or YP (Yellow Pages) domainname.
2794 These two
2795 domain names are in general different.
2796 For a detailed discussion
2797 see the
2798 .BR hostname (1)
2799 man page.
2800 .TP
2801 .I /proc/sys/kernel/hotplug
2802 This file
2803 contains the path for the hotplug policy agent.
2804 The default value in this file is
2805 .IR /sbin/hotplug .
2806 .TP
2807 .I /proc/sys/kernel/htab-reclaim
2808 (PowerPC only) If this file is set to a nonzero value,
2809 the PowerPC htab
2810 (see kernel file
2811 .IR Documentation/powerpc/ppc_htab.txt )
2812 is pruned
2813 each time the system hits the idle loop.
2814 .TP
2815 .IR /proc/sys/kernel/kptr_restrict " (since Linux 2.6.38)"
2816 .\" 455cd5ab305c90ffc422dd2e0fb634730942b257
2817 The value in this file determines whether kernel addresses are exposed via
2818 .I /proc
2819 files and other interfaces.
2820 A value of 0 in this file imposes no restrictions.
2821 If the value is 1, kernel pointers printed using the
2822 .I %pK
2823 format specifier will be replaced with zeros unless the user has the
2824 .BR CAP_SYSLOG
2825 capability.
2826 If the value is 2, kernel pointers printed using the
2827 .I %pK
2828 format specifier will be replaced with zeros regardless
2829 of the user's capabilities.
2830 The initial default value for this file was 1,
2831 but the default was changed
2832 .\" commit 411f05f123cbd7f8aa1edcae86970755a6e2a9d9
2833 to 0 in Linux 2.6.39.
2834 Since Linux 3.4,
2835 .\" commit 620f6e8e855d6d447688a5f67a4e176944a084e8
2836 only users with the
2837 .BR CAP_SYS_ADMIN
2838 capability can change the value in this file.
2839 .TP
2840 .I /proc/sys/kernel/l2cr
2841 (PowerPC only) This file
2842 contains a flag that controls the L2 cache of G3 processor
2843 boards.
2844 If 0, the cache is disabled.
2845 Enabled if nonzero.
2846 .TP
2847 .I /proc/sys/kernel/modprobe
2848 This file contains the path for the kernel module loader.
2849 The default value is
2850 .IR /sbin/modprobe .
2851 The file is present only if the kernel is built with the
2852 .B CONFIG_MODULES
2853 .RB ( CONFIG_KMOD
2854 in Linux 2.6.26 and earlier)
2855 option enabled.
2856 It is described by the Linux kernel source file
2857 .I Documentation/kmod.txt
2858 (present only in kernel 2.4 and earlier).
2859 .TP
2860 .IR /proc/sys/kernel/modules_disabled " (since Linux 2.6.31)"
2861 .\" 3d43321b7015387cfebbe26436d0e9d299162ea1
2862 .\" From Documentation/sysctl/kernel.txt
2863 A toggle value indicating if modules are allowed to be loaded
2864 in an otherwise modular kernel.
2865 This toggle defaults to off (0), but can be set true (1).
2866 Once true, modules can be neither loaded nor unloaded,
2867 and the toggle cannot be set back to false.
2868 The file is present only if the kernel is built with the
2869 .B CONFIG_MODULES
2870 option enabled.
2871 .TP
2872 .I /proc/sys/kernel/msgmax
2873 This file defines
2874 a system-wide limit specifying the maximum number of bytes in
2875 a single message written on a System V message queue.
2876 .TP
2877 .IR /proc/sys/kernel/msgmni " (since Linux 2.4)"
2878 This file defines the system-wide limit on the number of
2879 message queue identifiers.
2880 .TP
2881 .I /proc/sys/kernel/msgmnb
2882 This file defines a system-wide parameter used to initialize the
2883 .I msg_qbytes
2884 setting for subsequently created message queues.
2885 The
2886 .I msg_qbytes
2887 setting specifies the maximum number of bytes that may be written to the
2888 message queue.
2889 .TP
2890 .IR /proc/sys/kernel/ostype " and " /proc/sys/kernel/osrelease
2891 These files
2892 give substrings of
2893 .IR /proc/version .
2894 .TP
2895 .IR /proc/sys/kernel/overflowgid " and " /proc/sys/kernel/overflowuid
2896 These files duplicate the files
2897 .I /proc/sys/fs/overflowgid
2898 and
2899 .IR /proc/sys/fs/overflowuid .
2900 .TP
2901 .I /proc/sys/kernel/panic
2902 This file gives read/write access to the kernel variable
2903 .IR panic_timeout .
2904 If this is zero, the kernel will loop on a panic; if nonzero
2905 it indicates that the kernel should autoreboot after this number
2906 of seconds.
2907 When you use the
2908 software watchdog device driver, the recommended setting is 60.
2909 .TP
2910 .IR /proc/sys/kernel/panic_on_oops " (since Linux 2.5.68)"
2911 This file controls the kernel's behavior when an oops
2912 or BUG is encountered.
2913 If this file contains 0, then the system
2914 tries to continue operation.
2915 If it contains 1, then the system
2916 delays a few seconds (to give klogd time to record the oops output)
2917 and then panics.
2918 If the
2919 .I /proc/sys/kernel/panic
2920 file is also nonzero then the machine will be rebooted.
2921 .TP
2922 .IR /proc/sys/kernel/pid_max " (since Linux 2.5.34)"
2923 This file specifies the value at which PIDs wrap around
2924 (i.e., the value in this file is one greater than the maximum PID).
2925 The default value for this file, 32768,
2926 results in the same range of PIDs as on earlier kernels.
2927 On 32-bit platforms, 32768 is the maximum value for
2928 .IR pid_max .
2929 On 64-bit systems,
2930 .I pid_max
2931 can be set to any value up to 2^22
2932 .RB ( PID_MAX_LIMIT ,
2933 approximately 4 million).
2934 .\" Prior to 2.6.10, pid_max could also be raised above 32768 on 32-bit
2935 .\" platforms, but this broke /proc/[pid]
2936 .\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=109513010926152&w=2
2937 .TP
2938 .IR /proc/sys/kernel/powersave-nap " (PowerPC only)"
2939 This file contains a flag.
2940 If set, Linux-PPC will use the "nap" mode of
2941 powersaving,
2942 otherwise the "doze" mode will be used.
2943 .TP
2944 .I /proc/sys/kernel/printk
2945 The four values in this file are
2946 .IR console_loglevel ,
2947 .IR default_message_loglevel ,
2948 .IR minimum_console_level ,
2949 and
2950 .IR default_console_loglevel .
2951 These values influence
2952 .I printk()
2953 behavior when printing or logging error messages.
2954 See
2955 .BR syslog (2)
2956 for more info on the different loglevels.
2957 Messages with a higher priority than
2958 .I console_loglevel
2959 will be printed to the console.
2960 Messages without an explicit priority will be printed with priority
2961 .IR default_message_level .
2962 .I minimum_console_loglevel
2963 is the minimum (highest) value to which
2964 .I console_loglevel
2965 can be set.
2966 .I default_console_loglevel
2967 is the default value for
2968 .IR console_loglevel .
2969 .TP
2970 .IR /proc/sys/kernel/pty " (since Linux 2.6.4)"
2971 This directory contains two files relating to the number of UNIX 98
2972 pseudoterminals (see
2973 .BR pts (4))
2974 on the system.
2975 .TP
2976 .I /proc/sys/kernel/pty/max
2977 This file defines the maximum number of pseudoterminals.
2978 .TP
2979 .I /proc/sys/kernel/pty/nr
2980 This read-only file
2981 indicates how many pseudoterminals are currently in use.
2982 .TP
2983 .I /proc/sys/kernel/random
2984 This directory
2985 contains various parameters controlling the operation of the file
2986 .IR /dev/random .
2987 See
2988 .BR random (4)
2989 for further information.
2990 .TP
2991 .I /proc/sys/kernel/real-root-dev
2992 This file is documented in the Linux kernel source file
2993 .IR Documentation/initrd.txt .
2994 .TP
2995 .IR /proc/sys/kernel/reboot-cmd " (Sparc only) "
2996 This file seems to be a way to give an argument to the SPARC
2997 ROM/Flash boot loader.
2998 Maybe to tell it what to do after
2999 rebooting?
3000 .TP
3001 .I /proc/sys/kernel/rtsig-max
3002 (Only in kernels up to and including 2.6.7; see
3003 .BR setrlimit (2))
3004 This file can be used to tune the maximum number
3005 of POSIX real-time (queued) signals that can be outstanding
3006 in the system.
3007 .TP
3008 .I /proc/sys/kernel/rtsig-nr
3009 (Only in kernels up to and including 2.6.7.)
3010 This file shows the number POSIX real-time signals currently queued.
3011 .TP
3012 .IR /proc/sys/kernel/sched_rr_timeslice_ms " (since Linux 3.9)"
3013 See
3014 .BR sched_rr_get_interval (2).
3015 .TP
3016 .IR /proc/sys/kernel/sem " (since Linux 2.4)"
3017 This file contains 4 numbers defining limits for System V IPC semaphores.
3018 These fields are, in order:
3019 .RS
3020 .IP SEMMSL 8
3021 The maximum semaphores per semaphore set.
3022 .IP SEMMNS 8
3023 A system-wide limit on the number of semaphores in all semaphore sets.
3024 .IP SEMOPM 8
3025 The maximum number of operations that may be specified in a
3026 .BR semop (2)
3027 call.
3028 .IP SEMMNI 8
3029 A system-wide limit on the maximum number of semaphore identifiers.
3030 .RE
3031 .TP
3032 .I /proc/sys/kernel/sg-big-buff
3033 This file
3034 shows the size of the generic SCSI device (sg) buffer.
3035 You can't tune it just yet, but you could change it at
3036 compile time by editing
3037 .I include/scsi/sg.h
3038 and changing
3039 the value of
3040 .BR SG_BIG_BUFF .
3041 However, there shouldn't be any reason to change this value.
3042 .TP
3043 .IR /proc/sys/kernel/shm_rmid_forced " (since Linux 3.1)"
3044 .\" commit b34a6b1da371ed8af1221459a18c67970f7e3d53
3045 .\" See also Documentation/sysctl/kernel.txt
3046 If this file is set to 1, all System V shared memory segments will
3047 be marked for destruction as soon as the number of attached processes
3048 falls to zero;
3049 in other words, it is no longer possible to create shared memory segments
3050 that exist independently of any attached process.
3051 .IP
3052 The effect is as though a
3053 .BR shmctl (2)
3054 .B IPC_RMID
3055 is performed on all existing  segments as well as all segments
3056 created in the future (until this file is reset to 0).
3057 Note that existing segments that are attached to no process will be
3058 immediately destroyed when this file is set to 1.
3059 Setting this option will also destroy segments that were created,
3060 but never attached,
3061 upon termination of the process that created the segment with
3062 .BR shmget (2).
3063 .IP
3064 Setting this file to 1 provides a way of ensuring that
3065 all System V shared memory segments are counted against the
3066 resource usage and resource limits (see the description of
3067 .B RLIMIT_AS
3068 in
3069 .BR getrlimit (2))
3070 of at least one process.
3071 .IP
3072 Because setting this file to 1 produces behavior that is nonstandard
3073 and could also break existing applications,
3074 the default value in this file is 0.
3075 Only set this file to 1 if you have a good understanding
3076 of the semantics of the applications using
3077 System V shared memory on your system.
3078 .TP
3079 .I /proc/sys/kernel/shmall
3080 This file
3081 contains the system-wide limit on the total number of pages of
3082 System V shared memory.
3083 .TP
3084 .I /proc/sys/kernel/shmmax
3085 This file
3086 can be used to query and set the run-time limit
3087 on the maximum (System V IPC) shared memory segment size that can be
3088 created.
3089 Shared memory segments up to 1GB are now supported in the
3090 kernel.
3091 This value defaults to
3092 .BR SHMMAX .
3093 .TP
3094 .IR /proc/sys/kernel/shmmni " (since Linux 2.4)"
3095 This file
3096 specifies the system-wide maximum number of System V shared memory
3097 segments that can be created.
3098 .TP
3099 .I /proc/sys/kernel/sysrq
3100 This file controls the functions allowed to be invoked by the SysRq key.
3101 By default,
3102 the file contains 1 meaning that every possible SysRq request is allowed
3103 (in older kernel versions, SysRq was disabled by default,
3104 and you were required to specifically enable it at run-time,
3105 but this is not the case any more).
3106 Possible values in this file are:
3107
3108    0 - disable sysrq completely
3109    1 - enable all functions of sysrq
3110   >1 - bit mask of allowed sysrq functions, as follows:
3111           2 - enable control of console logging level
3112           4 - enable control of keyboard (SAK, unraw)
3113           8 - enable debugging dumps of processes etc.
3114          16 - enable sync command
3115          32 - enable remount read-only
3116          64 - enable signalling of processes (term, kill, oom-kill)
3117         128 - allow reboot/poweroff
3118         256 - allow nicing of all real-time tasks
3119
3120 This file is present only if the
3121 .B CONFIG_MAGIC_SYSRQ
3122 kernel configuration option is enabled.
3123 For further details see the Linux kernel source file
3124 .IR Documentation/sysrq.txt .
3125 .TP
3126 .I /proc/sys/kernel/version
3127 This file contains a string like:
3128
3129     #5 Wed Feb 25 21:49:24 MET 1998
3130
3131 The "#5" means that
3132 this is the fifth kernel built from this source base and the
3133 date behind it indicates the time the kernel was built.
3134 .TP
3135 .IR /proc/sys/kernel/threads-max " (since Linux 2.3.11)"
3136 This file specifies the system-wide limit on the number of
3137 threads (tasks) that can be created on the system.
3138 .TP
3139 .IR /proc/sys/kernel/zero-paged " (PowerPC only) "
3140 This file
3141 contains a flag.
3142 When enabled (nonzero), Linux-PPC will pre-zero pages in
3143 the idle loop, possibly speeding up get_free_pages.
3144 .TP
3145 .I /proc/sys/net
3146 This directory contains networking stuff.
3147 Explanations for some of the files under this directory can be found in
3148 .BR tcp (7)
3149 and
3150 .BR ip (7).
3151 .TP
3152 .I /proc/sys/net/core/somaxconn
3153 This file defines a ceiling value for the
3154 .I backlog
3155 argument of
3156 .BR listen (2);
3157 see the
3158 .BR listen (2)
3159 manual page for details.
3160 .TP
3161 .I /proc/sys/proc
3162 This directory may be empty.
3163 .TP
3164 .I /proc/sys/sunrpc
3165 This directory supports Sun remote procedure call for network file system
3166 (NFS).
3167 On some systems, it is not present.
3168 .TP
3169 .I /proc/sys/vm
3170 This directory contains files for memory management tuning, buffer and
3171 cache management.
3172 .TP
3173 .IR /proc/sys/vm/drop_caches " (since Linux 2.6.16)"
3174 Writing to this file causes the kernel to drop clean caches, dentries and
3175 inodes from memory, causing that memory to become free.
3176
3177 To free pagecache, use
3178 .IR "echo 1 > /proc/sys/vm/drop_caches" ;
3179 to free dentries and inodes, use
3180 .IR "echo 2 > /proc/sys/vm/drop_caches" ;
3181 to free pagecache, dentries and inodes, use
3182 .IR "echo 3 > /proc/sys/vm/drop_caches" .
3183
3184 Because this is a nondestructive operation and dirty objects
3185 are not freeable, the
3186 user should run
3187 .BR sync (8)
3188 first.
3189 .TP
3190 .IR /proc/sys/vm/legacy_va_layout " (since Linux 2.6.9)"
3191 .\" The following is from Documentation/filesystems/proc.txt
3192 If nonzero, this disables the new 32-bit memory-mapping layout;
3193 the kernel will use the legacy (2.4) layout for all processes.
3194 .TP
3195 .IR /proc/sys/vm/memory_failure_early_kill " (since Linux 2.6.32)"
3196 .\" The following is based on the text in Documentation/sysctl/vm.txt
3197 Control how to kill processes when an uncorrected memory error
3198 (typically a 2-bit error in a memory module)
3199 that cannot be handled by the kernel
3200 is detected in the background by hardware.
3201 In some cases (like the page still having a valid copy on disk),
3202 the kernel will handle the failure
3203 transparently without affecting any applications.
3204 But if there is no other up-to-date copy of the data,
3205 it will kill processes to prevent any data corruptions from propagating.
3206
3207 The file has one of the following values:
3208 .RS
3209 .IP 1: 4
3210 Kill all processes that have the corrupted-and-not-reloadable page mapped
3211 as soon as the corruption is detected.
3212 Note this is not supported for a few types of pages, like kernel internally
3213 allocated data or the swap cache, but works for the majority of user pages.
3214 .IP 0: 4
3215 Only unmap the corrupted page from all processes and kill only a process
3216 that tries to access it.
3217 .RE
3218 .IP
3219 The kill is performed using a
3220 .B SIGBUS
3221 signal with
3222 .I si_code
3223 set to
3224 .BR BUS_MCEERR_AO .
3225 Processes can handle this if they want to; see
3226 .BR sigaction (2)
3227 for more details.
3228
3229 This feature is active only on architectures/platforms with advanced machine
3230 check handling and depends on the hardware capabilities.
3231
3232 Applications can override the
3233 .I memory_failure_early_kill
3234 setting individually with the
3235 .BR prctl (2)
3236 .B PR_MCE_KILL
3237 operation.
3238 .IP
3239 Only present if the kernel was configured with
3240 .BR CONFIG_MEMORY_FAILURE .
3241 .TP
3242 .IR /proc/sys/vm/memory_failure_recovery " (since Linux 2.6.32)"
3243 .\" The following is based on the text in Documentation/sysctl/vm.txt
3244 Enable memory failure recovery (when supported by the platform)
3245 .RS
3246 .IP 1: 4
3247 Attempt recovery.
3248 .IP 0: 4
3249 Always panic on a memory failure.
3250 .RE
3251 .IP
3252 Only present if the kernel was configured with
3253 .BR CONFIG_MEMORY_FAILURE .
3254 .TP
3255 .IR /proc/sys/vm/oom_dump_tasks " (since Linux 2.6.25)"
3256 .\" The following is from Documentation/sysctl/vm.txt
3257 Enables a system-wide task dump (excluding kernel threads) to be
3258 produced when the kernel performs an OOM-killing.
3259 The dump includes the following information
3260 for each task (thread, process):
3261 thread ID, real user ID, thread group ID (process ID),
3262 virtual memory size, resident set size,
3263 the CPU that the task is scheduled on,
3264 oom_adj score (see the description of
3265 .IR /proc/[pid]/oom_adj ),
3266 and command name.
3267 This is helpful to determine why the OOM-killer was invoked
3268 and to identify the rogue task that caused it.
3269
3270 If this contains the value zero, this information is suppressed.
3271 On very large systems with thousands of tasks,
3272 it may not be feasible to dump the memory state information for each one.
3273 Such systems should not be forced to incur a performance penalty in
3274 OOM situations when the information may not be desired.
3275
3276 If this is set to nonzero, this information is shown whenever the
3277 OOM-killer actually kills a memory-hogging task.
3278
3279 The default value is 0.
3280 .TP
3281 .IR /proc/sys/vm/oom_kill_allocating_task " (since Linux 2.6.24)"
3282 .\" The following is from Documentation/sysctl/vm.txt
3283 This enables or disables killing the OOM-triggering task in
3284 out-of-memory situations.
3285
3286 If this is set to zero, the OOM-killer will scan through the entire
3287 tasklist and select a task based on heuristics to kill.
3288 This normally selects a rogue memory-hogging task that
3289 frees up a large amount of memory when killed.
3290
3291 If this is set to nonzero, the OOM-killer simply kills the task that
3292 triggered the out-of-memory condition.
3293 This avoids a possibly expensive tasklist scan.
3294
3295 If
3296 .I /proc/sys/vm/panic_on_oom
3297 is nonzero, it takes precedence over whatever value is used in
3298 .IR /proc/sys/vm/oom_kill_allocating_task .
3299
3300 The default value is 0.
3301 .TP
3302 .I /proc/sys/vm/overcommit_memory
3303 This file contains the kernel virtual memory accounting mode.
3304 Values are:
3305 .RS
3306 .IP
3307 0: heuristic overcommit (this is the default)
3308 .br
3309 1: always overcommit, never check
3310 .br
3311 2: always check, never overcommit
3312 .RE
3313 .IP
3314 In mode 0, calls of
3315 .BR mmap (2)
3316 with
3317 .B MAP_NORESERVE
3318 are not checked, and the default check is very weak,
3319 leading to the risk of getting a process "OOM-killed".
3320 Under Linux 2.4 any nonzero value implies mode 1.
3321 In mode 2 (available since Linux 2.6), the total virtual address space
3322 on the system is limited to (SS + RAM*(r/100)),
3323 where SS is the size of the swap space, and RAM
3324 is the size of the physical memory, and r is the contents of the file
3325 .IR /proc/sys/vm/overcommit_ratio .
3326 .TP
3327 .I /proc/sys/vm/overcommit_ratio
3328 See the description of
3329 .IR /proc/sys/vm/overcommit_memory .
3330 .TP
3331 .IR /proc/sys/vm/panic_on_oom " (since Linux 2.6.18)"
3332 .\" The following is adapted from Documentation/sysctl/vm.txt
3333 This enables or disables a kernel panic in
3334 an out-of-memory situation.
3335
3336 If this file is set to the value 0,
3337 the kernel's OOM-killer will kill some rogue process.
3338 Usually, the OOM-killer is able to kill a rogue process and the
3339 system will survive.
3340
3341 If this file is set to the value 1,
3342 then the kernel normally panics when out-of-memory happens.
3343 However, if a process limits allocations to certain nodes
3344 using memory policies
3345 .RB ( mbind  (2)
3346 .BR MPOL_BIND )
3347 or cpusets
3348 .RB ( cpuset (7))
3349 and those nodes reach memory exhaustion status,
3350 one process may be killed by the OOM-killer.
3351 No panic occurs in this case:
3352 because other nodes' memory may be free,
3353 this means the system as a whole may not have reached
3354 an out-of-memory situation yet.
3355
3356 If this file is set to the value 2,
3357 the kernel always panics when an out-of-memory condition occurs.
3358
3359 The default value is 0.
3360 1 and 2 are for failover of clustering.
3361 Select either according to your policy of failover.
3362 .TP
3363 .IR /proc/sys/vm/swappiness
3364 .\" The following is from Documentation/sysctl/vm.txt
3365 The value in this file controls how aggressively the kernel will swap
3366 memory pages.
3367 Higher values increase aggressiveness, lower values
3368 decrease aggressiveness.
3369 The default value is 60.
3370 .TP
3371 .IR /proc/sysrq-trigger " (since Linux 2.4.21)"
3372 Writing a character to this file triggers the same SysRq function as
3373 typing ALT-SysRq-<character> (see the description of
3374 .IR /proc/sys/kernel/sysrq ).
3375 This file is normally writable only by
3376 .IR root .
3377 For further details see the Linux kernel source file
3378 .IR Documentation/sysrq.txt .
3379 .TP
3380 .I /proc/sysvipc
3381 Subdirectory containing the pseudo-files
3382 .IR msg ", "  sem " and "  shm "."
3383 These files list the System V Interprocess Communication (IPC) objects
3384 (respectively: message queues, semaphores, and shared memory)
3385 that currently exist on the system,
3386 providing similar information to that available via
3387 .BR ipcs (1).
3388 These files have headers and are formatted (one IPC object per line)
3389 for easy understanding.
3390 .BR svipc (7)
3391 provides further background on the information shown by these files.
3392 .TP
3393 .I /proc/tty
3394 Subdirectory containing the pseudo-files and subdirectories for
3395 tty drivers and line disciplines.
3396 .TP
3397 .I /proc/uptime
3398 This file contains two numbers: the uptime of the system (seconds),
3399 and the amount of time spent in idle process (seconds).
3400 .TP
3401 .I /proc/version
3402 This string identifies the kernel version that is currently running.
3403 It includes the contents of
3404 .IR /proc/sys/kernel/ostype ,
3405 .I /proc/sys/kernel/osrelease
3406 and
3407 .IR /proc/sys/kernel/version .
3408 For example:
3409 .nf
3410 .in -2
3411 .ft CW
3412 Linux version 1.0.9 (quinlan@phaze) #1 Sat May 14 01:51:54 EDT 1994
3413 .ft
3414 .in +2
3415 .fi
3416 .\" FIXME Document /proc/timer_list
3417 .\" .TP
3418 .\" .IR /proc/timer_list " (since Linux 2.6.21)"
3419 .\" See the 2.6.21 Change log
3420 .\" FIXME Document /proc/timer_stats
3421 .\" .TP
3422 .\" .IR /proc/timer_stats " (since Linux 2.6.21)"
3423 .\" See the 2.6.21 Change log
3424 .TP
3425 .IR /proc/vmstat " (since Linux 2.6)"
3426 This file displays various virtual memory statistics.
3427 .TP
3428 .IR /proc/zoneinfo " (since Linux 2.6.13)"
3429 This file display information about memory zones.
3430 This is useful for analyzing virtual memory behavior.
3431 .\" FIXME more should be said about /proc/zoneinfo
3432 .SH NOTES
3433 Many strings (i.e., the environment and command line) are in
3434 the internal format, with subfields terminated by null bytes (\(aq\\0\(aq),
3435 so you
3436 may find that things are more readable if you use \fIod \-c\fP or \fItr
3437 "\\000" "\\n"\fP to read them.
3438 Alternatively, \fIecho \`cat <file>\`\fP works well.
3439
3440 This manual page is incomplete, possibly inaccurate, and is the kind
3441 of thing that needs to be updated very often.
3442 .\" .SH ACKNOWLEDGEMENTS
3443 .\" The material on /proc/sys/fs and /proc/sys/kernel is closely based on
3444 .\" kernel source documentation files written by Rik van Riel.
3445 .SH SEE ALSO
3446 .BR cat (1),
3447 .BR dmesg (1),
3448 .BR find (1),
3449 .BR free (1),
3450 .BR ps (1),
3451 .BR tr (1),
3452 .BR uptime (1),
3453 .BR chroot (2),
3454 .BR mmap (2),
3455 .BR readlink (2),
3456 .BR syslog (2),
3457 .BR slabinfo (5),
3458 .BR hier (7),
3459 .BR time (7),
3460 .BR arp (8),
3461 .BR hdparm (8),
3462 .BR ifconfig (8),
3463 .BR init (8),
3464 .BR lsmod (8),
3465 .BR lspci (8),
3466 .BR mount (8),
3467 .BR netstat (8),
3468 .BR procinfo (8),
3469 .BR route (8),
3470 .BR sysctl (8)
3471
3472 The Linux kernel source files:
3473 .IR Documentation/filesystems/proc.txt
3474 and
3475 .IR Documentation/sysctl/vm.txt .