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