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