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