]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/proc.5
setxattr.2: ERRORS: add ENOTSUP for invalid namespace prefix
[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.\"
bea08fec 51.\" FIXME . cross check against Documentation/filesystems/proc.txt
c13182ef 52.\" to see what information could be imported from that file
c533af9d 53.\" into this file.
fea681da 54.\"
8392a3b3 55.TH PROC 5 2015-01-22 "Linux" "Linux Programmer's Manual"
fea681da 56.SH NAME
9ee4a2b6 57proc \- process information pseudo-filesystem
fea681da
MK
58.SH DESCRIPTION
59The
60.I proc
ac8727b6 61filesystem is a pseudo-filesystem which provides an interface to
c13182ef
MK
62kernel data structures.
63It is commonly mounted at
fea681da 64.IR /proc .
c13182ef 65Most of it is read-only, but some files allow kernel variables to be
fea681da
MK
66changed.
67.LP
ac8727b6 68The following list describes many of the files and directories under the
743638fd
MK
69.I /proc
70hierarchy.
fea681da
MK
71.PD 1
72.TP
69119dc7 73.I /proc/[pid]
fea681da
MK
74There is a numerical subdirectory for each running process; the
75subdirectory is named by the process ID.
76Each such subdirectory contains the following
77pseudo-files and directories.
69119dc7 78.\" FIXME Describe /proc/[pid]/attr and
b3fb99e8
MK
79.\" /proc/[pid]/task/[tid]/attr
80.\" This is a directory
81.\" Added in 2.6.0
82.\" CONFIG_SECURITY
83.\" https://lwn.net/Articles/28222/
84.\" http://www.nsa.gov/research/_files/selinux/papers/module/x362.shtml
85.\"
86.\" fscreate, current, prev, and exec present in Linux 2.6.0
87.\" keycreate added in Linux 2.6.18
88.\" commit 4eb582cf1fbd7b9e5f466e3718a59c957e75254e
89.\" /Documentation/keys.txt
90.\" sockcreate added in Linux 2.6.18
91.\" commit 42c3e03ef6b298813557cdb997bd6db619cd65a2
92.\"
93.\" FIXME Describe /proc/[pid]/autogroup
94.\" 2.6.38
95.\" commit 5091faa449ee0b7d73bc296a93bca9540fc51d0a
96.\" CONFIG_SCHED_AUTOGROUP
b4e9ee8f 97.\"
fea681da 98.TP
69119dc7 99.IR /proc/[pid]/auxv " (since 2.6.0-test7)"
857f1942 100This contains the contents of the ELF interpreter information passed
c13182ef 101to the process at exec time.
857f1942 102The format is one \fIunsigned long\fP ID
c13182ef 103plus one \fIunsigned long\fP value for each entry.
857f1942 104The last entry contains two zeros.
4c69c692
MK
105See also
106.BR getauxval (3).
b5d204d0 107.TP
8d708d6b 108.IR /proc/[pid]/cgroup " (since Linux 2.6.24)"
b5d204d0
MK
109.\" Info in Documentation/cgroups/cgroups.txt
110This file describes control groups to which the process/task belongs.
111For each cgroup hierarchy there is one entry containing
112colon-separated fields of the form:
113.nf
114.ft CW
115
116 5:cpuacct,cpu,cpuset:/daemons
117.ft
118.fi
119.IP
120The colon-separated fields are, from left to right:
121.RS 11
122.IP 1. 3
123hierarchy ID number
124.IP 2.
125set of subsystems bound to the hierarchy
126.IP 3.
127control group in the hierarchy to which the process belongs
128.RE
129.IP
90878f7c 130This file is present only if the
b5d204d0
MK
131.B CONFIG_CGROUPS
132kernel configuration option is enabled.
76e0451c
MK
133.TP
134.IR /proc/[pid]/clear_refs " (since Linux 2.6.22)"
135.\" commit b813e931b4c8235bb42e301096ea97dbdee3e8fe (2.6.22)
136.\" commit 398499d5f3613c47f2143b8c54a04efb5d7a6da9 (2.6.32)
137.\" commit 040fa02077de01c7e08fa75be6125e4ca5636011 (3.11)
b4e9ee8f 138.\"
b4e9ee8f 139.\" "Clears page referenced bits shown in smaps output"
76e0451c
MK
140.\" write-only, writable only by the owner of the process
141
142This is a write-only file, writable only by owner of the process.
143
144The following values may be written to the file:
145.RS
146.TP
1471 (since Linux 2.6.22)
148.\" Internally: CLEAR_REFS_ALL
149Reset the PG_Referenced and ACCESSED/YOUNG
150bits for all the pages associated with the process.
151(Before kernel 2.6.32, writing any nonzero value to this file
152had this effect.)
153.TP
1542 (since Linux 2.6.32)
155.\" Internally: CLEAR_REFS_ANON
156Reset the PG_Referenced and ACCESSED/YOUNG
157bits for all anonymous pages associated with the process.
158.TP
1593 (since Linux 2.6.32)
160.\" Internally: CLEAR_REFS_MAPPED
161Reset the PG_Referenced and ACCESSED/YOUNG
162bits for all file-mapped pages associated with the process.
163.RE
164.IP
165Clearing the PG_Referenced and ACCESSED/YOUNG bits provides a method
166to measure approximately how much memory a process is using.
322d49fb 167One first inspects the values in the "Referenced" fields
76e0451c
MK
168for the VMAs shown in
169.IR /proc/[pid]/smaps
170to get an idea of the memory footprint of the
171process.
172One then clears the PG_Referenced and ACCESSED/YOUNG bits
173and, after some measured time interval,
322d49fb 174once again inspects the values in the "Referenced" fields
76e0451c
MK
175to get an idea of the change in memory footprint of the
176process during the measured interval.
177If one is interested only in inspecting the selected mapping types,
178then the value 2 or 3 can be used instead of 1.
179
180A further value can be written to affect a different bit:
181.RS
182.TP
1834 (since Linux 3.11)
184Clear the soft-dirty bit for all the pages associated with the process.
185.\" Internally: CLEAR_REFS_SOFT_DIRTY
186This is used (in conjunction with
187.IR /proc/[pid]/pagemap )
188by the check-point restore system to discover which pages of a process
189have been dirtied since the file
190.IR /proc/[pid]/clear_refs
191was written to.
192.RE
193.IP
194Writing any value to
195.IR /proc/[pid]/clear_refs
196other than those listed above has no effect.
197
198The
199.IR /proc/[pid]/clear_refs
200file is present only if the
201.B CONFIG_PROC_PAGE_MONITOR
202kernel configuration option is enabled.
857f1942 203.TP
69119dc7 204.I /proc/[pid]/cmdline
6975c16e 205This read-only file holds the complete command line for the process,
b447cd58
MK
206unless the process is a zombie.
207.\" In 2.3.26, this also used to be true if the process was swapped out.
208In the latter case, there is nothing in this file:
75b94dc3 209that is, a read on this file will return 0 characters.
b447cd58 210The command-line arguments appear in this file as a set of
6596d270
MK
211strings separated by null bytes (\(aq\\0\(aq),
212with a further null byte after the last string.
32d7ef00
MK
213.TP
214.IR /proc/[pid]/comm " (since Linux 2.6.33)"
215.\" commit 4614a696bd1c3a9af3a08f0e5874830a85b889d4
216This file exposes the process's
217.I comm
218value\(emthat is, the command name associated with the process.
219Different threads in the same process may have different
220.I comm
221values, accessible via
222.IR /proc/[pid]/task/[tid]/comm .
223A thread may modify its
224.I comm
225value, or that of any of other thread in the same thread group (see
226the discussion of
227.B CLONE_THREAD
228in
229.BR clone (2)),
230by writing to the file
231.IR /proc/self/task/[tid]/comm .
232Strings longer than
233.B TASK_COMM_LEN
234(16) characters are silently truncated.
235
ef4f4031 236This file provides a superset of the
32d7ef00
MK
237.BR prctl (2)
238.B PR_SET_NAME
239and
240.B PR_GET_NAME
241operations, and is employed by
242.BR pthread_setname_np (3)
243when used to rename threads other than the caller.
fea681da 244.TP
7e07d950 245.IR /proc/[pid]/coredump_filter " (since Linux 2.6.23)"
b4e9ee8f
MK
246See
247.BR core (5).
5c411b17 248.TP
7e07d950
MK
249.IR /proc/[pid]/cpuset " (since Linux 2.6.12)"
250.\" and/proc/[pid]/task/[tid]/cpuset
5c411b17
MK
251See
252.BR cpuset (7).
b4e9ee8f 253.TP
69119dc7 254.I /proc/[pid]/cwd
c13182ef 255This is a symbolic link to the current working directory of the process.
59a40ed7
MK
256To find out the current working directory of process 20,
257for instance, you can do this:
fea681da 258
59a40ed7 259.in +4n
fea681da 260.nf
b43a3b30 261.RB "$" " cd /proc/20/cwd; /bin/pwd"
fea681da 262.fi
59a40ed7 263.in
fea681da 264
c13182ef
MK
265Note that the
266.I pwd
e7b489f0 267command is often a shell built-in, and might
c13182ef 268not work properly.
743638fd
MK
269In
270.BR bash (1),
271you may use
272.IR "pwd\ \-P" .
afcaf646
MK
273
274.\" The following was still true as at kernel 2.6.13
c13182ef
MK
275In a multithreaded process, the contents of this symbolic link
276are not available if the main thread has already terminated
afcaf646 277(typically by calling
59a40ed7 278.BR pthread_exit (3)).
fea681da 279.TP
69119dc7 280.I /proc/[pid]/environ
fea681da 281This file contains the environment for the process.
f81fb444 282The entries are separated by null bytes (\(aq\\0\(aq),
b4e9ee8f 283and there may be a null byte at the end.
fea681da 284Thus, to print out the environment of process 1, you would do:
a08ea57c 285.in +4n
fea681da 286.nf
a08ea57c 287
fea681da 288.ft CW
13912780 289.RB "$" " strings /proc/1/environ"
fea681da
MK
290.fi
291.ft P
a08ea57c 292.in
fea681da 293.TP
69119dc7 294.I /proc/[pid]/exe
fea681da 295Under Linux 2.2 and later, this file is a symbolic link
2d7195b8 296containing the actual pathname of the executed command.
c13182ef
MK
297This symbolic link can be dereferenced normally; attempting to open
298it will open the executable.
299You can even type
69119dc7 300.I /proc/[pid]/exe
c13182ef 301to run another copy of the same executable as is being run by
69119dc7 302process [pid].
afcaf646 303.\" The following was still true as at kernel 2.6.13
c13182ef
MK
304In a multithreaded process, the contents of this symbolic link
305are not available if the main thread has already terminated
afcaf646
MK
306(typically by calling
307.BR pthread_exit (3)).
fea681da 308
eb9a0b2f 309Under Linux 2.0 and earlier,
69119dc7 310.I /proc/[pid]/exe
c13182ef
MK
311is a pointer to the binary which was executed,
312and appears as a symbolic link.
313A
fea681da
MK
314.BR readlink (2)
315call on this file under Linux 2.0 returns a string in the format:
316
59a40ed7 317 [device]:inode
fea681da
MK
318
319For example, [0301]:1502 would be inode 1502 on device major 03 (IDE,
320MFM, etc. drives) minor 01 (first partition on the first drive).
321
322.BR find (1)
59a40ed7
MK
323with the
324.I \-inum
325option can be used to locate the file.
fea681da 326.TP
d4529654 327.I /proc/[pid]/fd/
fea681da
MK
328This is a subdirectory containing one entry for each file which the
329process has open, named by its file descriptor, and which is a
c13182ef 330symbolic link to the actual file.
f78ed33a 331Thus, 0 is standard input, 1 standard output, 2 standard error, and so on.
fea681da 332
f75715e0
MK
333For file descriptors for pipes and sockets,
334the entries will be symbolic links whose content is the
335file type with the inode.
d4529654
MF
336A
337.BR readlink (2)
338call on this file returns a string in the format:
f75715e0 339
d4529654 340 type:[inode]
f75715e0
MK
341
342For example,
343.I socket:[2248868]
344will be a socket and its inode is 2248868.
345For sockets, that inode can be used to find more information
346in one of the files under
d4529654
MF
347.IR /proc/net/ .
348
2b7a2ac5
MK
349For file descriptors that have no corresponding inode
350(e.g., file descriptors produced by
351.BR epoll_create (2),
352.BR eventfd (2),
353.BR inotify_init (2),
354.BR signalfd (2),
355and
356.BR timerfd (2)),
357the entry will be a symbolic link with contents of the form
358
359 anon_inode:<file-type>
360
361In some cases, the
362.I file-type
363is surrounded by square brackets.
364
365For example, an epoll file descriptor will have a symbolic link
366whose content is the string
367.IR "anon_inode:[eventpoll]" .
368
d4529654 369.\"The following was still true as at kernel 2.6.13
afcaf646 370In a multithreaded process, the contents of this directory
c13182ef 371are not available if the main thread has already terminated
afcaf646
MK
372(typically by calling
373.BR pthread_exit (3)).
374
59a40ed7
MK
375Programs that will take a filename as a command-line argument,
376but will not take input from standard input if no argument is supplied,
377or that write to a file named as a command-line argument,
378but will not send their output to standard output
379if no argument is supplied, can nevertheless be made to use
380standard input or standard out using
69119dc7 381.IR /proc/[pid]/fd .
59a40ed7
MK
382For example, assuming that
383.I \-i
384is the flag designating an input file and
385.I \-o
386is the flag designating an output file:
a08ea57c 387.in +4n
fea681da
MK
388.nf
389
b43a3b30 390.RB "$" " foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ..."
fea681da 391.fi
a08ea57c
MK
392.in
393
fea681da
MK
394and you have a working filter.
395.\" The following is not true in my tests (MTK):
396.\" Note that this will not work for
397.\" programs that seek on their files, as the files in the fd directory
398.\" are not seekable.
399
59a40ed7
MK
400.I /proc/self/fd/N
401is approximately the same as
402.I /dev/fd/N
008f1ecc 403in some UNIX and UNIX-like systems.
c13182ef 404Most Linux MAKEDEV scripts symbolically link
59a40ed7
MK
405.I /dev/fd
406to
407.IR /proc/self/fd ,
408in fact.
409
410Most systems provide symbolic links
411.IR /dev/stdin ,
412.IR /dev/stdout ,
413and
414.IR /dev/stderr ,
415which respectively link to the files
416.IR 0 ,
417.IR 1 ,
418and
419.IR 2
420in
421.IR /proc/self/fd .
422Thus the example command above could be written as:
423.in +4n
424.nf
425
b43a3b30 426.RB "$" " foobar \-i /dev/stdin \-o /dev/stdout ..."
59a40ed7
MK
427.fi
428.in
69ab425e
MK
429.\" FIXME Describe /proc/[pid]/loginuid
430.\" Added in 2.6.11; updating requires CAP_AUDIT_CONTROL
431.\" CONFIG_AUDITSYSCALL
432.TP
7e07d950 433.IR /proc/[pid]/fdinfo/ " (since Linux 2.6.22)"
69ab425e
MK
434This is a subdirectory containing one entry for each file which the
435process has open, named by its file descriptor.
436The contents of each file can be read to obtain information
437about the corresponding file descriptor, for example:
438.in +4n
439.nf
440
441.RB "$" " cat /proc/12015/fdinfo/4"
442pos: 1000
443flags: 01002002
444.fi
445.in
446
447The
448.I pos
449field is a decimal number showing the current file offset.
450The
451.I flags
452field is an octal number that displays the
453file access mode and file status flags (see
454.BR open (2)).
455
456The files in this directory are readable only by the owner of the process.
43a8bfc6
MK
457.\" FIXME
458.\" Certain file types include additional info; see
459.\" Documentation/filesystems/proc.txt
460.\"
461.\" Especially interesting is this:
462.\"
463.\" commit ab49bdecc3ebb46ab661f5f05d5c5ea9606406c6
464.\" Author: Cyrill Gorcunov <gorcunov@openvz.org>
465.\" Date: Mon Dec 17 16:05:06 2012 -0800
466.\"
fa1d49a6 467.\" Basically, the /proc/PID/fdinfo/ entry for an inotify FD
43a8bfc6
MK
468.\" includes the file handles for all watched FDs
469.\"
0ca2fc4d
PS
470.TP
471.IR /proc/[pid]/io " (since kernel 2.6.20)"
68f11066
MK
472.\" commit 7c3ab7381e79dfc7db14a67c6f4f3285664e1ec2
473This file contains I/O statistics for the process, for example:
0ca2fc4d
PS
474.in +4n
475.nf
476
477.RB "#" " cat /proc/3828/io"
478rchar: 323934931
479wchar: 323929600
480syscr: 632687
481syscw: 632675
482read_bytes: 0
483write_bytes: 323932160
484cancelled_write_bytes: 0
485.fi
486.in
487
488The fields are as follows:
489.RS
68f11066
MK
490.TP
491.IR rchar ": characters read"
0ca2fc4d
PS
492The number of bytes which this task has caused to be read from storage.
493This is simply the sum of bytes which this process passed to
494.BR read (2)
68f11066 495and similar system calls.
11256884 496It includes things such as terminal I/O and
68f11066
MK
497is unaffected by whether or not actual
498physical disk I/O was required (the read might have been satisfied from
0ca2fc4d 499pagecache).
68f11066
MK
500.TP
501.IR wchar ": characters written"
0ca2fc4d
PS
502The number of bytes which this task has caused, or shall cause to be written
503to disk.
504Similar caveats apply here as with
505.IR rchar .
68f11066
MK
506.TP
507.IR syscr ": read syscalls"
508Attempt to count the number of read I/O operations\(emthat is,
509system calls such as
0ca2fc4d
PS
510.BR read (2)
511and
512.BR pread (2).
68f11066
MK
513.TP
514.IR syscw ": write syscalls"
515Attempt to count the number of write I/O operations\(emthat is,
516system calls such as
0ca2fc4d
PS
517.BR write (2)
518and
519.BR pwrite (2).
68f11066
MK
520.TP
521.IR read_bytes ": bytes read"
0ca2fc4d
PS
522Attempt to count the number of bytes which this process really did cause to
523be fetched from the storage layer.
524This is accurate for block-backed filesystems.
68f11066
MK
525.TP
526.IR write_bytes ": bytes written"
0ca2fc4d
PS
527Attempt to count the number of bytes which this process caused to be sent to
528the storage layer.
68f11066 529.TP
0ca2fc4d 530.IR cancelled_write_bytes :
0ca2fc4d
PS
531The big inaccuracy here is truncate.
532If a process writes 1MB to a file and then deletes the file,
533it will in fact perform no writeout.
534But it will have been accounted as having caused 1MB of write.
68f11066 535In other words: this field represents the number of bytes which this process
0ca2fc4d 536caused to not happen, by truncating pagecache.
68f11066 537A task can cause "negative" I/O too.
0ca2fc4d 538If this task truncates some dirty pagecache,
68f11066
MK
539some I/O which another task has been accounted for
540(in its
541.IR write_bytes )
542will not be happening.
543.RE
0ca2fc4d
PS
544.IP
545.IR Note :
68f11066 546In the current implementation, things are a bit racy on 32-bit systems:
0ca2fc4d
PS
547if process A reads process B's
548.I /proc/[pid]/io
68f11066 549while process B is updating one of these 64-bit counters,
0ca2fc4d 550process A could see an intermediate result.
f6e17121 551.TP
ccdc8958 552.IR /proc/[pid]/gid_map " (since Linux 3.5)"
149eeb7b
MK
553See the description of
554.IR /proc/[pid]/uid_map .
f6e17121 555
69ab425e 556.TP
7e07d950 557.IR /proc/[pid]/limits " (since Linux 2.6.24)"
69ab425e
MK
558This file displays the soft limit, hard limit, and units of measurement
559for each of the process's resource limits (see
560.BR getrlimit (2)).
561Up to and including Linux 2.6.35,
562this file is protected to allow reading only by the real UID of the process.
563Since Linux 2.6.36,
564.\" commit 3036e7b490bf7878c6dae952eec5fb87b1106589
565this file is readable by all users on the system.
b4f89985
PE
566.TP
567.IR /proc/[pid]/map_files/ " (since kernel 3.3)
18cdd0ac
MK
568.\" commit 640708a2cff7f81e246243b0073c66e6ece7e53e
569This subdirectory contains entries corresponding to memory-mapped
b4f89985
PE
570files (see
571.BR mmap (2)).
18cdd0ac
MK
572Entries are named by memory region start and end
573address pair (expressed as hexadecimal numbers),
574and are symbolic links to the mapped files themselves.
575Here is an example, with the output wrapped and reformatted to fit on an 80-column display:
b4f89985
PE
576.in +4n
577.nf
578
7d2e6d74 579.RB "$" " ls -l /proc/self/map_files/"
18cdd0ac
MK
580lr\-\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:31
581 3252e00000\-3252e20000 \-> /usr/lib64/ld-2.15.so
b4f89985
PE
582\&...
583.fi
584.in
585
586Although these entries are present for memory regions that were
d6a56978 587mapped with the
b4f89985 588.BR MAP_FILE
18cdd0ac 589flag, the way anonymous shared memory (regions created with the
b4f89985
PE
590.B MAP_ANON | MAP_SHARED
591flags)
592is implemented in Linux
18cdd0ac
MK
593means that such regions also appear on this directory.
594Here is an example where the target file is the deleted
595.I /dev/zero
596one:
b4f89985
PE
597.in +4n
598.nf
599
600.RB
18cdd0ac
MK
601lrw\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:33
602 7fc075d2f000\-7fc075e6f000 \-> /dev/zero (deleted)
b4f89985
PE
603.fi
604.in
605
606This directory appears only if the
607.B CONFIG_CHECKPOINT_RESTORE
608kernel configuration option is enabled.
fea681da 609.TP
69119dc7 610.I /proc/[pid]/maps
fea681da
MK
611A file containing the currently mapped memory regions and their access
612permissions.
bbf9f397
MK
613See
614.BR mmap (2)
615for some further information about memory mappings.
fea681da 616
dd0c3b96 617The format of the file is:
fea681da 618
21781757 619.in -7n
fea681da
MK
620.nf
621.ft CW
fea681da 622.ft
21781757
MK
623.I "address perms offset dev inode pathname"
62400400000-00452000 r-xp 00000000 08:02 173521 /usr/bin/dbus-daemon
62500651000-00652000 r--p 00051000 08:02 173521 /usr/bin/dbus-daemon
62600652000-00655000 rw-p 00052000 08:02 173521 /usr/bin/dbus-daemon
62700e03000-00e24000 rw-p 00000000 00:00 0 [heap]
62800e24000-011f7000 rw-p 00000000 00:00 0 [heap]
182090db 629\&...
21781757
MK
63035b1800000-35b1820000 r-xp 00000000 08:02 135522 /usr/lib64/ld-2.15.so
63135b1a1f000-35b1a20000 r--p 0001f000 08:02 135522 /usr/lib64/ld-2.15.so
63235b1a20000-35b1a21000 rw-p 00020000 08:02 135522 /usr/lib64/ld-2.15.so
7d2e6d74 63335b1a21000-35b1a22000 rw-p 00000000 00:00 0
21781757
MK
63435b1c00000-35b1dac000 r-xp 00000000 08:02 135870 /usr/lib64/libc-2.15.so
63535b1dac000-35b1fac000 ---p 001ac000 08:02 135870 /usr/lib64/libc-2.15.so
63635b1fac000-35b1fb0000 r--p 001ac000 08:02 135870 /usr/lib64/libc-2.15.so
63735b1fb0000-35b1fb2000 rw-p 001b0000 08:02 135870 /usr/lib64/libc-2.15.so
182090db 638\&...
21781757 639f2c6ff8c000-7f2c7078c000 rw-p 00000000 00:00 0 [stack:986]
182090db 640\&...
21781757
MK
6417fffb2c0d000-7fffb2c2e000 rw-p 00000000 00:00 0 [stack]
6427fffb2d48000-7fffb2d49000 r-xp 00000000 00:00 0 [vdso]
fea681da 643.fi
21781757 644.in
fea681da 645
7d2e6d74 646The
3eb8c588
MK
647.I address
648field is the address space in the process that the mapping occupies.
649The
650.I perms
651field is a set of permissions:
fea681da
MK
652
653.nf
654.in +5
655r = read
656w = write
657x = execute
658s = shared
659p = private (copy on write)
660.fi
661.in
662
3eb8c588
MK
663The
664.I offset
b844cf04 665field is the offset into the file/whatever;
3eb8c588
MK
666.I dev
667is the device
dd0c3b96 668(major:minor);
3eb8c588
MK
669.I inode
670is the inode on that device.
59a40ed7 6710 indicates that no inode is associated with the memory region,
16e64bae 672as would be the case with BSS (uninitialized data).
fea681da 673
3eb8c588
MK
674The
675.I pathname
676field will usually be the file that is backing the mapping.
491ea6f1 677For ELF files,
3eb8c588
MK
678you can easily coordinate with the
679.I offset
680field by looking at the
491ea6f1
MK
681Offset field in the ELF program headers
682.RI ( "readelf\ \-l" ).
37d32c38 683
491ea6f1 684There are additional helpful pseudo-paths:
61b0b1f4
MK
685.RS 12
686.TP
687.IR [stack]
16e64bae 688The initial process's (also known as the main thread's) stack.
61b0b1f4 689.TP
3eb8c588 690.IR [stack:<tid>] " (since Linux 3.4)"
a60894c5 691.\" commit b76437579d1344b612cf1851ae610c636cec7db0
61b0b1f4 692A thread's stack (where the
3eb8c588 693.IR <tid>
61b0b1f4 694is a thread ID).
491ea6f1 695It corresponds to the
3eb8c588 696.IR /proc/[pid]/task/[tid]/
37d32c38 697path.
61b0b1f4 698.TP
7d2e6d74 699.IR [vdso]
61b0b1f4
MK
700The virtual dynamically linked shared object.
701.TP
7d2e6d74 702.IR [heap]
61b0b1f4
MK
703The process's heap.
704.in
61b0b1f4
MK
705.RE
706.IP
3eb8c588
MK
707If the
708.I pathname
709field is blank,
491ea6f1 710this is an anonymous mapping as obtained via the
37d32c38 711.BR mmap (2)
491ea6f1 712function.
61b0b1f4
MK
713There is no easy way to coordinate this back to a process's source,
714short of running it through
491ea6f1
MK
715.BR gdb (1),
716.BR strace (1),
717or similar.
37d32c38 718
eb9a0b2f 719Under Linux 2.0, there is no field giving pathname.
fea681da 720.TP
69119dc7 721.I /proc/[pid]/mem
fea681da
MK
722This file can be used to access the pages of a process's memory through
723.BR open (2),
724.BR read (2),
725and
ccb2bb0d 726.BR lseek (2).
b4e9ee8f 727.TP
69119dc7 728.IR /proc/[pid]/mountinfo " (since Linux 2.6.26)"
b4e9ee8f
MK
729.\" This info adapted from Documentation/filesystems/proc.txt
730This file contains information about mount points.
731It contains lines of the form:
732.nf
733.ft CW
b4e9ee8f
MK
734
73536 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue
736(1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11)
b4e9ee8f
MK
737.ft
738.fi
739.IP
740The numbers in parentheses are labels for the descriptions below:
3bc960c2 741.RS 7
b4e9ee8f
MK
742.TP 5
743(1)
744mount ID: unique identifier of the mount (may be reused after
745.BR umount (2)).
746.TP
747(2)
748parent ID: ID of parent mount (or of self for the top of the mount tree).
749.TP
750(3)
751major:minor: value of
752.I st_dev
9ee4a2b6 753for files on filesystem (see
b4e9ee8f
MK
754.BR stat (2)).
755.TP
756(4)
9ee4a2b6 757root: root of the mount within the filesystem.
b4e9ee8f
MK
758.TP
759(5)
760mount point: mount point relative to the process's root.
761.TP
762(6)
763mount options: per-mount options.
764.TP
765(7)
766optional fields: zero or more fields of the form "tag[:value]".
767.TP
768(8)
769separator: marks the end of the optional fields.
770.TP
771(9)
9ee4a2b6 772filesystem type: name of filesystem in the form "type[.subtype]".
b4e9ee8f
MK
773.TP
774(10)
9ee4a2b6 775mount source: filesystem-specific information or "none".
b4e9ee8f
MK
776.TP
777(11)
68d86eac 778super options: per-superblock options.
b4e9ee8f
MK
779.RE
780.IP
781Parsers should ignore all unrecognized optional fields.
782Currently the possible optional fields are:
783.RS 12
784.TP 18
785shared:X
786mount is shared in peer group X
787.TP
788master:X
789mount is slave to peer group X
790.TP
791propagate_from:X
792mount is slave and receives propagation from peer group X (*)
793.TP
794unbindable
795mount is unbindable
796.RE
797.IP
798(*) X is the closest dominant peer group under the process's root.
799If X is the immediate master of the mount,
800or if there is no dominant peer group under the same root,
801then only the "master:X" field is present
802and not the "propagate_from:X" field.
803
804For more information on mount propagation see:
805.I Documentation/filesystems/sharedsubtree.txt
66a9882e 806in the Linux kernel source tree.
b4e9ee8f 807.TP
cea61382 808.IR /proc/[pid]/mounts " (since Linux 2.4.19)"
9ee4a2b6 809This is a list of all the filesystems currently mounted in the
732e54dd 810process's mount namespace.
cea61382
MK
811The format of this file is documented in
812.BR fstab (5).
813Since kernel version 2.6.15, this file is pollable:
814after opening the file for reading, a change in this file
9ee4a2b6 815(i.e., a filesystem mount or unmount) causes
cea61382
MK
816.BR select (2)
817to mark the file descriptor as readable, and
818.BR poll (2)
819and
820.BR epoll_wait (2)
821mark the file as having an error condition.
357002ec
MK
822See
823.BR namespaces (7)
824for more information.
cea61382 825.TP
69119dc7 826.IR /proc/[pid]/mountstats " (since Linux 2.6.17)"
783a6233 827This file exports information (statistics, configuration information)
0bafc692 828about the mount points in the process's mount namespace.
b4e9ee8f
MK
829Lines in this file have the form:
830.nf
831
832device /dev/sda7 mounted on /home with fstype ext3 [statistics]
833( 1 ) ( 2 ) (3 ) (4)
834.fi
835.IP
836The fields in each line are:
3bc960c2 837.RS 7
b4e9ee8f
MK
838.TP 5
839(1)
840The name of the mounted device
841(or "nodevice" if there is no corresponding device).
842.TP
843(2)
9ee4a2b6 844The mount point within the filesystem tree.
b4e9ee8f
MK
845.TP
846(3)
9ee4a2b6 847The filesystem type.
b4e9ee8f
MK
848.TP
849(4)
850Optional statistics and configuration information.
9ee4a2b6 851Currently (as at Linux 2.6.26), only NFS filesystems export
b4e9ee8f
MK
852information via this field.
853.RE
854.IP
90878f7c 855This file is readable only by the owner of the process.
4716a1dd
MK
856
857See
858.BR namespaces (7)
859for more information.
b4e9ee8f 860.TP
b4a185e5 861.IR /proc/[pid]/ns/ " (since Linux 3.0)"
2c4201f0 862.\" See commit 6b4e306aa3dc94a0545eb9279475b1ab6209a31f
b4a185e5
EB
863This is a subdirectory containing one entry for each namespace that
864supports being manipulated by
80e63655 865.BR setns (2).
cf8bfe6d
MK
866For more information, see
867.BR namespaces (7).
ec1dd85d 868
b4a185e5 869.TP
69119dc7 870.IR /proc/[pid]/numa_maps " (since Linux 2.6.14)"
610f75cc
MK
871See
872.BR numa (7).
7388733a 873.TP
69119dc7 874.IR /proc/[pid]/oom_adj " (since Linux 2.6.11)"
b4e9ee8f 875This file can be used to adjust the score used to select which process
0425de01 876should be killed in an out-of-memory (OOM) situation.
b4e9ee8f
MK
877The kernel uses this value for a bit-shift operation of the process's
878.IR oom_score
879value:
5b8dbfd4
MK
880valid values are in the range \-16 to +15,
881plus the special value \-17,
b4e9ee8f
MK
882which disables OOM-killing altogether for this process.
883A positive score increases the likelihood of this
884process being killed by the OOM-killer;
885a negative score decreases the likelihood.
de8e9cc1 886.IP
b4e9ee8f
MK
887The default value for this file is 0;
888a new process inherits its parent's
889.I oom_adj
890setting.
891A process must be privileged
892.RB ( CAP_SYS_RESOURCE )
893to update this file.
f2c8b197
MK
894.IP
895Since Linux 2.6.36, use of this file is deprecated in favor of
896.IR /proc/[pid]/oom_score_adj .
b4e9ee8f 897.TP
69119dc7 898.IR /proc/[pid]/oom_score " (since Linux 2.6.11)"
b4e9ee8f
MK
899.\" See mm/oom_kill.c::badness() in the 2.6.25 sources
900This file displays the current score that the kernel gives to
901this process for the purpose of selecting a process
902for the OOM-killer.
903A higher score means that the process is more likely to be
904selected by the OOM-killer.
905The basis for this score is the amount of memory used by the process,
906with increases (+) or decreases (\-) for factors including:
907.\" See mm/oom_kill.c::badness() in the 2.6.25 sources
908.RS
909.IP * 2
910whether the process creates a lot of children using
911.BR fork (2)
912(+);
913.IP *
914whether the process has been running a long time,
915or has used a lot of CPU time (\-);
916.IP *
917whether the process has a low nice value (i.e., > 0) (+);
918.IP *
919whether the process is privileged (\-); and
920.\" More precisely, if it has CAP_SYS_ADMIN or CAP_SYS_RESOURCE
921.IP *
922whether the process is making direct hardware access (\-).
923.\" More precisely, if it has CAP_SYS_RAWIO
924.RE
925.IP
926The
927.I oom_score
f2c8b197
MK
928also reflects the adjustment specified by the
929.I oom_score_adj
930or
b4e9ee8f
MK
931.I oom_adj
932setting for the process.
f2c8b197
MK
933.TP
934.IR /proc/[pid]/oom_score_adj " (since Linux 2.6.36)"
935.\" Text taken from 3.7 Documentation/filesystems/proc.txt
936This file can be used to adjust the badness heuristic used to select which
937process gets killed in out-of-memory conditions.
938
939The badness heuristic assigns a value to each candidate task ranging from 0
940(never kill) to 1000 (always kill) to determine which process is targeted.
941The units are roughly a proportion along that range of
942allowed memory the process may allocate from,
943based on an estimation of its current memory and swap use.
944For example, if a task is using all allowed memory,
945its badness score will be 1000.
946If it is using half of its allowed memory, its score will be 500.
947
948There is an additional factor included in the badness score: root
949processes are given 3% extra memory over other tasks.
950
951The amount of "allowed" memory depends on the context
0633f951 952in which the OOM-killer was called.
f2c8b197
MK
953If it is due to the memory assigned to the allocating task's cpuset
954being exhausted,
955the allowed memory represents the set of mems assigned to that
956cpuset (see
957.BR cpuset (7)).
958If it is due to a mempolicy's node(s) being exhausted,
959the allowed memory represents the set of mempolicy nodes.
960If it is due to a memory limit (or swap limit) being reached,
961the allowed memory is that configured limit.
962Finally, if it is due to the entire system being out of memory, the
963allowed memory represents all allocatable resources.
964
965The value of
0633f951 966.I oom_score_adj
f2c8b197
MK
967is added to the badness score before it
968is used to determine which task to kill.
969Acceptable values range from \-1000
970(OOM_SCORE_ADJ_MIN) to +1000 (OOM_SCORE_ADJ_MAX).
0633f951 971This allows user space to control the preference for OOM-killing,
f2c8b197 972ranging from always preferring a certain
f082ada4 973task or completely disabling it from OOM killing.
f2c8b197 974The lowest possible value, \-1000, is
0633f951 975equivalent to disabling OOM-killing entirely for that task,
f2c8b197
MK
976since it will always report a badness score of 0.
977
978Consequently, it is very simple for user space to define
979the amount of memory to consider for each task.
980Setting a
981.I oom_score_adj
982value of +500, for example,
983is roughly equivalent to allowing the remainder of tasks sharing the
984same system, cpuset, mempolicy, or memory controller resources
985to use at least 50% more memory.
986A value of \-500, on the other hand, would be roughly
987equivalent to discounting 50% of the task's
988allowed memory from being considered as scoring against the task.
989
0633f951 990For backward compatibility with previous kernels,
f2c8b197
MK
991.I /proc/[pid]/oom_adj
992can still be used to tune the badness score.
993Its value is
9f1b9726 994scaled linearly with
f2c8b197
MK
995.IR oom_score_adj .
996
997Writing to
998.IR /proc/[pid]/oom_score_adj
999or
1000.IR /proc/[pid]/oom_adj
1001will change the other with its scaled value.
b0aa1e51
MK
1002.TP
1003.IR /proc/[pid]/pagemap " (since Linux 2.6.25)"
1004This file shows the mapping of each of the process's virtual pages
1005into physical page frames or swap area.
1006It contains one 64-bit value for each virtual page,
1007with the bits set as follows:
1008.RS 12
1009.TP
101063
1011If set, the page is present in RAM.
1012.TP
101362
1014If set, the page is in swap space
1015.TP
101661 (since Linux 3.5)
1017The page is a file-mapped page or a shared anonymous page.
1018.TP
101960-56 (since Linux 3.11)
1020Zero
1021.\" Not quite true; see commit 541c237c0923f567c9c4cabb8a81635baadc713f
1022.TP
102355 (Since Linux 3.11)
1024PTE is soft-dirty
1025(see the kernel source file
1026.IR Documentation/vm/soft-dirty.txt ).
1027.TP
102854-0
1029If the page is present in RAM (bit 63), then these bits
1030provide the page frame number, which can be used to index
1031.IR /proc/kpageflags
1032and
1033.IR /proc/kpagecount .
1034If the page is present in swap (bit 62),
1035then bits 4-0 give the swap type, and bits 54-5 encode the swap offset.
1036.RE
1037.IP
1038Before Linux 3.11, bits 60-55 were
1039used to encode the base-2 log of the page size.
1040.IP
1041To employ
1042.IR /proc/[pid]/pagemap
1043efficiently, use
1044.IR /proc/[pid]/maps
1045to determine which areas of memory are actually mapped and seek
1046to skip over unmapped regions.
1047.IP
1048The
1049.IR /proc/[pid]/pagemap
1050file is present only if the
1051.B CONFIG_PROC_PAGE_MONITOR
1052kernel configuration option is enabled.
7c2905d1
MK
1053.TP
1054.IR /proc/[pid]/personality " (since Linux 2.6.28)"
1055.\" commit 478307230810d7e2a753ed220db9066dfdf88718
1056This read-only file exposes the process's execution domain, as set by
1057.BR personality (2).
1058The value is displayed in hexadecimal notation.
fea681da 1059.TP
69119dc7 1060.I /proc/[pid]/root
008f1ecc 1061UNIX and Linux support the idea of a per-process root of the
9ee4a2b6 1062filesystem, set by the
fea681da 1063.BR chroot (2)
c13182ef
MK
1064system call.
1065This file is a symbolic link that points to the process's
14d70713
MK
1066root directory, and behaves in the same way as
1067.IR exe ,
1068and
1069.IR fd/* .
afcaf646
MK
1070
1071.\" The following was still true as at kernel 2.6.13
c13182ef
MK
1072In a multithreaded process, the contents of this symbolic link
1073are not available if the main thread has already terminated
afcaf646
MK
1074(typically by calling
1075.BR pthread_exit (3)).
f34f0182
MK
1076.\" FIXME Describe /proc/[pid]/projid_map
1077.\" Added in 3.7, commit f76d207a66c3a53defea67e7d36c3eb1b7d6d61d
69119dc7 1078.\" FIXME Describe /proc/[pid]/seccomp
6aefb6df 1079.\" Added in 2.6.12
bea08fec 1080.\"
69119dc7 1081.\" FIXME Describe /proc/[pid]/sessionid
b4e9ee8f 1082.\" Added in 2.6.25; read-only; only readable by real UID
b3fb99e8 1083.\" commit 1e0bd7550ea9cf474b1ad4c6ff5729a507f75fdc
b4e9ee8f 1084.\" CONFIG_AUDITSYSCALL
bea08fec 1085.\"
69119dc7 1086.\" FIXME Describe /proc/[pid]/sched
b4e9ee8f
MK
1087.\" Added in 2.6.23
1088.\" CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS
1089.\" Displays various scheduling parameters
1090.\" This file can be written, to reset stats
ef4f4031 1091.\" The set of fields exposed by this file have changed
b3fb99e8
MK
1092.\" significantly over time.
1093.\" commit 43ae34cb4cd650d1eb4460a8253a8e747ba052ac
1094.\"
69119dc7
MK
1095.\" FIXME Describe /proc/[pid]/schedstats and
1096.\" /proc/[pid]/task/[tid]/schedstats
b4e9ee8f
MK
1097.\" Added in 2.6.9
1098.\" CONFIG_SCHEDSTATS
fea681da 1099.TP
69119dc7 1100.IR /proc/[pid]/smaps " (since Linux 2.6.14)"
b07b19c4 1101This file shows memory consumption for each of the process's mappings.
859503c3
MK
1102(The
1103.BR pmap (1)
1104command displays similar information,
1105in a form that may be easier for parsing.)
1f0add28 1106For each mapping there is a series of lines such as the following:
a08ea57c 1107.in +4n
b07b19c4
MK
1108.nf
1109
1f0add28 111000400000-0048a000 r-xp 00000000 fd:03 960637 /bin/bash
95fe794d
PG
1111Size: 552 kB
1112Rss: 460 kB
1113Pss: 100 kB
1114Shared_Clean: 452 kB
1115Shared_Dirty: 0 kB
1116Private_Clean: 8 kB
1117Private_Dirty: 0 kB
1118Referenced: 460 kB
1119Anonymous: 0 kB
1120AnonHugePages: 0 kB
1121Swap: 0 kB
1122KernelPageSize: 4 kB
1123MMUPageSize: 4 kB
1124Locked: 0 kB
b07b19c4
MK
1125
1126.fi
a08ea57c 1127.in
b07b19c4
MK
1128The first of these lines shows the same information as is displayed
1129for the mapping in
69119dc7 1130.IR /proc/[pid]/maps .
b07b19c4 1131The remaining lines show the size of the mapping,
95fe794d
PG
1132the amount of the mapping that is currently resident in RAM ("Rss"),
1133the process' proportional share of this mapping ("Pss"),
1f0add28 1134the number of clean and dirty shared pages in the mapping,
c7ce200d 1135and the number of clean and dirty private pages in the mapping.
95fe794d 1136"Referenced" indicates the amount of memory currently marked as
1f0add28
MK
1137referenced or accessed.
1138"Anonymous" shows the amount of memory
1139that does not belong to any file.
1140"Swap" shows how much
95fe794d
PG
1141would-be-anonymous memory is also used, but out on swap.
1142
d6a56978 1143The "KernelPageSize" entry is the page size used by the kernel to back a VMA.
1f0add28
MK
1144This matches the size used by the MMU in the majority of cases.
1145However, one counter-example occurs on PPC64 kernels
1146whereby a kernel using 64K as a base page size may still use 4K
1147pages for the MMU on older processors.
1148To distinguish, this
1149patch reports "MMUPageSize" as the page size used by the MMU.
95fe794d
PG
1150
1151The "Locked" indicates whether the mapping is locked in memory
1152or not.
1153
1154"VmFlags" field represents the kernel flags associated with
1f0add28
MK
1155the particular virtual memory area in two letter encoded manner.
1156The codes are the following:
1157
95fe794d 1158 rd - readable
1f0add28 1159 wr - writable
95fe794d
PG
1160 ex - executable
1161 sh - shared
1162 mr - may read
1163 mw - may write
1164 me - may execute
1165 ms - may share
723e333c 1166 gd - stack segment grows down
95fe794d
PG
1167 pf - pure PFN range
1168 dw - disabled write to the mapped file
1169 lo - pages are locked in memory
1170 io - memory mapped I/O area
1171 sr - sequential read advise provided
1172 rr - random read advise provided
1173 dc - do not copy area on fork
1174 de - do not expand area on remapping
1175 ac - area is accountable
1176 nr - swap space is not reserved for the area
1177 ht - area uses huge tlb pages
1178 nl - non-linear mapping
1179 ar - architecture specific flag
1180 dd - do not include area into core dump
1181 sd - soft-dirty flag
1182 mm - mixed map area
1183 hg - huge page advise flag
1184 nh - no-huge page advise flag
b5408a0f 1185 mg - mergeable advise flag
b07b19c4 1186
e618d945
MK
1187The
1188.IR /proc/[pid]/smaps
1189file is present only if the
1190.B CONFIG_PROC_PAGE_MONITOR
1191kernel configuration option is enabled.
b07b19c4 1192.TP
67aac6fb
MK
1193.IR /proc/[pid]/stack " (since Linux 2.6.29)"
1194.\" 2ec220e27f5040aec1e88901c1b6ea3d135787ad
1195This file provides a symbolic trace of the function calls in this
1196process's kernel stack.
1197This file is provided only if the kernel was built with the
1198.B CONFIG_STACKTRACE
1199configuration option.
1200.TP
69119dc7 1201.I /proc/[pid]/stat
c13182ef
MK
1202Status information about the process.
1203This is used by
1204.BR ps (1).
082bf5b8
MK
1205It is defined in the kernel source file
1206.IR fs/proc/array.c "."
fea681da
MK
1207
1208The fields, in order, with their proper
1209.BR scanf (3)
1210format specifiers, are:
1211.RS
62e4a418
MK
1212.TP 10
1213(1) \fIpid\fP \ %d
1214.br
1215The process ID.
fea681da 1216.TP
62e4a418
MK
1217(2) \fIcomm\fP \ %s
1218The filename of the executable, in parentheses.
c13182ef 1219This is visible whether or not the executable is swapped out.
fea681da 1220.TP
62e4a418 1221(3) \fIstate\fP \ %c
31293f37
MK
1222One of the following characters, indicating process state:
1223.RS
1224.IP R 3
1225Running
1226.IP S
1227Sleeping in an interruptible wait
1228.IP D
1229Waiting in uninterruptible
1230disk sleep
1231.IP Z
1232Zombie
1233.IP T
1234Stopped (on a signal) or (before Linux 2.6.33) trace stopped
1235.IP t
1236.\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
1237Tracing stop (Linux 2.6.33 onward)
1238.IP W
1239Paging (only before Linux 2.6.0)
1240.IP X
ef4f4031 1241Dead (from Linux 2.6.0 onward)
31293f37
MK
1242.IP x
1243.\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
1244Dead (Linux 2.6.33 to
1245.\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
12463.13 only)
1247.IP K
1248.\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
1249Wakekill (Linux 2.6.33 to
1250.\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
12513.13 only)
1252.IP W
1253.\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
1254Waking (Linux 2.6.33 to
1255.\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
12563.13 only)
1257.IP P
1258.\" commit f2530dc71cf0822f90bb63ea4600caaef33a66bb
1259Parked (Linux 3.9 to
1260.\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
12613.13 only)
1262.RE
fea681da 1263.TP
62e4a418 1264(4) \fIppid\fP \ %d
e0fdc57c 1265The PID of the parent of this process.
fea681da 1266.TP
62e4a418
MK
1267(5) \fIpgrp\fP \ %d
1268The process group ID of the process.
fea681da 1269.TP
62e4a418
MK
1270(6) \fIsession\fP \ %d
1271The session ID of the process.
fea681da 1272.TP
62e4a418
MK
1273(7) \fItty_nr\fP \ %d
1274The controlling terminal of the process.
59a40ed7
MK
1275(The minor device number is contained in the combination of bits
127631 to 20 and 7 to 0;
b97deb97 1277the major device number is in bits 15 to 8.)
fea681da 1278.TP
62e4a418 1279(8) \fItpgid\fP \ %d
fea681da 1280.\" This field and following, up to and including wchan added 0.99.1
62e4a418 1281The ID of the foreground process group of the controlling
59a40ed7 1282terminal of the process.
fea681da 1283.TP
62e4a418
MK
1284(9) \fIflags\fP \ %u
1285The kernel flags word of the process.
c13182ef 1286For bit meanings,
66a9882e 1287see the PF_* defines in the Linux kernel source file
00702acc 1288.IR include/linux/sched.h .
fea681da 1289Details depend on the kernel version.
62e4a418
MK
1290
1291The format for this field was %lu before Linux 2.6.
fea681da 1292.TP
ee566744 1293(10) \fIminflt\fP \ %lu
62e4a418 1294The number of minor faults the process has made which have not
fea681da
MK
1295required loading a memory page from disk.
1296.TP
62e4a418
MK
1297(11) \fIcminflt\fP \ %lu
1298The number of minor faults that the process's
fea681da
MK
1299waited-for children have made.
1300.TP
62e4a418
MK
1301(12) \fImajflt\fP \ %lu
1302The number of major faults the process has made which have
fea681da
MK
1303required loading a memory page from disk.
1304.TP
62e4a418
MK
1305(13) \fIcmajflt\fP \ %lu
1306The number of major faults that the process's
fea681da
MK
1307waited-for children have made.
1308.TP
62e4a418
MK
1309(14) \fIutime\fP \ %lu
1310Amount of time that this process has been scheduled in user mode,
7a017e24 1311measured in clock ticks (divide by
67914165 1312.IR sysconf(_SC_CLK_TCK) ).
a1c9dc59
MK
1313This includes guest time, \fIguest_time\fP
1314(time spent running a virtual CPU, see below),
1315so that applications that are not aware of the guest time field
1316do not lose that time from their calculations.
fea681da 1317.TP
62e4a418
MK
1318(15) \fIstime\fP \ %lu
1319Amount of time that this process has been scheduled in kernel mode,
7a017e24 1320measured in clock ticks (divide by
67914165 1321.IR sysconf(_SC_CLK_TCK) ).
fea681da 1322.TP
62e4a418
MK
1323(16) \fIcutime\fP \ %ld
1324Amount of time that this process's
7a017e24
MK
1325waited-for children have been scheduled in user mode,
1326measured in clock ticks (divide by
67914165 1327.IR sysconf(_SC_CLK_TCK) ).
c13182ef 1328(See also
fea681da 1329.BR times (2).)
a1c9dc59
MK
1330This includes guest time, \fIcguest_time\fP
1331(time spent running a virtual CPU, see below).
fea681da 1332.TP
62e4a418
MK
1333(17) \fIcstime\fP \ %ld
1334Amount of time that this process's
7a017e24
MK
1335waited-for children have been scheduled in kernel mode,
1336measured in clock ticks (divide by
67914165 1337.IR sysconf(_SC_CLK_TCK) ).
fea681da 1338.TP
62e4a418
MK
1339(18) \fIpriority\fP \ %ld
1340(Explanation for Linux 2.6)
59a40ed7
MK
1341For processes running a real-time scheduling policy
1342.RI ( policy
1343below; see
1344.BR sched_setscheduler (2)),
1345this is the negated scheduling priority, minus one;
1346that is, a number in the range \-2 to \-100,
1347corresponding to real-time priorities 1 to 99.
1348For processes running under a non-real-time scheduling policy,
1349this is the raw nice value
1350.RB ( setpriority (2))
1351as represented in the kernel.
1352The kernel stores nice values as numbers
1353in the range 0 (high) to 39 (low),
1354corresponding to the user-visible nice range of \-20 to 19.
1355
1356Before Linux 2.6, this was a scaled value based on
1357the scheduler weighting given to this process.
1358.\" And back in kernel 1.2 days things were different again.
fea681da 1359.TP
62e4a418
MK
1360(19) \fInice\fP \ %ld
1361The nice value (see
59a40ed7
MK
1362.BR setpriority (2)),
1363a value in the range 19 (low priority) to \-20 (high priority).
1364.\" Back in kernel 1.2 days things were different.
fea681da
MK
1365.\" .TP
1366.\" \fIcounter\fP %ld
1367.\" The current maximum size in jiffies of the process's next timeslice,
1368.\" or what is currently left of its current timeslice, if it is the
1369.\" currently running process.
1370.\" .TP
1371.\" \fItimeout\fP %u
1372.\" The time in jiffies of the process's next timeout.
0e94f77b 1373.\" timeout was removed sometime around 2.1/2.2
aa610245 1374.TP
62e4a418
MK
1375(20) \fInum_threads\fP \ %ld
1376Number of threads in this process (since Linux 2.6).
bb83d1b9 1377Before kernel 2.6, this field was hard coded to 0 as a placeholder
0e94f77b 1378for an earlier removed field.
fea681da 1379.TP
62e4a418
MK
1380(21) \fIitrealvalue\fP \ %ld
1381The time in jiffies before the next
8bd58774
MK
1382.B SIGALRM
1383is sent to the process due to an interval timer.
0e94f77b
MK
1384Since kernel 2.6.17, this field is no longer maintained,
1385and is hard coded as 0.
fea681da 1386.TP
62e4a418
MK
1387(22) \fIstarttime\fP \ %llu
1388The time the process started after system boot.
055024ed
MK
1389In kernels before Linux 2.6, this value was expressed in jiffies.
1390Since Linux 2.6, the value is expressed in clock ticks (divide by
1391.IR sysconf(_SC_CLK_TCK) ).
62e4a418
MK
1392
1393The format for this field was %lu before Linux 2.6.
fea681da 1394.TP
62e4a418
MK
1395(23) \fIvsize\fP \ %lu
1396Virtual memory size in bytes.
fea681da 1397.TP
62e4a418
MK
1398(24) \fIrss\fP \ %ld
1399Resident Set Size: number of pages the process has in real memory.
c13182ef 1400This is just the pages which
5fab2e7c 1401count toward text, data, or stack space.
c13182ef 1402This does not include pages
fea681da
MK
1403which have not been demand-loaded in, or which are swapped out.
1404.TP
62e4a418
MK
1405(25) \fIrsslim\fP \ %lu
1406Current soft limit in bytes on the rss of the process;
59a40ed7
MK
1407see the description of
1408.B RLIMIT_RSS
1409in
2b5407af 1410.BR getrlimit (2).
fea681da 1411.TP
62e4a418
MK
1412(26) \fIstartcode\fP \ %lu
1413The address above which program text can run.
fea681da 1414.TP
62e4a418
MK
1415(27) \fIendcode\fP \ %lu
1416The address below which program text can run.
fea681da 1417.TP
62e4a418
MK
1418(28) \fIstartstack\fP \ %lu
1419The address of the start (i.e., bottom) of the stack.
fea681da 1420.TP
62e4a418
MK
1421(29) \fIkstkesp\fP \ %lu
1422The current value of ESP (stack pointer), as found in the
fea681da
MK
1423kernel stack page for the process.
1424.TP
62e4a418
MK
1425(30) \fIkstkeip\fP \ %lu
1426The current EIP (instruction pointer).
fea681da 1427.TP
62e4a418
MK
1428(31) \fIsignal\fP \ %lu
1429The bitmap of pending signals, displayed as a decimal number.
59a40ed7 1430Obsolete, because it does not provide information on real-time signals; use
69119dc7 1431.I /proc/[pid]/status
59a40ed7 1432instead.
fea681da 1433.TP
62e4a418
MK
1434(32) \fIblocked\fP \ %lu
1435The bitmap of blocked signals, displayed as a decimal number.
59a40ed7 1436Obsolete, because it does not provide information on real-time signals; use
69119dc7 1437.I /proc/[pid]/status
59a40ed7 1438instead.
fea681da 1439.TP
62e4a418
MK
1440(33) \fIsigignore\fP \ %lu
1441The bitmap of ignored signals, displayed as a decimal number.
59a40ed7 1442Obsolete, because it does not provide information on real-time signals; use
69119dc7 1443.I /proc/[pid]/status
59a40ed7 1444instead.
fea681da 1445.TP
62e4a418
MK
1446(34) \fIsigcatch\fP \ %lu
1447The bitmap of caught signals, displayed as a decimal number.
59a40ed7 1448Obsolete, because it does not provide information on real-time signals; use
69119dc7 1449.I /proc/[pid]/status
59a40ed7 1450instead.
fea681da 1451.TP
62e4a418
MK
1452(35) \fIwchan\fP \ %lu
1453This is the "channel" in which the process is waiting.
2054f761
MK
1454It is the address of a location in the kernel where the process is sleeping.
1455The corresponding symbolic name can be found in
1456.IR /proc/[pid]/wchan .
fea681da 1457.TP
62e4a418 1458(36) \fInswap\fP \ %lu
0633f951 1459.\" nswap was added in 2.0
4d9b6984 1460Number of pages swapped (not maintained).
fea681da 1461.TP
62e4a418 1462(37) \fIcnswap\fP \ %lu
0633f951 1463.\" cnswap was added in 2.0
4d9b6984 1464Cumulative \fInswap\fP for child processes (not maintained).
fea681da 1465.TP
62e4a418
MK
1466(38) \fIexit_signal\fP \ %d \ (since Linux 2.1.22)
1467Signal to be sent to parent when we die.
fea681da 1468.TP
62e4a418
MK
1469(39) \fIprocessor\fP \ %d \ (since Linux 2.2.8)
1470CPU number last executed on.
568105c6 1471.TP
62e4a418
MK
1472(40) \fIrt_priority\fP \ %u \ (since Linux 2.5.19)
1473Real-time scheduling priority, a number in the range 1 to 99 for
59a40ed7
MK
1474processes scheduled under a real-time policy,
1475or 0, for non-real-time processes (see
568105c6
MK
1476.BR sched_setscheduler (2)).
1477.TP
62e4a418
MK
1478(41) \fIpolicy\fP \ %u \ (since Linux 2.5.19)
1479Scheduling policy (see
568105c6 1480.BR sched_setscheduler (2)).
cd60dedd 1481Decode using the SCHED_* constants in
59a40ed7 1482.IR linux/sched.h .
62e4a418
MK
1483
1484The format for this field was %lu before Linux 2.6.22.
167450d6 1485.TP
62e4a418
MK
1486(42) \fIdelayacct_blkio_ticks\fP \ %llu \ (since Linux 2.6.18)
1487Aggregated block I/O delays, measured in clock ticks (centiseconds).
14c06953 1488.TP
62e4a418
MK
1489(43) \fIguest_time\fP \ %lu \ (since Linux 2.6.24)
1490Guest time of the process (time spent running a virtual CPU
7a017e24 1491for a guest operating system), measured in clock ticks (divide by
67914165 1492.IR sysconf(_SC_CLK_TCK) ).
14c06953 1493.TP
62e4a418
MK
1494(44) \fIcguest_time\fP \ %ld \ (since Linux 2.6.24)
1495Guest time of the process's children, measured in clock ticks (divide by
67914165 1496.IR sysconf(_SC_CLK_TCK) ).
fea681da 1497.TP
62e4a418 1498(45) \fIstart_data\fP \ %lu \ (since Linux 3.3)
0be30a54 1499.\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff
62e4a418 1500Address above which program initialized and
426bc8d7 1501uninitialized (BSS) data are placed.
12449ae3 1502.TP
62e4a418 1503(46) \fIend_data\fP \ %lu \ (since Linux 3.3)
0be30a54 1504.\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff
62e4a418 1505Address below which program initialized and
426bc8d7 1506uninitialized (BSS) data are placed.
12449ae3 1507.TP
62e4a418 1508(47) \fIstart_brk\fP \ %lu \ (since Linux 3.3)
0be30a54 1509.\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff
62e4a418 1510Address above which program heap can be expanded with
426bc8d7 1511.BR brk (2).
12449ae3 1512.TP
62e4a418 1513(48) \fIarg_start\fP \ %lu \ (since Linux 3.5)
0be30a54 1514.\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
62e4a418 1515Address above which program command-line arguments
426bc8d7
MK
1516.RI ( argv )
1517are placed.
12449ae3 1518.TP
62e4a418 1519(49) \fIarg_end\fP \ %lu \ (since Linux 3.5)
0be30a54 1520.\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
62e4a418 1521Address below program command-line arguments
426bc8d7
MK
1522.RI ( argv )
1523are placed.
12449ae3 1524.TP
62e4a418 1525(50) \fIenv_start\fP \ %lu \ (since Linux 3.5)
0be30a54 1526.\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
62e4a418 1527Address above which program environment is placed.
12449ae3 1528.TP
62e4a418 1529(51) \fIenv_end\fP \ %lu \ (since Linux 3.5)
0be30a54 1530.\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
62e4a418 1531Address below which program environment is placed.
12449ae3 1532.TP
62e4a418 1533(52) \fIexit_code\fP \ %d \ (since Linux 3.5)
0be30a54 1534.\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
62e4a418 1535The thread's exit status in the form reported by
426bc8d7 1536.BR waitpid (2).
12449ae3 1537.RE
1538.TP
69119dc7 1539.I /proc/[pid]/statm
59a40ed7 1540Provides information about memory usage, measured in pages.
c13182ef 1541The columns are:
a08ea57c
MK
1542.in +4n
1543.nf
1544
cb42fb56 1545size (1) total program size
69119dc7 1546 (same as VmSize in \fI/proc/[pid]/status\fP)
cb42fb56 1547resident (2) resident set size
69119dc7 1548 (same as VmRSS in \fI/proc/[pid]/status\fP)
cb42fb56
MK
1549share (3) shared pages (i.e., backed by a file)
1550text (4) text (code)
59a40ed7 1551.\" (not including libs; broken, includes data segment)
cb42fb56
MK
1552lib (5) library (unused in Linux 2.6)
1553data (6) data + stack
59a40ed7 1554.\" (including libs; broken, includes library text)
cb42fb56 1555dt (7) dirty pages (unused in Linux 2.6)
a08ea57c
MK
1556.fi
1557.in
fea681da 1558.TP
69119dc7 1559.I /proc/[pid]/status
fea681da 1560Provides much of the information in
69119dc7 1561.I /proc/[pid]/stat
fea681da 1562and
69119dc7 1563.I /proc/[pid]/statm
fea681da 1564in a format that's easier for humans to parse.
16b5f7ba
MK
1565Here's an example:
1566.in +4n
1567.nf
1568
b43a3b30 1569.RB "$" " cat /proc/$$/status"
16b5f7ba
MK
1570Name: bash
1571State: S (sleeping)
1572Tgid: 3515
1573Pid: 3515
1574PPid: 3452
1575TracerPid: 0
1576Uid: 1000 1000 1000 1000
1577Gid: 100 100 100 100
1578FDSize: 256
1579Groups: 16 33 100
1580VmPeak: 9136 kB
1581VmSize: 7896 kB
1582VmLck: 0 kB
1583VmHWM: 7572 kB
1584VmRSS: 6316 kB
1585VmData: 5224 kB
1586VmStk: 88 kB
1587VmExe: 572 kB
1588VmLib: 1708 kB
1589VmPTE: 20 kB
49f6dda7 1590VmSwap: 0 kB
16b5f7ba
MK
1591Threads: 1
1592SigQ: 0/3067
1593SigPnd: 0000000000000000
1594ShdPnd: 0000000000000000
1595SigBlk: 0000000000010000
1596SigIgn: 0000000000384004
1597SigCgt: 000000004b813efb
1598CapInh: 0000000000000000
1599CapPrm: 0000000000000000
1600CapEff: 0000000000000000
1601CapBnd: ffffffffffffffff
039b6546 1602Seccomp: 0
16b5f7ba
MK
1603Cpus_allowed: 00000001
1604Cpus_allowed_list: 0
1605Mems_allowed: 1
1606Mems_allowed_list: 0
1607voluntary_ctxt_switches: 150
1608nonvoluntary_ctxt_switches: 545
1609.fi
1610.in
1611.IP
1612The fields are as follows:
1613.RS
1614.IP * 2
1615.IR Name :
1616Command run by this process.
1617.IP *
1618.IR State :
4175f999
MK
1619Current state of the process.
1620One of
16b5f7ba
MK
1621"R (running)",
1622"S (sleeping)",
1623"D (disk sleep)",
1624"T (stopped)",
1625"T (tracing stop)",
1626"Z (zombie)",
1627or
1628"X (dead)".
1629.IP *
1630.IR Tgid :
1631Thread group ID (i.e., Process ID).
1632.IP *
1633.IR Pid :
1634Thread ID (see
1635.BR gettid (2)).
1636.IP *
a1bc91d5
MK
1637.IR PPid :
1638PID of parent process.
1639.IP *
16b5f7ba
MK
1640.IR TracerPid :
1641PID of process tracing this process (0 if not being traced).
1642.IP *
1643.IR Uid ", " Gid :
9ee4a2b6 1644Real, effective, saved set, and filesystem UIDs (GIDs).
16b5f7ba
MK
1645.IP *
1646.IR FDSize :
1647Number of file descriptor slots currently allocated.
1648.IP *
1649.IR Groups :
1650Supplementary group list.
1651.IP *
1652.IR VmPeak :
1653Peak virtual memory size.
1654.IP *
1655.IR VmSize :
1656Virtual memory size.
1657.IP *
1658.IR VmLck :
fde39195
MK
1659Locked memory size (see
1660.BR mlock (3)).
16b5f7ba
MK
1661.IP *
1662.IR VmHWM :
1663Peak resident set size ("high water mark").
1664.IP *
1665.IR VmRSS :
1666Resident set size.
1667.IP *
1668.IR VmData ", " VmStk ", " VmExe :
1669Size of data, stack, and text segments.
1670.IP *
1671.IR VmLib :
1672Shared library code size.
1673.IP *
1674.IR VmPTE :
1675Page table entries size (since Linux 2.6.10).
1676.IP *
ac4b0eb3 1677.IR VmSwap :
1ddc1665 1678.\" commit b084d4353ff99d824d3bc5a5c2c22c70b1fba722
ac4b0eb3 1679Swapped-out virtual memory size (since Linux 2.6.34).
49f6dda7 1680.IP *
16b5f7ba
MK
1681.IR Threads :
1682Number of threads in process containing this thread.
1683.IP *
6ee625eb
MK
1684.IR SigQ :
1685This field contains two slash-separated numbers that relate to
1686queued signals for the real user ID of this process.
1687The first of these is the number of currently queued
1688signals for this real user ID, and the second is the
1689resource limit on the number of queued signals for this process
1690(see the description of
1691.BR RLIMIT_SIGPENDING
1692in
1693.BR getrlimit (2)).
1694.IP *
16b5f7ba
MK
1695.IR SigPnd ", " ShdPnd :
1696Number of signals pending for thread and for process as a whole (see
1697.BR pthreads (7)
1698and
1699.BR signal (7)).
1700.IP *
1701.IR SigBlk ", " SigIgn ", " SigCgt :
1702Masks indicating signals being blocked, ignored, and caught (see
1703.BR signal (7)).
1704.IP *
1705.IR CapInh ", " CapPrm ", " CapEff :
1706Masks of capabilities enabled in inheritable, permitted, and effective sets
1707(see
1708.BR capabilities (7)).
1709.IP *
1710.IR CapBnd :
1711Capability Bounding set
7e07d950 1712(since Linux 2.6.26, see
16b5f7ba
MK
1713.BR capabilities (7)).
1714.IP *
039b6546
MK
1715.IR Seccomp :
1716.\" commit 2f4b3bf6b2318cfaa177ec5a802f4d8d6afbd816
1717Seccomp mode of the process
1718(since Linux 3.8, see
1719.BR seccomp (2)).
17200 means
1721.BR SECCOMP_MODE_DISABLED ;
17221 means
1723.BR SECCOMP_MODE_STRICT ;
17242 means
1725.BR SECCOMP_MODE_FILTER .
1726This field is provided only if the kernel was built with the
1727.BR CONFIG_SECCOMP
1728kernel configuration option enabled.
1729.IP *
16b5f7ba
MK
1730.IR Cpus_allowed :
1731Mask of CPUs on which this process may run
1732(since Linux 2.6.24, see
1733.BR cpuset (7)).
1734.IP *
1735.IR Cpus_allowed_list :
1736Same as previous, but in "list format"
1737(since Linux 2.6.26, see
1738.BR cpuset (7)).
1739.IP *
1740.IR Mems_allowed :
1741Mask of memory nodes allowed to this process
1742(since Linux 2.6.24, see
1743.BR cpuset (7)).
1744.IP *
1745.IR Mems_allowed_list :
1746Same as previous, but in "list format"
1747(since Linux 2.6.26, see
1748.BR cpuset (7)).
1749.IP *
7c82878a 1750.IR voluntary_ctxt_switches ", " nonvoluntary_ctxt_switches :
16b5f7ba
MK
1751Number of voluntary and involuntary context switches (since Linux 2.6.23).
1752.RE
afb7b014
MK
1753.TP
1754.IR /proc/[pid]/syscall " (since Linux 2.6.27)"
1755.\" commit ebcb67341fee34061430f3367f2e507e52ee051b
1756This file exposes the system call number and argument registers for the
1757system call currently being executed by the process,
1758followed by the values of the stack pointer and program counter registers.
1759The values of all six argument registers are exposed,
1760although most system calls use fewer registers.
1761
1762If the process is blocked, but not in a system call,
1fb61947 1763then the file displays \-1 in place of the system call number,
afb7b014
MK
1764followed by just the values of the stack pointer and program counter.
1765If process is not blocked, then file contains just the string "running".
1766
1767This file is present only if the kernel was configured with
1768.BR CONFIG_HAVE_ARCH_TRACEHOOK .
fea681da 1769.TP
69119dc7 1770.IR /proc/[pid]/task " (since Linux 2.6.0-test6)"
afcaf646
MK
1771This is a directory that contains one subdirectory
1772for each thread in the process.
69119dc7
MK
1773The name of each subdirectory is the numerical thread ID
1774.RI ( [tid] )
1775of the thread (see
afcaf646
MK
1776.BR gettid (2)).
1777Within each of these subdirectories, there is a set of
1778files with the same names and contents as under the
69119dc7 1779.I /proc/[pid]
afcaf646
MK
1780directories.
1781For attributes that are shared by all threads, the contents for
1782each of the files under the
69119dc7 1783.I task/[tid]
afcaf646 1784subdirectories will be the same as in the corresponding
c13182ef 1785file in the parent
69119dc7 1786.I /proc/[pid]
afcaf646 1787directory
c13182ef 1788(e.g., in a multithreaded process, all of the
69119dc7 1789.I task/[tid]/cwd
c13182ef 1790files will have the same value as the
69119dc7 1791.I /proc/[pid]/cwd
c13182ef 1792file in the parent directory, since all of the threads in a process
afcaf646
MK
1793share a working directory).
1794For attributes that are distinct for each thread,
c13182ef 1795the corresponding files under
69119dc7 1796.I task/[tid]
afcaf646 1797may have different values (e.g., various fields in each of the
69119dc7 1798.I task/[tid]/status
afcaf646
MK
1799files may be different for each thread).
1800
1801.\" The following was still true as at kernel 2.6.13
1802In a multithreaded process, the contents of the
69119dc7 1803.I /proc/[pid]/task
c13182ef 1804directory are not available if the main thread has already terminated
afcaf646
MK
1805(typically by calling
1806.BR pthread_exit (3)).
1807.TP
ccdc8958 1808.IR /proc/[pid]/uid_map ", " /proc/[pid]/gid_map " (since Linux 3.5)"
149eeb7b
MK
1809.\" commit 22d917d80e842829d0ca0a561967d728eb1d6303
1810These files expose the mappings for user and group IDs
1811inside the user namespace for the process
1812.IR pid .
1813The description here explains the details for
1814.IR uid_map ;
1815.IR gid_map
1816is exactly the same,
1817but each instance of "user ID" is replaced by "group ID".
1818
1819The
1820.I uid_map
1821file exposes the mapping of user IDs from the user namespace
1822of the process
f6e17121
EB
1823.IR pid
1824to the user namespace of the process that opened
6b1eaf53
MK
1825.IR uid_map
1826(but see a qualification to this point below).
1827In other words, processes that are in different user namespaces
23be33af
MK
1828will potentially see different values when reading from a particular
1829.I uid_map
1830file, depending on the user ID mappings for the user namespaces
6b1eaf53 1831of the reading processes.
23be33af 1832
f6e17121 1833
149eeb7b 1834Each line in the file specifies a 1-to-1 mapping of a range of contiguous
6b1eaf53
MK
1835between two user namespaces.
1836The specification in each line takes the form of
1837three numbers delimited by white space.
f5d401dd 1838The first two numbers specify the starting user ID in
6b1eaf53
MK
1839each user namespace.
1840The third number specifies the length of the mapped range.
1841In detail, the fields are interpreted as follows:
149eeb7b
MK
1842.RS
1843.IP (1) 4
1844The start of the range of user IDs in
1845the user namespace of the process
1846.IR pid .
1847.IP (2)
6b1eaf53
MK
1848The start of the range of user
1849IDs to which the user IDs specified by field one map.
1850How field two is interpreted depends on whether the process that opened
1851.I uid_map
1852and the process
1853.IR pid
1854are in the same user namespace, as follows:
1855.RS
1856.IP a) 3
1857If the two processes are in different user namespaces:
1858field two is the start of a range of
1859user IDs in the user namespace of the process that opened
149eeb7b 1860.IR uid_map .
6b1eaf53
MK
1861.IP b)
1862If the two processes are in the same user namespace:
1863field two is the start of the range of
1864user IDs in the parent user namespace of the process
1865.IR pid .
1866(The "parent user namespace"
1867is the user namespace of the process that created a user namespace
1868via a call to
1869.BR unshare (2)
1870or
1871.BR clone (2)
f5d401dd 1872with the
6b1eaf53
MK
1873.BR CLONE_NEWUSER
1874flag.)
1875This case enables the opener of
1876.I uid_map
1877(the common case here is opening
1878.IR /proc/self/uid_map )
1879to see the mapping of user IDs into the user namespace of the process
1880that created this user namespace.
1881.RE
149eeb7b
MK
1882.IP (3)
1883The length of the range of user IDs that is mapped between the two
f6e17121 1884user namespaces.
149eeb7b
MK
1885.RE
1886.IP
a2f479de
MK
1887After the creation of a new user namespace, the
1888.I uid_map
1889file may be written to exactly once to specify
149eeb7b
MK
1890the mapping of user IDs in the new user namespace.
1891(An attempt to write more than once to the file fails with the error
1892.BR EPERM .)
8b69f9c7
MK
1893.IP
1894The lines written to
1895.IR uid_map
1896must conform to the following rules:
1897.RS
1898.IP * 3
1899The three fields must be valid numbers,
1900and the last field must be greater than 0.
1901.IP *
1902Lines are terminated by newline characters.
1903.IP *
d0ebf398 1904There is an (arbitrary) limit on the number of lines in the file.
a2f479de 1905As at Linux 3.8, the limit is five lines.
8b69f9c7 1906.IP *
8b69f9c7
MK
1907The range of user IDs specified in each line cannot overlap with the ranges
1908in any other lines.
f5d401dd 1909In the current implementation (Linux 3.8), this requirement is
98ea4173
MK
1910satisfied by a simplistic implementation that imposes the further
1911requirement that
1912the values in both field 1 and field 2 of successive lines must be
1913in ascending numerical order.
8b69f9c7
MK
1914.RE
1915.IP
1916Writes that violate the above rules fail with the error
1917.BR EINVAL .
3d33f6ce 1918
6b1eaf53 1919In order for a process to write to the
3d33f6ce
MK
1920.I /proc/[pid]/uid_map
1921.RI ( /proc/[pid]/gid_map )
6b1eaf53
MK
1922file, the following requirements must be met:
1923.RS
1924.IP * 3
1925The process must have the
3d33f6ce
MK
1926.BR CAP_SETUID
1927.RB ( CAP_SETGID )
1928capability in the user namespace of the process
1929.IR pid .
6b1eaf53
MK
1930.IP *
1931The process must have the
1932.BR CAP_SETUID
1933.RB ( CAP_SETGID )
1934capability in the parent user namespace.
1935.IP *
1936The process must be in either the user namespace of the process
1937.I pid
1938or inside the parent user namespace of the process
1939.IR pid .
1940.RE
b81acb15
MK
1941For further details, see
1942.BR namespaces (7).
f6e17121 1943.TP
2054f761
MK
1944.IR /proc/[pid]/wchan " (since Linux 2.6.0)"
1945The symbolic name corresponding to the location
1946in the kernel where the process is sleeping.
1947.TP
fea681da 1948.I /proc/apm
097585ed
MK
1949Advanced power management version and battery information when
1950.B CONFIG_APM
1951is defined at kernel compilation time.
fea681da 1952.TP
eb7097c2
EDB
1953.I /proc/buddyinfo
1954This file contains information which is used for diagnosing memory
1955fragmentation issues.
1956Each line starts with the identification of the node and the name
b96ddae0
MK
1957of the zone which together identify a memory region
1958This is then
eb7097c2
EDB
1959followed by the count of available chunks of a certain order in
1960which these zones are split.
b96ddae0
MK
1961The size in bytes of a certain order is given by the formual:
1962
1963 (2^order)\ *\ PAGE_SIZE
1964
eb7097c2
EDB
1965The binary buddy allocator algorithm inside the kernel will split
1966one chunk into two chunks of a smaller order (thus with half the
1967size) or combine two contiguous chunks into one larger chunk of
1968a higher order (thus with double the size) to satisfy allocation
1969requests and to counter memory fragmentation.
1970The order matches the column number, when starting to count at zero.
1971
1972For example on a x86_64 system:
b96ddae0
MK
1973
1974.in -12n
eb7097c2 1975.nf
b96ddae0
MK
1976Node 0, zone DMA 1 1 1 0 2 1 1 0 1 1 3
1977Node 0, zone DMA32 65 47 4 81 52 28 13 10 5 1 404
1978Node 0, zone Normal 216 55 189 101 84 38 37 27 5 3 587
eb7097c2
EDB
1979.fi
1980.in
1981
b96ddae0 1982In this example, there is one node containing three zones and there
eb7097c2 1983are 11 different chunk sizes.
73ba31a9 1984If the page size is 4 kilobytes, then the first zone called
eb7097c2 1985.I DMA
b96ddae0
MK
1986(on x86 the first 16 megabyte of memory) has 1 chunk of 4 kilobytes
1987(order 0) available and has 3 chunks of 4 megabytes (order 10) available.
eb7097c2 1988
73ba31a9 1989If the memory is heavily fragmented, the counters for higher
eb7097c2
EDB
1990order chunks will be zero and allocation of large contiguous areas
1991will fail.
1992
1993Further information about the zones can be found in
1994.IR /proc/zoneinfo .
1995.TP
fea681da
MK
1996.I /proc/bus
1997Contains subdirectories for installed busses.
1998.TP
1999.I /proc/bus/pccard
59a40ed7 2000Subdirectory for PCMCIA devices when
097585ed
MK
2001.B CONFIG_PCMCIA
2002is set at kernel compilation time.
fea681da 2003.TP
1509ca0e
MK
2004.IR /proc/[pid]/timers " (since Linux 3.10)"
2005.\" commit 5ed67f05f66c41e39880a6d61358438a25f9fee5
2006.\" commit 48f6a7a511ef8823fdff39afee0320092d43a8a0
2007A list of the POSIX timers for this process.
9d54c087 2008Each timer is listed with a line that started with the string "ID:".
1509ca0e
MK
2009For example:
2010
2011.in +4n
2012.nf
2013ID: 1
2014signal: 60/00007fff86e452a8
2015notify: signal/pid.2634
2016ClockID: 0
2017ID: 0
2018signal: 60/00007fff86e452a8
2019notify: signal/pid.2634
2020ClockID: 1
2021.fi
2022.in
2023
2024The lines shown for each timer have the following meanings:
2025.RS
2026.TP
2027.I ID
2028The ID for this timer.
2029This is not the same as the timer ID returned by
2030.BR timer_create (2);
2031rather, it is the same kernel-internal ID that is available via the
2032.I si_timerid
2033field of the
2034.IR siginfo_t
2035structure (see
2036.BR sigaction (2)).
2037.TP
2038.I signal
2039This is the signal number that this timer uses to deliver notifications
2040followed by a slash, and then the
2041.I sigev_value.sival_ptr
2042value supplied to the signal handler.
2043Valid only for timers that notify via a signal.
2044.TP
2045.I notify
2046The part before the slash specifies the mechanism
2047that this timer uses to deliver notifications,
2048and is one of "thread", "signal", or "none".
2049Immediately following the slash is either the string "tid" for timers
2050with
2051.B SIGEV_THREAD_ID
2052notification, or "pid" for timers that notify by other mechanisms.
2053Following the "." is the PID of the process that will be delivered
2054a signal if the timer delivers notifications via a signal.
2055.TP
2056.I ClockID
2057This field identifies the clock that the timer uses for measuring time.
2058For most clocks, this is a number that matches one of the user-space
2059.BR CLOCK_*
9d54c087 2060constants exposed via
1509ca0e
MK
2061.IR <time.h> .
2062.B CLOCK_PROCESS_CPUTIME_ID
2063timers display with a value of -6
2064in this field.
2065.B CLOCK_THREAD_CPUTIME_ID
2066timers display with a value of -2
2067in this field.
2068.RE
2069.TP
fea681da
MK
2070.I /proc/bus/pccard/drivers
2071.TP
2072.I /proc/bus/pci
c13182ef 2073Contains various bus subdirectories and pseudo-files containing
59a40ed7 2074information about PCI busses, installed devices, and device
c13182ef
MK
2075drivers.
2076Some of these files are not ASCII.
fea681da
MK
2077.TP
2078.I /proc/bus/pci/devices
59a40ed7 2079Information about PCI devices.
c13182ef 2080They may be accessed through
fea681da
MK
2081.BR lspci (8)
2082and
2083.BR setpci (8).
2084.TP
2085.I /proc/cmdline
c13182ef
MK
2086Arguments passed to the Linux kernel at boot time.
2087Often done via a boot manager such as
59a40ed7
MK
2088.BR lilo (8)
2089or
2090.BR grub (8).
f6e524c4
MK
2091.TP
2092.IR /proc/config.gz " (since Linux 2.6)"
2093This file exposes the configuration options that were used
c3d9780d 2094to build the currently running kernel,
f6e524c4
MK
2095in the same format as they would be shown in the
2096.I .config
2097file that resulted when configuring the kernel (using
2098.IR "make xconfig" ,
2099.IR "make config" ,
2100or similar).
2101The file contents are compressed; view or search them using
f78ed33a
MK
2102.BR zcat (1)
2103and
2104.BR zgrep (1).
f6e524c4 2105As long as no changes have been made to the following file,
250e01ec
MK
2106the contents of
2107.I /proc/config.gz
2108are the same as those provided by :
f6e524c4
MK
2109.in +4n
2110.nf
2111
c3074d70 2112cat /lib/modules/$(uname \-r)/build/.config
f6e524c4
MK
2113.fi
2114.in
250e01ec
MK
2115.IP
2116.I /proc/config.gz
90878f7c 2117is provided only if the kernel is configured with
250e01ec 2118.BR CONFIG_IKCONFIG_PROC .
fea681da
MK
2119.TP
2120.I /proc/cpuinfo
2121This is a collection of CPU and system architecture dependent items,
2122for each supported architecture a different list.
2123Two common entries are \fIprocessor\fP which gives CPU number and
c13182ef
MK
2124\fIbogomips\fP; a system constant that is calculated
2125during kernel initialization.
2126SMP machines have information for
fea681da 2127each CPU.
a091f002
MK
2128The
2129.BR lscpu (1)
2130command gathers its information from this file.
fea681da
MK
2131.TP
2132.I /proc/devices
c13182ef
MK
2133Text listing of major numbers and device groups.
2134This can be used by MAKEDEV scripts for consistency with the kernel.
fea681da
MK
2135.TP
2136.IR /proc/diskstats " (since Linux 2.5.69)"
2137This file contains disk I/O statistics for each disk device.
66a9882e 2138See the Linux kernel source file
fea681da
MK
2139.I Documentation/iostats.txt
2140for further information.
2141.TP
2142.I /proc/dma
c13182ef 2143This is a list of the registered \fIISA\fP DMA (direct memory access)
fea681da
MK
2144channels in use.
2145.TP
2146.I /proc/driver
2147Empty subdirectory.
2148.TP
2149.I /proc/execdomains
2150List of the execution domains (ABI personalities).
2151.TP
2152.I /proc/fb
097585ed
MK
2153Frame buffer information when
2154.B CONFIG_FB
2155is defined during kernel compilation.
fea681da
MK
2156.TP
2157.I /proc/filesystems
9ee4a2b6
MK
2158A text listing of the filesystems which are supported by the kernel,
2159namely filesystems which were compiled into the kernel or whose kernel
6387216b
MK
2160modules are currently loaded.
2161(See also
fb477da2 2162.BR filesystems (5).)
9ee4a2b6 2163If a filesystem is marked with "nodev",
809d0164 2164this means that it does not require a block device to be mounted
9ee4a2b6 2165(e.g., virtual filesystem, network filesystem).
809d0164
MK
2166
2167Incidentally, this file may be used by
2168.BR mount (8)
9ee4a2b6
MK
2169when no filesystem is specified and it didn't manage to determine the
2170filesystem type.
2171Then filesystems contained in this file are tried
809d0164 2172(excepted those that are marked with "nodev").
fea681da
MK
2173.TP
2174.I /proc/fs
df352acc 2175.\" FIXME Much more needs to be said about /proc/fs
91085d85 2176.\"
df352acc
MK
2177Contains subdirectories that in turn contain files
2178with information about (certain) mounted filesystems.
fea681da
MK
2179.TP
2180.I /proc/ide
2181This directory
59a40ed7
MK
2182exists on systems with the IDE bus.
2183There are directories for each IDE channel and attached device.
c13182ef 2184Files include:
fea681da 2185
a08ea57c 2186.in +4n
fea681da
MK
2187.nf
2188cache buffer size in KB
2189capacity number of sectors
2190driver driver version
2191geometry physical and logical geometry
9fdfa163 2192identify in hexadecimal
fea681da
MK
2193media media type
2194model manufacturer's model number
2195settings drive settings
9fdfa163
MK
2196smart_thresholds in hexadecimal
2197smart_values in hexadecimal
fea681da 2198.fi
a08ea57c 2199.in
fea681da 2200
c13182ef 2201The
fea681da
MK
2202.BR hdparm (8)
2203utility provides access to this information in a friendly format.
2204.TP
2205.I /proc/interrupts
23ec6ff0
MK
2206This is used to record the number of interrupts per CPU per IO device.
2207Since Linux 2.6.24,
2208for the i386 and x86_64 architectures, at least, this also includes
2209interrupts internal to the system (that is, not associated with a device
2210as such), such as NMI (nonmaskable interrupt), LOC (local timer interrupt),
2211and for SMP systems, TLB (TLB flush interrupt), RES (rescheduling
2212interrupt), CAL (remote function call interrupt), and possibly others.
2213Very easy to read formatting, done in ASCII.
fea681da
MK
2214.TP
2215.I /proc/iomem
2216I/O memory map in Linux 2.4.
2217.TP
2218.I /proc/ioports
c13182ef 2219This is a list of currently registered Input-Output port regions that
fea681da
MK
2220are in use.
2221.TP
2222.IR /proc/kallsyms " (since Linux 2.5.71)"
2223This holds the kernel exported symbol definitions used by the
2224.BR modules (X)
2225tools to dynamically link and bind loadable modules.
2226In Linux 2.5.47 and earlier, a similar file with slightly different syntax
2227was named
2228.IR ksyms .
2229.TP
2230.I /proc/kcore
2231This file represents the physical memory of the system and is stored
c13182ef
MK
2232in the ELF core file format.
2233With this pseudo-file, and an unstripped
9a67332e
MK
2234kernel
2235.RI ( /usr/src/linux/vmlinux )
2236binary, GDB can be used to
fea681da
MK
2237examine the current state of any kernel data structures.
2238
2239The total length of the file is the size of physical memory (RAM) plus
22404KB.
2241.TP
2242.I /proc/kmsg
2243This file can be used instead of the
2244.BR syslog (2)
c13182ef
MK
2245system call to read kernel messages.
2246A process must have superuser
fea681da 2247privileges to read this file, and only one process should read this
c13182ef
MK
2248file.
2249This file should not be read if a syslog process is running
fea681da
MK
2250which uses the
2251.BR syslog (2)
2252system call facility to log kernel messages.
2253
2254Information in this file is retrieved with the
c4517613 2255.BR dmesg (1)
fea681da
MK
2256program.
2257.TP
ff56ac8b
MK
2258.IR /proc/kpagecount " (since Linux 2.6.25)"
2259This file contains a 64-bit count of the number of
2260times each physical page frame is mapped,
2261indexed by page frame number (see the discussion of
2262.IR /proc/[pid]/pagemap ).
2263.IP
2264The
2265.IR /proc/kpagecount
2266file is present only if the
2267.B CONFIG_PROC_PAGE_MONITOR
59d566a9
MK
2268kernel configuration option is enabled.
2269.TP
2270.IR /proc/kpageflags " (since Linux 2.6.25)"
ef4f4031 2271This file contains 64-bit masks corresponding to each physical page frame;
59d566a9
MK
2272it is indexed by page frame number (see the discussion of
2273.IR /proc/[pid]/pagemap ).
2274The bits are as follows:
2275
2276 0 - KPF_LOCKED
2277 1 - KPF_ERROR
2278 2 - KPF_REFERENCED
2279 3 - KPF_UPTODATE
2280 4 - KPF_DIRTY
2281 5 - KPF_LRU
2282 6 - KPF_ACTIVE
2283 7 - KPF_SLAB
2284 8 - KPF_WRITEBACK
2285 9 - KPF_RECLAIM
2286 10 - KPF_BUDDY
2287 11 - KPF_MMAP (since Linux 2.6.31)
2288 12 - KPF_ANON (since Linux 2.6.31)
2289 13 - KPF_SWAPCACHE (since Linux 2.6.31)
2290 14 - KPF_SWAPBACKED (since Linux 2.6.31)
2291 15 - KPF_COMPOUND_HEAD (since Linux 2.6.31)
2292 16 - KPF_COMPOUND_TAIL (since Linux 2.6.31)
2293 16 - KPF_HUGE (since Linux 2.6.31)
2294 18 - KPF_UNEVICTABLE (since Linux 2.6.31)
2295 19 - KPF_HWPOISON (since Linux 2.6.31)
2296 20 - KPF_NOPAGE (since Linux 2.6.31)
2297 21 - KPF_KSM (since Linux 2.6.32)
2298 22 - KPF_THP (since Linux 3.4)
2299
2300For further details on the meanings of these bits,
2301see the kernel source file
2302.IR Documentation/vm/pagemap.txt .
2303Before kernel 2.6.29,
2304.\" commit ad3bdefe877afb47480418fdb05ecd42842de65e
2305.\" commit e07a4b9217d1e97d2f3a62b6b070efdc61212110
2306.BR KPF_WRITEBACK ,
2307.BR KPF_RECLAIM ,
2308.BR KPF_BUDDY ,
2309and
2310.BR KPF_LOCKED
2311did not report correctly.
2312.IP
2313The
2314.IR /proc/kpageflags
2315file is present only if the
2316.B CONFIG_PROC_PAGE_MONITOR
ff56ac8b
MK
2317kernel configuration option is enabled.
2318.TP
fea681da
MK
2319.IR /proc/ksyms " (Linux 1.1.23-2.5.47)"
2320See
2321.IR /proc/kallsyms .
2322.TP
2323.I /proc/loadavg
6b05dc38
MK
2324The first three fields in this file are load average figures
2325giving the number of jobs in the run queue (state R)
fea681da
MK
2326or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes.
2327They are the same as the load average numbers given by
2328.BR uptime (1)
2329and other programs.
6b05dc38 2330The fourth field consists of two numbers separated by a slash (/).
78fc91ec
EDB
2331The first of these is the number of currently runnable kernel
2332scheduling entities (processes, threads).
6b05dc38
MK
2333The value after the slash is the number of kernel scheduling entities
2334that currently exist on the system.
2335The fifth field is the PID of the process that was most
2336recently created on the system.
fea681da
MK
2337.TP
2338.I /proc/locks
2339This file shows current file locks
2340.RB ( flock "(2) and " fcntl (2))
2341and leases
2342.RB ( fcntl (2)).
2343.TP
89dd5f8a 2344.IR /proc/malloc " (only up to and including Linux 2.2)"
59a40ed7 2345.\" It looks like this only ever did something back in 1.0 days
90878f7c 2346This file is present only if
89dd5f8a 2347.B CONFIG_DEBUG_MALLOC
097585ed 2348was defined during compilation.
fea681da
MK
2349.TP
2350.I /proc/meminfo
77b802ec
MK
2351This file reports statistics about memory usage on the system.
2352It is used by
fea681da
MK
2353.BR free (1)
2354to report the amount of free and used memory (both physical and swap)
2355on the system as well as the shared memory and buffers used by the
2356kernel.
3ba3d5b1
MK
2357Each line of the file consists of a parameter name, followed by a colon,
2358the value of the parameter, and an option unit of measurement (e.g., "kB").
2359The list below describes the parameter names and
2360the format specifier required to read the field value.
2361Except as noted below,
2362all of the fields have been present since at least Linux 2.6.0.
86cf87d7 2363Some fields are displayed only if the kernel was configured
3ba3d5b1
MK
2364with various options; those dependencies are noted in the list.
2365.RS
2366.TP
2367.IR MemTotal " %lu"
449dd4e2 2368Total usable RAM (i.e., physical RAM minus a few reserved
99e91586 2369bits and the kernel binary code).
3ba3d5b1
MK
2370.TP
2371.IR MemFree " %lu"
7bccb7d4
DP
2372The sum of
2373.IR LowFree + HighFree .
3ba3d5b1
MK
2374.TP
2375.IR Buffers " %lu"
99e91586 2376Relatively temporary storage for raw disk blocks that
3ba3d5b1
MK
2377shouldn't get tremendously large (20MB or so).
2378.TP
2379.IR Cached " %lu"
2380In-memory cache for files read from the disk (the page cache).
2381Doesn't include
2382.IR SwapCached .
2383.TP
2384.IR SwapCached " %lu"
2385Memory that once was swapped out, is swapped back in but
2386still also is in the swap file.
fa1d2749 2387(If memory pressure is high, these pages
3ba3d5b1 2388don't need to be swapped out again because they are already
99e91586 2389in the swap file.
3ba3d5b1
MK
2390This saves I/O.)
2391.TP
2392.IR Active " %lu"
2393Memory that has been used more recently and usually not
2394reclaimed unless absolutely necessary.
2395.TP
2396.IR Inactive " %lu"
2397Memory which has been less recently used.
2398It is more eligible to be reclaimed for other purposes.
2399.TP
2400.IR Active(anon) " %lu (since Linux 2.6.28)"
2401[To be documented.]
2402.TP
2403.IR Inactive(anon) " %lu (since Linux 2.6.28)"
2404[To be documented.]
2405.TP
2406.IR Active(file) " %lu (since Linux 2.6.28)"
2407[To be documented.]
2408.TP
2409.IR Inactive(file) " %lu (since Linux 2.6.28)"
2410[To be documented.]
2411.TP
2412.IR Unevictable " %lu (since Linux 2.6.28)"
2413(From Linux 2.6.28 to 2.6.30,
2414\fBCONFIG_UNEVICTABLE_LRU\fP was required.)
2415[To be documented.]
2416.TP
46fbfc07 2417.IR Mlocked " %lu (since Linux 2.6.28)"
3ba3d5b1
MK
2418(From Linux 2.6.28 to 2.6.30,
2419\fBCONFIG_UNEVICTABLE_LRU\fP was required.)
2420[To be documented.]
2421.TP
2422.IR HighTotal " %lu"
2423(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
2424Total amount of highmem.
99e91586 2425Highmem is all memory above ~860MB of physical memory.
3ba3d5b1
MK
2426Highmem areas are for use by user-space programs,
2427or for the page cache.
2428The kernel must use tricks to access
2429this memory, making it slower to access than lowmem.
2430.TP
2431.IR HighFree " %lu
2432(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
2433Amount of free highmem.
2434.TP
2435.IR LowTotal " %lu
2436(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
2437Total amount of lowmem.
2438Lowmem is memory which can be used for everything that
2439highmem can be used for, but it is also available for the
2440kernel's use for its own data structures.
2441Among many other things,
99e91586 2442it is where everything from
7bccb7d4
DP
2443.I Slab
2444is allocated.
3ba3d5b1
MK
2445Bad things happen when you're out of lowmem.
2446.TP
2447.IR LowFree " %lu
2448(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
2449Amount of free lowmem.
2450.TP
2451.IR MmapCopy " %lu (since Linux 2.6.29)"
99e91586
DP
2452.RB ( CONFIG_MMU
2453is required.)
3ba3d5b1
MK
2454[To be documented.]
2455.TP
2456.IR SwapTotal " %lu"
2457Total amount of swap space available.
2458.TP
2459.IR SwapFree " %lu"
c16d4f25 2460Amount of swap space that is currently unused.
3ba3d5b1
MK
2461.TP
2462.IR Dirty " %lu"
2463Memory which is waiting to get written back to the disk.
2464.TP
2465.IR Writeback " %lu"
2466Memory which is actively being written back to the disk.
2467.TP
2468.IR AnonPages " %lu (since Linux 2.6.18)"
2469Non-file backed pages mapped into user-space page tables.
2470.TP
2471.IR Mapped " %lu"
fda70f5b
MK
2472Files which have been mapped into memory (with
2473.BR mmap (2)),
2474such as libraries.
3ba3d5b1
MK
2475.TP
2476.IR Shmem " %lu (since Linux 2.6.32)"
2477[To be documented.]
2478.TP
2479.IR Slab " %lu"
2480In-kernel data structures cache.
2481.TP
2482.IR SReclaimable " %lu (since Linux 2.6.19)"
7bccb7d4
DP
2483Part of
2484.IR Slab ,
2485that might be reclaimed, such as caches.
3ba3d5b1
MK
2486.TP
2487.IR SUnreclaim " %lu (since Linux 2.6.19)"
7bccb7d4
DP
2488Part of
2489.IR Slab ,
2490that cannot be reclaimed on memory pressure.
3ba3d5b1
MK
2491.TP
2492.IR KernelStack " %lu (since Linux 2.6.32)"
2493Amount of memory allocated to kernel stacks.
2494.TP
2495.IR PageTables " %lu (since Linux 2.6.18)"
2496Amount of memory dedicated to the lowest level of page tables.
2497.TP
2498.IR Quicklists " %lu (since Linux 2.6.27)"
2499(\fBCONFIG_QUICKLIST\fP is required.)
2500[To be documented.]
2501.TP
2502.IR NFS_Unstable " %lu (since Linux 2.6.18)"
2503NFS pages sent to the server, but not yet committed to stable storage.
2504.TP
2505.IR Bounce " %lu (since Linux 2.6.18)"
2506Memory used for block device "bounce buffers".
2507.TP
2508.IR WritebackTmp " %lu (since Linux 2.6.26)"
2509Memory used by FUSE for temporary writeback buffers.
2510.TP
2511.IR CommitLimit " %lu (since Linux 2.6.10)"
cd7b6c40
MK
2512This is the total amount of memory currently available to
2513be allocated on the system, expressed in kilobytes.
90878f7c
MK
2514This limit is adhered to
2515only if strict overcommit accounting is enabled (mode 2 in
cd7b6c40
MK
2516.IR /proc/sys/vm/overcommit_memory ).
2517The limit is calculated according to the formula described under
2518.IR /proc/sys/vm/overcommit_memory .
2519For further details, see the kernel source file
3ba3d5b1
MK
2520.IR Documentation/vm/overcommit-accounting .
2521.TP
2522.IR Committed_AS " %lu"
2523The amount of memory presently allocated on the system.
2524The committed memory is a sum of all of the memory which
2525has been allocated by processes, even if it has not been
2526"used" by them as of yet.
2527A process which allocates 1GB of memory (using
2528.BR malloc (3)
33a0ccb2 2529or similar), but touches only 300MB of that memory will show up
90878f7c 2530as using only 300MB of memory even if it has the address space
3ba3d5b1 2531allocated for the entire 1GB.
cd7b6c40 2532
3ba3d5b1
MK
2533This 1GB is memory which has been "committed" to by the VM
2534and can be used at any time by the allocating application.
cd7b6c40
MK
2535With strict overcommit enabled on the system (mode 2 in
2536IR /proc/sys/vm/overcommit_memory ),
3ba3d5b1
MK
2537allocations which would exceed the
2538.I CommitLimit
cd7b6c40 2539will not be permitted.
3ba3d5b1
MK
2540This is useful if one needs to guarantee that processes will not
2541fail due to lack of memory once that memory has been successfully allocated.
2542.TP
2543.IR VmallocTotal " %lu"
2544Total size of vmalloc memory area.
2545.TP
2546.IR VmallocUsed " %lu"
2547Amount of vmalloc area which is used.
2548.TP
2549.IR VmallocChunk " %lu"
2550Largest contiguous block of vmalloc area which is free.
2551.TP
2552.IR HardwareCorrupted " %lu (since Linux 2.6.32)"
2553(\fBCONFIG_MEMORY_FAILURE\fP is required.)
2554[To be documented.]
2555.TP
2556.IR AnonHugePages " %lu (since Linux 2.6.38)"
2557(\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.)
7fac88a9 2558Non-file backed huge pages mapped into user-space page tables.
3ba3d5b1
MK
2559.TP
2560.IR HugePages_Total " %lu"
2561(\fBCONFIG_HUGETLB_PAGE\fP is required.)
2562The size of the pool of huge pages.
2563.TP
2564.IR HugePages_Free " %lu"
2565(\fBCONFIG_HUGETLB_PAGE\fP is required.)
2566The number of huge pages in the pool that are not yet allocated.
2567.TP
2568.IR HugePages_Rsvd " %lu (since Linux 2.6.17)"
2569(\fBCONFIG_HUGETLB_PAGE\fP is required.)
2570This is the number of huge pages for
2571which a commitment to allocate from the pool has been made,
2572but no allocation has yet been made.
2573These reserved huge pages
2574guarantee that an application will be able to allocate a
2575huge page from the pool of huge pages at fault time.
2576.TP
aa8a6b4f 2577.IR HugePages_Surp " %lu (since Linux 2.6.24)"
3ba3d5b1
MK
2578(\fBCONFIG_HUGETLB_PAGE\fP is required.)
2579This is the number of huge pages in
2580the pool above the value in
2581.IR /proc/sys/vm/nr_hugepages .
2582The maximum number of surplus huge pages is controlled by
2583.IR /proc/sys/vm/nr_overcommit_hugepages .
2584.TP
2585.IR Hugepagesize " %lu"
2586(\fBCONFIG_HUGETLB_PAGE\fP is required.)
2587The size of huge pages.
2588.RE
fea681da 2589.TP
aa341984
MK
2590.I /proc/modules
2591A text list of the modules that have been loaded by the system.
2592See also
2593.BR lsmod (8).
2594.TP
fea681da 2595.I /proc/mounts
c1eea65a 2596Before kernel 2.4.19, this file was a list
9ee4a2b6 2597of all the filesystems currently mounted on the system.
732e54dd 2598With the introduction of per-process mount namespaces in
c1eea65a
MK
2599Linux 2.4.19, this file became a link to
2600.IR /proc/self/mounts ,
732e54dd 2601which lists the mount points of the process's own mount namespace.
fea681da 2602The format of this file is documented in
31e9a9ec 2603.BR fstab (5).
fea681da 2604.TP
fea681da 2605.I /proc/mtrr
c13182ef 2606Memory Type Range Registers.
66a9882e 2607See the Linux kernel source file
cfe70b66 2608.I Documentation/mtrr.txt
fea681da
MK
2609for details.
2610.TP
2611.I /proc/net
2612various net pseudo-files, all of which give the status of some part of
c13182ef
MK
2613the networking layer.
2614These files contain ASCII structures and are,
59a40ed7
MK
2615therefore, readable with
2616.BR cat (1).
c13182ef 2617However, the standard
fea681da
MK
2618.BR netstat (8)
2619suite provides much cleaner access to these files.
2620.TP
2621.I /proc/net/arp
2622This holds an ASCII readable dump of the kernel ARP table used for
c13182ef 2623address resolutions.
01d0a447 2624It will show both dynamically learned and preprogrammed ARP entries.
c13182ef 2625The format is:
fea681da
MK
2626
2627.nf
2628.ft CW
2629.in 8n
2630IP address HW type Flags HW address Mask Device
2631192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0
2632192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0
2633.ft
2634.fi
2635.in
2636
6c04f928 2637Here "IP address" is the IPv4 address of the machine and the "HW type"
c13182ef
MK
2638is the hardware type of the address from RFC\ 826.
2639The flags are the internal
9a67332e
MK
2640flags of the ARP structure (as defined in
2641.IR /usr/include/linux/if_arp.h )
2642and
6c04f928 2643the "HW address" is the data link layer mapping for that IP address if
fea681da
MK
2644it is known.
2645.TP
2646.I /proc/net/dev
c13182ef
MK
2647The dev pseudo-file contains network device status information.
2648This gives
2649the number of received and sent packets, the number of errors and
fea681da 2650collisions
c13182ef
MK
2651and other basic statistics.
2652These are used by the
fea681da 2653.BR ifconfig (8)
c13182ef
MK
2654program to report device status.
2655The format is:
fea681da
MK
2656
2657.nf
2658.ft CW
2659.in 1n
2660Inter-| Receive | Transmit
2661 face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
2662 lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0
2663 eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0
2664 ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0
2665 tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0
2666.in
2667.ft
2668.fi
2669.\" .TP
2670.\" .I /proc/net/ipx
2671.\" No information.
2672.\" .TP
2673.\" .I /proc/net/ipx_route
2674.\" No information.
2675.TP
2676.I /proc/net/dev_mcast
2677Defined in
2678.IR /usr/src/linux/net/core/dev_mcast.c :
2679.nf
2680.in +5
9fdfa163 2681indx interface_name dmi_u dmi_g dmi_address
fea681da
MK
26822 eth0 1 0 01005e000001
26833 eth1 1 0 01005e000001
26844 eth2 1 0 01005e000001
2685.in
2686.fi
2687.TP
2688.I /proc/net/igmp
c13182ef
MK
2689Internet Group Management Protocol.
2690Defined in
fea681da
MK
2691.IR /usr/src/linux/net/core/igmp.c .
2692.TP
2693.I /proc/net/rarp
2694This file uses the same format as the
2695.I arp
2696file and contains the current reverse mapping database used to provide
2697.BR rarp (8)
c13182ef
MK
2698reverse address lookup services.
2699If RARP is not configured into the
fea681da
MK
2700kernel,
2701this file will not be present.
2702.TP
2703.I /proc/net/raw
c13182ef
MK
2704Holds a dump of the RAW socket table.
2705Much of the information is not of
fea681da 2706use
c13182ef 2707apart from debugging.
6c04f928 2708The "sl" value is the kernel hash slot for the
fea681da 2709socket,
6c04f928
MK
2710the "local_address" is the local address and protocol number pair.
2711\&"St" is
c13182ef
MK
2712the internal status of the socket.
2713The "tx_queue" and "rx_queue" are the
fea681da 2714outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 2715The "tr", "tm\->when", and "rexmits" fields are not used by RAW.
fdc196f5
MK
2716The "uid"
2717field holds the effective UID of the creator of the socket.
fea681da
MK
2718.\" .TP
2719.\" .I /proc/net/route
2720.\" No information, but looks similar to
2721.\" .BR route (8).
2722.TP
2723.I /proc/net/snmp
c13182ef 2724This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP
fea681da 2725management
763f0e47 2726information bases for an SNMP agent.
fea681da
MK
2727.TP
2728.I /proc/net/tcp
c13182ef
MK
2729Holds a dump of the TCP socket table.
2730Much of the information is not
2731of use apart from debugging.
2732The "sl" value is the kernel hash slot
6beb1671
MK
2733for the socket, the "local_address" is the local address and port number pair.
2734The "rem_address" is the remote address and port number pair
6c04f928
MK
2735(if connected).
2736\&"St" is the internal status of the socket.
2737The "tx_queue" and "rx_queue" are the
fea681da 2738outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 2739The "tr", "tm\->when", and "rexmits" fields hold internal information of
f33774c4 2740the kernel socket state and are useful only for debugging.
fdc196f5
MK
2741The "uid"
2742field holds the effective UID of the creator of the socket.
fea681da
MK
2743.TP
2744.I /proc/net/udp
c13182ef
MK
2745Holds a dump of the UDP socket table.
2746Much of the information is not of
2747use apart from debugging.
2748The "sl" value is the kernel hash slot for the
6beb1671
MK
2749socket, the "local_address" is the local address and port number pair.
2750The "rem_address" is the remote address and port number pair
fea681da
MK
2751(if connected). "St" is the internal status of the socket.
2752The "tx_queue" and "rx_queue" are the outgoing and incoming data queue
c13182ef 2753in terms of kernel memory usage.
94e9d9fe 2754The "tr", "tm\->when", and "rexmits" fields
c13182ef 2755are not used by UDP.
fdc196f5
MK
2756The "uid"
2757field holds the effective UID of the creator of the socket.
fea681da
MK
2758The format is:
2759
2760.nf
2761.ft CW
2762.in 1n
94e9d9fe 2763sl local_address rem_address st tx_queue rx_queue tr rexmits tm\->when uid
fea681da
MK
2764 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0
2765 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0
2766 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0
2767.in
2768.ft
2769.fi
2770.TP
2771.I /proc/net/unix
008f1ecc 2772Lists the UNIX domain sockets present within the system and their
c13182ef
MK
2773status.
2774The format is:
fea681da
MK
2775.nf
2776.sp .5
2777.ft CW
2778Num RefCount Protocol Flags Type St Path
2779 0: 00000002 00000000 00000000 0001 03
2780 1: 00000001 00000000 00010000 0001 01 /dev/printer
2781.ft
2782.sp .5
2783.fi
2784
6c04f928
MK
2785Here "Num" is the kernel table slot number, "RefCount" is the number
2786of users of the socket, "Protocol" is currently always 0, "Flags"
fea681da 2787represent the internal kernel flags holding the status of the
c13182ef 2788socket.
008f1ecc 2789Currently, type is always "1" (UNIX domain datagram sockets are
6c04f928
MK
2790not yet supported in the kernel).
2791\&"St" is the internal state of the
fea681da
MK
2792socket and Path is the bound path (if any) of the socket.
2793.TP
ed8de0e4
FW
2794.I /proc/net/netfilter/nfnetlink_queue
2795This file contains information about netfilter userspace queueing, if used.
2796Each line represents a queue. Queues that have not been subscribed to
2797by userspace are not shown.
2798.nf
2799
2800 1 4207 0 2 65535 0 0 0 1
2801 (1) (2) (3)(4) (5) (6) (7) (8)
2802.fi
2803.IP
2804The fields in each line are:
2805.RS 7
2806.TP 5
2807(1)
2808The ID of the queue. This matches what is specified in the
2809.B \-\-queue\-num
2810or
2811.B \-\-queue\-balance
2812options to the
2813.BR iptables (8)
2814NFQUEUE target. See
2815.BR iptables-extensions (8)
2816for more information.
2817.TP
2818(2)
2819The netlink port id subscribed to the queue.
2820.TP
2821(3)
2822The number of packets currently queued and waiting to be processed by
2823the application.
2824.TP
2825(4)
2826The copy mode of the queue. It is either 1 (metadata only) or 2
2827(also copy payload data to userspace).
2828.TP
2829(5)
2830Copy range, i.e. how many bytes of packet payload should be copied to
2831userspace at most.
2832.TP
2833(6)
2834queue dropped. Number of packets that had to be dropped by the kernel because
2835too many packets are already waiting for userspace to send back the mandatory
2836accept/drop verdicts.
2837.TP
2838(7)
2839queue user dropped. Number of packets that were dropped within the netlink
2840subsystem. Such drops usually happen when the corresponding socket buffer is
2841full, i.e. userspace is not able to read messages fast enough.
2842.TP
2843(8)
2844sequence number. Every queued packet is associated with a (32-bit)
2845monotonically-increasing sequence number.
2846This shows the ID of the most recent packet queued.
2847.RE
2848.IP
f33774c4 2849The last number exists only for compatibility reasons and is always 1.
ed8de0e4 2850.TP
fea681da 2851.I /proc/partitions
f042d149
MK
2852Contains the major and minor numbers of each partition as well as the number
2853of 1024-byte blocks and the partition name.
fea681da
MK
2854.TP
2855.I /proc/pci
2856This is a listing of all PCI devices found during kernel initialization
2857and their configuration.
2990d781 2858
59a40ed7
MK
2859This file has been deprecated in favor of a new
2860.I /proc
2990d781
MK
2861interface for PCI
2862.RI ( /proc/bus/pci ).
2863It became optional in Linux 2.2 (available with
2864.B CONFIG_PCI_OLD_PROC
2865set at kernel compilation).
24b74457 2866It became once more nonoptionally enabled in Linux 2.4.
2990d781
MK
2867Next, it was deprecated in Linux 2.6 (still available with
2868.B CONFIG_PCI_LEGACY_PROC
2869set), and finally removed altogether since Linux 2.6.17.
bea08fec
MK
2870.\" FIXME Document /proc/sched_debug
2871.\"
b4e9ee8f
MK
2872.\" .TP
2873.\" .IR /proc/sched_debug " (since Linux 2.6.23)"
69119dc7 2874.\" See also /proc/[pid]/sched
caea7868
MK
2875.TP
2876.IR /proc/profile " (since Linux 2.4)"
2877This file is present only if the kernel was booted with the
2878.I profile=1
2879command-line option.
2880It exposes kernel profiling information in a binary format for use by
2881.BR readprofile (1).
2882Writing (e.g., an empty string) to this file resets the profiling counters;
2883on some architectures,
2884writing a binary integer "profiling multiplier" of size
2885.IR sizeof(int)
8a3ac89a 2886sets the profiling interrupt frequency.
fea681da
MK
2887.TP
2888.I /proc/scsi
59a40ed7
MK
2889A directory with the
2890.I scsi
2891mid-level pseudo-file and various SCSI low-level
2990d781
MK
2892driver directories,
2893which contain a file for each SCSI host in this system, all of
c13182ef
MK
2894which give the status of some part of the SCSI IO subsystem.
2895These files contain ASCII structures and are, therefore, readable with
2990d781 2896.BR cat (1).
fea681da 2897
c13182ef 2898You can also write to some of the files to reconfigure the subsystem or
59a40ed7 2899switch certain features on or off.
fea681da
MK
2900.TP
2901.I /proc/scsi/scsi
c13182ef 2902This is a listing of all SCSI devices known to the kernel.
59a40ed7 2903The listing is similar to the one seen during bootup.
c13182ef 2904scsi currently supports only the \fIadd-single-device\fP command which
59a40ed7
MK
2905allows root to add a hotplugged device to the list of known devices.
2906
2907The command
2908.in +4n
2909.nf
2910
2911echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi
fea681da 2912
59a40ed7
MK
2913.fi
2914.in
c13182ef
MK
2915will cause
2916host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0.
2917If there
fea681da
MK
2918is already a device known on this address or the address is invalid, an
2919error will be returned.
2920.TP
2921.I /proc/scsi/[drivername]
c13182ef
MK
2922\fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740,
2923aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic,
2924scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000.
2925These directories show up for all drivers that registered at least one
59a40ed7 2926SCSI HBA.
c13182ef 2927Every directory contains one file per registered host.
59a40ed7 2928Every host-file is named after the number the host was assigned during
c13182ef 2929initialization.
fea681da 2930
c13182ef 2931Reading these files will usually show driver and host configuration,
f78ed33a 2932statistics, and so on.
fea681da
MK
2933
2934Writing to these files allows different things on different hosts.
2935For example, with the \fIlatency\fP and \fInolatency\fP commands,
2936root can switch on and off command latency measurement code in the
c13182ef
MK
2937eata_dma driver.
2938With the \fIlockup\fP and \fIunlock\fP commands,
2939root can control bus lockups simulated by the scsi_debug driver.
fea681da
MK
2940.TP
2941.I /proc/self
59a40ed7
MK
2942This directory refers to the process accessing the
2943.I /proc
9ee4a2b6 2944filesystem,
59a40ed7
MK
2945and is identical to the
2946.I /proc
2947directory named by the process ID of the same process.
fea681da
MK
2948.TP
2949.I /proc/slabinfo
c13182ef 2950Information about kernel caches.
90878f7c 2951Since Linux 2.6.16 this file is present only if the
821643a8
MK
2952.B CONFIG_SLAB
2953kernel configuration option is enabled.
350038ff 2954The columns in
38f76cd2 2955.I /proc/slabinfo
350038ff 2956are:
a08ea57c 2957.in +4n
fea681da 2958.nf
a08ea57c 2959
fea681da
MK
2960cache-name
2961num-active-objs
2962total-objs
2963object-size
2964num-active-slabs
2965total-slabs
2966num-pages-per-slab
2967.fi
a08ea57c
MK
2968.in
2969
c13182ef 2970See
fea681da
MK
2971.BR slabinfo (5)
2972for details.
2973.TP
2974.I /proc/stat
c13182ef
MK
2975kernel/system statistics.
2976Varies with architecture.
2977Common
fea681da
MK
2978entries include:
2979.RS
2980.TP
2981\fIcpu 3357 0 4313 1362393\fP
bfbfcd18 2982The amount of time, measured in units of
268f000b
MK
2983USER_HZ (1/100ths of a second on most architectures, use
2984.IR sysconf(_SC_CLK_TCK)
2985to obtain the right value),
b81087ab 2986.\" 1024 on Alpha and ia64
ae3b8047
MK
2987that the system spent in various states:
2988.RS
2989.TP
2990.I user
ea0841f6 2991(1) Time spent in user mode.
ae3b8047
MK
2992.TP
2993.I nice
0633f951 2994(2) Time spent in user mode with low priority (nice).
9f1b9726 2995.TP
ae3b8047 2996.I system
0633f951 2997(3) Time spent in system mode.
ae3b8047
MK
2998.TP
2999.I idle
ea0841f6 3000(4) Time spent in the idle task.
bea08fec 3001.\" FIXME . Actually, the following info about the /proc/stat 'cpu' field
e04a1f93
MK
3002.\" does not seem to be quite right (at least in 2.6.12 or 3.6):
3003.\" the idle time in /proc/uptime does not quite match this value
3004This value should be USER_HZ times the
4cb1deb7
MK
3005second entry in the
3006.I /proc/uptime
3007pseudo-file.
ae3b8047
MK
3008.TP
3009.IR iowait " (since Linux 2.5.41)"
ea0841f6 3010(5) Time waiting for I/O to complete.
ae3b8047
MK
3011.TP
3012.IR irq " (since Linux 2.6.0-test4)"
ea0841f6 3013(6) Time servicing interrupts.
ae3b8047 3014.TP
0633f951 3015.IR softirq " (since Linux 2.6.0-test4)"
ea0841f6 3016(7) Time servicing softirqs.
ae3b8047
MK
3017.TP
3018.IR steal " (since Linux 2.6.11)"
ea0841f6 3019(8) Stolen time, which is the time spent in other operating systems when
9de1f6cc 3020running in a virtualized environment
ae3b8047
MK
3021.TP
3022.IR guest " (since Linux 2.6.24)"
0633f951 3023(9) Time spent running a virtual CPU for guest
afef1764 3024operating systems under the control of the Linux kernel.
14c06953 3025.\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de
d4fd4120
MK
3026.TP
3027.IR guest_nice " (since Linux 2.6.33)"
3028.\" commit ce0e7b28fb75cb003cfc8d0238613aaf1c55e797
3029(10) Time spent running a niced guest (virtual CPU for guest
3030operating systems under the control of the Linux kernel).
ae3b8047 3031.RE
fea681da
MK
3032.TP
3033\fIpage 5741 1808\fP
3034The number of pages the system paged in and the number that were paged
3035out (from disk).
3036.TP
3037\fIswap 1 0\fP
3038The number of swap pages that have been brought in and out.
3039.TP
bea08fec 3040.\" FIXME . The following is not the full picture for the 'intr' of
777f5a9e 3041.\" /proc/stat on 2.6:
fea681da 3042\fIintr 1462898\fP
bfbfcd18
MK
3043This line shows counts of interrupts serviced since boot time,
3044for each of the possible system interrupts.
d63ff76e 3045The first column is the total of all interrupts serviced
d6a56978
MK
3046including unnumbered architecture specific interrupts;
3047each subsequent column is the total for that particular numbered interrupt.
d63ff76e 3048Unnumbered interrupts are not shown, only summed into the total.
fea681da
MK
3049.TP
3050\fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP...
636297e9 3051(major,disk_idx):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written)
bfbfcd18
MK
3052.br
3053(Linux 2.4 only)
fea681da
MK
3054.TP
3055\fIctxt 115315\fP
3056The number of context switches that the system underwent.
3057.TP
3058\fIbtime 769041601\fP
f49c451a 3059boot time, in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
fea681da
MK
3060.TP
3061\fIprocesses 86031\fP
3062Number of forks since boot.
bfbfcd18
MK
3063.TP
3064\fIprocs_running 6\fP
3065Number of processes in runnable state.
5fab2e7c 3066(Linux 2.5.45 onward.)
bfbfcd18
MK
3067.TP
3068\fIprocs_blocked 2\fP
3069Number of processes blocked waiting for I/O to complete.
5fab2e7c 3070(Linux 2.5.45 onward.)
fea681da
MK
3071.RE
3072.TP
3073.I /proc/swaps
c13182ef
MK
3074Swap areas in use.
3075See also
fea681da
MK
3076.BR swapon (8).
3077.TP
3078.I /proc/sys
3079This directory (present since 1.3.57) contains a number of files
3080and subdirectories corresponding to kernel variables.
3081These variables can be read and sometimes modified using
9ee4a2b6 3082the \fI/proc\fP filesystem, and the (deprecated)
fea681da 3083.BR sysctl (2)
c13182ef 3084system call.
fea681da 3085.TP
6ab7c0aa 3086.IR /proc/sys/abi " (since Linux 2.4.10)"
fea681da 3087This directory may contain files with application binary information.
6ab7c0aa 3088.\" On some systems, it is not present.
66a9882e 3089See the Linux kernel source file
6ab7c0aa
MK
3090.I Documentation/sysctl/abi.txt
3091for more information.
fea681da
MK
3092.TP
3093.I /proc/sys/debug
3094This directory may be empty.
3095.TP
3096.I /proc/sys/dev
e2badfdf 3097This directory contains device-specific information (e.g.,
9a67332e 3098.IR dev/cdrom/info ).
fea681da
MK
3099On
3100some systems, it may be empty.
3101.TP
3102.I /proc/sys/fs
49236d3c 3103This directory contains the files and subdirectories for kernel variables
9ee4a2b6 3104related to filesystems.
fea681da
MK
3105.TP
3106.I /proc/sys/fs/binfmt_misc
c13182ef 3107Documentation for files in this directory can be found
66a9882e 3108in the Linux kernel sources in
fea681da
MK
3109.IR Documentation/binfmt_misc.txt .
3110.TP
59a40ed7
MK
3111.IR /proc/sys/fs/dentry-state " (since Linux 2.2)"
3112This file contains information about the status of the
3113directory cache (dcache).
3114The file contains six numbers,
c13182ef 3115.IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), "
59a40ed7 3116.I want_pages
fea681da 3117(pages requested by system) and two dummy values.
59a40ed7
MK
3118.RS
3119.IP * 2
3120.I nr_dentry
3121is the number of allocated dentries (dcache entries).
3122This field is unused in Linux 2.2.
3123.IP *
3124.I nr_unused
3125is the number of unused dentries.
3126.IP *
3127.I age_limit
3128.\" looks like this is unused in kernels 2.2 to 2.6
3129is the age in seconds after which dcache entries
3130can be reclaimed when memory is short.
3131.IP *
3132.I want_pages
3133.\" looks like this is unused in kernels 2.2 to 2.6
c7094399 3134is nonzero when the kernel has called shrink_dcache_pages() and the
fea681da 3135dcache isn't pruned yet.
59a40ed7 3136.RE
fea681da
MK
3137.TP
3138.I /proc/sys/fs/dir-notify-enable
3139This file can be used to disable or enable the
3140.I dnotify
3141interface described in
3142.BR fcntl (2)
3143on a system-wide basis.
3144A value of 0 in this file disables the interface,
3145and a value of 1 enables it.
3146.TP
3147.I /proc/sys/fs/dquot-max
3148This file shows the maximum number of cached disk quota entries.
3149On some (2.4) systems, it is not present.
3150If the number of free cached disk quota entries is very low and
3151you have some awesome number of simultaneous system users,
3152you might want to raise the limit.
3153.TP
3154.I /proc/sys/fs/dquot-nr
3155This file shows the number of allocated disk quota
3156entries and the number of free disk quota entries.
3157.TP
24cb4a4b 3158.IR /proc/sys/fs/epoll " (since Linux 2.6.28)"
242b46af
MK
3159This directory contains the file
3160.IR max_user_watches ,
24cb4a4b
MK
3161which can be used to limit the amount of kernel memory consumed by the
3162.I epoll
3163interface.
3164For further details, see