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