]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/proc.5
syscalls.2, iso_8859-5.7, iso_8859-7.7, koi8-r.7, koi8-u.7: Table edits to eliminate...
[thirdparty/man-pages.git] / man5 / proc.5
CommitLineData
fea681da 1.\" Copyright (C) 1994, 1995 by Daniel Quinlan (quinlan@yggdrasil.com)
b4e9ee8f 2.\" and Copyright (C) 2002-2008 Michael Kerrisk <mtk.manpages@gmail.com>
fea681da
MK
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
c11b1abf 7.\" Michael Kerrisk <mtk.manpages@gmail.com>
fea681da 8.\"
1dd72f9c 9.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
fea681da
MK
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
c715f741
MK
26.\" License along with this manual; if not, see
27.\" <http://www.gnu.org/licenses/>.
6a8d8745 28.\" %%%LICENSE_END
fea681da
MK
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
c11b1abf 36.\" by Michael Kerrisk <mtk.manpages@gmail.com>
5d6d14a0
MK
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
568105c6
MK
39.\" 2004-12-14, mtk, updated 'statm', and fixed error in order of list
40.\" 2005-05-12, mtk, updated 'stat'
6d64ca9c 41.\" 2005-07-13, mtk, added /proc/sys/fs/mqueue/*
363f747c
MK
42.\" 2005-09-16, mtk, Added /proc/sys/fs/suid_dumpable
43.\" 2005-09-19, mtk, added /proc/zoneinfo
b4e9ee8f 44.\" 2005-03-01, mtk, moved /proc/sys/fs/mqueue/* material to mq_overview.7.
69119dc7
MK
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.
cc2d5c36 49.\" 2008-07-15, mtk, added /proc/config.gz
363f747c 50.\"
c533af9d 51.\" FIXME 2.6.13 seems to have /proc/vmcore implemented
c13182ef
MK
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
c533af9d 55.\" entry in this man page.
cc2d5c36 56.\" Needs CONFIG_VMCORE
8cf9de1b 57.\"
c13182ef
MK
58.\" FIXME cross check against Documentation/filesystems/proc.txt
59.\" to see what information could be imported from that file
c533af9d 60.\" into this file.
fea681da 61.\"
491ea6f1 62.TH PROC 5 2013-03-15 "Linux" "Linux Programmer's Manual"
fea681da 63.SH NAME
24d01c53 64proc \- process information pseudo-file system
fea681da
MK
65.SH DESCRIPTION
66The
67.I proc
24d01c53 68file system is a pseudo-file system which is used as an interface to
c13182ef
MK
69kernel data structures.
70It is commonly mounted at
fea681da 71.IR /proc .
c13182ef 72Most of it is read-only, but some files allow kernel variables to be
fea681da
MK
73changed.
74.LP
743638fd
MK
75The following outline gives a quick tour through the
76.I /proc
77hierarchy.
fea681da
MK
78.PD 1
79.TP
69119dc7 80.I /proc/[pid]
fea681da
MK
81There is a numerical subdirectory for each running process; the
82subdirectory is named by the process ID.
83Each such subdirectory contains the following
84pseudo-files and directories.
69119dc7
MK
85.\" FIXME Describe /proc/[pid]/attr and
86.\" /proc/[pid]/task/[tid]/attr
b4e9ee8f
MK
87.\" This is a directory
88.\" Added in ???
89.\" CONFIG_SECURITY
90.\"
fea681da 91.TP
69119dc7 92.IR /proc/[pid]/auxv " (since 2.6.0-test7)"
857f1942 93This contains the contents of the ELF interpreter information passed
c13182ef 94to the process at exec time.
857f1942 95The format is one \fIunsigned long\fP ID
c13182ef 96plus one \fIunsigned long\fP value for each entry.
857f1942 97The last entry contains two zeros.
b5d204d0 98.TP
8d708d6b 99.IR /proc/[pid]/cgroup " (since Linux 2.6.24)"
b5d204d0
MK
100.\" Info in Documentation/cgroups/cgroups.txt
101This file describes control groups to which the process/task belongs.
102For each cgroup hierarchy there is one entry containing
103colon-separated fields of the form:
104.nf
105.ft CW
106
107 5:cpuacct,cpu,cpuset:/daemons
108.ft
109.fi
110.IP
111The colon-separated fields are, from left to right:
112.RS 11
113.IP 1. 3
114hierarchy ID number
115.IP 2.
116set of subsystems bound to the hierarchy
117.IP 3.
118control group in the hierarchy to which the process belongs
119.RE
120.IP
121This file is only present if the
122.B CONFIG_CGROUPS
123kernel configuration option is enabled.
b4e9ee8f 124.\"
69119dc7 125.\" FIXME Describe /proc/[pid]/clear_refs
b4e9ee8f
MK
126.\" Added in 2.6.22
127.\" "Clears page referenced bits shown in smaps output"
128.\" write-only
129.\" CONFIG_PROC_PAGE_MONITOR
857f1942 130.TP
69119dc7 131.I /proc/[pid]/cmdline
b447cd58
MK
132This holds the complete command line for the process,
133unless the process is a zombie.
134.\" In 2.3.26, this also used to be true if the process was swapped out.
135In the latter case, there is nothing in this file:
75b94dc3 136that is, a read on this file will return 0 characters.
b447cd58 137The command-line arguments appear in this file as a set of
6596d270
MK
138strings separated by null bytes (\(aq\\0\(aq),
139with a further null byte after the last string.
fea681da 140.TP
69119dc7 141.IR /proc/[pid]/coredump_filter " (since kernel 2.6.23)"
b4e9ee8f
MK
142See
143.BR core (5).
5c411b17 144.TP
69119dc7
MK
145.IR /proc/[pid]/cpuset " (since kernel 2.6.12)"
146.\" and/proc/[pid]/task/[tid]/cpuset
5c411b17
MK
147See
148.BR cpuset (7).
b4e9ee8f 149.TP
69119dc7 150.I /proc/[pid]/cwd
c13182ef 151This is a symbolic link to the current working directory of the process.
59a40ed7
MK
152To find out the current working directory of process 20,
153for instance, you can do this:
fea681da 154
59a40ed7 155.in +4n
fea681da 156.nf
b43a3b30 157.RB "$" " cd /proc/20/cwd; /bin/pwd"
fea681da 158.fi
59a40ed7 159.in
fea681da 160
c13182ef
MK
161Note that the
162.I pwd
e7b489f0 163command is often a shell built-in, and might
c13182ef 164not work properly.
743638fd
MK
165In
166.BR bash (1),
167you may use
168.IR "pwd\ \-P" .
afcaf646
MK
169
170.\" The following was still true as at kernel 2.6.13
c13182ef
MK
171In a multithreaded process, the contents of this symbolic link
172are not available if the main thread has already terminated
afcaf646 173(typically by calling
59a40ed7 174.BR pthread_exit (3)).
fea681da 175.TP
69119dc7 176.I /proc/[pid]/environ
fea681da 177This file contains the environment for the process.
f81fb444 178The entries are separated by null bytes (\(aq\\0\(aq),
b4e9ee8f 179and there may be a null byte at the end.
fea681da 180Thus, to print out the environment of process 1, you would do:
a08ea57c 181.in +4n
fea681da 182.nf
a08ea57c 183
fea681da 184.ft CW
31a6818e 185.RB "$" " (cat /proc/1/environ; echo) | tr \(aq\e000\(aq \(aq\en\(aq"
fea681da
MK
186.fi
187.ft P
a08ea57c 188.in
fea681da 189.TP
69119dc7 190.I /proc/[pid]/exe
fea681da 191Under Linux 2.2 and later, this file is a symbolic link
2d7195b8 192containing the actual pathname of the executed command.
c13182ef
MK
193This symbolic link can be dereferenced normally; attempting to open
194it will open the executable.
195You can even type
69119dc7 196.I /proc/[pid]/exe
c13182ef 197to run another copy of the same executable as is being run by
69119dc7 198process [pid].
afcaf646 199.\" The following was still true as at kernel 2.6.13
c13182ef
MK
200In a multithreaded process, the contents of this symbolic link
201are not available if the main thread has already terminated
afcaf646
MK
202(typically by calling
203.BR pthread_exit (3)).
fea681da
MK
204
205Under Linux 2.0 and earlier
69119dc7 206.I /proc/[pid]/exe
c13182ef
MK
207is a pointer to the binary which was executed,
208and appears as a symbolic link.
209A
fea681da
MK
210.BR readlink (2)
211call on this file under Linux 2.0 returns a string in the format:
212
59a40ed7 213 [device]:inode
fea681da
MK
214
215For example, [0301]:1502 would be inode 1502 on device major 03 (IDE,
216MFM, etc. drives) minor 01 (first partition on the first drive).
217
218.BR find (1)
59a40ed7
MK
219with the
220.I \-inum
221option can be used to locate the file.
fea681da 222.TP
69119dc7 223.I /proc/[pid]/fd
fea681da
MK
224This is a subdirectory containing one entry for each file which the
225process has open, named by its file descriptor, and which is a
c13182ef
MK
226symbolic link to the actual file.
227Thus, 0 is standard input, 1 standard output, 2 standard error, etc.
fea681da 228
afcaf646
MK
229.\" The following was still true as at kernel 2.6.13
230In a multithreaded process, the contents of this directory
c13182ef 231are not available if the main thread has already terminated
afcaf646
MK
232(typically by calling
233.BR pthread_exit (3)).
234
59a40ed7
MK
235Programs that will take a filename as a command-line argument,
236but will not take input from standard input if no argument is supplied,
237or that write to a file named as a command-line argument,
238but will not send their output to standard output
239if no argument is supplied, can nevertheless be made to use
240standard input or standard out using
69119dc7 241.IR /proc/[pid]/fd .
59a40ed7
MK
242For example, assuming that
243.I \-i
244is the flag designating an input file and
245.I \-o
246is the flag designating an output file:
a08ea57c 247.in +4n
fea681da
MK
248.nf
249
b43a3b30 250.RB "$" " foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ..."
fea681da 251.fi
a08ea57c
MK
252.in
253
fea681da
MK
254and you have a working filter.
255.\" The following is not true in my tests (MTK):
256.\" Note that this will not work for
257.\" programs that seek on their files, as the files in the fd directory
258.\" are not seekable.
259
59a40ed7
MK
260.I /proc/self/fd/N
261is approximately the same as
262.I /dev/fd/N
008f1ecc 263in some UNIX and UNIX-like systems.
c13182ef 264Most Linux MAKEDEV scripts symbolically link
59a40ed7
MK
265.I /dev/fd
266to
267.IR /proc/self/fd ,
268in fact.
269
270Most systems provide symbolic links
271.IR /dev/stdin ,
272.IR /dev/stdout ,
273and
274.IR /dev/stderr ,
275which respectively link to the files
276.IR 0 ,
277.IR 1 ,
278and
279.IR 2
280in
281.IR /proc/self/fd .
282Thus the example command above could be written as:
283.in +4n
284.nf
285
b43a3b30 286.RB "$" " foobar \-i /dev/stdin \-o /dev/stdout ..."
59a40ed7
MK
287.fi
288.in
69119dc7 289.\" FIXME Describe /proc/[pid]/loginuid
b877b392 290.\" Added in 2.6.11; updating requires CAP_AUDIT_CONTROL
b4e9ee8f
MK
291.\" CONFIG_AUDITSYSCALL
292.TP
69119dc7 293.IR /proc/[pid]/fdinfo/ " (since kernel 2.6.22)"
b4e9ee8f
MK
294This is a subdirectory containing one entry for each file which the
295process has open, named by its file descriptor.
296The contents of each file can be read to obtain information
297about the corresponding file descriptor, for example:
298.in +4n
299.nf
300
b43a3b30 301.RB "$" " cat /proc/12015/fdinfo/4"
b4e9ee8f
MK
302pos: 1000
303flags: 01002002
304.fi
305.in
306
307The
308.I pos
309field is a decimal number showing the current file offset.
310The
311.I flags
312field is an octal number that displays the
313file access mode and file status flags (see
314.BR open (2)).
315
316The files in this directory are readable only by the owner of the process.
69119dc7 317.\" FIXME document /proc/[pid]/io
b4e9ee8f 318.\" .TP
69119dc7 319.\" .IR /proc/[pid]/io " (since kernel 2.6.20)"
b4e9ee8f 320.TP
69119dc7 321.IR /proc/[pid]/limits " (since kernel 2.6.24)"
b4e9ee8f
MK
322This file displays the soft limit, hard limit, and units of measurement
323for each of the process's resource limits (see
59a40ed7 324.BR getrlimit (2)).
e1282f17
MK
325Up to and including Linux 2.6.35,
326this file is protected to only allow reading by the real UID of the process.
327Since Linux 2.6.36,
328.\" commit 3036e7b490bf7878c6dae952eec5fb87b1106589
1f6aa3ea 329this file is readable by all users on the system.
fea681da 330.TP
69119dc7 331.I /proc/[pid]/maps
fea681da
MK
332A file containing the currently mapped memory regions and their access
333permissions.
bbf9f397
MK
334See
335.BR mmap (2)
336for some further information about memory mappings.
fea681da 337
dd0c3b96 338The format of the file is:
fea681da 339
21781757 340.in -7n
fea681da
MK
341.nf
342.ft CW
fea681da 343.ft
21781757
MK
344.I "address perms offset dev inode pathname"
34500400000-00452000 r-xp 00000000 08:02 173521 /usr/bin/dbus-daemon
34600651000-00652000 r--p 00051000 08:02 173521 /usr/bin/dbus-daemon
34700652000-00655000 rw-p 00052000 08:02 173521 /usr/bin/dbus-daemon
34800e03000-00e24000 rw-p 00000000 00:00 0 [heap]
34900e24000-011f7000 rw-p 00000000 00:00 0 [heap]
182090db 350\&...
21781757
MK
35135b1800000-35b1820000 r-xp 00000000 08:02 135522 /usr/lib64/ld-2.15.so
35235b1a1f000-35b1a20000 r--p 0001f000 08:02 135522 /usr/lib64/ld-2.15.so
35335b1a20000-35b1a21000 rw-p 00020000 08:02 135522 /usr/lib64/ld-2.15.so
35435b1a21000-35b1a22000 rw-p 00000000 00:00 0
35535b1c00000-35b1dac000 r-xp 00000000 08:02 135870 /usr/lib64/libc-2.15.so
35635b1dac000-35b1fac000 ---p 001ac000 08:02 135870 /usr/lib64/libc-2.15.so
35735b1fac000-35b1fb0000 r--p 001ac000 08:02 135870 /usr/lib64/libc-2.15.so
35835b1fb0000-35b1fb2000 rw-p 001b0000 08:02 135870 /usr/lib64/libc-2.15.so
182090db 359\&...
21781757 360f2c6ff8c000-7f2c7078c000 rw-p 00000000 00:00 0 [stack:986]
182090db 361\&...
21781757
MK
3627fffb2c0d000-7fffb2c2e000 rw-p 00000000 00:00 0 [stack]
3637fffb2d48000-7fffb2d49000 r-xp 00000000 00:00 0 [vdso]
fea681da 364.fi
21781757 365.in
fea681da 366
3eb8c588
MK
367The
368.I address
369field is the address space in the process that the mapping occupies.
370The
371.I perms
372field is a set of permissions:
fea681da
MK
373
374.nf
375.in +5
376r = read
377w = write
378x = execute
379s = shared
380p = private (copy on write)
381.fi
382.in
383
3eb8c588
MK
384The
385.I offset
b844cf04 386field is the offset into the file/whatever;
3eb8c588
MK
387.I dev
388is the device
dd0c3b96 389(major:minor);
3eb8c588
MK
390.I inode
391is the inode on that device.
59a40ed7 3920 indicates that no inode is associated with the memory region,
7b82eec8 393as would be ithe case with BSS (uninitialized data).
fea681da 394
3eb8c588
MK
395The
396.I pathname
397field will usually be the file that is backing the mapping.
491ea6f1 398For ELF files,
3eb8c588
MK
399you can easily coordinate with the
400.I offset
401field by looking at the
491ea6f1
MK
402Offset field in the ELF program headers
403.RI ( "readelf\ \-l" ).
37d32c38 404
491ea6f1 405There are additional helpful pseudo-paths:
61b0b1f4
MK
406.RS 12
407.TP
408.IR [stack]
409The initial process's (also known as the main thread's) stack
410.TP
3eb8c588 411.IR [stack:<tid>] " (since Linux 3.4)"
a60894c5 412.\" commit b76437579d1344b612cf1851ae610c636cec7db0
61b0b1f4 413A thread's stack (where the
3eb8c588 414.IR <tid>
61b0b1f4 415is a thread ID).
491ea6f1 416It corresponds to the
3eb8c588 417.IR /proc/[pid]/task/[tid]/
37d32c38 418path.
61b0b1f4
MK
419.TP
420.IR [vdso]
421The virtual dynamically linked shared object.
422.TP
423.IR [heap]
424The process's heap.
425.in
426.fi
427.RE
428.IP
3eb8c588
MK
429If the
430.I pathname
431field is blank,
491ea6f1 432this is an anonymous mapping as obtained via the
37d32c38 433.BR mmap (2)
491ea6f1 434function.
61b0b1f4
MK
435There is no easy way to coordinate this back to a process's source,
436short of running it through
491ea6f1
MK
437.BR gdb (1),
438.BR strace (1),
439or similar.
37d32c38 440
fea681da
MK
441Under Linux 2.0 there is no field giving pathname.
442.TP
69119dc7 443.I /proc/[pid]/mem
fea681da
MK
444This file can be used to access the pages of a process's memory through
445.BR open (2),
446.BR read (2),
447and
ccb2bb0d 448.BR lseek (2).
b4e9ee8f 449.TP
69119dc7 450.IR /proc/[pid]/mountinfo " (since Linux 2.6.26)"
b4e9ee8f
MK
451.\" This info adapted from Documentation/filesystems/proc.txt
452This file contains information about mount points.
453It contains lines of the form:
454.nf
455.ft CW
b4e9ee8f
MK
456
45736 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue
458(1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11)
b4e9ee8f
MK
459.ft
460.fi
461.IP
462The numbers in parentheses are labels for the descriptions below:
3bc960c2 463.RS 7
b4e9ee8f
MK
464.TP 5
465(1)
466mount ID: unique identifier of the mount (may be reused after
467.BR umount (2)).
468.TP
469(2)
470parent ID: ID of parent mount (or of self for the top of the mount tree).
471.TP
472(3)
473major:minor: value of
474.I st_dev
475for files on file system (see
476.BR stat (2)).
477.TP
478(4)
479root: root of the mount within the file system.
480.TP
481(5)
482mount point: mount point relative to the process's root.
483.TP
484(6)
485mount options: per-mount options.
486.TP
487(7)
488optional fields: zero or more fields of the form "tag[:value]".
489.TP
490(8)
491separator: marks the end of the optional fields.
492.TP
493(9)
494file system type: name of file system in the form "type[.subtype]".
495.TP
496(10)
497mount source: file system-specific information or "none".
498.TP
499(11)
500super options: per-super block options.
501.RE
502.IP
503Parsers should ignore all unrecognized optional fields.
504Currently the possible optional fields are:
505.RS 12
506.TP 18
507shared:X
508mount is shared in peer group X
509.TP
510master:X
511mount is slave to peer group X
512.TP
513propagate_from:X
514mount is slave and receives propagation from peer group X (*)
515.TP
516unbindable
517mount is unbindable
518.RE
519.IP
520(*) X is the closest dominant peer group under the process's root.
521If X is the immediate master of the mount,
522or if there is no dominant peer group under the same root,
523then only the "master:X" field is present
524and not the "propagate_from:X" field.
525
526For more information on mount propagation see:
527.I Documentation/filesystems/sharedsubtree.txt
66a9882e 528in the Linux kernel source tree.
b4e9ee8f 529.TP
cea61382
MK
530.IR /proc/[pid]/mounts " (since Linux 2.4.19)"
531This is a list of all the file systems currently mounted in the
732e54dd 532process's mount namespace.
cea61382
MK
533The format of this file is documented in
534.BR fstab (5).
535Since kernel version 2.6.15, this file is pollable:
536after opening the file for reading, a change in this file
537(i.e., a file system mount or unmount) causes
538.BR select (2)
539to mark the file descriptor as readable, and
540.BR poll (2)
541and
542.BR epoll_wait (2)
543mark the file as having an error condition.
544.TP
69119dc7 545.IR /proc/[pid]/mountstats " (since Linux 2.6.17)"
783a6233 546This file exports information (statistics, configuration information)
b4e9ee8f
MK
547about the mount points in the process's name space.
548Lines in this file have the form:
549.nf
550
551device /dev/sda7 mounted on /home with fstype ext3 [statistics]
552( 1 ) ( 2 ) (3 ) (4)
553.fi
554.IP
555The fields in each line are:
3bc960c2 556.RS 7
b4e9ee8f
MK
557.TP 5
558(1)
559The name of the mounted device
560(or "nodevice" if there is no corresponding device).
561.TP
562(2)
563The mount point within the file system tree.
564.TP
565(3)
566The file system type.
567.TP
568(4)
569Optional statistics and configuration information.
570Currently (as at Linux 2.6.26), only NFS file systems export
571information via this field.
572.RE
573.IP
574This file is only readable by the owner of the process.
b4e9ee8f 575.TP
b4a185e5 576.IR /proc/[pid]/ns/ " (since Linux 3.0)"
2c4201f0 577.\" See commit 6b4e306aa3dc94a0545eb9279475b1ab6209a31f
b4a185e5
EB
578This is a subdirectory containing one entry for each namespace that
579supports being manipulated by
80e63655
MK
580.BR setns (2).
581For information about namespaces, see
582.BR clone (2).
b4a185e5
EB
583.TP
584.IR /proc/[pid]/ns/ipc " (since Linux 3.0)"
80e63655
MK
585Bind mounting this file (see
586.BR mount (2))
587to somewhere else in the filesystem keeps
c409c4ff 588the IPC namespace of the process specified by
b4a185e5 589.I pid
80e63655 590alive even if all processes currently in the namespace terminate.
b4a185e5 591
80e63655 592Opening this file returns a file handle for the IPC namespace
b4a185e5 593of the process specified by
80e63655
MK
594.IR pid .
595As long as this file descriptor remains open,
596the IPC namespace will remain alive,
597even if all processes in the namespace terminate.
598The file descriptor can be passed to
599.BR setns (2).
b4a185e5
EB
600.TP
601.IR /proc/[pid]/ns/net " (since Linux 3.0)"
80e63655
MK
602Bind mounting this file (see
603.BR mount (2))
604to somewhere else in the filesystem keeps
c409c4ff 605the network namespace of the process specified by
b4a185e5 606.I pid
80e63655 607alive even if all processes in the namespace terminate.
b4a185e5 608
80e63655 609Opening this file returns a file handle for the network namespace
b4a185e5 610of the process specified by
80e63655
MK
611.IR pid .
612As long as this file descriptor remains open,
613the network namespace will remain alive,
614even if all processes in the namespace terminate.
615The file descriptor can be passed to
616.BR setns (2).
b4a185e5
EB
617.TP
618.IR /proc/[pid]/ns/uts " (since Linux 3.0)"
80e63655
MK
619Bind mounting this file (see
620.BR mount (2))
621to somewhere else in the filesystem keeps
c409c4ff 622the UTS namespace of the process specified by
b4a185e5 623.I pid
80e63655 624alive even if all processes currently in the namespace terminate.
b4a185e5 625
80e63655 626Opening this file returns a file handle for the UTS namespace
b4a185e5 627of the process specified by
80e63655
MK
628.IR pid .
629As long as this file descriptor remains open,
630the UTS namespace will remain alive,
631even if all processes in the namespace terminate.
632The file descriptor can be passed to
633.BR setns (2).
b4a185e5 634.TP
69119dc7 635.IR /proc/[pid]/numa_maps " (since Linux 2.6.14)"
610f75cc
MK
636See
637.BR numa (7).
7388733a 638.TP
69119dc7 639.IR /proc/[pid]/oom_adj " (since Linux 2.6.11)"
b4e9ee8f 640This file can be used to adjust the score used to select which process
0425de01 641should be killed in an out-of-memory (OOM) situation.
b4e9ee8f
MK
642The kernel uses this value for a bit-shift operation of the process's
643.IR oom_score
644value:
5b8dbfd4
MK
645valid values are in the range \-16 to +15,
646plus the special value \-17,
b4e9ee8f
MK
647which disables OOM-killing altogether for this process.
648A positive score increases the likelihood of this
649process being killed by the OOM-killer;
650a negative score decreases the likelihood.
de8e9cc1 651.IP
b4e9ee8f
MK
652The default value for this file is 0;
653a new process inherits its parent's
654.I oom_adj
655setting.
656A process must be privileged
657.RB ( CAP_SYS_RESOURCE )
658to update this file.
f2c8b197
MK
659.IP
660Since Linux 2.6.36, use of this file is deprecated in favor of
661.IR /proc/[pid]/oom_score_adj .
b4e9ee8f 662.TP
69119dc7 663.IR /proc/[pid]/oom_score " (since Linux 2.6.11)"
b4e9ee8f
MK
664.\" See mm/oom_kill.c::badness() in the 2.6.25 sources
665This file displays the current score that the kernel gives to
666this process for the purpose of selecting a process
667for the OOM-killer.
668A higher score means that the process is more likely to be
669selected by the OOM-killer.
670The basis for this score is the amount of memory used by the process,
671with increases (+) or decreases (\-) for factors including:
672.\" See mm/oom_kill.c::badness() in the 2.6.25 sources
673.RS
674.IP * 2
675whether the process creates a lot of children using
676.BR fork (2)
677(+);
678.IP *
679whether the process has been running a long time,
680or has used a lot of CPU time (\-);
681.IP *
682whether the process has a low nice value (i.e., > 0) (+);
683.IP *
684whether the process is privileged (\-); and
685.\" More precisely, if it has CAP_SYS_ADMIN or CAP_SYS_RESOURCE
686.IP *
687whether the process is making direct hardware access (\-).
688.\" More precisely, if it has CAP_SYS_RAWIO
689.RE
690.IP
691The
692.I oom_score
f2c8b197
MK
693also reflects the adjustment specified by the
694.I oom_score_adj
695or
b4e9ee8f
MK
696.I oom_adj
697setting for the process.
f2c8b197
MK
698.TP
699.IR /proc/[pid]/oom_score_adj " (since Linux 2.6.36)"
700.\" Text taken from 3.7 Documentation/filesystems/proc.txt
701This file can be used to adjust the badness heuristic used to select which
702process gets killed in out-of-memory conditions.
703
704The badness heuristic assigns a value to each candidate task ranging from 0
705(never kill) to 1000 (always kill) to determine which process is targeted.
706The units are roughly a proportion along that range of
707allowed memory the process may allocate from,
708based on an estimation of its current memory and swap use.
709For example, if a task is using all allowed memory,
710its badness score will be 1000.
711If it is using half of its allowed memory, its score will be 500.
712
713There is an additional factor included in the badness score: root
714processes are given 3% extra memory over other tasks.
715
716The amount of "allowed" memory depends on the context
0633f951 717in which the OOM-killer was called.
f2c8b197
MK
718If it is due to the memory assigned to the allocating task's cpuset
719being exhausted,
720the allowed memory represents the set of mems assigned to that
721cpuset (see
722.BR cpuset (7)).
723If it is due to a mempolicy's node(s) being exhausted,
724the allowed memory represents the set of mempolicy nodes.
725If it is due to a memory limit (or swap limit) being reached,
726the allowed memory is that configured limit.
727Finally, if it is due to the entire system being out of memory, the
728allowed memory represents all allocatable resources.
729
730The value of
0633f951 731.I oom_score_adj
f2c8b197
MK
732is added to the badness score before it
733is used to determine which task to kill.
734Acceptable values range from \-1000
735(OOM_SCORE_ADJ_MIN) to +1000 (OOM_SCORE_ADJ_MAX).
0633f951 736This allows user space to control the preference for OOM-killing,
f2c8b197 737ranging from always preferring a certain
0633f951 738task or completely disabling it from OOM-killing.
f2c8b197 739The lowest possible value, \-1000, is
0633f951 740equivalent to disabling OOM-killing entirely for that task,
f2c8b197
MK
741since it will always report a badness score of 0.
742
743Consequently, it is very simple for user space to define
744the amount of memory to consider for each task.
745Setting a
746.I oom_score_adj
747value of +500, for example,
748is roughly equivalent to allowing the remainder of tasks sharing the
749same system, cpuset, mempolicy, or memory controller resources
750to use at least 50% more memory.
751A value of \-500, on the other hand, would be roughly
752equivalent to discounting 50% of the task's
753allowed memory from being considered as scoring against the task.
754
0633f951 755For backward compatibility with previous kernels,
f2c8b197
MK
756.I /proc/[pid]/oom_adj
757can still be used to tune the badness score.
758Its value is
9f1b9726 759scaled linearly with
f2c8b197
MK
760.IR oom_score_adj .
761
762Writing to
763.IR /proc/[pid]/oom_score_adj
764or
765.IR /proc/[pid]/oom_adj
766will change the other with its scaled value.
69119dc7 767.\" FIXME Describe /proc/[pid]/pagemap
b4e9ee8f
MK
768.\" Added in 2.6.25
769.\" CONFIG_PROC_PAGE_MONITOR
fea681da 770.TP
69119dc7 771.I /proc/[pid]/root
008f1ecc 772UNIX and Linux support the idea of a per-process root of the
24d01c53 773file system, set by the
fea681da 774.BR chroot (2)
c13182ef
MK
775system call.
776This file is a symbolic link that points to the process's
fea681da 777root directory, and behaves as exe, fd/*, etc. do.
afcaf646
MK
778
779.\" The following was still true as at kernel 2.6.13
c13182ef
MK
780In a multithreaded process, the contents of this symbolic link
781are not available if the main thread has already terminated
afcaf646
MK
782(typically by calling
783.BR pthread_exit (3)).
69119dc7 784.\" FIXME Describe /proc/[pid]/seccomp
6aefb6df 785.\" Added in 2.6.12
69119dc7 786.\" FIXME Describe /proc/[pid]/sessionid
b4e9ee8f
MK
787.\" Added in 2.6.25; read-only; only readable by real UID
788.\" CONFIG_AUDITSYSCALL
69119dc7 789.\" FIXME Describe /proc/[pid]/sched
b4e9ee8f
MK
790.\" Added in 2.6.23
791.\" CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS
792.\" Displays various scheduling parameters
793.\" This file can be written, to reset stats
69119dc7
MK
794.\" FIXME Describe /proc/[pid]/schedstats and
795.\" /proc/[pid]/task/[tid]/schedstats
b4e9ee8f
MK
796.\" Added in 2.6.9
797.\" CONFIG_SCHEDSTATS
fea681da 798.TP
69119dc7 799.IR /proc/[pid]/smaps " (since Linux 2.6.14)"
b4e9ee8f 800.\" CONFIG_PROC_PAGE_MONITOR
b07b19c4 801This file shows memory consumption for each of the process's mappings.
59a40ed7 802For each of mappings there is a series of lines such as the following:
a08ea57c 803.in +4n
b07b19c4
MK
804.nf
805
80608048000-080bc000 r-xp 00000000 03:02 13130 /bin/bash
807Size: 464 kB
808Rss: 424 kB
809Shared_Clean: 424 kB
810Shared_Dirty: 0 kB
811Private_Clean: 0 kB
812Private_Dirty: 0 kB
813
814.fi
a08ea57c 815.in
b07b19c4
MK
816The first of these lines shows the same information as is displayed
817for the mapping in
69119dc7 818.IR /proc/[pid]/maps .
b07b19c4
MK
819The remaining lines show the size of the mapping,
820the amount of the mapping that is currently resident in RAM,
c7ce200d
VN
821the number of clean and dirty shared pages in the mapping,
822and the number of clean and dirty private pages in the mapping.
b07b19c4 823
097585ed
MK
824This file is only present if the
825.B CONFIG_MMU
826kernel configuration
b07b19c4
MK
827option is enabled.
828.TP
69119dc7 829.I /proc/[pid]/stat
c13182ef
MK
830Status information about the process.
831This is used by
832.BR ps (1).
833It is defined in
fea681da
MK
834.IR /usr/src/linux/fs/proc/array.c "."
835
836The fields, in order, with their proper
837.BR scanf (3)
838format specifiers, are:
839.RS
59a40ed7 840.TP 12
fea681da 841\fIpid\fP %d
aa610245 842(1) The process ID.
fea681da
MK
843.TP
844\fIcomm\fP %s
aa610245 845(2) The filename of the executable, in parentheses.
c13182ef 846This is visible whether or not the executable is swapped out.
fea681da
MK
847.TP
848\fIstate\fP %c
aa610245 849(3) One character from the string "RSDZTW" where R is running, S is
fea681da
MK
850sleeping in an interruptible wait, D is waiting in uninterruptible
851disk sleep, Z is zombie, T is traced or stopped (on a signal),
852and W is paging.
853.TP
854\fIppid\fP %d
aa610245 855(4) The PID of the parent.
fea681da
MK
856.TP
857\fIpgrp\fP %d
aa610245 858(5) The process group ID of the process.
fea681da
MK
859.TP
860\fIsession\fP %d
aa610245 861(6) The session ID of the process.
fea681da 862.TP
fea681da 863\fItty_nr\fP %d
aa610245 864(7) The controlling terminal of the process.
59a40ed7
MK
865(The minor device number is contained in the combination of bits
86631 to 20 and 7 to 0;
b97deb97 867the major device number is in bits 15 to 8.)
fea681da
MK
868.TP
869\fItpgid\fP %d
870.\" This field and following, up to and including wchan added 0.99.1
aa610245 871(8) The ID of the foreground process group of the controlling
59a40ed7 872terminal of the process.
fea681da 873.TP
2ebfeb1b 874\fIflags\fP %u (%lu before Linux 2.6.22)
aa610245 875(9) The kernel flags word of the process.
c13182ef 876For bit meanings,
66a9882e 877see the PF_* defines in the Linux kernel source file
00702acc 878.IR include/linux/sched.h .
fea681da
MK
879Details depend on the kernel version.
880.TP
881\fIminflt\fP %lu
aa610245 882(10) The number of minor faults the process has made which have not
fea681da
MK
883required loading a memory page from disk.
884.TP
59a40ed7 885.\" field 11
fea681da 886\fIcminflt\fP %lu
aa610245 887(11) The number of minor faults that the process's
fea681da
MK
888waited-for children have made.
889.TP
890\fImajflt\fP %lu
aa610245 891(12) The number of major faults the process has made which have
fea681da
MK
892required loading a memory page from disk.
893.TP
894\fIcmajflt\fP %lu
aa610245 895(13) The number of major faults that the process's
fea681da
MK
896waited-for children have made.
897.TP
898\fIutime\fP %lu
aa610245 899(14) Amount of time that this process has been scheduled in user mode,
7a017e24 900measured in clock ticks (divide by
67914165 901.IR sysconf(_SC_CLK_TCK) ).
a1c9dc59
MK
902This includes guest time, \fIguest_time\fP
903(time spent running a virtual CPU, see below),
904so that applications that are not aware of the guest time field
905do not lose that time from their calculations.
fea681da
MK
906.TP
907\fIstime\fP %lu
aa610245 908(15) Amount of time that this process has been scheduled in kernel mode,
7a017e24 909measured in clock ticks (divide by
67914165 910.IR sysconf(_SC_CLK_TCK) ).
fea681da
MK
911.TP
912\fIcutime\fP %ld
aa610245 913(16) Amount of time that this process's
7a017e24
MK
914waited-for children have been scheduled in user mode,
915measured in clock ticks (divide by
67914165 916.IR sysconf(_SC_CLK_TCK) ).
c13182ef 917(See also
fea681da 918.BR times (2).)
a1c9dc59
MK
919This includes guest time, \fIcguest_time\fP
920(time spent running a virtual CPU, see below).
fea681da
MK
921.TP
922\fIcstime\fP %ld
aa610245 923(17) Amount of time that this process's
7a017e24
MK
924waited-for children have been scheduled in kernel mode,
925measured in clock ticks (divide by
67914165 926.IR sysconf(_SC_CLK_TCK) ).
fea681da
MK
927.TP
928\fIpriority\fP %ld
aa610245 929(18) (Explanation for Linux 2.6)
59a40ed7
MK
930For processes running a real-time scheduling policy
931.RI ( policy
932below; see
933.BR sched_setscheduler (2)),
934this is the negated scheduling priority, minus one;
935that is, a number in the range \-2 to \-100,
936corresponding to real-time priorities 1 to 99.
937For processes running under a non-real-time scheduling policy,
938this is the raw nice value
939.RB ( setpriority (2))
940as represented in the kernel.
941The kernel stores nice values as numbers
942in the range 0 (high) to 39 (low),
943corresponding to the user-visible nice range of \-20 to 19.
944
945Before Linux 2.6, this was a scaled value based on
946the scheduler weighting given to this process.
947.\" And back in kernel 1.2 days things were different again.
fea681da
MK
948.TP
949\fInice\fP %ld
aa610245 950(19) The nice value (see
59a40ed7
MK
951.BR setpriority (2)),
952a value in the range 19 (low priority) to \-20 (high priority).
953.\" Back in kernel 1.2 days things were different.
fea681da
MK
954.\" .TP
955.\" \fIcounter\fP %ld
956.\" The current maximum size in jiffies of the process's next timeslice,
957.\" or what is currently left of its current timeslice, if it is the
958.\" currently running process.
959.\" .TP
960.\" \fItimeout\fP %u
961.\" The time in jiffies of the process's next timeout.
0e94f77b 962.\" timeout was removed sometime around 2.1/2.2
aa610245 963.TP
0e94f77b 964\fInum_threads\fP %ld
aa610245 965(20) Number of threads in this process (since Linux 2.6).
bb83d1b9 966Before kernel 2.6, this field was hard coded to 0 as a placeholder
0e94f77b 967for an earlier removed field.
fea681da 968.TP
59a40ed7 969.\" field 21
fea681da 970\fIitrealvalue\fP %ld
aa610245 971(21) The time in jiffies before the next
8bd58774
MK
972.B SIGALRM
973is sent to the process due to an interval timer.
0e94f77b
MK
974Since kernel 2.6.17, this field is no longer maintained,
975and is hard coded as 0.
fea681da 976.TP
0e94f77b 977\fIstarttime\fP %llu (was %lu before Linux 2.6)
aa610245 978(22) The time the process started after system boot.
055024ed
MK
979In kernels before Linux 2.6, this value was expressed in jiffies.
980Since Linux 2.6, the value is expressed in clock ticks (divide by
981.IR sysconf(_SC_CLK_TCK) ).
fea681da
MK
982.TP
983\fIvsize\fP %lu
aa610245 984(23) Virtual memory size in bytes.
fea681da
MK
985.TP
986\fIrss\fP %ld
aa610245 987(24) Resident Set Size: number of pages the process has in real memory.
c13182ef 988This is just the pages which
5fab2e7c 989count toward text, data, or stack space.
c13182ef 990This does not include pages
fea681da
MK
991which have not been demand-loaded in, or which are swapped out.
992.TP
59a40ed7 993\fIrsslim\fP %lu
aa610245 994(25) Current soft limit in bytes on the rss of the process;
59a40ed7
MK
995see the description of
996.B RLIMIT_RSS
997in
2b5407af 998.BR getrlimit (2).
fea681da
MK
999.TP
1000\fIstartcode\fP %lu
aa610245 1001(26) The address above which program text can run.
fea681da
MK
1002.TP
1003\fIendcode\fP %lu
aa610245 1004(27) The address below which program text can run.
fea681da
MK
1005.TP
1006\fIstartstack\fP %lu
aa610245 1007(28) The address of the start (i.e., bottom) of the stack.
fea681da
MK
1008.TP
1009\fIkstkesp\fP %lu
aa610245 1010(29) The current value of ESP (stack pointer), as found in the
fea681da
MK
1011kernel stack page for the process.
1012.TP
1013\fIkstkeip\fP %lu
aa610245 1014(30) The current EIP (instruction pointer).
fea681da 1015.TP
59a40ed7 1016.\" field 31
fea681da 1017\fIsignal\fP %lu
aa610245 1018(31) The bitmap of pending signals, displayed as a decimal number.
59a40ed7 1019Obsolete, because it does not provide information on real-time signals; use
69119dc7 1020.I /proc/[pid]/status
59a40ed7 1021instead.
fea681da
MK
1022.TP
1023\fIblocked\fP %lu
aa610245 1024(32) The bitmap of blocked signals, displayed as a decimal number.
59a40ed7 1025Obsolete, because it does not provide information on real-time signals; use
69119dc7 1026.I /proc/[pid]/status
59a40ed7 1027instead.
fea681da
MK
1028.TP
1029\fIsigignore\fP %lu
aa610245 1030(33) The bitmap of ignored signals, displayed as a decimal number.
59a40ed7 1031Obsolete, because it does not provide information on real-time signals; use
69119dc7 1032.I /proc/[pid]/status
59a40ed7 1033instead.
fea681da
MK
1034.TP
1035\fIsigcatch\fP %lu
aa610245 1036(34) The bitmap of caught signals, displayed as a decimal number.
59a40ed7 1037Obsolete, because it does not provide information on real-time signals; use
69119dc7 1038.I /proc/[pid]/status
59a40ed7 1039instead.
fea681da
MK
1040.TP
1041\fIwchan\fP %lu
aa610245 1042(35) This is the "channel" in which the process is waiting.
c13182ef 1043It is the
fea681da 1044address of a system call, and can be looked up in a namelist if you
c13182ef 1045need a textual name.
9a67332e
MK
1046(If you have an up-to-date
1047.IR /etc/psdatabase ,
1048then
4d9b6984 1049try \fIps \-l\fP to see the WCHAN field in action.)
fea681da
MK
1050.TP
1051\fInswap\fP %lu
0633f951
DP
1052(36)
1053.\" nswap was added in 2.0
4d9b6984 1054Number of pages swapped (not maintained).
fea681da
MK
1055.TP
1056\fIcnswap\fP %lu
0633f951
DP
1057(37)
1058.\" cnswap was added in 2.0
4d9b6984 1059Cumulative \fInswap\fP for child processes (not maintained).
fea681da 1060.TP
2ebfeb1b 1061\fIexit_signal\fP %d (since Linux 2.1.22)
aa610245 1062(38) Signal to be sent to parent when we die.
fea681da 1063.TP
2ebfeb1b 1064\fIprocessor\fP %d (since Linux 2.2.8)
aa610245 1065(39) CPU number last executed on.
568105c6 1066.TP
2ebfeb1b 1067\fIrt_priority\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
aa610245 1068(40) Real-time scheduling priority, a number in the range 1 to 99 for
59a40ed7
MK
1069processes scheduled under a real-time policy,
1070or 0, for non-real-time processes (see
568105c6
MK
1071.BR sched_setscheduler (2)).
1072.TP
59a40ed7 1073.\" field 41
2ebfeb1b 1074\fIpolicy\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
aa610245 1075(41) Scheduling policy (see
568105c6 1076.BR sched_setscheduler (2)).
cd60dedd 1077Decode using the SCHED_* constants in
59a40ed7 1078.IR linux/sched.h .
167450d6 1079.TP
2ebfeb1b 1080\fIdelayacct_blkio_ticks\fP %llu (since Linux 2.6.18)
aa610245 1081(42) Aggregated block I/O delays, measured in clock ticks (centiseconds).
14c06953
MK
1082.TP
1083\fIguest_time\fP %lu (since Linux 2.6.24)
aa610245 1084(43) Guest time of the process (time spent running a virtual CPU
7a017e24 1085for a guest operating system), measured in clock ticks (divide by
67914165 1086.IR sysconf(_SC_CLK_TCK) ).
14c06953
MK
1087.TP
1088\fIcguest_time\fP %ld (since Linux 2.6.24)
aa610245 1089(44) Guest time of the process's children, measured in clock ticks (divide by
67914165 1090.IR sysconf(_SC_CLK_TCK) ).
fea681da
MK
1091.RE
1092.TP
69119dc7 1093.I /proc/[pid]/statm
59a40ed7 1094Provides information about memory usage, measured in pages.
c13182ef 1095The columns are:
a08ea57c
MK
1096.in +4n
1097.nf
1098
cb42fb56 1099size (1) total program size
69119dc7 1100 (same as VmSize in \fI/proc/[pid]/status\fP)
cb42fb56 1101resident (2) resident set size
69119dc7 1102 (same as VmRSS in \fI/proc/[pid]/status\fP)
cb42fb56
MK
1103share (3) shared pages (i.e., backed by a file)
1104text (4) text (code)
59a40ed7 1105.\" (not including libs; broken, includes data segment)
cb42fb56
MK
1106lib (5) library (unused in Linux 2.6)
1107data (6) data + stack
59a40ed7 1108.\" (including libs; broken, includes library text)
cb42fb56 1109dt (7) dirty pages (unused in Linux 2.6)
a08ea57c
MK
1110.fi
1111.in
fea681da 1112.TP
69119dc7 1113.I /proc/[pid]/status
fea681da 1114Provides much of the information in
69119dc7 1115.I /proc/[pid]/stat
fea681da 1116and
69119dc7 1117.I /proc/[pid]/statm
fea681da 1118in a format that's easier for humans to parse.
16b5f7ba
MK
1119Here's an example:
1120.in +4n
1121.nf
1122
b43a3b30 1123.RB "$" " cat /proc/$$/status"
16b5f7ba
MK
1124Name: bash
1125State: S (sleeping)
1126Tgid: 3515
1127Pid: 3515
1128PPid: 3452
1129TracerPid: 0
1130Uid: 1000 1000 1000 1000
1131Gid: 100 100 100 100
1132FDSize: 256
1133Groups: 16 33 100
1134VmPeak: 9136 kB
1135VmSize: 7896 kB
1136VmLck: 0 kB
1137VmHWM: 7572 kB
1138VmRSS: 6316 kB
1139VmData: 5224 kB
1140VmStk: 88 kB
1141VmExe: 572 kB
1142VmLib: 1708 kB
1143VmPTE: 20 kB
1144Threads: 1
1145SigQ: 0/3067
1146SigPnd: 0000000000000000
1147ShdPnd: 0000000000000000
1148SigBlk: 0000000000010000
1149SigIgn: 0000000000384004
1150SigCgt: 000000004b813efb
1151CapInh: 0000000000000000
1152CapPrm: 0000000000000000
1153CapEff: 0000000000000000
1154CapBnd: ffffffffffffffff
1155Cpus_allowed: 00000001
1156Cpus_allowed_list: 0
1157Mems_allowed: 1
1158Mems_allowed_list: 0
1159voluntary_ctxt_switches: 150
1160nonvoluntary_ctxt_switches: 545
1161.fi
1162.in
1163.IP
1164The fields are as follows:
1165.RS
1166.IP * 2
1167.IR Name :
1168Command run by this process.
1169.IP *
1170.IR State :
4175f999
MK
1171Current state of the process.
1172One of
16b5f7ba
MK
1173"R (running)",
1174"S (sleeping)",
1175"D (disk sleep)",
1176"T (stopped)",
1177"T (tracing stop)",
1178"Z (zombie)",
1179or
1180"X (dead)".
1181.IP *
1182.IR Tgid :
1183Thread group ID (i.e., Process ID).
1184.IP *
1185.IR Pid :
1186Thread ID (see
1187.BR gettid (2)).
1188.IP *
a1bc91d5
MK
1189.IR PPid :
1190PID of parent process.
1191.IP *
16b5f7ba
MK
1192.IR TracerPid :
1193PID of process tracing this process (0 if not being traced).
1194.IP *
1195.IR Uid ", " Gid :
1196Real, effective, saved set, and file system UIDs (GIDs).
1197.IP *
1198.IR FDSize :
1199Number of file descriptor slots currently allocated.
1200.IP *
1201.IR Groups :
1202Supplementary group list.
1203.IP *
1204.IR VmPeak :
1205Peak virtual memory size.
1206.IP *
1207.IR VmSize :
1208Virtual memory size.
1209.IP *
1210.IR VmLck :
fde39195
MK
1211Locked memory size (see
1212.BR mlock (3)).
16b5f7ba
MK
1213.IP *
1214.IR VmHWM :
1215Peak resident set size ("high water mark").
1216.IP *
1217.IR VmRSS :
1218Resident set size.
1219.IP *
1220.IR VmData ", " VmStk ", " VmExe :
1221Size of data, stack, and text segments.
1222.IP *
1223.IR VmLib :
1224Shared library code size.
1225.IP *
1226.IR VmPTE :
1227Page table entries size (since Linux 2.6.10).
1228.IP *
1229.IR Threads :
1230Number of threads in process containing this thread.
1231.IP *
6ee625eb
MK
1232.IR SigQ :
1233This field contains two slash-separated numbers that relate to
1234queued signals for the real user ID of this process.
1235The first of these is the number of currently queued
1236signals for this real user ID, and the second is the
1237resource limit on the number of queued signals for this process
1238(see the description of
1239.BR RLIMIT_SIGPENDING
1240in
1241.BR getrlimit (2)).
1242.IP *
16b5f7ba
MK
1243.IR SigPnd ", " ShdPnd :
1244Number of signals pending for thread and for process as a whole (see
1245.BR pthreads (7)
1246and
1247.BR signal (7)).
1248.IP *
1249.IR SigBlk ", " SigIgn ", " SigCgt :
1250Masks indicating signals being blocked, ignored, and caught (see
1251.BR signal (7)).
1252.IP *
1253.IR CapInh ", " CapPrm ", " CapEff :
1254Masks of capabilities enabled in inheritable, permitted, and effective sets
1255(see
1256.BR capabilities (7)).
1257.IP *
1258.IR CapBnd :
1259Capability Bounding set
1260(since kernel 2.6.26, see
1261.BR capabilities (7)).
1262.IP *
1263.IR Cpus_allowed :
1264Mask of CPUs on which this process may run
1265(since Linux 2.6.24, see
1266.BR cpuset (7)).
1267.IP *
1268.IR Cpus_allowed_list :
1269Same as previous, but in "list format"
1270(since Linux 2.6.26, see
1271.BR cpuset (7)).
1272.IP *
1273.IR Mems_allowed :
1274Mask of memory nodes allowed to this process
1275(since Linux 2.6.24, see
1276.BR cpuset (7)).
1277.IP *
1278.IR Mems_allowed_list :
1279Same as previous, but in "list format"
1280(since Linux 2.6.26, see
1281.BR cpuset (7)).
1282.IP *
1283.IR voluntary_context_switches ", " nonvoluntary_context_switches :
1284Number of voluntary and involuntary context switches (since Linux 2.6.23).
1285.RE
fea681da 1286.TP
69119dc7 1287.IR /proc/[pid]/task " (since Linux 2.6.0-test6)"
afcaf646
MK
1288This is a directory that contains one subdirectory
1289for each thread in the process.
69119dc7
MK
1290The name of each subdirectory is the numerical thread ID
1291.RI ( [tid] )
1292of the thread (see
afcaf646
MK
1293.BR gettid (2)).
1294Within each of these subdirectories, there is a set of
1295files with the same names and contents as under the
69119dc7 1296.I /proc/[pid]
afcaf646
MK
1297directories.
1298For attributes that are shared by all threads, the contents for
1299each of the files under the
69119dc7 1300.I task/[tid]
afcaf646 1301subdirectories will be the same as in the corresponding
c13182ef 1302file in the parent
69119dc7 1303.I /proc/[pid]
afcaf646 1304directory
c13182ef 1305(e.g., in a multithreaded process, all of the
69119dc7 1306.I task/[tid]/cwd
c13182ef 1307files will have the same value as the
69119dc7 1308.I /proc/[pid]/cwd
c13182ef 1309file in the parent directory, since all of the threads in a process
afcaf646
MK
1310share a working directory).
1311For attributes that are distinct for each thread,
c13182ef 1312the corresponding files under
69119dc7 1313.I task/[tid]
afcaf646 1314may have different values (e.g., various fields in each of the
69119dc7 1315.I task/[tid]/status
afcaf646
MK
1316files may be different for each thread).
1317
1318.\" The following was still true as at kernel 2.6.13
1319In a multithreaded process, the contents of the
69119dc7 1320.I /proc/[pid]/task
c13182ef 1321directory are not available if the main thread has already terminated
afcaf646
MK
1322(typically by calling
1323.BR pthread_exit (3)).
1324.TP
fea681da 1325.I /proc/apm
097585ed
MK
1326Advanced power management version and battery information when
1327.B CONFIG_APM
1328is defined at kernel compilation time.
fea681da
MK
1329.TP
1330.I /proc/bus
1331Contains subdirectories for installed busses.
1332.TP
1333.I /proc/bus/pccard
59a40ed7 1334Subdirectory for PCMCIA devices when
097585ed
MK
1335.B CONFIG_PCMCIA
1336is set at kernel compilation time.
fea681da
MK
1337.TP
1338.I /proc/bus/pccard/drivers
1339.TP
1340.I /proc/bus/pci
c13182ef 1341Contains various bus subdirectories and pseudo-files containing
59a40ed7 1342information about PCI busses, installed devices, and device
c13182ef
MK
1343drivers.
1344Some of these files are not ASCII.
fea681da
MK
1345.TP
1346.I /proc/bus/pci/devices
59a40ed7 1347Information about PCI devices.
c13182ef 1348They may be accessed through
fea681da
MK
1349.BR lspci (8)
1350and
1351.BR setpci (8).
1352.TP
1353.I /proc/cmdline
c13182ef
MK
1354Arguments passed to the Linux kernel at boot time.
1355Often done via a boot manager such as
59a40ed7
MK
1356.BR lilo (8)
1357or
1358.BR grub (8).
f6e524c4
MK
1359.TP
1360.IR /proc/config.gz " (since Linux 2.6)"
1361This file exposes the configuration options that were used
c3d9780d 1362to build the currently running kernel,
f6e524c4
MK
1363in the same format as they would be shown in the
1364.I .config
1365file that resulted when configuring the kernel (using
1366.IR "make xconfig" ,
1367.IR "make config" ,
1368or similar).
1369The file contents are compressed; view or search them using
1370.BR zcat (1),
1371.BR zgrep (1),
1372etc.
1373As long as no changes have been made to the following file,
250e01ec
MK
1374the contents of
1375.I /proc/config.gz
1376are the same as those provided by :
f6e524c4
MK
1377.in +4n
1378.nf
1379
c3074d70 1380cat /lib/modules/$(uname \-r)/build/.config
f6e524c4
MK
1381.fi
1382.in
250e01ec
MK
1383.IP
1384.I /proc/config.gz
1385is only provided if the kernel is configured with
250e01ec 1386.BR CONFIG_IKCONFIG_PROC .
fea681da
MK
1387.TP
1388.I /proc/cpuinfo
1389This is a collection of CPU and system architecture dependent items,
1390for each supported architecture a different list.
1391Two common entries are \fIprocessor\fP which gives CPU number and
c13182ef
MK
1392\fIbogomips\fP; a system constant that is calculated
1393during kernel initialization.
1394SMP machines have information for
fea681da 1395each CPU.
a091f002
MK
1396The
1397.BR lscpu (1)
1398command gathers its information from this file.
fea681da
MK
1399.TP
1400.I /proc/devices
c13182ef
MK
1401Text listing of major numbers and device groups.
1402This can be used by MAKEDEV scripts for consistency with the kernel.
fea681da
MK
1403.TP
1404.IR /proc/diskstats " (since Linux 2.5.69)"
1405This file contains disk I/O statistics for each disk device.
66a9882e 1406See the Linux kernel source file
fea681da
MK
1407.I Documentation/iostats.txt
1408for further information.
1409.TP
1410.I /proc/dma
c13182ef 1411This is a list of the registered \fIISA\fP DMA (direct memory access)
fea681da
MK
1412channels in use.
1413.TP
1414.I /proc/driver
1415Empty subdirectory.
1416.TP
1417.I /proc/execdomains
1418List of the execution domains (ABI personalities).
1419.TP
1420.I /proc/fb
097585ed
MK
1421Frame buffer information when
1422.B CONFIG_FB
1423is defined during kernel compilation.
fea681da
MK
1424.TP
1425.I /proc/filesystems
24d01c53
MK
1426A text listing of the file systems which are supported by the kernel,
1427namely file systems which were compiled into the kernel or whose kernel
6387216b
MK
1428modules are currently loaded.
1429(See also
fb477da2 1430.BR filesystems (5).)
24d01c53 1431If a file system is marked with "nodev",
809d0164 1432this means that it does not require a block device to be mounted
24d01c53 1433(e.g., virtual file system, network file system).
809d0164
MK
1434
1435Incidentally, this file may be used by
1436.BR mount (8)
24d01c53
MK
1437when no file system is specified and it didn't manage to determine the
1438file system type.
1439Then file systems contained in this file are tried
809d0164 1440(excepted those that are marked with "nodev").
fea681da
MK
1441.TP
1442.I /proc/fs
1443Empty subdirectory.
1444.TP
1445.I /proc/ide
1446This directory
59a40ed7
MK
1447exists on systems with the IDE bus.
1448There are directories for each IDE channel and attached device.
c13182ef 1449Files include:
fea681da 1450
a08ea57c 1451.in +4n
fea681da
MK
1452.nf
1453cache buffer size in KB
1454capacity number of sectors
1455driver driver version
1456geometry physical and logical geometry
9fdfa163 1457identify in hexadecimal
fea681da
MK
1458media media type
1459model manufacturer's model number
1460settings drive settings
9fdfa163
MK
1461smart_thresholds in hexadecimal
1462smart_values in hexadecimal
fea681da 1463.fi
a08ea57c 1464.in
fea681da 1465
c13182ef 1466The
fea681da
MK
1467.BR hdparm (8)
1468utility provides access to this information in a friendly format.
1469.TP
1470.I /proc/interrupts
23ec6ff0
MK
1471This is used to record the number of interrupts per CPU per IO device.
1472Since Linux 2.6.24,
1473for the i386 and x86_64 architectures, at least, this also includes
1474interrupts internal to the system (that is, not associated with a device
1475as such), such as NMI (nonmaskable interrupt), LOC (local timer interrupt),
1476and for SMP systems, TLB (TLB flush interrupt), RES (rescheduling
1477interrupt), CAL (remote function call interrupt), and possibly others.
1478Very easy to read formatting, done in ASCII.
fea681da
MK
1479.TP
1480.I /proc/iomem
1481I/O memory map in Linux 2.4.
1482.TP
1483.I /proc/ioports
c13182ef 1484This is a list of currently registered Input-Output port regions that
fea681da
MK
1485are in use.
1486.TP
1487.IR /proc/kallsyms " (since Linux 2.5.71)"
1488This holds the kernel exported symbol definitions used by the
1489.BR modules (X)
1490tools to dynamically link and bind loadable modules.
1491In Linux 2.5.47 and earlier, a similar file with slightly different syntax
1492was named
1493.IR ksyms .
1494.TP
1495.I /proc/kcore
1496This file represents the physical memory of the system and is stored
c13182ef
MK
1497in the ELF core file format.
1498With this pseudo-file, and an unstripped
9a67332e
MK
1499kernel
1500.RI ( /usr/src/linux/vmlinux )
1501binary, GDB can be used to
fea681da
MK
1502examine the current state of any kernel data structures.
1503
1504The total length of the file is the size of physical memory (RAM) plus
15054KB.
1506.TP
1507.I /proc/kmsg
1508This file can be used instead of the
1509.BR syslog (2)
c13182ef
MK
1510system call to read kernel messages.
1511A process must have superuser
fea681da 1512privileges to read this file, and only one process should read this
c13182ef
MK
1513file.
1514This file should not be read if a syslog process is running
fea681da
MK
1515which uses the
1516.BR syslog (2)
1517system call facility to log kernel messages.
1518
1519Information in this file is retrieved with the
c4517613 1520.BR dmesg (1)
fea681da
MK
1521program.
1522.TP
1523.IR /proc/ksyms " (Linux 1.1.23-2.5.47)"
1524See
1525.IR /proc/kallsyms .
1526.TP
1527.I /proc/loadavg
6b05dc38
MK
1528The first three fields in this file are load average figures
1529giving the number of jobs in the run queue (state R)
fea681da
MK
1530or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes.
1531They are the same as the load average numbers given by
1532.BR uptime (1)
1533and other programs.
6b05dc38 1534The fourth field consists of two numbers separated by a slash (/).
78fc91ec
EDB
1535The first of these is the number of currently runnable kernel
1536scheduling entities (processes, threads).
6b05dc38
MK
1537The value after the slash is the number of kernel scheduling entities
1538that currently exist on the system.
1539The fifth field is the PID of the process that was most
1540recently created on the system.
fea681da
MK
1541.TP
1542.I /proc/locks
1543This file shows current file locks
1544.RB ( flock "(2) and " fcntl (2))
1545and leases
1546.RB ( fcntl (2)).
1547.TP
89dd5f8a 1548.IR /proc/malloc " (only up to and including Linux 2.2)"
59a40ed7 1549.\" It looks like this only ever did something back in 1.0 days
097585ed 1550This file is only present if
89dd5f8a 1551.B CONFIG_DEBUG_MALLOC
097585ed 1552was defined during compilation.
fea681da
MK
1553.TP
1554.I /proc/meminfo
77b802ec
MK
1555This file reports statistics about memory usage on the system.
1556It is used by
fea681da
MK
1557.BR free (1)
1558to report the amount of free and used memory (both physical and swap)
1559on the system as well as the shared memory and buffers used by the
1560kernel.
3ba3d5b1
MK
1561Each line of the file consists of a parameter name, followed by a colon,
1562the value of the parameter, and an option unit of measurement (e.g., "kB").
1563The list below describes the parameter names and
1564the format specifier required to read the field value.
1565Except as noted below,
1566all of the fields have been present since at least Linux 2.6.0.
1567Some fileds are only displayed if the kernel was configured
1568with various options; those dependencies are noted in the list.
1569.RS
1570.TP
1571.IR MemTotal " %lu"
1572Total usable RAM (i.e. physical RAM minus a few reserved
99e91586 1573bits and the kernel binary code).
3ba3d5b1
MK
1574.TP
1575.IR MemFree " %lu"
7bccb7d4
DP
1576The sum of
1577.IR LowFree + HighFree .
3ba3d5b1
MK
1578.TP
1579.IR Buffers " %lu"
99e91586 1580Relatively temporary storage for raw disk blocks that
3ba3d5b1
MK
1581shouldn't get tremendously large (20MB or so).
1582.TP
1583.IR Cached " %lu"
1584In-memory cache for files read from the disk (the page cache).
1585Doesn't include
1586.IR SwapCached .
1587.TP
1588.IR SwapCached " %lu"
1589Memory that once was swapped out, is swapped back in but
1590still also is in the swap file.
fa1d2749 1591(If memory pressure is high, these pages
3ba3d5b1 1592don't need to be swapped out again because they are already
99e91586 1593in the swap file.
3ba3d5b1
MK
1594This saves I/O.)
1595.TP
1596.IR Active " %lu"
1597Memory that has been used more recently and usually not
1598reclaimed unless absolutely necessary.
1599.TP
1600.IR Inactive " %lu"
1601Memory which has been less recently used.
1602It is more eligible to be reclaimed for other purposes.
1603.TP
1604.IR Active(anon) " %lu (since Linux 2.6.28)"
1605[To be documented.]
1606.TP
1607.IR Inactive(anon) " %lu (since Linux 2.6.28)"
1608[To be documented.]
1609.TP
1610.IR Active(file) " %lu (since Linux 2.6.28)"
1611[To be documented.]
1612.TP
1613.IR Inactive(file) " %lu (since Linux 2.6.28)"
1614[To be documented.]
1615.TP
1616.IR Unevictable " %lu (since Linux 2.6.28)"
1617(From Linux 2.6.28 to 2.6.30,
1618\fBCONFIG_UNEVICTABLE_LRU\fP was required.)
1619[To be documented.]
1620.TP
46fbfc07 1621.IR Mlocked " %lu (since Linux 2.6.28)"
3ba3d5b1
MK
1622(From Linux 2.6.28 to 2.6.30,
1623\fBCONFIG_UNEVICTABLE_LRU\fP was required.)
1624[To be documented.]
1625.TP
1626.IR HighTotal " %lu"
1627(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1628Total amount of highmem.
99e91586 1629Highmem is all memory above ~860MB of physical memory.
3ba3d5b1
MK
1630Highmem areas are for use by user-space programs,
1631or for the page cache.
1632The kernel must use tricks to access
1633this memory, making it slower to access than lowmem.
1634.TP
1635.IR HighFree " %lu
1636(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1637Amount of free highmem.
1638.TP
1639.IR LowTotal " %lu
1640(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1641Total amount of lowmem.
1642Lowmem is memory which can be used for everything that
1643highmem can be used for, but it is also available for the
1644kernel's use for its own data structures.
1645Among many other things,
99e91586 1646it is where everything from
7bccb7d4
DP
1647.I Slab
1648is allocated.
3ba3d5b1
MK
1649Bad things happen when you're out of lowmem.
1650.TP
1651.IR LowFree " %lu
1652(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1653Amount of free lowmem.
1654.TP
1655.IR MmapCopy " %lu (since Linux 2.6.29)"
99e91586
DP
1656.RB ( CONFIG_MMU
1657is required.)
3ba3d5b1
MK
1658[To be documented.]
1659.TP
1660.IR SwapTotal " %lu"
1661Total amount of swap space available.
1662.TP
1663.IR SwapFree " %lu"
c16d4f25 1664Amount of swap space that is currently unused.
3ba3d5b1
MK
1665.TP
1666.IR Dirty " %lu"
1667Memory which is waiting to get written back to the disk.
1668.TP
1669.IR Writeback " %lu"
1670Memory which is actively being written back to the disk.
1671.TP
1672.IR AnonPages " %lu (since Linux 2.6.18)"
1673Non-file backed pages mapped into user-space page tables.
1674.TP
1675.IR Mapped " %lu"
1676Files which have been mmaped, such as libraries.
1677.TP
1678.IR Shmem " %lu (since Linux 2.6.32)"
1679[To be documented.]
1680.TP
1681.IR Slab " %lu"
1682In-kernel data structures cache.
1683.TP
1684.IR SReclaimable " %lu (since Linux 2.6.19)"
7bccb7d4
DP
1685Part of
1686.IR Slab ,
1687that might be reclaimed, such as caches.
3ba3d5b1
MK
1688.TP
1689.IR SUnreclaim " %lu (since Linux 2.6.19)"
7bccb7d4
DP
1690Part of
1691.IR Slab ,
1692that cannot be reclaimed on memory pressure.
3ba3d5b1
MK
1693.TP
1694.IR KernelStack " %lu (since Linux 2.6.32)"
1695Amount of memory allocated to kernel stacks.
1696.TP
1697.IR PageTables " %lu (since Linux 2.6.18)"
1698Amount of memory dedicated to the lowest level of page tables.
1699.TP
1700.IR Quicklists " %lu (since Linux 2.6.27)"
1701(\fBCONFIG_QUICKLIST\fP is required.)
1702[To be documented.]
1703.TP
1704.IR NFS_Unstable " %lu (since Linux 2.6.18)"
1705NFS pages sent to the server, but not yet committed to stable storage.
1706.TP
1707.IR Bounce " %lu (since Linux 2.6.18)"
1708Memory used for block device "bounce buffers".
1709.TP
1710.IR WritebackTmp " %lu (since Linux 2.6.26)"
1711Memory used by FUSE for temporary writeback buffers.
1712.TP
1713.IR CommitLimit " %lu (since Linux 2.6.10)"
1714Based on the overcommit ratio ('vm.overcommit_ratio'),
1715this is the total amount of memory currently available to
1716be allocated on the system. This limit is only adhered to
1717if strict overcommit accounting is enabled (mode 2 in
1718.IR /proc/sys/vm/overcommit_ratio ).
1719The
1720.I CommitLimit
1721is calculated using the following formula:
1722
1723 CommitLimit = (overcommit_ratio * Physical RAM) + Swap
1724
1725For example, on a system with 1GB of physical RAM and 7GB
1726of swap with a
1727.I overcommit_ratio
1728of 30, this formula yields a
1729.I CommitLimit
99e91586 1730of 7.3GB.
3ba3d5b1 1731For more details, see the memory overcommit documentation
99e91586 1732in the kernel source file
3ba3d5b1
MK
1733.IR Documentation/vm/overcommit-accounting .
1734.TP
1735.IR Committed_AS " %lu"
1736The amount of memory presently allocated on the system.
1737The committed memory is a sum of all of the memory which
1738has been allocated by processes, even if it has not been
1739"used" by them as of yet.
1740A process which allocates 1GB of memory (using
1741.BR malloc (3)
1742or similar), but only touches 300MB of that memory will only show up
1743as using 300MB of memory even if it has the address space
1744allocated for the entire 1GB.
1745This 1GB is memory which has been "committed" to by the VM
1746and can be used at any time by the allocating application.
1747With strict overcommit enabled on the system (mode 2
99e91586 1748.IR /proc/sys/vm/overcommit_memory ),
3ba3d5b1
MK
1749allocations which would exceed the
1750.I CommitLimit
1751(detailed above) will not be permitted.
1752This is useful if one needs to guarantee that processes will not
1753fail due to lack of memory once that memory has been successfully allocated.
1754.TP
1755.IR VmallocTotal " %lu"
1756Total size of vmalloc memory area.
1757.TP
1758.IR VmallocUsed " %lu"
1759Amount of vmalloc area which is used.
1760.TP
1761.IR VmallocChunk " %lu"
1762Largest contiguous block of vmalloc area which is free.
1763.TP
1764.IR HardwareCorrupted " %lu (since Linux 2.6.32)"
1765(\fBCONFIG_MEMORY_FAILURE\fP is required.)
1766[To be documented.]
1767.TP
1768.IR AnonHugePages " %lu (since Linux 2.6.38)"
1769(\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.)
7fac88a9 1770Non-file backed huge pages mapped into user-space page tables.
3ba3d5b1
MK
1771.TP
1772.IR HugePages_Total " %lu"
1773(\fBCONFIG_HUGETLB_PAGE\fP is required.)
1774The size of the pool of huge pages.
1775.TP
1776.IR HugePages_Free " %lu"
1777(\fBCONFIG_HUGETLB_PAGE\fP is required.)
1778The number of huge pages in the pool that are not yet allocated.
1779.TP
1780.IR HugePages_Rsvd " %lu (since Linux 2.6.17)"
1781(\fBCONFIG_HUGETLB_PAGE\fP is required.)
1782This is the number of huge pages for
1783which a commitment to allocate from the pool has been made,
1784but no allocation has yet been made.
1785These reserved huge pages
1786guarantee that an application will be able to allocate a
1787huge page from the pool of huge pages at fault time.
1788.TP
aa8a6b4f 1789.IR HugePages_Surp " %lu (since Linux 2.6.24)"
3ba3d5b1
MK
1790(\fBCONFIG_HUGETLB_PAGE\fP is required.)
1791This is the number of huge pages in
1792the pool above the value in
1793.IR /proc/sys/vm/nr_hugepages .
1794The maximum number of surplus huge pages is controlled by
1795.IR /proc/sys/vm/nr_overcommit_hugepages .
1796.TP
1797.IR Hugepagesize " %lu"
1798(\fBCONFIG_HUGETLB_PAGE\fP is required.)
1799The size of huge pages.
1800.RE
fea681da 1801.TP
aa341984
MK
1802.I /proc/modules
1803A text list of the modules that have been loaded by the system.
1804See also
1805.BR lsmod (8).
1806.TP
fea681da 1807.I /proc/mounts
c1eea65a
MK
1808Before kernel 2.4.19, this file was a list
1809of all the file systems currently mounted on the system.
732e54dd 1810With the introduction of per-process mount namespaces in
c1eea65a
MK
1811Linux 2.4.19, this file became a link to
1812.IR /proc/self/mounts ,
732e54dd 1813which lists the mount points of the process's own mount namespace.
fea681da 1814The format of this file is documented in
31e9a9ec 1815.BR fstab (5).
fea681da 1816.TP
fea681da 1817.I /proc/mtrr
c13182ef 1818Memory Type Range Registers.
66a9882e 1819See the Linux kernel source file
cfe70b66 1820.I Documentation/mtrr.txt
fea681da
MK
1821for details.
1822.TP
1823.I /proc/net
1824various net pseudo-files, all of which give the status of some part of
c13182ef
MK
1825the networking layer.
1826These files contain ASCII structures and are,
59a40ed7
MK
1827therefore, readable with
1828.BR cat (1).
c13182ef 1829However, the standard
fea681da
MK
1830.BR netstat (8)
1831suite provides much cleaner access to these files.
1832.TP
1833.I /proc/net/arp
1834This holds an ASCII readable dump of the kernel ARP table used for
c13182ef 1835address resolutions.
01d0a447 1836It will show both dynamically learned and preprogrammed ARP entries.
c13182ef 1837The format is:
fea681da
MK
1838
1839.nf
1840.ft CW
1841.in 8n
1842IP address HW type Flags HW address Mask Device
1843192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0
1844192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0
1845.ft
1846.fi
1847.in
1848
6c04f928 1849Here "IP address" is the IPv4 address of the machine and the "HW type"
c13182ef
MK
1850is the hardware type of the address from RFC\ 826.
1851The flags are the internal
9a67332e
MK
1852flags of the ARP structure (as defined in
1853.IR /usr/include/linux/if_arp.h )
1854and
6c04f928 1855the "HW address" is the data link layer mapping for that IP address if
fea681da
MK
1856it is known.
1857.TP
1858.I /proc/net/dev
c13182ef
MK
1859The dev pseudo-file contains network device status information.
1860This gives
1861the number of received and sent packets, the number of errors and
fea681da 1862collisions
c13182ef
MK
1863and other basic statistics.
1864These are used by the
fea681da 1865.BR ifconfig (8)
c13182ef
MK
1866program to report device status.
1867The format is:
fea681da
MK
1868
1869.nf
1870.ft CW
1871.in 1n
1872Inter-| Receive | Transmit
1873 face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
1874 lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0
1875 eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0
1876 ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0
1877 tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0
1878.in
1879.ft
1880.fi
1881.\" .TP
1882.\" .I /proc/net/ipx
1883.\" No information.
1884.\" .TP
1885.\" .I /proc/net/ipx_route
1886.\" No information.
1887.TP
1888.I /proc/net/dev_mcast
1889Defined in
1890.IR /usr/src/linux/net/core/dev_mcast.c :
1891.nf
1892.in +5
9fdfa163 1893indx interface_name dmi_u dmi_g dmi_address
fea681da
MK
18942 eth0 1 0 01005e000001
18953 eth1 1 0 01005e000001
18964 eth2 1 0 01005e000001
1897.in
1898.fi
1899.TP
1900.I /proc/net/igmp
c13182ef
MK
1901Internet Group Management Protocol.
1902Defined in
fea681da
MK
1903.IR /usr/src/linux/net/core/igmp.c .
1904.TP
1905.I /proc/net/rarp
1906This file uses the same format as the
1907.I arp
1908file and contains the current reverse mapping database used to provide
1909.BR rarp (8)
c13182ef
MK
1910reverse address lookup services.
1911If RARP is not configured into the
fea681da
MK
1912kernel,
1913this file will not be present.
1914.TP
1915.I /proc/net/raw
c13182ef
MK
1916Holds a dump of the RAW socket table.
1917Much of the information is not of
fea681da 1918use
c13182ef 1919apart from debugging.
6c04f928 1920The "sl" value is the kernel hash slot for the
fea681da 1921socket,
6c04f928
MK
1922the "local_address" is the local address and protocol number pair.
1923\&"St" is
c13182ef
MK
1924the internal status of the socket.
1925The "tx_queue" and "rx_queue" are the
fea681da 1926outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 1927The "tr", "tm\->when", and "rexmits" fields are not used by RAW.
fdc196f5
MK
1928The "uid"
1929field holds the effective UID of the creator of the socket.
fea681da
MK
1930.\" .TP
1931.\" .I /proc/net/route
1932.\" No information, but looks similar to
1933.\" .BR route (8).
1934.TP
1935.I /proc/net/snmp
c13182ef 1936This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP
fea681da 1937management
763f0e47 1938information bases for an SNMP agent.
fea681da
MK
1939.TP
1940.I /proc/net/tcp
c13182ef
MK
1941Holds a dump of the TCP socket table.
1942Much of the information is not
1943of use apart from debugging.
1944The "sl" value is the kernel hash slot
6beb1671
MK
1945for the socket, the "local_address" is the local address and port number pair.
1946The "rem_address" is the remote address and port number pair
6c04f928
MK
1947(if connected).
1948\&"St" is the internal status of the socket.
1949The "tx_queue" and "rx_queue" are the
fea681da 1950outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 1951The "tr", "tm\->when", and "rexmits" fields hold internal information of
fdc196f5
MK
1952the kernel socket state and are only useful for debugging.
1953The "uid"
1954field holds the effective UID of the creator of the socket.
fea681da
MK
1955.TP
1956.I /proc/net/udp
c13182ef
MK
1957Holds a dump of the UDP socket table.
1958Much of the information is not of
1959use apart from debugging.
1960The "sl" value is the kernel hash slot for the
6beb1671
MK
1961socket, the "local_address" is the local address and port number pair.
1962The "rem_address" is the remote address and port number pair
fea681da
MK
1963(if connected). "St" is the internal status of the socket.
1964The "tx_queue" and "rx_queue" are the outgoing and incoming data queue
c13182ef 1965in terms of kernel memory usage.
94e9d9fe 1966The "tr", "tm\->when", and "rexmits" fields
c13182ef 1967are not used by UDP.
fdc196f5
MK
1968The "uid"
1969field holds the effective UID of the creator of the socket.
fea681da
MK
1970The format is:
1971
1972.nf
1973.ft CW
1974.in 1n
94e9d9fe 1975sl local_address rem_address st tx_queue rx_queue tr rexmits tm\->when uid
fea681da
MK
1976 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0
1977 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0
1978 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0
1979.in
1980.ft
1981.fi
1982.TP
1983.I /proc/net/unix
008f1ecc 1984Lists the UNIX domain sockets present within the system and their
c13182ef
MK
1985status.
1986The format is:
fea681da
MK
1987.nf
1988.sp .5
1989.ft CW
1990Num RefCount Protocol Flags Type St Path
1991 0: 00000002 00000000 00000000 0001 03
1992 1: 00000001 00000000 00010000 0001 01 /dev/printer
1993.ft
1994.sp .5
1995.fi
1996
6c04f928
MK
1997Here "Num" is the kernel table slot number, "RefCount" is the number
1998of users of the socket, "Protocol" is currently always 0, "Flags"
fea681da 1999represent the internal kernel flags holding the status of the
c13182ef 2000socket.
008f1ecc 2001Currently, type is always "1" (UNIX domain datagram sockets are
6c04f928
MK
2002not yet supported in the kernel).
2003\&"St" is the internal state of the
fea681da
MK
2004socket and Path is the bound path (if any) of the socket.
2005.TP
2006.I /proc/partitions
2007Contains major and minor numbers of each partition as well as number
2008of blocks and partition name.
2009.TP
2010.I /proc/pci
2011This is a listing of all PCI devices found during kernel initialization
2012and their configuration.
2990d781 2013
59a40ed7
MK
2014This file has been deprecated in favor of a new
2015.I /proc
2990d781
MK
2016interface for PCI
2017.RI ( /proc/bus/pci ).
2018It became optional in Linux 2.2 (available with
2019.B CONFIG_PCI_OLD_PROC
2020set at kernel compilation).
24b74457 2021It became once more nonoptionally enabled in Linux 2.4.
2990d781
MK
2022Next, it was deprecated in Linux 2.6 (still available with
2023.B CONFIG_PCI_LEGACY_PROC
2024set), and finally removed altogether since Linux 2.6.17.
b4e9ee8f
MK
2025.\" FIXME /proc/sched_debug
2026.\" .TP
2027.\" .IR /proc/sched_debug " (since Linux 2.6.23)"
69119dc7 2028.\" See also /proc/[pid]/sched
caea7868
MK
2029.TP
2030.IR /proc/profile " (since Linux 2.4)"
2031This file is present only if the kernel was booted with the
2032.I profile=1
2033command-line option.
2034It exposes kernel profiling information in a binary format for use by
2035.BR readprofile (1).
2036Writing (e.g., an empty string) to this file resets the profiling counters;
2037on some architectures,
2038writing a binary integer "profiling multiplier" of size
2039.IR sizeof(int)
8a3ac89a 2040sets the profiling interrupt frequency.
fea681da
MK
2041.TP
2042.I /proc/scsi
59a40ed7
MK
2043A directory with the
2044.I scsi
2045mid-level pseudo-file and various SCSI low-level
2990d781
MK
2046driver directories,
2047which contain a file for each SCSI host in this system, all of
c13182ef
MK
2048which give the status of some part of the SCSI IO subsystem.
2049These files contain ASCII structures and are, therefore, readable with
2990d781 2050.BR cat (1).
fea681da 2051
c13182ef 2052You can also write to some of the files to reconfigure the subsystem or
59a40ed7 2053switch certain features on or off.
fea681da
MK
2054.TP
2055.I /proc/scsi/scsi
c13182ef 2056This is a listing of all SCSI devices known to the kernel.
59a40ed7 2057The listing is similar to the one seen during bootup.
c13182ef 2058scsi currently supports only the \fIadd-single-device\fP command which
59a40ed7
MK
2059allows root to add a hotplugged device to the list of known devices.
2060
2061The command
2062.in +4n
2063.nf
2064
2065echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi
fea681da 2066
59a40ed7
MK
2067.fi
2068.in
c13182ef
MK
2069will cause
2070host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0.
2071If there
fea681da
MK
2072is already a device known on this address or the address is invalid, an
2073error will be returned.
2074.TP
2075.I /proc/scsi/[drivername]
c13182ef
MK
2076\fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740,
2077aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic,
2078scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000.
2079These directories show up for all drivers that registered at least one
59a40ed7 2080SCSI HBA.
c13182ef 2081Every directory contains one file per registered host.
59a40ed7 2082Every host-file is named after the number the host was assigned during
c13182ef 2083initialization.
fea681da 2084
c13182ef 2085Reading these files will usually show driver and host configuration,
59a40ed7 2086statistics, etc.
fea681da
MK
2087
2088Writing to these files allows different things on different hosts.
2089For example, with the \fIlatency\fP and \fInolatency\fP commands,
2090root can switch on and off command latency measurement code in the
c13182ef
MK
2091eata_dma driver.
2092With the \fIlockup\fP and \fIunlock\fP commands,
2093root can control bus lockups simulated by the scsi_debug driver.
fea681da
MK
2094.TP
2095.I /proc/self
59a40ed7
MK
2096This directory refers to the process accessing the
2097.I /proc
2098file system,
2099and is identical to the
2100.I /proc
2101directory named by the process ID of the same process.
fea681da
MK
2102.TP
2103.I /proc/slabinfo
c13182ef 2104Information about kernel caches.
821643a8
MK
2105Since Linux 2.6.16 this file is only present if the
2106.B CONFIG_SLAB
2107kernel configuration option is enabled.
350038ff 2108The columns in
38f76cd2 2109.I /proc/slabinfo
350038ff 2110are:
a08ea57c 2111.in +4n
fea681da 2112.nf
a08ea57c 2113
fea681da
MK
2114cache-name
2115num-active-objs
2116total-objs
2117object-size
2118num-active-slabs
2119total-slabs
2120num-pages-per-slab
2121.fi
a08ea57c
MK
2122.in
2123
c13182ef 2124See
fea681da
MK
2125.BR slabinfo (5)
2126for details.
2127.TP
2128.I /proc/stat
c13182ef
MK
2129kernel/system statistics.
2130Varies with architecture.
2131Common
fea681da
MK
2132entries include:
2133.RS
2134.TP
2135\fIcpu 3357 0 4313 1362393\fP
bfbfcd18 2136The amount of time, measured in units of
268f000b
MK
2137USER_HZ (1/100ths of a second on most architectures, use
2138.IR sysconf(_SC_CLK_TCK)
2139to obtain the right value),
b81087ab 2140.\" 1024 on Alpha and ia64
ae3b8047
MK
2141that the system spent in various states:
2142.RS
2143.TP
2144.I user
ea0841f6 2145(1) Time spent in user mode.
ae3b8047
MK
2146.TP
2147.I nice
0633f951 2148(2) Time spent in user mode with low priority (nice).
9f1b9726 2149.TP
ae3b8047 2150.I system
0633f951 2151(3) Time spent in system mode.
ae3b8047
MK
2152.TP
2153.I idle
ea0841f6 2154(4) Time spent in the idle task.
b09b8526 2155.\" FIXME Actually, the following info about the /proc/stat 'cpu' field
e04a1f93
MK
2156.\" does not seem to be quite right (at least in 2.6.12 or 3.6):
2157.\" the idle time in /proc/uptime does not quite match this value
2158This value should be USER_HZ times the
4cb1deb7
MK
2159second entry in the
2160.I /proc/uptime
2161pseudo-file.
ae3b8047
MK
2162.TP
2163.IR iowait " (since Linux 2.5.41)"
ea0841f6 2164(5) Time waiting for I/O to complete.
ae3b8047
MK
2165.TP
2166.IR irq " (since Linux 2.6.0-test4)"
ea0841f6 2167(6) Time servicing interrupts.
ae3b8047 2168.TP
0633f951 2169.IR softirq " (since Linux 2.6.0-test4)"
ea0841f6 2170(7) Time servicing softirqs.
ae3b8047
MK
2171.TP
2172.IR steal " (since Linux 2.6.11)"
ea0841f6 2173(8) Stolen time, which is the time spent in other operating systems when
9de1f6cc 2174running in a virtualized environment
ae3b8047
MK
2175.TP
2176.IR guest " (since Linux 2.6.24)"
0633f951 2177(9) Time spent running a virtual CPU for guest
afef1764 2178operating systems under the control of the Linux kernel.
14c06953 2179.\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de
d4fd4120
MK
2180.TP
2181.IR guest_nice " (since Linux 2.6.33)"
2182.\" commit ce0e7b28fb75cb003cfc8d0238613aaf1c55e797
2183(10) Time spent running a niced guest (virtual CPU for guest
2184operating systems under the control of the Linux kernel).
ae3b8047 2185.RE
fea681da
MK
2186.TP
2187\fIpage 5741 1808\fP
2188The number of pages the system paged in and the number that were paged
2189out (from disk).
2190.TP
2191\fIswap 1 0\fP
2192The number of swap pages that have been brought in and out.
2193.TP
c13182ef 2194.\" FIXME The following is not the full picture for the 'intr' of
777f5a9e 2195.\" /proc/stat on 2.6:
fea681da 2196\fIintr 1462898\fP
bfbfcd18
MK
2197This line shows counts of interrupts serviced since boot time,
2198for each of the possible system interrupts.
2199The first column is the total of all interrupts serviced;
2200each subsequent column is the total for a particular interrupt.
fea681da
MK
2201.TP
2202\fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP...
636297e9 2203(major,disk_idx):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written)
bfbfcd18
MK
2204.br
2205(Linux 2.4 only)
fea681da
MK
2206.TP
2207\fIctxt 115315\fP
2208The number of context switches that the system underwent.
2209.TP
2210\fIbtime 769041601\fP
f49c451a 2211boot time, in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
fea681da
MK
2212.TP
2213\fIprocesses 86031\fP
2214Number of forks since boot.
bfbfcd18
MK
2215.TP
2216\fIprocs_running 6\fP
2217Number of processes in runnable state.
5fab2e7c 2218(Linux 2.5.45 onward.)
bfbfcd18
MK
2219.TP
2220\fIprocs_blocked 2\fP
2221Number of processes blocked waiting for I/O to complete.
5fab2e7c 2222(Linux 2.5.45 onward.)
fea681da
MK
2223.RE
2224.TP
2225.I /proc/swaps
c13182ef
MK
2226Swap areas in use.
2227See also
fea681da
MK
2228.BR swapon (8).
2229.TP
2230.I /proc/sys
2231This directory (present since 1.3.57) contains a number of files
2232and subdirectories corresponding to kernel variables.
2233These variables can be read and sometimes modified using
5a2ff571 2234the \fI/proc\fP file system, and the (deprecated)
fea681da 2235.BR sysctl (2)
c13182ef 2236system call.
fea681da 2237.TP
6ab7c0aa 2238.IR /proc/sys/abi " (since Linux 2.4.10)"
fea681da 2239This directory may contain files with application binary information.
6ab7c0aa 2240.\" On some systems, it is not present.
66a9882e 2241See the Linux kernel source file
6ab7c0aa
MK
2242.I Documentation/sysctl/abi.txt
2243for more information.
fea681da
MK
2244.TP
2245.I /proc/sys/debug
2246This directory may be empty.
2247.TP
2248.I /proc/sys/dev
e2badfdf 2249This directory contains device-specific information (e.g.,
9a67332e 2250.IR dev/cdrom/info ).
fea681da
MK
2251On
2252some systems, it may be empty.
2253.TP
2254.I /proc/sys/fs
49236d3c
MK
2255This directory contains the files and subdirectories for kernel variables
2256related to file systems.
fea681da
MK
2257.TP
2258.I /proc/sys/fs/binfmt_misc
c13182ef 2259Documentation for files in this directory can be found
66a9882e 2260in the Linux kernel sources in
fea681da
MK
2261.IR Documentation/binfmt_misc.txt .
2262.TP
59a40ed7
MK
2263.IR /proc/sys/fs/dentry-state " (since Linux 2.2)"
2264This file contains information about the status of the
2265directory cache (dcache).
2266The file contains six numbers,
c13182ef 2267.IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), "
59a40ed7 2268.I want_pages
fea681da 2269(pages requested by system) and two dummy values.
59a40ed7
MK
2270.RS
2271.IP * 2
2272.I nr_dentry
2273is the number of allocated dentries (dcache entries).
2274This field is unused in Linux 2.2.
2275.IP *
2276.I nr_unused
2277is the number of unused dentries.
2278.IP *
2279.I age_limit
2280.\" looks like this is unused in kernels 2.2 to 2.6
2281is the age in seconds after which dcache entries
2282can be reclaimed when memory is short.
2283.IP *
2284.I want_pages
2285.\" looks like this is unused in kernels 2.2 to 2.6
c7094399 2286is nonzero when the kernel has called shrink_dcache_pages() and the
fea681da 2287dcache isn't pruned yet.
59a40ed7 2288.RE
fea681da
MK
2289.TP
2290.I /proc/sys/fs/dir-notify-enable
2291This file can be used to disable or enable the
2292.I dnotify
2293interface described in
2294.BR fcntl (2)
2295on a system-wide basis.
2296A value of 0 in this file disables the interface,
2297and a value of 1 enables it.
2298.TP
2299.I /proc/sys/fs/dquot-max
2300This file shows the maximum number of cached disk quota entries.
2301On some (2.4) systems, it is not present.
2302If the number of free cached disk quota entries is very low and
2303you have some awesome number of simultaneous system users,
2304you might want to raise the limit.
2305.TP
2306.I /proc/sys/fs/dquot-nr
2307This file shows the number of allocated disk quota
2308entries and the number of free disk quota entries.
2309.TP
24cb4a4b 2310.IR /proc/sys/fs/epoll " (since Linux 2.6.28)"
242b46af
MK
2311This directory contains the file
2312.IR max_user_watches ,
24cb4a4b
MK
2313which can be used to limit the amount of kernel memory consumed by the
2314.I epoll
2315interface.
2316For further details, see