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