]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/proc.5
proc.5: tfix
[thirdparty/man-pages.git] / man5 / proc.5
CommitLineData
fea681da 1.\" Copyright (C) 1994, 1995 by Daniel Quinlan (quinlan@yggdrasil.com)
f352b560 2.\" and Copyright (C) 2002-2008,2017 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.\"
43d42cc0 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.\"
4b8c67d9 55.TH PROC 5 2017-09-15 "Linux" "Linux Programmer's Manual"
fea681da 56.SH NAME
9ee4a2b6 57proc \- process information pseudo-filesystem
fea681da
MK
58.SH DESCRIPTION
59The
31fa1fd2 60.B 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 .
b574c52d
MK
65Typically, it is mounted automatically by the system,
66but it can also be mounted manually using a command such as:
67.PP
68.in +4n
69.EX
70mount \-t proc proc /proc
71.EE
72.in
73.PP
7e174651 74Most of the files in the
31fa1fd2 75.B proc
7e174651 76filesystem are read-only,
64165e01 77but some files are writable, allowing kernel variables to be changed.
7e174651 78.\"
fee59977
MK
79.SS Mount options
80The
31fa1fd2 81.B proc
fee59977
MK
82filesystem supports the following mount options:
83.TP
84.BR hidepid "=\fIn\fP (since Linux 3.3)"
85.\" commit 0499680a42141d86417a8fbaa8c8db806bea1201
86This option controls who can access the information in
87.IR /proc/[pid]
88directories.
89The argument,
90.IR n ,
91is one of the following values:
92.RS
93.TP 4
940
95Everybody may access all
96.IR /proc/[pid]
97directories.
98This is the traditional behavior,
99and the default if this mount option is not specified.
100.TP
1011
102Users may not access files and subdirectories inside any
103.IR /proc/[pid]
104directories but their own (the
105.IR /proc/[pid]
106directories themselves remain visible).
107Sensitive files such as
97949440 108.IR /proc/[pid]/cmdline
fee59977 109and
97949440 110.IR /proc/[pid]/status
fee59977
MK
111are now protected against other users.
112This makes it impossible to learn whether any user is running a
113specific program
114(so long as the program doesn't otherwise reveal itself by its behavior).
115.\" As an additional bonus, since
97949440 116.\" .IR /proc/[pid]/cmdline
fee59977
MK
117.\" is unaccessible for other users,
118.\" poorly written programs passing sensitive information via
119.\" program arguments are now protected against local eavesdroppers.
120.TP
1212
122As for mode 1, but in addition the
123.IR /proc/[pid]
124directories belonging to other users become invisible.
125This means that
126.IR /proc/[pid]
127entries can no longer be used to discover the PIDs on the system.
128This doesn't hide the fact that a process with a specific PID value exists
9bc87ed0 129(it can be learned by other means, for example, by "kill \-0 $PID"),
fee59977
MK
130but it hides a process's UID and GID,
131which could otherwise be learned by employing
132.BR stat (2)
133on a
134.IR /proc/[pid]
135directory.
136This greatly complicates an attacker's task of gathering
137information about running processes (e.g., discovering whether
138some daemon is running with elevated privileges,
139whether another user is running some sensitive program,
140whether other users are running any program at all, and so on).
141.RE
142.TP
143.BR gid "=\fIgid\fP (since Linux 3.3)"
144.\" commit 0499680a42141d86417a8fbaa8c8db806bea1201
145Specifies the ID of a group whose members are authorized to
146learn process information otherwise prohibited by
147.BR hidepid
95b1c1d1 148(i.e., users in this group behave as though
fee59977
MK
149.I /proc
150was mounted with
95b1c1d1 151.IR hidepid=0 ).
fee59977
MK
152This group should be used instead of approaches such as putting
153nonroot users into the
154.BR sudoers (5)
155file.
156.SS Files and directories
ac8727b6 157The following list describes many of the files and directories under the
743638fd
MK
158.I /proc
159hierarchy.
fea681da 160.TP
69119dc7 161.I /proc/[pid]
fea681da
MK
162There is a numerical subdirectory for each running process; the
163subdirectory is named by the process ID.
1e6a8e2f
MK
164Each
165.I /proc/[pid]
e96ad1fd
MK
166subdirectory contains the pseudo-files and directories described below.
167.IP
168The files inside each
169.I /proc/[pid]
170directory are normally owned by the effective user and
3bdb8ec5
MK
171effective group ID of the process.
172However, as a security measure, the ownership is made
173.IR root:root
174if the process's "dumpable" attribute is set to a value other than 1.
fb49322d 175.IP
ae636827
MK
176Before Linux 4.11,
177.\" commit 68eb94f16227336a5773b83ecfa8290f1d6b78ce
178.IR root:root
179meant the "global" root user ID and group ID
180(i.e., UID 0 and GID 0 in the initial user namespace).
181Since Linux 4.11,
182if the process is in a noninitial user namespace that has a
183valid mapping for user (group) ID 0 inside the namespace, then
184the user (group) ownership of the files under
185.I /proc/[pid]
186is instead made the same as the root user (group) ID of the namespace.
187This means that inside a container,
188things work as expected for the container "root" user.
189.IP
fb49322d 190The process's "dumpable" attribute may change for the following reasons:
3bdb8ec5
MK
191.RS
192.IP * 3
193The attribute was explicitly set via the
194.BR prctl (2)
195.B PR_SET_DUMPABLE
196operation.
197.IP *
198The attribute was reset to the value in the file
199.IR /proc/sys/fs/suid_dumpable
200(described below), for the reasons described in
201.BR prctl (2).
202.RE
203.IP
204Resetting the "dumpable" attribute to 1 reverts the ownership of the
205.IR /proc/[pid]/*
eada5570 206files to the process's effective UID and GID.
b7a42567
MK
207.TP
208.I /proc/[pid]/attr
209.\" https://lwn.net/Articles/28222/
210.\" From: Stephen Smalley <sds@epoch.ncsc.mil>
211.\" To: LKML and others
212.\" Subject: [RFC][PATCH] Process Attribute API for Security Modules
213.\" Date: 08 Apr 2003 16:17:52 -0400
214.\"
b3fb99e8
MK
215.\" http://www.nsa.gov/research/_files/selinux/papers/module/x362.shtml
216.\"
b7a42567
MK
217The files in this directory provide an API for security modules.
218The contents of this directory are files that can be read and written
219in order to set security-related attributes.
220This directory was added to support SELinux,
221but the intention was that the API be general enough to support
222other security modules.
223For the purpose of explanation,
224examples of how SELinux uses these files are provided below.
2dad4c59 225.IP
b7a42567
MK
226This directory is present only if the kernel was configured with
227.BR CONFIG_SECURITY .
228.TP
229.IR /proc/[pid]/attr/current " (since Linux 2.6.0)"
230The contents of this file represent the current
231security attributes of the process.
2dad4c59 232.IP
fd44bdc7
TY
233In SELinux, this file is used to get the security context of a process.
234Prior to Linux 2.6.11, this file could not be used to set the security
235context (a write was always denied), since SELinux limited process security
236transitions to
b7a42567
MK
237.BR execve (2)
238(see the description of
239.IR /proc/[pid]/attr/exec ,
240below).
fd44bdc7
TY
241Since Linux 2.6.11, SELinux lifted this restriction and began supporting
242"set" operations via writes to this node if authorized by policy,
243although use of this operation is only suitable for applications that are
244trusted to maintain any desired separation between the old and new security
b6620a25
MK
245contexts.
246Prior to Linux 2.6.28, SELinux did not allow threads within a
fd44bdc7
TY
247multi-threaded process to set their security context via this node
248as it would yield an inconsistency among the security contexts of the
b6620a25
MK
249threads sharing the same memory space.
250Since Linux 2.6.28, SELinux lifted
fd44bdc7 251this restriction and began supporting "set" operations for threads within
b6620a25 252a multithreaded process if the new security context is bounded by the old
fd44bdc7
TY
253security context, where the bounded relation is defined in policy and
254guarantees that the new security context has a subset of the permissions
255of the old security context.
b7a42567
MK
256Other security modules may choose to support "set" operations via
257writes to this node.
258.TP
259.IR /proc/[pid]/attr/exec " (since Linux 2.6.0)"
260This file represents the attributes to assign to the
261process upon a subsequent
262.BR execve (2).
2dad4c59 263.IP
b7a42567
MK
264In SELinux,
265this is needed to support role/domain transitions, and
266.BR execve (2)
267is the preferred point to make such transitions because it offers better
268control over the initialization of the process in the new security label
269and the inheritance of state.
270In SELinux, this attribute is reset on
271.BR execve (2)
272so that the new program reverts to the default behavior for any
273.BR execve (2)
274calls that it may make.
275In SELinux, a process can set
276only its own
277.I /proc/[pid]/attr/exec
278attribute.
279.TP
280.IR /proc/[pid]/attr/fscreate " (since Linux 2.6.0)"
281This file represents the attributes to assign to files
282created by subsequent calls to
283.BR open (2),
284.BR mkdir (2),
285.BR symlink (2),
286and
287.BR mknod (2)
2dad4c59 288.IP
b7a42567
MK
289SELinux employs this file to support creation of a file
290(using the aforementioned system calls)
291in a secure state,
292so that there is no risk of inappropriate access being obtained
293between the time of creation and the time that attributes are set.
294In SELinux, this attribute is reset on
295.BR execve (2),
296so that the new program reverts to the default behavior for
297any file creation calls it may make, but the attribute will persist
298across multiple file creation calls within a program unless it is
299explicitly reset.
300In SELinux, a process can set only its own
301.IR /proc/[pid]/attr/fscreate
302attribute.
303.TP
666db07e
MK
304.IR /proc/[pid]/attr/keycreate " (since Linux 2.6.18)"
305.\" commit 4eb582cf1fbd7b9e5f466e3718a59c957e75254e
666db07e
MK
306If a process writes a security context into this file,
307all subsequently created keys
308.RB ( add_key (2))
309will be labeled with this context.
310For further information, see the kernel source file
6b3ead8f
ES
311.I Documentation/security/keys/core.rst
312(or file
313.\" commit b68101a1e8f0263dbc7b8375d2a7c57c6216fb76
314.I Documentation/security/keys.txt
315on Linux between 3.0 and 4.13, or
316.\" commit d410fa4ef99112386de5f218dd7df7b4fca910b4
317.I Documentation/keys.txt
318before Linux 3.0).
2702dc21 319.TP
93401860
MK
320.IR /proc/[pid]/attr/prev " (since Linux 2.6.0)"
321This file contains the security context of the process before the last
322.BR execve (2);
323that is, the previous value of
324.IR /proc/[pid]/attr/current .
325.TP
2702dc21
MK
326.IR /proc/[pid]/attr/socketcreate " (since Linux 2.6.18)"
327.\" commit 42c3e03ef6b298813557cdb997bd6db619cd65a2
328If a process writes a security context into this file,
329all subsequently created sockets will be labeled with this context.
39b35179
MK
330.TP
331.IR /proc/[pid]/autogroup " (since Linux 2.6.38)"
332.\" commit 5091faa449ee0b7d73bc296a93bca9540fc51d0a
333See
334.BR sched (7).
fea681da 335.TP
69119dc7 336.IR /proc/[pid]/auxv " (since 2.6.0-test7)"
857f1942 337This contains the contents of the ELF interpreter information passed
c13182ef 338to the process at exec time.
857f1942 339The format is one \fIunsigned long\fP ID
c13182ef 340plus one \fIunsigned long\fP value for each entry.
857f1942 341The last entry contains two zeros.
4c69c692
MK
342See also
343.BR getauxval (3).
2dad4c59 344.IP
82664739
MK
345Permission to access this file is governed by a ptrace access mode
346.B PTRACE_MODE_READ_FSCREDS
347check; see
348.BR ptrace (2).
b5d204d0 349.TP
8d708d6b 350.IR /proc/[pid]/cgroup " (since Linux 2.6.24)"
5c2181ad
MK
351See
352.BR cgroups (7).
76e0451c
MK
353.TP
354.IR /proc/[pid]/clear_refs " (since Linux 2.6.22)"
355.\" commit b813e931b4c8235bb42e301096ea97dbdee3e8fe (2.6.22)
356.\" commit 398499d5f3613c47f2143b8c54a04efb5d7a6da9 (2.6.32)
357.\" commit 040fa02077de01c7e08fa75be6125e4ca5636011 (3.11)
b4e9ee8f 358.\"
b4e9ee8f 359.\" "Clears page referenced bits shown in smaps output"
76e0451c 360.\" write-only, writable only by the owner of the process
2dad4c59 361.IP
76e0451c 362This is a write-only file, writable only by owner of the process.
2dad4c59 363.IP
76e0451c
MK
364The following values may be written to the file:
365.RS
366.TP
3671 (since Linux 2.6.22)
368.\" Internally: CLEAR_REFS_ALL
369Reset the PG_Referenced and ACCESSED/YOUNG
370bits for all the pages associated with the process.
371(Before kernel 2.6.32, writing any nonzero value to this file
372had this effect.)
373.TP
3742 (since Linux 2.6.32)
375.\" Internally: CLEAR_REFS_ANON
376Reset the PG_Referenced and ACCESSED/YOUNG
377bits for all anonymous pages associated with the process.
378.TP
3793 (since Linux 2.6.32)
380.\" Internally: CLEAR_REFS_MAPPED
381Reset the PG_Referenced and ACCESSED/YOUNG
382bits for all file-mapped pages associated with the process.
383.RE
384.IP
385Clearing the PG_Referenced and ACCESSED/YOUNG bits provides a method
386to measure approximately how much memory a process is using.
322d49fb 387One first inspects the values in the "Referenced" fields
76e0451c
MK
388for the VMAs shown in
389.IR /proc/[pid]/smaps
390to get an idea of the memory footprint of the
391process.
392One then clears the PG_Referenced and ACCESSED/YOUNG bits
393and, after some measured time interval,
322d49fb 394once again inspects the values in the "Referenced" fields
76e0451c
MK
395to get an idea of the change in memory footprint of the
396process during the measured interval.
397If one is interested only in inspecting the selected mapping types,
398then the value 2 or 3 can be used instead of 1.
2dad4c59 399.IP
dfdf642e 400Further values can be written to affect different properties:
76e0451c
MK
401.RS
402.TP
4034 (since Linux 3.11)
404Clear the soft-dirty bit for all the pages associated with the process.
405.\" Internally: CLEAR_REFS_SOFT_DIRTY
406This is used (in conjunction with
407.IR /proc/[pid]/pagemap )
408by the check-point restore system to discover which pages of a process
409have been dirtied since the file
410.IR /proc/[pid]/clear_refs
411was written to.
dfdf642e
NK
412.TP
4135 (since Linux 4.0)
414.\" Internally: CLEAR_REFS_MM_HIWATER_RSS
0989246e
MK
415Reset the peak resident set size ("high water mark") to the process's
416current resident set size value.
76e0451c
MK
417.RE
418.IP
419Writing any value to
420.IR /proc/[pid]/clear_refs
421other than those listed above has no effect.
2dad4c59 422.IP
76e0451c
MK
423The
424.IR /proc/[pid]/clear_refs
425file is present only if the
426.B CONFIG_PROC_PAGE_MONITOR
427kernel configuration option is enabled.
857f1942 428.TP
69119dc7 429.I /proc/[pid]/cmdline
6975c16e 430This read-only file holds the complete command line for the process,
b447cd58
MK
431unless the process is a zombie.
432.\" In 2.3.26, this also used to be true if the process was swapped out.
433In the latter case, there is nothing in this file:
75b94dc3 434that is, a read on this file will return 0 characters.
b447cd58 435The command-line arguments appear in this file as a set of
6596d270
MK
436strings separated by null bytes (\(aq\\0\(aq),
437with a further null byte after the last string.
32d7ef00
MK
438.TP
439.IR /proc/[pid]/comm " (since Linux 2.6.33)"
440.\" commit 4614a696bd1c3a9af3a08f0e5874830a85b889d4
441This file exposes the process's
442.I comm
443value\(emthat is, the command name associated with the process.
444Different threads in the same process may have different
445.I comm
446values, accessible via
447.IR /proc/[pid]/task/[tid]/comm .
448A thread may modify its
449.I comm
450value, or that of any of other thread in the same thread group (see
451the discussion of
452.B CLONE_THREAD
453in
454.BR clone (2)),
455by writing to the file
456.IR /proc/self/task/[tid]/comm .
457Strings longer than
458.B TASK_COMM_LEN
459(16) characters are silently truncated.
2dad4c59 460.IP
ef4f4031 461This file provides a superset of the
32d7ef00
MK
462.BR prctl (2)
463.B PR_SET_NAME
464and
465.B PR_GET_NAME
466operations, and is employed by
467.BR pthread_setname_np (3)
468when used to rename threads other than the caller.
fea681da 469.TP
7e07d950 470.IR /proc/[pid]/coredump_filter " (since Linux 2.6.23)"
b4e9ee8f
MK
471See
472.BR core (5).
5c411b17 473.TP
7e07d950
MK
474.IR /proc/[pid]/cpuset " (since Linux 2.6.12)"
475.\" and/proc/[pid]/task/[tid]/cpuset
5c411b17
MK
476See
477.BR cpuset (7).
b4e9ee8f 478.TP
69119dc7 479.I /proc/[pid]/cwd
c13182ef 480This is a symbolic link to the current working directory of the process.
59a40ed7
MK
481To find out the current working directory of process 20,
482for instance, you can do this:
2dad4c59 483.IP
59a40ed7 484.in +4n
37d5e699 485.EX
b43a3b30 486.RB "$" " cd /proc/20/cwd; /bin/pwd"
37d5e699 487.EE
59a40ed7 488.in
2dad4c59 489.IP
c13182ef
MK
490Note that the
491.I pwd
e7b489f0 492command is often a shell built-in, and might
c13182ef 493not work properly.
743638fd
MK
494In
495.BR bash (1),
496you may use
497.IR "pwd\ \-P" .
2dad4c59 498.IP
afcaf646 499.\" The following was still true as at kernel 2.6.13
c13182ef
MK
500In a multithreaded process, the contents of this symbolic link
501are not available if the main thread has already terminated
afcaf646 502(typically by calling
59a40ed7 503.BR pthread_exit (3)).
2dad4c59 504.IP
b902fe18
MK
505Permission to dereference or read
506.RB ( readlink (2))
507this symbolic link is governed by a ptrace access mode
508.B PTRACE_MODE_READ_FSCREDS
509check; see
510.BR ptrace (2).
fea681da 511.TP
69119dc7 512.I /proc/[pid]/environ
09651080
MK
513This file contains the initial environment that was set
514when the currently executing program was started via
515.BR execve (2).
f81fb444 516The entries are separated by null bytes (\(aq\\0\(aq),
b4e9ee8f 517and there may be a null byte at the end.
fea681da 518Thus, to print out the environment of process 1, you would do:
37d5e699 519.IP
a08ea57c 520.in +4n
37d5e699 521.EX
13912780 522.RB "$" " strings /proc/1/environ"
37d5e699 523.EE
a08ea57c 524.in
2dad4c59 525.IP
09651080
MK
526If, after an
527.BR execve (2),
528the process modifies its environment
c187d2a1 529(e.g., by calling functions such as
387e2438
MF
530.BR putenv (3)
531or modifying the
532.BR environ (7)
533variable directly),
09651080
MK
534this file will
535.I not
536reflect those changes.
2dad4c59 537.IP
c187d2a1 538Furthermore, a process may change the memory location that this file refers via
387e2438 539.BR prctl (2)
c187d2a1 540operations such as
387e2438 541.BR PR_SET_MM_ENV_START .
2dad4c59 542.IP
82664739
MK
543Permission to access this file is governed by a ptrace access mode
544.B PTRACE_MODE_READ_FSCREDS
545check; see
546.BR ptrace (2).
fea681da 547.TP
69119dc7 548.I /proc/[pid]/exe
fea681da 549Under Linux 2.2 and later, this file is a symbolic link
2d7195b8 550containing the actual pathname of the executed command.
c13182ef
MK
551This symbolic link can be dereferenced normally; attempting to open
552it will open the executable.
553You can even type
69119dc7 554.I /proc/[pid]/exe
06dd061c 555to run another copy of the same executable that is being run by
69119dc7 556process [pid].
7e3c767a
GJ
557If the pathname has been unlinked, the symbolic link will contain the
558string \(aq(deleted)\(aq appended to the original pathname.
afcaf646 559.\" The following was still true as at kernel 2.6.13
c13182ef
MK
560In a multithreaded process, the contents of this symbolic link
561are not available if the main thread has already terminated
afcaf646
MK
562(typically by calling
563.BR pthread_exit (3)).
2dad4c59 564.IP
b902fe18
MK
565Permission to dereference or read
566.RB ( readlink (2))
567this symbolic link is governed by a ptrace access mode
568.B PTRACE_MODE_READ_FSCREDS
569check; see
570.BR ptrace (2).
2dad4c59 571.IP
eb9a0b2f 572Under Linux 2.0 and earlier,
69119dc7 573.I /proc/[pid]/exe
c13182ef
MK
574is a pointer to the binary which was executed,
575and appears as a symbolic link.
576A
fea681da
MK
577.BR readlink (2)
578call on this file under Linux 2.0 returns a string in the format:
2dad4c59 579.IP
59a40ed7 580 [device]:inode
2dad4c59 581.IP
fea681da
MK
582For example, [0301]:1502 would be inode 1502 on device major 03 (IDE,
583MFM, etc. drives) minor 01 (first partition on the first drive).
2dad4c59 584.IP
fea681da 585.BR find (1)
59a40ed7
MK
586with the
587.I \-inum
588option can be used to locate the file.
fea681da 589.TP
d4529654 590.I /proc/[pid]/fd/
fea681da
MK
591This is a subdirectory containing one entry for each file which the
592process has open, named by its file descriptor, and which is a
c13182ef 593symbolic link to the actual file.
f78ed33a 594Thus, 0 is standard input, 1 standard output, 2 standard error, and so on.
2dad4c59 595.IP
f75715e0
MK
596For file descriptors for pipes and sockets,
597the entries will be symbolic links whose content is the
598file type with the inode.
d4529654
MF
599A
600.BR readlink (2)
601call on this file returns a string in the format:
2dad4c59 602.IP
d4529654 603 type:[inode]
2dad4c59 604.IP
f75715e0
MK
605For example,
606.I socket:[2248868]
607will be a socket and its inode is 2248868.
608For sockets, that inode can be used to find more information
609in one of the files under
d4529654 610.IR /proc/net/ .
2dad4c59 611.IP
2b7a2ac5
MK
612For file descriptors that have no corresponding inode
613(e.g., file descriptors produced by
89e284a2 614.BR bpf (2),
2b7a2ac5
MK
615.BR epoll_create (2),
616.BR eventfd (2),
617.BR inotify_init (2),
89e284a2 618.BR perf_event_open (2),
2b7a2ac5 619.BR signalfd (2),
89e284a2 620.BR timerfd_create (2),
2b7a2ac5 621and
e8675558 622.BR userfaultfd (2)),
2b7a2ac5 623the entry will be a symbolic link with contents of the form
2dad4c59 624.IP
2b7a2ac5 625 anon_inode:<file-type>
2dad4c59 626.IP
e2a5929d 627In many cases (but not all), the
2b7a2ac5
MK
628.I file-type
629is surrounded by square brackets.
2dad4c59 630.IP
2b7a2ac5
MK
631For example, an epoll file descriptor will have a symbolic link
632whose content is the string
633.IR "anon_inode:[eventpoll]" .
2dad4c59 634.IP
d4529654 635.\"The following was still true as at kernel 2.6.13
afcaf646 636In a multithreaded process, the contents of this directory
c13182ef 637are not available if the main thread has already terminated
afcaf646
MK
638(typically by calling
639.BR pthread_exit (3)).
2dad4c59 640.IP
20c1a631
MK
641Programs that take a filename as a command-line argument,
642but don't take input from standard input if no argument is supplied,
643and programs that write to a file named as a command-line argument,
644but don't send their output to standard output
59a40ed7 645if no argument is supplied, can nevertheless be made to use
20c1a631
MK
646standard input or standard output by using
647.IR /proc/[pid]/fd
648files as command-line arguments.
59a40ed7
MK
649For example, assuming that
650.I \-i
651is the flag designating an input file and
652.I \-o
653is the flag designating an output file:
37d5e699 654.IP
a08ea57c 655.in +4n
37d5e699 656.EX
b43a3b30 657.RB "$" " foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ..."
37d5e699 658.EE
a08ea57c 659.in
2dad4c59 660.IP
fea681da
MK
661and you have a working filter.
662.\" The following is not true in my tests (MTK):
663.\" Note that this will not work for
664.\" programs that seek on their files, as the files in the fd directory
665.\" are not seekable.
2dad4c59 666.IP
59a40ed7
MK
667.I /proc/self/fd/N
668is approximately the same as
669.I /dev/fd/N
008f1ecc 670in some UNIX and UNIX-like systems.
c13182ef 671Most Linux MAKEDEV scripts symbolically link
59a40ed7
MK
672.I /dev/fd
673to
674.IR /proc/self/fd ,
675in fact.
2dad4c59 676.IP
59a40ed7
MK
677Most systems provide symbolic links
678.IR /dev/stdin ,
679.IR /dev/stdout ,
680and
681.IR /dev/stderr ,
682which respectively link to the files
683.IR 0 ,
684.IR 1 ,
685and
686.IR 2
687in
688.IR /proc/self/fd .
689Thus the example command above could be written as:
d6bd89f3 690.IP
59a40ed7 691.in +4n
37d5e699 692.EX
b43a3b30 693.RB "$" " foobar \-i /dev/stdin \-o /dev/stdout ..."
37d5e699 694.EE
59a40ed7 695.in
138a191e
MK
696.IP
697Permission to dereference or read
698.RB ( readlink (2))
699the symbolic links in this directory is governed by a ptrace access mode
700.B PTRACE_MODE_READ_FSCREDS
701check; see
702.BR ptrace (2).
81c8aeb6
LW
703.IP
704Note that for file descriptors referring to inodes (pipes and sockets, see above),
705those inodes still have permission bits and ownership information
706distinct from those of the
707.I /proc/[pid]/fd
708entry,
709and that the owner may differ from the user and group IDs of the process.
710An unprivileged process may lack permissions to open them, as in this example:
711.IP
712.in +4n
713.EX
714.RB "$" " echo test | sudo -u nobody cat"
715test
716.RB "$" " echo test | sudo -u nobody cat /proc/self/fd/0"
717cat: /proc/self/fd/0: Permission denied
718.EE
719.in
720.IP
721File descriptor 0 refers to the pipe created by the shell
722and owned by that shell's user, which is not
723.IR nobody ,
724so
725.B cat
726does not have permission to create a new file descriptor to read from that inode,
727even though it can still read from its existing file descriptor 0.
69ab425e 728.TP
7e07d950 729.IR /proc/[pid]/fdinfo/ " (since Linux 2.6.22)"
69ab425e
MK
730This is a subdirectory containing one entry for each file which the
731process has open, named by its file descriptor.
0275956d 732The files in this directory are readable only by the owner of the process.
69ab425e 733The contents of each file can be read to obtain information
0275956d
MK
734about the corresponding file descriptor.
735The content depends on the type of file referred to by the
d9cb0d7d 736corresponding file descriptor.
2dad4c59 737.IP
0275956d 738For regular files and directories, we see something like:
37d5e699 739.IP
69ab425e 740.in +4n
37d5e699 741.EX
69ab425e
MK
742.RB "$" " cat /proc/12015/fdinfo/4"
743pos: 1000
744flags: 01002002
0275956d 745mnt_id: 21
37d5e699 746.EE
69ab425e 747.in
2dad4c59 748.IP
9599cbb3
MK
749The fields are as follows:
750.RS
751.TP
69ab425e 752.I pos
9599cbb3
MK
753This is a decimal number showing the file offset.
754.TP
69ab425e 755.I flags
9599cbb3 756This is an octal number that displays the
69ab425e
MK
757file access mode and file status flags (see
758.BR open (2)).
d7e537ce
MK
759If the close-on-exec file descriptor flag is set, then
760.I flags
761will also include the value
762.BR O_CLOEXEC .
2dad4c59 763.IP
d7e537ce
MK
764Before Linux 3.1,
765.\" commit 1117f72ea0217ba0cc19f05adbbd8b9a397f5ab7
766this field incorrectly displayed the setting of
767.B O_CLOEXEC
768at the time the file was opened,
769rather than the current setting of the close-on-exec flag.
9599cbb3
MK
770.TP
771.I
0275956d 772.I mnt_id
9599cbb3 773This field, present since Linux 3.15,
0275956d
MK
774.\" commit 49d063cb353265c3af701bab215ac438ca7df36d
775is the ID of the mount point containing this file.
776See the description of
777.IR /proc/[pid]/mountinfo .
9599cbb3
MK
778.RE
779.IP
6e7622ee
MK
780For eventfd file descriptors (see
781.BR eventfd (2)),
b6a7fd50
MK
782we see (since Linux 3.8)
783.\" commit cbac5542d48127b546a23d816380a7926eee1c25
784the following fields:
2dad4c59 785.IP
6e7622ee 786.in +4n
37d5e699 787.EX
6e7622ee
MK
788pos: 0
789flags: 02
790mnt_id: 10
791eventfd-count: 40
37d5e699 792.EE
6e7622ee 793.in
2dad4c59 794.IP
6e7622ee
MK
795.I eventfd-count
796is the current value of the eventfd counter, in hexadecimal.
2dad4c59 797.IP
58d375dd
MK
798For epoll file descriptors (see
799.BR epoll (7)),
b6a7fd50
MK
800we see (since Linux 3.8)
801.\" commit 138d22b58696c506799f8de759804083ff9effae
802the following fields:
2dad4c59 803.IP
58d375dd 804.in +4n
37d5e699 805.EX
58d375dd
MK
806pos: 0
807flags: 02
808mnt_id: 10
809tfd: 9 events: 19 data: 74253d2500000009
810tfd: 7 events: 19 data: 74253d2500000007
37d5e699 811.EE
58d375dd 812.in
2dad4c59 813.IP
58d375dd
MK
814Each of the lines beginning
815.I tfd
816describes one of the file descriptors being monitored via
817the epoll file descriptor (see
818.BR epoll_ctl (2)
819for some details).
820The
821.IR tfd
822field is the number of the file descriptor.
823The
824.I events
825field is a hexadecimal mask of the events being monitored for this file
826descriptor.
827The
828.I data
829field is the data value associated with this file descriptor.
2dad4c59 830.IP
f8a14cac
MK
831For signalfd file descriptors (see
832.BR signalfd (2)),
b6a7fd50
MK
833we see (since Linux 3.8)
834.\" commit 138d22b58696c506799f8de759804083ff9effae
835the following fields:
2dad4c59 836.IP
f8a14cac 837.in +4n
37d5e699 838.EX
f8a14cac
MK
839pos: 0
840flags: 02
841mnt_id: 10
842sigmask: 0000000000000006
37d5e699 843.EE
f8a14cac 844.in
2dad4c59 845.IP
f8a14cac
MK
846.I sigmask
847is the hexadecimal mask of signals that are accepted via this
848signalfd file descriptor.
849(In this example, bits 2 and 3 are set, corresponding to the signals
850.B SIGINT
851and
852.BR SIGQUIT ;
853see
854.BR signal (7).)
2dad4c59 855.IP
4e77145c
MK
856For inotify file descriptors (see
857.BR inotify (7)),
858we see (since Linux 3.8)
859the following fields:
2dad4c59 860.IP
4e77145c 861.in +4n
37d5e699 862.EX
4e77145c
MK
863pos: 0
864flags: 00
865mnt_id: 11
866inotify wd:2 ino:7ef82a sdev:800001 mask:800afff ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:2af87e00220ffd73
867inotify wd:1 ino:192627 sdev:800001 mask:800afff ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:27261900802dfd73
37d5e699 868.EE
4e77145c 869.in
2dad4c59 870.IP
4e77145c
MK
871Each of the lines beginning with "inotify" displays information about
872one file or directory that is being monitored.
873The fields in this line are as follows:
874.RS
875.TP
876.I wd
877A watch descriptor number (in decimal).
878.TP
879.I ino
880The inode number of the target file (in hexadecimal).
881.TP
882.I sdev
883The ID of the device where the target file resides (in hexadecimal).
884.TP
885.I mask
886The mask of events being monitored for the target file (in hexadecimal).
887.RE
888.IP
889If the kernel was built with exportfs support, the path to the target
890file is exposed as a file handle, via three hexadecimal fields:
891.IR fhandle-bytes ,
892.IR fhandle-type ,
893and
894.IR f_handle .
2dad4c59 895.IP
e2444bcb
MK
896For fanotify file descriptors (see
897.BR fanotify (7)),
898we see (since Linux 3.8)
899the following fields:
2dad4c59 900.IP
e2444bcb 901.in +4n
37d5e699 902.EX
e2444bcb
MK
903pos: 0
904flags: 02
905mnt_id: 11
906fanotify flags:0 event-flags:88002
907fanotify ino:19264f sdev:800001 mflags:0 mask:1 ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:4f261900a82dfd73
37d5e699 908.EE
e2444bcb 909.in
2dad4c59 910.IP
e2444bcb
MK
911The fourth line displays information defined when the fanotify group
912was created via
913.BR fanotify_init (2):
914.RS
915.TP
916.I flags
917The
918.I flags
919argument given to
920.BR fanotify_init (2)
921(expressed in hexadecimal).
922.TP
923.I event-flags
924The
925.I event_f_flags
926argument given to
927.BR fanotify_init (2)
928(expressed in hexadecimal).
929.RE
930.IP
931Each additional line shown in the file contains information
932about one of the marks in the fanotify group.
933Most of these fields are as for inotify, except:
934.RS
935.TP
936.I mflags
937The flags associated with the mark
938(expressed in hexadecimal).
939.TP
940.I mask
941The events mask for this mark
942(expressed in hexadecimal).
943.TP
944.I ignored_mask
945The mask of events that are ignored for this mark
946(expressed in hexadecimal).
947.RE
948.IP
949For details on these fields, see
950.BR fanotify_mark (2).
340a16a6
LW
951.IP
952For timerfd file descriptors (see
953.BR timerfd (2)),
954we see (since Linux 3.17)
cd595f62 955.\" commit af9c4957cf212ad9cf0bee34c95cb11de5426e85
340a16a6
LW
956the following fields:
957.IP
958.in +4n
959.EX
960pos: 0
961flags: 02004002
962mnt_id: 13
963clockid: 0
964ticks: 0
965settime flags: 03
966it_value: (7695568592, 640020877)
967it_interval: (0, 0)
968.EE
969.in
1cdbc3a6
MK
970.RS
971.TP
340a16a6 972.I clockid
1cdbc3a6 973This is the numeric value of the clock ID
734ec506
MK
974(corresponding to one of the
975.B CLOCK_*
976constants defined via
a6425049 977.IR <time.h> )
cb5a67a4 978that is used to mark the progress of the timer (in this example, 0 is
340a16a6 979.BR CLOCK_REALTIME ).
1cdbc3a6 980.TP
340a16a6 981.I ticks
1cdbc3a6
MK
982This is the number of timer expirations that have occurred,
983(i.e., the value that
340a16a6 984.BR read (2)
1cdbc3a6
MK
985on it would return).
986.TP
340a16a6 987.I settime flags
1cdbc3a6 988This field lists the flags with which the timerfd was last armed (see
340a16a6
LW
989.BR timerfd_settime (2)),
990in octal
991(in this example, both
992.B TFD_TIMER_ABSTIME
993and
994.B TFD_TIMER_CANCEL_ON_SET
995are set).
1cdbc3a6 996.TP
340a16a6 997.I it_value
1cdbc3a6
MK
998This field contains the amount of time until the timer will next expire,
999expressed in seconds and nanoseconds.
734ec506
MK
1000This is always expressed as a relative value,
1001regardless of whether the timer was created using the
1002.B TFD_TIMER_ABSTIME
1003flag.
1cdbc3a6 1004.TP
340a16a6 1005.I it_interval
1cdbc3a6
MK
1006This field contains the interval of the timer,
1007in seconds and nanoseconds.
1008(The
1009.I it_value
1010and
1011.I it_interval
1012fields contain the values that
340a16a6 1013.BR timerfd_gettime (2)
1cdbc3a6
MK
1014on this file descriptor would return.)
1015.RE
0ca2fc4d 1016.TP
93401860
MK
1017.IR /proc/[pid]/gid_map " (since Linux 3.5)"
1018See
1019.BR user_namespaces (7).
1020.TP
0ca2fc4d 1021.IR /proc/[pid]/io " (since kernel 2.6.20)"
68f11066
MK
1022.\" commit 7c3ab7381e79dfc7db14a67c6f4f3285664e1ec2
1023This file contains I/O statistics for the process, for example:
37d5e699 1024.IP
0ca2fc4d 1025.in +4n
37d5e699 1026.EX
0ca2fc4d
PS
1027.RB "#" " cat /proc/3828/io"
1028rchar: 323934931
1029wchar: 323929600
1030syscr: 632687
1031syscw: 632675
1032read_bytes: 0
1033write_bytes: 323932160
1034cancelled_write_bytes: 0
37d5e699 1035.EE
0ca2fc4d 1036.in
2dad4c59 1037.IP
0ca2fc4d
PS
1038The fields are as follows:
1039.RS
68f11066
MK
1040.TP
1041.IR rchar ": characters read"
0ca2fc4d
PS
1042The number of bytes which this task has caused to be read from storage.
1043This is simply the sum of bytes which this process passed to
1044.BR read (2)
68f11066 1045and similar system calls.
11256884 1046It includes things such as terminal I/O and
68f11066
MK
1047is unaffected by whether or not actual
1048physical disk I/O was required (the read might have been satisfied from
0ca2fc4d 1049pagecache).
68f11066
MK
1050.TP
1051.IR wchar ": characters written"
0ca2fc4d
PS
1052The number of bytes which this task has caused, or shall cause to be written
1053to disk.
1054Similar caveats apply here as with
1055.IR rchar .
68f11066
MK
1056.TP
1057.IR syscr ": read syscalls"
1058Attempt to count the number of read I/O operations\(emthat is,
1059system calls such as
0ca2fc4d
PS
1060.BR read (2)
1061and
1062.BR pread (2).
68f11066
MK
1063.TP
1064.IR syscw ": write syscalls"
1065Attempt to count the number of write I/O operations\(emthat is,
1066system calls such as
0ca2fc4d
PS
1067.BR write (2)
1068and
1069.BR pwrite (2).
68f11066
MK
1070.TP
1071.IR read_bytes ": bytes read"
0ca2fc4d
PS
1072Attempt to count the number of bytes which this process really did cause to
1073be fetched from the storage layer.
1074This is accurate for block-backed filesystems.
68f11066
MK
1075.TP
1076.IR write_bytes ": bytes written"
0ca2fc4d
PS
1077Attempt to count the number of bytes which this process caused to be sent to
1078the storage layer.
68f11066 1079.TP
0ca2fc4d 1080.IR cancelled_write_bytes :
0ca2fc4d
PS
1081The big inaccuracy here is truncate.
1082If a process writes 1MB to a file and then deletes the file,
1083it will in fact perform no writeout.
1084But it will have been accounted as having caused 1MB of write.
68f11066 1085In other words: this field represents the number of bytes which this process
0ca2fc4d 1086caused to not happen, by truncating pagecache.
68f11066 1087A task can cause "negative" I/O too.
0ca2fc4d 1088If this task truncates some dirty pagecache,
68f11066
MK
1089some I/O which another task has been accounted for
1090(in its
1091.IR write_bytes )
1092will not be happening.
1093.RE
0ca2fc4d
PS
1094.IP
1095.IR Note :
68f11066 1096In the current implementation, things are a bit racy on 32-bit systems:
0ca2fc4d
PS
1097if process A reads process B's
1098.I /proc/[pid]/io
68f11066 1099while process B is updating one of these 64-bit counters,
0ca2fc4d 1100process A could see an intermediate result.
2dad4c59 1101.IP
d8e2972a
MK
1102Permission to access this file is governed by a ptrace access mode
1103.B PTRACE_MODE_READ_FSCREDS
1104check; see
1105.BR ptrace (2).
f6e17121 1106.TP
7e07d950 1107.IR /proc/[pid]/limits " (since Linux 2.6.24)"
69ab425e
MK
1108This file displays the soft limit, hard limit, and units of measurement
1109for each of the process's resource limits (see
1110.BR getrlimit (2)).
1111Up to and including Linux 2.6.35,
1112this file is protected to allow reading only by the real UID of the process.
1113Since Linux 2.6.36,
1114.\" commit 3036e7b490bf7878c6dae952eec5fb87b1106589
1115this file is readable by all users on the system.
df2a8576
MK
1116.\" FIXME Describe /proc/[pid]/loginuid
1117.\" Added in 2.6.11; updating requires CAP_AUDIT_CONTROL
1118.\" CONFIG_AUDITSYSCALL
b4f89985
PE
1119.TP
1120.IR /proc/[pid]/map_files/ " (since kernel 3.3)
18cdd0ac
MK
1121.\" commit 640708a2cff7f81e246243b0073c66e6ece7e53e
1122This subdirectory contains entries corresponding to memory-mapped
b4f89985
PE
1123files (see
1124.BR mmap (2)).
18cdd0ac
MK
1125Entries are named by memory region start and end
1126address pair (expressed as hexadecimal numbers),
1127and are symbolic links to the mapped files themselves.
1128Here is an example, with the output wrapped and reformatted to fit on an 80-column display:
37d5e699 1129.IP
b4f89985 1130.in +4n
37d5e699 1131.EX
f2aa4dcc 1132.RB "#" " ls -l /proc/self/map_files/"
18cdd0ac 1133lr\-\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:31
9bc87ed0 1134 3252e00000\-3252e20000 \-> /usr/lib64/ld\-2.15.so
b4f89985 1135\&...
37d5e699 1136.EE
b4f89985 1137.in
2dad4c59 1138.IP
b4f89985 1139Although these entries are present for memory regions that were
d6a56978 1140mapped with the
b4f89985 1141.BR MAP_FILE
18cdd0ac 1142flag, the way anonymous shared memory (regions created with the
b4f89985
PE
1143.B MAP_ANON | MAP_SHARED
1144flags)
1145is implemented in Linux
18cdd0ac
MK
1146means that such regions also appear on this directory.
1147Here is an example where the target file is the deleted
1148.I /dev/zero
1149one:
37d5e699 1150.IP
b4f89985 1151.in +4n
37d5e699 1152.EX
18cdd0ac
MK
1153lrw\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:33
1154 7fc075d2f000\-7fc075e6f000 \-> /dev/zero (deleted)
37d5e699 1155.EE
b4f89985 1156.in
2dad4c59 1157.IP
b4f89985
PE
1158This directory appears only if the
1159.B CONFIG_CHECKPOINT_RESTORE
1160kernel configuration option is enabled.
f2aa4dcc
MK
1161Privilege
1162.RB ( CAP_SYS_ADMIN )
1163.\" FIXME
1164.\" This may change. See the mail thread
43d42cc0 1165.\" "[RFC][PATCH v2] procfs: Always expose /proc/<pid>/map_files/ and make it readable"
f2aa4dcc
MK
1166.\" from Jan 2015
1167is required to view the contents of this directory.
fea681da 1168.TP
69119dc7 1169.I /proc/[pid]/maps
fea681da
MK
1170A file containing the currently mapped memory regions and their access
1171permissions.
bbf9f397
MK
1172See
1173.BR mmap (2)
1174for some further information about memory mappings.
2dad4c59 1175.IP
aee2f0bf
MK
1176Permission to access this file is governed by a ptrace access mode
1177.B PTRACE_MODE_READ_FSCREDS
1178check; see
1179.BR ptrace (2).
2dad4c59 1180.IP
dd0c3b96 1181The format of the file is:
c1a022dc
MK
1182.IP
1183.in 4n
1184.EX
21781757 1185.I "address perms offset dev inode pathname"
9bc87ed0
MK
118600400000\-00452000 r-xp 00000000 08:02 173521 /usr/bin/dbus-daemon
118700651000\-00652000 r--p 00051000 08:02 173521 /usr/bin/dbus-daemon
118800652000\-00655000 rw-p 00052000 08:02 173521 /usr/bin/dbus-daemon
118900e03000\-00e24000 rw-p 00000000 00:00 0 [heap]
119000e24000\-011f7000 rw-p 00000000 00:00 0 [heap]
182090db 1191\&...
9bc87ed0
MK
119235b1800000\-35b1820000 r-xp 00000000 08:02 135522 /usr/lib64/ld\-2.15.so
119335b1a1f000\-35b1a20000 r--p 0001f000 08:02 135522 /usr/lib64/ld\-2.15.so
119435b1a20000\-35b1a21000 rw-p 00020000 08:02 135522 /usr/lib64/ld\-2.15.so
119535b1a21000\-35b1a22000 rw-p 00000000 00:00 0
119635b1c00000\-35b1dac000 r-xp 00000000 08:02 135870 /usr/lib64/libc\-2.15.so
119735b1dac000\-35b1fac000 ---p 001ac000 08:02 135870 /usr/lib64/libc\-2.15.so
119835b1fac000\-35b1fb0000 r--p 001ac000 08:02 135870 /usr/lib64/libc\-2.15.so
119935b1fb0000\-35b1fb2000 rw-p 001b0000 08:02 135870 /usr/lib64/libc\-2.15.so
182090db 1200\&...
9bc87ed0 1201f2c6ff8c000\-7f2c7078c000 rw-p 00000000 00:00 0 [stack:986]
182090db 1202\&...
9bc87ed0
MK
12037fffb2c0d000\-7fffb2c2e000 rw-p 00000000 00:00 0 [stack]
12047fffb2d48000\-7fffb2d49000 r-xp 00000000 00:00 0 [vdso]
c1a022dc 1205.EE
21781757 1206.in
c1a022dc 1207.IP
7d2e6d74 1208The
3eb8c588
MK
1209.I address
1210field is the address space in the process that the mapping occupies.
1211The
1212.I perms
1213field is a set of permissions:
2dad4c59 1214.IP
37d5e699
MK
1215.in +4
1216.EX
fea681da
MK
1217r = read
1218w = write
1219x = execute
1220s = shared
1221p = private (copy on write)
37d5e699 1222.EE
fea681da 1223.in
2dad4c59 1224.IP
3eb8c588
MK
1225The
1226.I offset
b844cf04 1227field is the offset into the file/whatever;
3eb8c588
MK
1228.I dev
1229is the device
dd0c3b96 1230(major:minor);
3eb8c588
MK
1231.I inode
1232is the inode on that device.
59a40ed7 12330 indicates that no inode is associated with the memory region,
16e64bae 1234as would be the case with BSS (uninitialized data).
2dad4c59 1235.IP
3eb8c588
MK
1236The
1237.I pathname
1238field will usually be the file that is backing the mapping.
491ea6f1 1239For ELF files,
3eb8c588
MK
1240you can easily coordinate with the
1241.I offset
1242field by looking at the
491ea6f1
MK
1243Offset field in the ELF program headers
1244.RI ( "readelf\ \-l" ).
2dad4c59 1245.IP
491ea6f1 1246There are additional helpful pseudo-paths:
61b0b1f4
MK
1247.RS 12
1248.TP
1249.IR [stack]
16e64bae 1250The initial process's (also known as the main thread's) stack.
61b0b1f4 1251.TP
3eb8c588 1252.IR [stack:<tid>] " (since Linux 3.4)"
a60894c5 1253.\" commit b76437579d1344b612cf1851ae610c636cec7db0
61b0b1f4 1254A thread's stack (where the
3eb8c588 1255.IR <tid>
61b0b1f4 1256is a thread ID).
491ea6f1 1257It corresponds to the
3eb8c588 1258.IR /proc/[pid]/task/[tid]/
37d32c38 1259path.
61b0b1f4 1260.TP
7d2e6d74 1261.IR [vdso]
61b0b1f4 1262The virtual dynamically linked shared object.
c56a0185
MK
1263See
1264.BR vdso (7).
61b0b1f4 1265.TP
7d2e6d74 1266.IR [heap]
61b0b1f4
MK
1267The process's heap.
1268.in
61b0b1f4
MK
1269.RE
1270.IP
3eb8c588
MK
1271If the
1272.I pathname
1273field is blank,
40382e5e
MK
1274this is an anonymous mapping as obtained via
1275.BR mmap (2).
61b0b1f4
MK
1276There is no easy way to coordinate this back to a process's source,
1277short of running it through
491ea6f1
MK
1278.BR gdb (1),
1279.BR strace (1),
1280or similar.
2dad4c59 1281.IP
b6547479
EK
1282.I pathname
1283is shown unescaped except for newline characters, which are replaced
d512e7b4
MK
1284with an octal escape sequence.
1285As a result, it is not possible to determine whether the original
1286pathname contained a newline character or the literal
b6547479
EK
1287.I \\\012
1288character sequence.
1289.IP
1290If the mapping is file-backed and the file has been deleted, the string
d512e7b4
MK
1291" (deleted)" is appended to the pathname.
1292Note that this is ambiguous too.
b6547479 1293.IP
eb9a0b2f 1294Under Linux 2.0, there is no field giving pathname.
fea681da 1295.TP
69119dc7 1296.I /proc/[pid]/mem
fea681da
MK
1297This file can be used to access the pages of a process's memory through
1298.BR open (2),
1299.BR read (2),
1300and
ccb2bb0d 1301.BR lseek (2).
2dad4c59 1302.IP
aee2f0bf
MK
1303Permission to access this file is governed by a ptrace access mode
1304.B PTRACE_MODE_ATTACH_FSCREDS
1305check; see
1306.BR ptrace (2).
b4e9ee8f 1307.TP
69119dc7 1308.IR /proc/[pid]/mountinfo " (since Linux 2.6.26)"
b4e9ee8f 1309.\" This info adapted from Documentation/filesystems/proc.txt
fb4bdaa1 1310.\" commit 2d4d4864ac08caff5c204a752bd004eed4f08760
ef5b47f6
MK
1311This file contains information about mount points
1312in the process's mount namespace (see
1313.BR mount_namespaces (7)).
fb4bdaa1
MK
1314It supplies various information
1315(e.g., propagation state, root of mount for bind mounts,
1316identifier for each mount and its parent) that is missing from the (older)
1317.IR /proc/[pid]/mounts
1318file, and fixes various other problems with that file
1319(e.g., nonextensibility,
1320failure to distinguish per-mount versus per-superblock options).
2dad4c59 1321.IP
fb4bdaa1 1322The file contains lines of the form:
c1a022dc
MK
1323.IP
1324.in 0n
1325.EX
0f619d1f 132636 35 98:0 /mnt1 /mnt2 rw,noatime master:1 \- ext3 /dev/root rw,errors=continue
b4e9ee8f 1327(1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11)
c1a022dc
MK
1328.in
1329.EE
b4e9ee8f
MK
1330.IP
1331The numbers in parentheses are labels for the descriptions below:
3bc960c2 1332.RS 7
b4e9ee8f
MK
1333.TP 5
1334(1)
0f619d1f 1335mount ID: a unique ID for the mount (may be reused after
b4e9ee8f
MK
1336.BR umount (2)).
1337.TP
1338(2)
29270550
MK
1339parent ID: the ID of the parent mount
1340(or of self for the root of this mount namespace's mount tree).
1341.IP
8c420ed8
MK
1342If a new mount is stacked on top of a previous existing mount
1343(so that it hides the existing mount) at pathname P,
1344then the parent of the new mount is the previous mount at that location.
1345Thus, when looking at all the mounts stacked at a particular location,
1346the top-most mount is the one that is not the parent
1347of any other mount at the same location.
1348(Note, however, that this top-most mount will be accessible only if
1349the longest path subprefix of P that is a mount point
1350is not itself hidden by a stacked mount.)
1351.IP
29270550
MK
1352If the parent mount point lies outside the process's root directory (see
1353.BR chroot (2)),
1354the ID shown here won't have a corresponding record in
35cf1b93 1355.I mountinfo
29270550
MK
1356whose mount ID (field 1) matches this parent mount ID
1357(because mount points that lie outside the process's root directory
1358are not shown in
1359.IR mountinfo ).
1360As a special case of this point,
1361the process's root mount point may have a parent mount
1362(for the initramfs filesystem) that lies
1363.\" Miklos Szeredi, Nov 2017: The hidden one is the initramfs, I believe
1364.\" mtk: In the initial mount namespace, this hidden ID has the value 0
1365outside the process's root directory,
1366and an entry for that mount point will not appear in
1367.IR mountinfo .
b4e9ee8f
MK
1368.TP
1369(3)
0f619d1f 1370major:minor: the value of
b4e9ee8f 1371.I st_dev
0f619d1f 1372for files on this filesystem (see
b4e9ee8f
MK
1373.BR stat (2)).
1374.TP
1375(4)
0f619d1f 1376root: the pathname of the directory in the filesystem
8d857fcb 1377which forms the root of this mount.
b4e9ee8f
MK
1378.TP
1379(5)
ebdc66e2 1380mount point: the pathname of the mount point relative
0f619d1f 1381to the process's root directory.
b4e9ee8f
MK
1382.TP
1383(6)
1384mount options: per-mount options.
1385.TP
1386(7)
0f619d1f 1387optional fields: zero or more fields of the form "tag[:value]"; see below.
b4e9ee8f
MK
1388.TP
1389(8)
0f619d1f 1390separator: the end of the optional fields is marked by a single hyphen.
b4e9ee8f
MK
1391.TP
1392(9)
0f619d1f 1393filesystem type: the filesystem type in the form "type[.subtype]".
b4e9ee8f
MK
1394.TP
1395(10)
9ee4a2b6 1396mount source: filesystem-specific information or "none".
b4e9ee8f
MK
1397.TP
1398(11)
68d86eac 1399super options: per-superblock options.
b4e9ee8f
MK
1400.RE
1401.IP
966b5839
MK
1402Currently, the possible optional fields are
1403.IR shared ,
1404.IR master ,
1405.IR propagate_from ,
1406and
1407.IR unbindable .
1408See
1409.BR mount_namespaces (7)
1410for a description of these fields.
0f619d1f
MK
1411Parsers should ignore all unrecognized optional fields.
1412.IP
b4e9ee8f
MK
1413For more information on mount propagation see:
1414.I Documentation/filesystems/sharedsubtree.txt
66a9882e 1415in the Linux kernel source tree.
b4e9ee8f 1416.TP
cea61382 1417.IR /proc/[pid]/mounts " (since Linux 2.4.19)"
226cb3a8 1418This file lists all the filesystems currently mounted in the
ef5b47f6
MK
1419process's mount namespace (see
1420.BR mount_namespaces (7)).
cea61382
MK
1421The format of this file is documented in
1422.BR fstab (5).
2dad4c59 1423.IP
cea61382
MK
1424Since kernel version 2.6.15, this file is pollable:
1425after opening the file for reading, a change in this file
9ee4a2b6 1426(i.e., a filesystem mount or unmount) causes
cea61382 1427.BR select (2)
226cb3a8 1428to mark the file descriptor as having an exceptional condition, and
cea61382
MK
1429.BR poll (2)
1430and
1431.BR epoll_wait (2)
226cb3a8
MK
1432mark the file as having a priority event
1433.RB ( POLLPRI ).
1434(Before Linux 2.6.30,
1435a change in this file was indicated by the file descriptor
1436being marked as readable for
1437.BR select (2),
1438and being marked as having an error condition for
1439.BR poll (2)
1440and
1441.BR epoll_wait (2).)
cea61382 1442.TP
69119dc7 1443.IR /proc/[pid]/mountstats " (since Linux 2.6.17)"
783a6233 1444This file exports information (statistics, configuration information)
ef5b47f6
MK
1445about the mount points in the process's mount namespace (see
1446.BR mount_namespaces (7)).
b4e9ee8f 1447Lines in this file have the form:
37d5e699
MK
1448.IP
1449.in +4n
1450.EX
b4e9ee8f
MK
1451device /dev/sda7 mounted on /home with fstype ext3 [statistics]
1452( 1 ) ( 2 ) (3 ) (4)
37d5e699
MK
1453.EE
1454.in
b4e9ee8f
MK
1455.IP
1456The fields in each line are:
3bc960c2 1457.RS 7
b4e9ee8f
MK
1458.TP 5
1459(1)
1460The name of the mounted device
1461(or "nodevice" if there is no corresponding device).
1462.TP
1463(2)
9ee4a2b6 1464The mount point within the filesystem tree.
b4e9ee8f
MK
1465.TP
1466(3)
9ee4a2b6 1467The filesystem type.
b4e9ee8f
MK
1468.TP
1469(4)
1470Optional statistics and configuration information.
9ee4a2b6 1471Currently (as at Linux 2.6.26), only NFS filesystems export
b4e9ee8f
MK
1472information via this field.
1473.RE
1474.IP
90878f7c 1475This file is readable only by the owner of the process.
b4e9ee8f 1476.TP
2d3fb75b 1477.IR /proc/[pid]/net " (since Linux 2.6.25)"
9fb88bc8
MK
1478See the description of
1479.IR /proc/net .
1480.TP
b4a185e5 1481.IR /proc/[pid]/ns/ " (since Linux 3.0)"
2c4201f0 1482.\" See commit 6b4e306aa3dc94a0545eb9279475b1ab6209a31f
b4a185e5
EB
1483This is a subdirectory containing one entry for each namespace that
1484supports being manipulated by
80e63655 1485.BR setns (2).
cf8bfe6d
MK
1486For more information, see
1487.BR namespaces (7).
b4a185e5 1488.TP
69119dc7 1489.IR /proc/[pid]/numa_maps " (since Linux 2.6.14)"
610f75cc
MK
1490See
1491.BR numa (7).
7388733a 1492.TP
69119dc7 1493.IR /proc/[pid]/oom_adj " (since Linux 2.6.11)"
b4e9ee8f 1494This file can be used to adjust the score used to select which process
0425de01 1495should be killed in an out-of-memory (OOM) situation.
b4e9ee8f
MK
1496The kernel uses this value for a bit-shift operation of the process's
1497.IR oom_score
1498value:
5b8dbfd4
MK
1499valid values are in the range \-16 to +15,
1500plus the special value \-17,
b4e9ee8f
MK
1501which disables OOM-killing altogether for this process.
1502A positive score increases the likelihood of this
1503process being killed by the OOM-killer;
1504a negative score decreases the likelihood.
de8e9cc1 1505.IP
b4e9ee8f
MK
1506The default value for this file is 0;
1507a new process inherits its parent's
1508.I oom_adj
1509setting.
1510A process must be privileged
1511.RB ( CAP_SYS_RESOURCE )
1512to update this file.
f2c8b197
MK
1513.IP
1514Since Linux 2.6.36, use of this file is deprecated in favor of
1515.IR /proc/[pid]/oom_score_adj .
b4e9ee8f 1516.TP
69119dc7 1517.IR /proc/[pid]/oom_score " (since Linux 2.6.11)"
5753354a
MF
1518.\" See mm/oom_kill.c::badness() in pre 2.6.36 sources
1519.\" See mm/oom_kill.c::oom_badness() after 2.6.36
1520.\" commit a63d83f427fbce97a6cea0db2e64b0eb8435cd10
b4e9ee8f
MK
1521This file displays the current score that the kernel gives to
1522this process for the purpose of selecting a process
1523for the OOM-killer.
1524A higher score means that the process is more likely to be
1525selected by the OOM-killer.
1526The basis for this score is the amount of memory used by the process,
1527with increases (+) or decreases (\-) for factors including:
5753354a
MF
1528.\" See mm/oom_kill.c::badness() in pre 2.6.36 sources
1529.\" See mm/oom_kill.c::oom_badness() after 2.6.36
1530.\" commit a63d83f427fbce97a6cea0db2e64b0eb8435cd10
1531.RS
1532.IP * 2
9b0e3937 1533whether the process is privileged (\-).
5753354a
MF
1534.\" More precisely, if it has CAP_SYS_ADMIN or (pre 2.6.36) CAP_SYS_RESOURCE
1535.RE
1536.IP
1537Before kernel 2.6.36 the following factors were also used in the calculation of oom_score:
b4e9ee8f
MK
1538.RS
1539.IP * 2
1540whether the process creates a lot of children using
1541.BR fork (2)
1542(+);
1543.IP *
1544whether the process has been running a long time,
1545or has used a lot of CPU time (\-);
1546.IP *
5753354a 1547whether the process has a low nice value (i.e., > 0) (+); and
b4e9ee8f
MK
1548.IP *
1549whether the process is making direct hardware access (\-).
1550.\" More precisely, if it has CAP_SYS_RAWIO
1551.RE
1552.IP
1553The
1554.I oom_score
f2c8b197
MK
1555also reflects the adjustment specified by the
1556.I oom_score_adj
1557or
b4e9ee8f
MK
1558.I oom_adj
1559setting for the process.
f2c8b197
MK
1560.TP
1561.IR /proc/[pid]/oom_score_adj " (since Linux 2.6.36)"
1562.\" Text taken from 3.7 Documentation/filesystems/proc.txt
1563This file can be used to adjust the badness heuristic used to select which
1564process gets killed in out-of-memory conditions.
2dad4c59 1565.IP
f2c8b197
MK
1566The badness heuristic assigns a value to each candidate task ranging from 0
1567(never kill) to 1000 (always kill) to determine which process is targeted.
1568The units are roughly a proportion along that range of
1569allowed memory the process may allocate from,
1570based on an estimation of its current memory and swap use.
1571For example, if a task is using all allowed memory,
1572its badness score will be 1000.
1573If it is using half of its allowed memory, its score will be 500.
2dad4c59 1574.IP
f2c8b197
MK
1575There is an additional factor included in the badness score: root
1576processes are given 3% extra memory over other tasks.
2dad4c59 1577.IP
f2c8b197 1578The amount of "allowed" memory depends on the context
0633f951 1579in which the OOM-killer was called.
f2c8b197
MK
1580If it is due to the memory assigned to the allocating task's cpuset
1581being exhausted,
1582the allowed memory represents the set of mems assigned to that
1583cpuset (see
1584.BR cpuset (7)).
1585If it is due to a mempolicy's node(s) being exhausted,
1586the allowed memory represents the set of mempolicy nodes.
1587If it is due to a memory limit (or swap limit) being reached,
1588the allowed memory is that configured limit.
1589Finally, if it is due to the entire system being out of memory, the
1590allowed memory represents all allocatable resources.
2dad4c59 1591.IP
f2c8b197 1592The value of
0633f951 1593.I oom_score_adj
f2c8b197
MK
1594is added to the badness score before it
1595is used to determine which task to kill.
1596Acceptable values range from \-1000
1597(OOM_SCORE_ADJ_MIN) to +1000 (OOM_SCORE_ADJ_MAX).
0633f951 1598This allows user space to control the preference for OOM-killing,
f2c8b197 1599ranging from always preferring a certain
f082ada4 1600task or completely disabling it from OOM killing.
f2c8b197 1601The lowest possible value, \-1000, is
0633f951 1602equivalent to disabling OOM-killing entirely for that task,
f2c8b197 1603since it will always report a badness score of 0.
2dad4c59 1604.IP
f2c8b197
MK
1605Consequently, it is very simple for user space to define
1606the amount of memory to consider for each task.
48ac01a7 1607Setting an
f2c8b197
MK
1608.I oom_score_adj
1609value of +500, for example,
1610is roughly equivalent to allowing the remainder of tasks sharing the
1611same system, cpuset, mempolicy, or memory controller resources
1612to use at least 50% more memory.
1613A value of \-500, on the other hand, would be roughly
1614equivalent to discounting 50% of the task's
1615allowed memory from being considered as scoring against the task.
2dad4c59 1616.IP
0633f951 1617For backward compatibility with previous kernels,
f2c8b197
MK
1618.I /proc/[pid]/oom_adj
1619can still be used to tune the badness score.
1620Its value is
9f1b9726 1621scaled linearly with
f2c8b197 1622.IR oom_score_adj .
2dad4c59 1623.IP
f2c8b197
MK
1624Writing to
1625.IR /proc/[pid]/oom_score_adj
1626or
1627.IR /proc/[pid]/oom_adj
1628will change the other with its scaled value.
6f752251
MK
1629.IP
1630The
1631.BR choom (1)
1632program provides a command-line interface for adjusting the
1633.I oom_score_adj
1634value of a running process or a newly executed command.
b0aa1e51
MK
1635.TP
1636.IR /proc/[pid]/pagemap " (since Linux 2.6.25)"
1637This file shows the mapping of each of the process's virtual pages
1638into physical page frames or swap area.
1639It contains one 64-bit value for each virtual page,
1640with the bits set as follows:
1641.RS 12
1642.TP
164363
1644If set, the page is present in RAM.
1645.TP
164662
1647If set, the page is in swap space
1648.TP
164961 (since Linux 3.5)
1650The page is a file-mapped page or a shared anonymous page.
1651.TP
2e84528d 165260\(en57 (since Linux 3.11)
b0aa1e51
MK
1653Zero
1654.\" Not quite true; see commit 541c237c0923f567c9c4cabb8a81635baadc713f
1655.TP
2e84528d 165656 (since Linux 4.2)
abfbcb56
MK
1657.\" commit 77bb499bb60f4b79cca7d139c8041662860fcf87
1658.\" commit 83b4b0bb635eee2b8e075062e4e008d1bc110ed7
2e84528d
OE
1659The page is exclusively mapped.
1660.TP
b5301584 166155 (since Linux 3.11)
b0aa1e51
MK
1662PTE is soft-dirty
1663(see the kernel source file
1664.IR Documentation/vm/soft-dirty.txt ).
1665.TP
9bc87ed0 166654\(en0
b0aa1e51
MK
1667If the page is present in RAM (bit 63), then these bits
1668provide the page frame number, which can be used to index
1669.IR /proc/kpageflags
1670and
1671.IR /proc/kpagecount .
1672If the page is present in swap (bit 62),
9bc87ed0 1673then bits 4\(en0 give the swap type, and bits 54\(en5 encode the swap offset.
b0aa1e51
MK
1674.RE
1675.IP
9bc87ed0 1676Before Linux 3.11, bits 60\(en55 were
b0aa1e51
MK
1677used to encode the base-2 log of the page size.
1678.IP
1679To employ
1680.IR /proc/[pid]/pagemap
1681efficiently, use
1682.IR /proc/[pid]/maps
1683to determine which areas of memory are actually mapped and seek
1684to skip over unmapped regions.
1685.IP
1686The
1687.IR /proc/[pid]/pagemap
1688file is present only if the
1689.B CONFIG_PROC_PAGE_MONITOR
1690kernel configuration option is enabled.
2dad4c59 1691.IP
aee2f0bf
MK
1692Permission to access this file is governed by a ptrace access mode
1693.B PTRACE_MODE_READ_FSCREDS
1694check; see
1695.BR ptrace (2).
7c2905d1
MK
1696.TP
1697.IR /proc/[pid]/personality " (since Linux 2.6.28)"
1698.\" commit 478307230810d7e2a753ed220db9066dfdf88718
1699This read-only file exposes the process's execution domain, as set by
1700.BR personality (2).
1701The value is displayed in hexadecimal notation.
2dad4c59 1702.IP
4834ae91
MK
1703Permission to access this file is governed by a ptrace access mode
1704.B PTRACE_MODE_ATTACH_FSCREDS
1705check; see
1706.BR ptrace (2).
fea681da 1707.TP
69119dc7 1708.I /proc/[pid]/root
008f1ecc 1709UNIX and Linux support the idea of a per-process root of the
9ee4a2b6 1710filesystem, set by the
fea681da 1711.BR chroot (2)
c13182ef
MK
1712system call.
1713This file is a symbolic link that points to the process's
14d70713
MK
1714root directory, and behaves in the same way as
1715.IR exe ,
1716and
1717.IR fd/* .
2dad4c59 1718.IP
948f0ff4 1719Note however that this file is not merely a symbolic link.
2b312241
MF
1720It provides the same view of the filesystem (including namespaces and the
1721set of per-process mounts) as the process itself.
a77efd58
MK
1722An example illustrates this point.
1723In one terminal, we start a shell in new user and mount namespaces,
1724and in that shell we create some new mount points:
2dad4c59 1725.IP
a77efd58 1726.in +4n
37d5e699 1727.EX
a77efd58
MK
1728$ \fBPS1='sh1# ' unshare \-Urnm\fP
1729sh1# \fBmount \-t tmpfs tmpfs /etc\fP # Mount empty tmpfs at /etc
1730sh1# \fBmount \-\-bind /usr /dev\fP # Mount /usr at /dev
89f92905 1731sh1# \fBecho $$\fP
a77efd58 173227123
37d5e699 1733.EE
a77efd58 1734.in
2dad4c59 1735.IP
a77efd58
MK
1736In a second terminal window, in the initial mount namespace,
1737we look at the contents of the corresponding mounts in
1738the initial and new namespaces:
2dad4c59 1739.IP
a77efd58 1740.in +4n
37d5e699 1741.EX
89f92905 1742$ \fBPS1='sh2# ' sudo sh\fP
a77efd58
MK
1743sh2# \fBls /etc | wc \-l\fP # In initial NS
1744309
1745sh2# \fBls /proc/27123/root/etc | wc \-l\fP # /etc in other NS
17460 # The empty tmpfs dir
1747sh2# \fBls /dev | wc \-l\fP # In initial NS
1748205
1749sh2# \fBls /proc/27123/root/dev | wc \-l\fP # /dev in other NS
175011 # Actually bind
1751 # mounted to /usr
1752sh2# \fBls /usr | wc \-l\fP # /usr in initial NS
175311
37d5e699 1754.EE
a77efd58 1755.in
2dad4c59 1756.IP
afcaf646 1757.\" The following was still true as at kernel 2.6.13
3ed7270e
MK
1758In a multithreaded process, the contents of the
1759.I /proc/[pid]/root
1760symbolic link are not available if the main thread has already terminated
afcaf646
MK
1761(typically by calling
1762.BR pthread_exit (3)).
2dad4c59 1763.IP
b902fe18
MK
1764Permission to dereference or read
1765.RB ( readlink (2))
1766this symbolic link is governed by a ptrace access mode
1767.B PTRACE_MODE_READ_FSCREDS
1768check; see
1769.BR ptrace (2).
f34f0182 1770.\" FIXME Describe /proc/[pid]/projid_map
43d42cc0
MK
1771.\" Added in 3.7
1772.\" commit f76d207a66c3a53defea67e7d36c3eb1b7d6d61d
15869389
MK
1773.TP
1774.IR /proc/[pid]/seccomp " (Linux 2.6.12 to 2.6.22)"
1775This file can be used to read and change the process's
1776secure computing (seccomp) mode setting.
1777It contains the value 0 if the process is not in seccomp mode,
1778and 1 if the process is in strict seccomp mode (see
1779.BR seccomp (2)).
1780Writing 1 to this file places the process irreversibly in strict seccomp mode.
1781(Further attempts to write to the file fail with the
1782.B EPERM
1783error.)
2dad4c59 1784.IP
15869389
MK
1785In Linux 2.6.23,
1786this file went away, to be replaced by the
1787.BR prctl (2)
1788.BR PR_GET_SECCOMP
1789and
1790.BR PR_SET_SECCOMP
1791operations (and later by
1792.BR seccomp (2)
1793and the
1794.I Seccomp
1795field in
1796.IR /proc/[pid]/status ).
69119dc7 1797.\" FIXME Describe /proc/[pid]/sessionid
b3fb99e8 1798.\" commit 1e0bd7550ea9cf474b1ad4c6ff5729a507f75fdc
b4e9ee8f 1799.\" CONFIG_AUDITSYSCALL
43d42cc0 1800.\" Added in 2.6.25; read-only; only readable by real UID
bea08fec 1801.\"
69119dc7 1802.\" FIXME Describe /proc/[pid]/sched
b4e9ee8f
MK
1803.\" Added in 2.6.23
1804.\" CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS
1805.\" Displays various scheduling parameters
1806.\" This file can be written, to reset stats
ef4f4031 1807.\" The set of fields exposed by this file have changed
b3fb99e8
MK
1808.\" significantly over time.
1809.\" commit 43ae34cb4cd650d1eb4460a8253a8e747ba052ac
1810.\"
69119dc7
MK
1811.\" FIXME Describe /proc/[pid]/schedstats and
1812.\" /proc/[pid]/task/[tid]/schedstats
b4e9ee8f
MK
1813.\" Added in 2.6.9
1814.\" CONFIG_SCHEDSTATS
fea681da 1815.TP
5c92b1b7 1816.IR /proc/[pid]/setgroups " (since Linux 3.19)"
ab28dba9
MK
1817See
1818.BR user_namespaces (7).
d520465b 1819.TP
69119dc7 1820.IR /proc/[pid]/smaps " (since Linux 2.6.14)"
b07b19c4 1821This file shows memory consumption for each of the process's mappings.
859503c3
MK
1822(The
1823.BR pmap (1)
1824command displays similar information,
1825in a form that may be easier for parsing.)
1f0add28 1826For each mapping there is a series of lines such as the following:
37d5e699 1827.IP
a08ea57c 1828.in +4n
37d5e699 1829.EX
9bc87ed0 183000400000\-0048a000 r\-xp 00000000 fd:03 960637 /bin/bash
95fe794d
PG
1831Size: 552 kB
1832Rss: 460 kB
1833Pss: 100 kB
1834Shared_Clean: 452 kB
1835Shared_Dirty: 0 kB
1836Private_Clean: 8 kB
1837Private_Dirty: 0 kB
1838Referenced: 460 kB
1839Anonymous: 0 kB
1840AnonHugePages: 0 kB
4ad958e1
MK
1841ShmemHugePages: 0 kB
1842ShmemPmdMapped: 0 kB
95fe794d
PG
1843Swap: 0 kB
1844KernelPageSize: 4 kB
1845MMUPageSize: 4 kB
6861f8f0
MK
1846KernelPageSize: 4 kB
1847MMUPageSize: 4 kB
95fe794d 1848Locked: 0 kB
2f057281 1849ProtectionKey: 0
eb848708 1850VmFlags: rd ex mr mw me dw
37d5e699 1851.EE
a08ea57c 1852.in
2d3fb75b 1853.IP
b07b19c4
MK
1854The first of these lines shows the same information as is displayed
1855for the mapping in
69119dc7 1856.IR /proc/[pid]/maps .
c3d59262 1857The following lines show the size of the mapping,
95fe794d 1858the amount of the mapping that is currently resident in RAM ("Rss"),
a5a3e91b 1859the process's proportional share of this mapping ("Pss"),
1f0add28 1860the number of clean and dirty shared pages in the mapping,
c7ce200d 1861and the number of clean and dirty private pages in the mapping.
95fe794d 1862"Referenced" indicates the amount of memory currently marked as
1f0add28
MK
1863referenced or accessed.
1864"Anonymous" shows the amount of memory
1865that does not belong to any file.
1866"Swap" shows how much
95fe794d 1867would-be-anonymous memory is also used, but out on swap.
2dad4c59 1868.IP
6861f8f0
MK
1869The "KernelPageSize" line (available since Linux 2.6.29)
1870is the page size used by the kernel to back the virtual memory area.
1f0add28
MK
1871This matches the size used by the MMU in the majority of cases.
1872However, one counter-example occurs on PPC64 kernels
6861f8f0 1873whereby a kernel using 64kB as a base page size may still use 4kB
1f0add28 1874pages for the MMU on older processors.
6861f8f0
MK
1875To distinguish the two attributes, the "MMUPageSize" line
1876(also available since Linux 2.6.29)
1877reports the page size used by the MMU.
2dad4c59 1878.IP
95fe794d
PG
1879The "Locked" indicates whether the mapping is locked in memory
1880or not.
2dad4c59 1881.IP
9b780b06
MK
1882The "ProtectionKey" line (available since Linux 4.9, on x86 only)
1883contains the memory protection key (see
1884.BR pkeys (7))
1885associated with the virtual memory area.
1886This entry is present only if the kernel was built with the
1887.B CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
1888configuration option.
2dad4c59 1889.IP
eb848708
MK
1890The "VmFlags" line (available since Linux 3.8)
1891represents the kernel flags associated with the virtual memory area,
1892encoded using the following two-letter codes:
2dad4c59 1893.IP
95fe794d 1894 rd - readable
1f0add28 1895 wr - writable
95fe794d
PG
1896 ex - executable
1897 sh - shared
1898 mr - may read
1899 mw - may write
1900 me - may execute
1901 ms - may share
723e333c 1902 gd - stack segment grows down
95fe794d
PG
1903 pf - pure PFN range
1904 dw - disabled write to the mapped file
1905 lo - pages are locked in memory
1906 io - memory mapped I/O area
1907 sr - sequential read advise provided
1908 rr - random read advise provided
1909 dc - do not copy area on fork
1910 de - do not expand area on remapping
1911 ac - area is accountable
1912 nr - swap space is not reserved for the area
1913 ht - area uses huge tlb pages
1914 nl - non-linear mapping
1915 ar - architecture specific flag
1916 dd - do not include area into core dump
1917 sd - soft-dirty flag
1918 mm - mixed map area
1919 hg - huge page advise flag
1920 nh - no-huge page advise flag
b5408a0f 1921 mg - mergeable advise flag
2dad4c59 1922.IP
be729d66
DH
1923"ProtectionKey" field contains the memory protection key (see
1924.BR pkeys (5))
1925associated with the virtual memory area.
f12f1b9b 1926Present only if the kernel was built with the
be729d66
DH
1927.B CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
1928configuration option. (since Linux 4.6)
2dad4c59 1929.IP
e618d945
MK
1930The
1931.IR /proc/[pid]/smaps
1932file is present only if the
1933.B CONFIG_PROC_PAGE_MONITOR
1934kernel configuration option is enabled.
b07b19c4 1935.TP
67aac6fb
MK
1936.IR /proc/[pid]/stack " (since Linux 2.6.29)"
1937.\" 2ec220e27f5040aec1e88901c1b6ea3d135787ad
1938This file provides a symbolic trace of the function calls in this
1939process's kernel stack.
1940This file is provided only if the kernel was built with the
1941.B CONFIG_STACKTRACE
1942configuration option.
2dad4c59 1943.IP
4834ae91
MK
1944Permission to access this file is governed by a ptrace access mode
1945.B PTRACE_MODE_ATTACH_FSCREDS
1946check; see
1947.BR ptrace (2).
67aac6fb 1948.TP
69119dc7 1949.I /proc/[pid]/stat
c13182ef
MK
1950Status information about the process.
1951This is used by
1952.BR ps (1).
082bf5b8
MK
1953It is defined in the kernel source file
1954.IR fs/proc/array.c "."
2dad4c59 1955.IP
fea681da
MK
1956The fields, in order, with their proper
1957.BR scanf (3)
b02b4b74
MK
1958format specifiers, are listed below.
1959Whether or not certain of these fields display valid information is governed by
1960a ptrace access mode
1961.BR PTRACE_MODE_READ_FSCREDS "\ |\ " PTRACE_MODE_NOAUDIT
1962check (refer to
1963.BR ptrace (2)).
1964If the check denies access, then the field value is displayed as 0.
1965The affected fields are indicated with the marking [PT].
2dad4c59 1966.IP
fea681da 1967.RS
62e4a418
MK
1968.TP 10
1969(1) \fIpid\fP \ %d
1970.br
1971The process ID.
fea681da 1972.TP
62e4a418
MK
1973(2) \fIcomm\fP \ %s
1974The filename of the executable, in parentheses.
c13182ef 1975This is visible whether or not the executable is swapped out.
fea681da 1976.TP
62e4a418 1977(3) \fIstate\fP \ %c
31293f37
MK
1978One of the following characters, indicating process state:
1979.RS
1980.IP R 3
1981Running
1982.IP S
1983Sleeping in an interruptible wait
1984.IP D
1985Waiting in uninterruptible
1986disk sleep
1987.IP Z
1988Zombie
1989.IP T
1990Stopped (on a signal) or (before Linux 2.6.33) trace stopped
1991.IP t
1992.\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
1993Tracing stop (Linux 2.6.33 onward)
1994.IP W
1995Paging (only before Linux 2.6.0)
1996.IP X
ef4f4031 1997Dead (from Linux 2.6.0 onward)
31293f37
MK
1998.IP x
1999.\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
2000Dead (Linux 2.6.33 to
2001.\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
20023.13 only)
2003.IP K
2004.\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
2005Wakekill (Linux 2.6.33 to
2006.\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
20073.13 only)
2008.IP W
2009.\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
2010Waking (Linux 2.6.33 to
2011.\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
20123.13 only)
2013.IP P
2014.\" commit f2530dc71cf0822f90bb63ea4600caaef33a66bb
2015Parked (Linux 3.9 to
2016.\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
20173.13 only)
2018.RE
fea681da 2019.TP
62e4a418 2020(4) \fIppid\fP \ %d
e0fdc57c 2021The PID of the parent of this process.
fea681da 2022.TP
62e4a418
MK
2023(5) \fIpgrp\fP \ %d
2024The process group ID of the process.
fea681da 2025.TP
62e4a418
MK
2026(6) \fIsession\fP \ %d
2027The session ID of the process.
fea681da 2028.TP
62e4a418
MK
2029(7) \fItty_nr\fP \ %d
2030The controlling terminal of the process.
59a40ed7
MK
2031(The minor device number is contained in the combination of bits
203231 to 20 and 7 to 0;
b97deb97 2033the major device number is in bits 15 to 8.)
fea681da 2034.TP
62e4a418 2035(8) \fItpgid\fP \ %d
fea681da 2036.\" This field and following, up to and including wchan added 0.99.1
62e4a418 2037The ID of the foreground process group of the controlling
59a40ed7 2038terminal of the process.
fea681da 2039.TP
62e4a418
MK
2040(9) \fIflags\fP \ %u
2041The kernel flags word of the process.
c13182ef 2042For bit meanings,
66a9882e 2043see the PF_* defines in the Linux kernel source file
00702acc 2044.IR include/linux/sched.h .
fea681da 2045Details depend on the kernel version.
2dad4c59 2046.IP
62e4a418 2047The format for this field was %lu before Linux 2.6.
fea681da 2048.TP
ee566744 2049(10) \fIminflt\fP \ %lu
62e4a418 2050The number of minor faults the process has made which have not
fea681da
MK
2051required loading a memory page from disk.
2052.TP
62e4a418
MK
2053(11) \fIcminflt\fP \ %lu
2054The number of minor faults that the process's
fea681da
MK
2055waited-for children have made.
2056.TP
62e4a418
MK
2057(12) \fImajflt\fP \ %lu
2058The number of major faults the process has made which have
fea681da
MK
2059required loading a memory page from disk.
2060.TP
62e4a418
MK
2061(13) \fIcmajflt\fP \ %lu
2062The number of major faults that the process's
fea681da
MK
2063waited-for children have made.
2064.TP
62e4a418
MK
2065(14) \fIutime\fP \ %lu
2066Amount of time that this process has been scheduled in user mode,
7a017e24 2067measured in clock ticks (divide by
67914165 2068.IR sysconf(_SC_CLK_TCK) ).
a1c9dc59
MK
2069This includes guest time, \fIguest_time\fP
2070(time spent running a virtual CPU, see below),
2071so that applications that are not aware of the guest time field
2072do not lose that time from their calculations.
fea681da 2073.TP
62e4a418
MK
2074(15) \fIstime\fP \ %lu
2075Amount of time that this process has been scheduled in kernel mode,
7a017e24 2076measured in clock ticks (divide by
67914165 2077.IR sysconf(_SC_CLK_TCK) ).
fea681da 2078.TP
62e4a418
MK
2079(16) \fIcutime\fP \ %ld
2080Amount of time that this process's
7a017e24
MK
2081waited-for children have been scheduled in user mode,
2082measured in clock ticks (divide by
67914165 2083.IR sysconf(_SC_CLK_TCK) ).
c13182ef 2084(See also
fea681da 2085.BR times (2).)
a1c9dc59
MK
2086This includes guest time, \fIcguest_time\fP
2087(time spent running a virtual CPU, see below).
fea681da 2088.TP
62e4a418
MK
2089(17) \fIcstime\fP \ %ld
2090Amount of time that this process's
7a017e24
MK
2091waited-for children have been scheduled in kernel mode,
2092measured in clock ticks (divide by
67914165 2093.IR sysconf(_SC_CLK_TCK) ).
fea681da 2094.TP
62e4a418
MK
2095(18) \fIpriority\fP \ %ld
2096(Explanation for Linux 2.6)
59a40ed7
MK
2097For processes running a real-time scheduling policy
2098.RI ( policy
2099below; see
2100.BR sched_setscheduler (2)),
2101this is the negated scheduling priority, minus one;
2102that is, a number in the range \-2 to \-100,
2103corresponding to real-time priorities 1 to 99.
2104For processes running under a non-real-time scheduling policy,
2105this is the raw nice value
2106.RB ( setpriority (2))
2107as represented in the kernel.
2108The kernel stores nice values as numbers
2109in the range 0 (high) to 39 (low),
2110corresponding to the user-visible nice range of \-20 to 19.
2dad4c59 2111.IP
59a40ed7
MK
2112Before Linux 2.6, this was a scaled value based on
2113the scheduler weighting given to this process.
2114.\" And back in kernel 1.2 days things were different again.
fea681da 2115.TP
62e4a418
MK
2116(19) \fInice\fP \ %ld
2117The nice value (see
59a40ed7
MK
2118.BR setpriority (2)),
2119a value in the range 19 (low priority) to \-20 (high priority).
2120.\" Back in kernel 1.2 days things were different.
fea681da
MK
2121.\" .TP
2122.\" \fIcounter\fP %ld
2123.\" The current maximum size in jiffies of the process's next timeslice,
2124.\" or what is currently left of its current timeslice, if it is the
2125.\" currently running process.
2126.\" .TP
2127.\" \fItimeout\fP %u
2128.\" The time in jiffies of the process's next timeout.
0e94f77b 2129.\" timeout was removed sometime around 2.1/2.2
aa610245 2130.TP
62e4a418
MK
2131(20) \fInum_threads\fP \ %ld
2132Number of threads in this process (since Linux 2.6).
bb83d1b9 2133Before kernel 2.6, this field was hard coded to 0 as a placeholder
0e94f77b 2134for an earlier removed field.
fea681da 2135.TP
62e4a418
MK
2136(21) \fIitrealvalue\fP \ %ld
2137The time in jiffies before the next
8bd58774
MK
2138.B SIGALRM
2139is sent to the process due to an interval timer.
0e94f77b
MK
2140Since kernel 2.6.17, this field is no longer maintained,
2141and is hard coded as 0.
fea681da 2142.TP
62e4a418
MK
2143(22) \fIstarttime\fP \ %llu
2144The time the process started after system boot.
055024ed
MK
2145In kernels before Linux 2.6, this value was expressed in jiffies.
2146Since Linux 2.6, the value is expressed in clock ticks (divide by
2147.IR sysconf(_SC_CLK_TCK) ).
2dad4c59 2148.IP
62e4a418 2149The format for this field was %lu before Linux 2.6.
fea681da 2150.TP
62e4a418
MK
2151(23) \fIvsize\fP \ %lu
2152Virtual memory size in bytes.
fea681da 2153.TP
62e4a418
MK
2154(24) \fIrss\fP \ %ld
2155Resident Set Size: number of pages the process has in real memory.
c13182ef 2156This is just the pages which
5fab2e7c 2157count toward text, data, or stack space.
c13182ef 2158This does not include pages
fea681da
MK
2159which have not been demand-loaded in, or which are swapped out.
2160.TP
62e4a418
MK
2161(25) \fIrsslim\fP \ %lu
2162Current soft limit in bytes on the rss of the process;
59a40ed7
MK
2163see the description of
2164.B RLIMIT_RSS
2165in
2b5407af 2166.BR getrlimit (2).
fea681da 2167.TP
b02b4b74 2168(26) \fIstartcode\fP \ %lu \ [PT]
62e4a418 2169The address above which program text can run.
fea681da 2170.TP
b02b4b74 2171(27) \fIendcode\fP \ %lu \ [PT]
62e4a418 2172The address below which program text can run.
fea681da 2173.TP
b02b4b74 2174(28) \fIstartstack\fP \ %lu \ [PT]
62e4a418 2175The address of the start (i.e., bottom) of the stack.
fea681da 2176.TP
b02b4b74 2177(29) \fIkstkesp\fP \ %lu \ [PT]
62e4a418 2178The current value of ESP (stack pointer), as found in the
fea681da
MK
2179kernel stack page for the process.
2180.TP
b02b4b74 2181(30) \fIkstkeip\fP \ %lu \ [PT]
62e4a418 2182The current EIP (instruction pointer).
fea681da 2183.TP
62e4a418
MK
2184(31) \fIsignal\fP \ %lu
2185The bitmap of pending signals, displayed as a decimal number.
59a40ed7 2186Obsolete, because it does not provide information on real-time signals; use
69119dc7 2187.I /proc/[pid]/status
59a40ed7 2188instead.
fea681da 2189.TP
62e4a418
MK
2190(32) \fIblocked\fP \ %lu
2191The bitmap of blocked signals, displayed as a decimal number.
59a40ed7 2192Obsolete, because it does not provide information on real-time signals; use
69119dc7 2193.I /proc/[pid]/status
59a40ed7 2194instead.
fea681da 2195.TP
62e4a418
MK
2196(33) \fIsigignore\fP \ %lu
2197The bitmap of ignored signals, displayed as a decimal number.
59a40ed7 2198Obsolete, because it does not provide information on real-time signals; use
69119dc7 2199.I /proc/[pid]/status
59a40ed7 2200instead.
fea681da 2201.TP
62e4a418
MK
2202(34) \fIsigcatch\fP \ %lu
2203The bitmap of caught signals, displayed as a decimal number.
59a40ed7 2204Obsolete, because it does not provide information on real-time signals; use
69119dc7 2205.I /proc/[pid]/status
59a40ed7 2206instead.
fea681da 2207.TP
b02b4b74 2208(35) \fIwchan\fP \ %lu \ [PT]
62e4a418 2209This is the "channel" in which the process is waiting.
2054f761
MK
2210It is the address of a location in the kernel where the process is sleeping.
2211The corresponding symbolic name can be found in
2212.IR /proc/[pid]/wchan .
fea681da 2213.TP
62e4a418 2214(36) \fInswap\fP \ %lu
0633f951 2215.\" nswap was added in 2.0
4d9b6984 2216Number of pages swapped (not maintained).
fea681da 2217.TP
62e4a418 2218(37) \fIcnswap\fP \ %lu
0633f951 2219.\" cnswap was added in 2.0
4d9b6984 2220Cumulative \fInswap\fP for child processes (not maintained).
fea681da 2221.TP
62e4a418
MK
2222(38) \fIexit_signal\fP \ %d \ (since Linux 2.1.22)
2223Signal to be sent to parent when we die.
fea681da 2224.TP
62e4a418
MK
2225(39) \fIprocessor\fP \ %d \ (since Linux 2.2.8)
2226CPU number last executed on.
568105c6 2227.TP
62e4a418
MK
2228(40) \fIrt_priority\fP \ %u \ (since Linux 2.5.19)
2229Real-time scheduling priority, a number in the range 1 to 99 for
59a40ed7
MK
2230processes scheduled under a real-time policy,
2231or 0, for non-real-time processes (see
568105c6
MK
2232.BR sched_setscheduler (2)).
2233.TP
62e4a418
MK
2234(41) \fIpolicy\fP \ %u \ (since Linux 2.5.19)
2235Scheduling policy (see
568105c6 2236.BR sched_setscheduler (2)).
cd60dedd 2237Decode using the SCHED_* constants in
59a40ed7 2238.IR linux/sched.h .
2dad4c59 2239.IP
62e4a418 2240The format for this field was %lu before Linux 2.6.22.
167450d6 2241.TP
62e4a418
MK
2242(42) \fIdelayacct_blkio_ticks\fP \ %llu \ (since Linux 2.6.18)
2243Aggregated block I/O delays, measured in clock ticks (centiseconds).
14c06953 2244.TP
62e4a418
MK
2245(43) \fIguest_time\fP \ %lu \ (since Linux 2.6.24)
2246Guest time of the process (time spent running a virtual CPU
7a017e24 2247for a guest operating system), measured in clock ticks (divide by
67914165 2248.IR sysconf(_SC_CLK_TCK) ).
14c06953 2249.TP
62e4a418
MK
2250(44) \fIcguest_time\fP \ %ld \ (since Linux 2.6.24)
2251Guest time of the process's children, measured in clock ticks (divide by
67914165 2252.IR sysconf(_SC_CLK_TCK) ).
fea681da 2253.TP
b02b4b74 2254(45) \fIstart_data\fP \ %lu \ (since Linux 3.3) \ [PT]
0be30a54 2255.\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff
62e4a418 2256Address above which program initialized and
426bc8d7 2257uninitialized (BSS) data are placed.
12449ae3 2258.TP
b02b4b74 2259(46) \fIend_data\fP \ %lu \ (since Linux 3.3) \ [PT]
0be30a54 2260.\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff
62e4a418 2261Address below which program initialized and
426bc8d7 2262uninitialized (BSS) data are placed.
12449ae3 2263.TP
b02b4b74 2264(47) \fIstart_brk\fP \ %lu \ (since Linux 3.3) \ [PT]
0be30a54 2265.\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff
62e4a418 2266Address above which program heap can be expanded with
426bc8d7 2267.BR brk (2).
12449ae3 2268.TP
b02b4b74 2269(48) \fIarg_start\fP \ %lu \ (since Linux 3.5) \ [PT]
0be30a54 2270.\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
62e4a418 2271Address above which program command-line arguments
426bc8d7
MK
2272.RI ( argv )
2273are placed.
12449ae3 2274.TP
b02b4b74 2275(49) \fIarg_end\fP \ %lu \ (since Linux 3.5) \ [PT]
0be30a54 2276.\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
62e4a418 2277Address below program command-line arguments
426bc8d7
MK
2278.RI ( argv )
2279are placed.
12449ae3 2280.TP
b02b4b74 2281(50) \fIenv_start\fP \ %lu \ (since Linux 3.5) \ [PT]
0be30a54 2282.\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
62e4a418 2283Address above which program environment is placed.
12449ae3 2284.TP
b02b4b74 2285(51) \fIenv_end\fP \ %lu \ (since Linux 3.5) \ [PT]
0be30a54 2286.\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
62e4a418 2287Address below which program environment is placed.
12449ae3 2288.TP
b02b4b74 2289(52) \fIexit_code\fP \ %d \ (since Linux 3.5) \ [PT]
0be30a54 2290.\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
62e4a418 2291The thread's exit status in the form reported by
426bc8d7 2292.BR waitpid (2).
12449ae3 2293.RE
2294.TP
69119dc7 2295.I /proc/[pid]/statm
59a40ed7 2296Provides information about memory usage, measured in pages.
c13182ef 2297The columns are:
37d5e699 2298.IP
a08ea57c 2299.in +4n
37d5e699 2300.EX
cb42fb56 2301size (1) total program size
69119dc7 2302 (same as VmSize in \fI/proc/[pid]/status\fP)
cb42fb56 2303resident (2) resident set size
69119dc7 2304 (same as VmRSS in \fI/proc/[pid]/status\fP)
4e6fa352
MK
2305shared (3) number of resident shared pages (i.e., backed by a file)
2306 (same as RssFile+RssShmem in \fI/proc/[pid]/status\fP)
cb42fb56 2307text (4) text (code)
59a40ed7 2308.\" (not including libs; broken, includes data segment)
d133b9b3 2309lib (5) library (unused since Linux 2.6; always 0)
cb42fb56 2310data (6) data + stack
59a40ed7 2311.\" (including libs; broken, includes library text)
d133b9b3 2312dt (7) dirty pages (unused since Linux 2.6; always 0)
37d5e699 2313.EE
a08ea57c 2314.in
fea681da 2315.TP
69119dc7 2316.I /proc/[pid]/status
fea681da 2317Provides much of the information in
69119dc7 2318.I /proc/[pid]/stat
fea681da 2319and
69119dc7 2320.I /proc/[pid]/statm
fea681da 2321in a format that's easier for humans to parse.
16b5f7ba 2322Here's an example:
37d5e699 2323.IP
16b5f7ba 2324.in +4n
37d5e699 2325.EX
b43a3b30 2326.RB "$" " cat /proc/$$/status"
16b5f7ba 2327Name: bash
a79343e9 2328Umask: 0022
16b5f7ba 2329State: S (sleeping)
aac0b30f 2330Tgid: 17248
2d2dfb69 2331Ngid: 0
aac0b30f
MK
2332Pid: 17248
2333PPid: 17200
16b5f7ba
MK
2334TracerPid: 0
2335Uid: 1000 1000 1000 1000
2336Gid: 100 100 100 100
2337FDSize: 256
2338Groups: 16 33 100
aac0b30f
MK
2339NStgid: 17248
2340NSpid: 17248
2341NSpgid: 17248
2342NSsid: 17200
06b7cee0
MK
2343VmPeak: 131168 kB
2344VmSize: 131168 kB
2345VmLck: 0 kB
2346VmPin: 0 kB
2347VmHWM: 13484 kB
2348VmRSS: 13484 kB
e546617e
MK
2349RssAnon: 10264 kB
2350RssFile: 3220 kB
2351RssShmem: 0 kB
06b7cee0
MK
2352VmData: 10332 kB
2353VmStk: 136 kB
2354VmExe: 992 kB
2355VmLib: 2104 kB
2356VmPTE: 76 kB
2357VmPMD: 12 kB
2358VmSwap: 0 kB
4084d612 2359HugetlbPages: 0 kB # 4.4
16b5f7ba
MK
2360Threads: 1
2361SigQ: 0/3067
2362SigPnd: 0000000000000000
2363ShdPnd: 0000000000000000
2364SigBlk: 0000000000010000
2365SigIgn: 0000000000384004
2366SigCgt: 000000004b813efb
2367CapInh: 0000000000000000
2368CapPrm: 0000000000000000
2369CapEff: 0000000000000000
2370CapBnd: ffffffffffffffff
6112ea97 2371CapAmb: 0000000000000000
6c0ed873 2372NoNewPrivs: 0
039b6546 2373Seccomp: 0
bf8fc275 2374Speculation_Store_Bypass: vulnerable
16b5f7ba
MK
2375Cpus_allowed: 00000001
2376Cpus_allowed_list: 0
2377Mems_allowed: 1
2378Mems_allowed_list: 0
2379voluntary_ctxt_switches: 150
2380nonvoluntary_ctxt_switches: 545
37d5e699 2381.EE
16b5f7ba
MK
2382.in
2383.IP
2384The fields are as follows:
2385.RS
2386.IP * 2
2387.IR Name :
2388Command run by this process.
2389.IP *
a79343e9 2390.IR Umask :
53473996
MK
2391Process umask, expressed in octal with a leading zero; see
2392.BR umask (2).
a79343e9
MK
2393(Since Linux 4.7.)
2394.IP *
16b5f7ba 2395.IR State :
4175f999
MK
2396Current state of the process.
2397One of
16b5f7ba
MK
2398"R (running)",
2399"S (sleeping)",
2400"D (disk sleep)",
2401"T (stopped)",
2402"T (tracing stop)",
2403"Z (zombie)",
2404or
2405"X (dead)".
2406.IP *
2407.IR Tgid :
2408Thread group ID (i.e., Process ID).
2409.IP *
2d2dfb69
MK
2410.IR Ngid :
2411NUMA group ID (0 if none; since Linux 3.13).
2412.IP *
16b5f7ba
MK
2413.IR Pid :
2414Thread ID (see
2415.BR gettid (2)).
2416.IP *
a1bc91d5
MK
2417.IR PPid :
2418PID of parent process.
2419.IP *
16b5f7ba
MK
2420.IR TracerPid :
2421PID of process tracing this process (0 if not being traced).
2422.IP *
2423.IR Uid ", " Gid :
9ee4a2b6 2424Real, effective, saved set, and filesystem UIDs (GIDs).
16b5f7ba
MK
2425.IP *
2426.IR FDSize :
2427Number of file descriptor slots currently allocated.
2428.IP *
2429.IR Groups :
2430Supplementary group list.
2431.IP *
b84a64f4 2432.IR NStgid :
aac0b30f
MK
2433Thread group ID (i.e., PID) in each of the PID namespaces of which
2434.I [pid]
2435is a member.
2436The leftmost entry shows the value with respect to the PID namespace
0aae4092
KF
2437of the process that mounted this procfs (or the root namespace
2438if mounted by the kernel),
aac0b30f
MK
2439followed by the value in successively nested inner namespaces.
2440.\" commit e4bc33245124db69b74a6d853ac76c2976f472d5
2441(Since Linux 4.1.)
2442.IP *
b84a64f4 2443.IR NSpid :
aac0b30f
MK
2444Thread ID in each of the PID namespaces of which
2445.I [pid]
2446is a member.
2447The fields are ordered as for
2448.IR NStgid .
2449(Since Linux 4.1.)
2450.IP *
ecc9535d 2451.IR NSpgid :
aac0b30f
MK
2452Process group ID in each of the PID namespaces of which
2453.I [pid]
2454is a member.
2455The fields are ordered as for
2456.IR NStgid .
2457(Since Linux 4.1.)
2458.IP *
ecc9535d 2459.IR NSsid :
aac0b30f
MK
2460descendant namespace session ID hierarchy
2461Session ID in each of the PID namespaces of which
2462.I [pid]
2463is a member.
2464The fields are ordered as for
2465.IR NStgid .
2466(Since Linux 4.1.)
2467.IP *
16b5f7ba
MK
2468.IR VmPeak :
2469Peak virtual memory size.
2470.IP *
2471.IR VmSize :
2472Virtual memory size.
2473.IP *
2474.IR VmLck :
fde39195 2475Locked memory size (see
f8bfb68e 2476.BR mlock (2)).
16b5f7ba 2477.IP *
15789039
TY
2478.IR VmPin :
2479Pinned memory size
2480.\" commit bc3e53f682d93df677dbd5006a404722b3adfe18
2481(since Linux 3.2).
2482These are pages that can't be moved because something needs to
2483directly access physical memory.
2484.IP *
16b5f7ba
MK
2485.IR VmHWM :
2486Peak resident set size ("high water mark").
2487.IP *
2488.IR VmRSS :
2489Resident set size.
e546617e
MK
2490Note that the value here is the sum of
2491.IR RssAnon ,
2492.IR RssFile ,
2493and
2494.IR RssShmem .
2495.IP *
2496.IR RssAnon :
2497Size of resident anonymous memory.
2498.\" commit bf9683d6990589390b5178dafe8fd06808869293
2499(since Linux 4.5).
2500.IP *
2501.IR RssFile :
2502Size of resident file mappings.
2503.\" commit bf9683d6990589390b5178dafe8fd06808869293
2504(since Linux 4.5).
2505.IP *
2506.IR RssShmem :
78230722 2507Size of resident shared memory (includes System V shared memory,
4e07c70f
MK
2508mappings from
2509.BR tmpfs (5),
2510and shared anonymous mappings).
e546617e
MK
2511.\" commit bf9683d6990589390b5178dafe8fd06808869293
2512(since Linux 4.5).
16b5f7ba
MK
2513.IP *
2514.IR VmData ", " VmStk ", " VmExe :
2515Size of data, stack, and text segments.
2516.IP *
2517.IR VmLib :
2518Shared library code size.
2519.IP *
2520.IR VmPTE :
2521Page table entries size (since Linux 2.6.10).
2522.IP *
e28af9cd
MK
2523.IR VmPMD :
2524.\" commit dc6c9a35b66b520cf67e05d8ca60ebecad3b0479
73b9cbe1 2525Size of second-level page tables (since Linux 4.0).
e28af9cd 2526.IP *
ac4b0eb3 2527.IR VmSwap :
1ddc1665 2528.\" commit b084d4353ff99d824d3bc5a5c2c22c70b1fba722
fce21149
MK
2529Swapped-out virtual memory size by anonymous private pages;
2530shmem swap usage is not included (since Linux 2.6.34).
49f6dda7 2531.IP *
4084d612
MK
2532.IR HugetlbPages :
2533Size of hugetlb memory portions.
2534.\" commit 5d317b2b6536592a9b51fe65faed43d65ca9158e
2535(since Linux 4.4).
2536.IP *
16b5f7ba
MK
2537.IR Threads :
2538Number of threads in process containing this thread.
2539.IP *
6ee625eb
MK
2540.IR SigQ :
2541This field contains two slash-separated numbers that relate to
2542queued signals for the real user ID of this process.
2543The first of these is the number of currently queued
2544signals for this real user ID, and the second is the
2545resource limit on the number of queued signals for this process
2546(see the description of
2547.BR RLIMIT_SIGPENDING
2548in
2549.BR getrlimit (2)).
2550.IP *
16b5f7ba
MK
2551.IR SigPnd ", " ShdPnd :
2552Number of signals pending for thread and for process as a whole (see
2553.BR pthreads (7)
2554and
2555.BR signal (7)).
2556.IP *
2557.IR SigBlk ", " SigIgn ", " SigCgt :
2558Masks indicating signals being blocked, ignored, and caught (see
2559.BR signal (7)).
2560.IP *
2561.IR CapInh ", " CapPrm ", " CapEff :
2562Masks of capabilities enabled in inheritable, permitted, and effective sets
2563(see
2564.BR capabilities (7)).
2565.IP *
2566.IR CapBnd :
2567Capability Bounding set
7e07d950 2568(since Linux 2.6.26, see
16b5f7ba
MK
2569.BR capabilities (7)).
2570.IP *
6112ea97
MK
2571.IR CapAmb :
2572Ambient capability set
2573(since Linux 4.3, see
2574.BR capabilities (7)).
2575.IP *
6c0ed873
MK
2576.IR NoNewPrivs :
2577.\" commit af884cd4a5ae62fcf5e321fecf0ec1014730353d
2578Value of the
2579.I no_new_privs
2580bit
2581(since Linux 4.10, see
2582.BR prctl (2)).
2583.IP *
039b6546
MK
2584.IR Seccomp :
2585.\" commit 2f4b3bf6b2318cfaa177ec5a802f4d8d6afbd816
2586Seccomp mode of the process
2587(since Linux 3.8, see
2588.BR seccomp (2)).
25890 means
2590.BR SECCOMP_MODE_DISABLED ;
25911 means
2592.BR SECCOMP_MODE_STRICT ;
25932 means
2594.BR SECCOMP_MODE_FILTER .
2595This field is provided only if the kernel was built with the
2596.BR CONFIG_SECCOMP
2597kernel configuration option enabled.
2598.IP *
bf8fc275
NF
2599.IR Speculation_Store_Bypass :
2600.\" commit fae1fa0fc6cca8beee3ab8ed71d54f9a78fa3f64
2601Speculation flaw mitigation state
2602(since Linux 4.17, see
2603.BR prctl (2)).
2604.IP *
16b5f7ba
MK
2605.IR Cpus_allowed :
2606Mask of CPUs on which this process may run
2607(since Linux 2.6.24, see
2608.BR cpuset (7)).
2609.IP *
2610.IR Cpus_allowed_list :
2611Same as previous, but in "list format"
2612(since Linux 2.6.26, see
2613.BR cpuset (7)).
2614.IP *
2615.IR Mems_allowed :
2616Mask of memory nodes allowed to this process
2617(since Linux 2.6.24, see
2618.BR cpuset (7)).
2619.IP *
2620.IR Mems_allowed_list :
2621Same as previous, but in "list format"
2622(since Linux 2.6.26, see
2623.BR cpuset (7)).
2624.IP *
7c82878a 2625.IR voluntary_ctxt_switches ", " nonvoluntary_ctxt_switches :
16b5f7ba
MK
2626Number of voluntary and involuntary context switches (since Linux 2.6.23).
2627.RE
afb7b014
MK
2628.TP
2629.IR /proc/[pid]/syscall " (since Linux 2.6.27)"
2630.\" commit ebcb67341fee34061430f3367f2e507e52ee051b
2631This file exposes the system call number and argument registers for the
2632system call currently being executed by the process,
2633followed by the values of the stack pointer and program counter registers.
2634The values of all six argument registers are exposed,
2635although most system calls use fewer registers.
2dad4c59 2636.IP
afb7b014 2637If the process is blocked, but not in a system call,
1fb61947 2638then the file displays \-1 in place of the system call number,
afb7b014 2639followed by just the values of the stack pointer and program counter.
64fcb6e1 2640If process is not blocked, then the file contains just the string "running".
2dad4c59 2641.IP
afb7b014
MK
2642This file is present only if the kernel was configured with
2643.BR CONFIG_HAVE_ARCH_TRACEHOOK .
2dad4c59 2644.IP
4834ae91
MK
2645Permission to access this file is governed by a ptrace access mode
2646.B PTRACE_MODE_ATTACH_FSCREDS
2647check; see
2648.BR ptrace (2).
fea681da 2649.TP
69119dc7 2650.IR /proc/[pid]/task " (since Linux 2.6.0-test6)"
afcaf646
MK
2651This is a directory that contains one subdirectory
2652for each thread in the process.
69119dc7
MK
2653The name of each subdirectory is the numerical thread ID
2654.RI ( [tid] )
2655of the thread (see
afcaf646
MK
2656.BR gettid (2)).
2657Within each of these subdirectories, there is a set of
2658files with the same names and contents as under the
69119dc7 2659.I /proc/[pid]
afcaf646
MK
2660directories.
2661For attributes that are shared by all threads, the contents for
2662each of the files under the
69119dc7 2663.I task/[tid]
afcaf646 2664subdirectories will be the same as in the corresponding
c13182ef 2665file in the parent
69119dc7 2666.I /proc/[pid]
afcaf646 2667directory
c13182ef 2668(e.g., in a multithreaded process, all of the
69119dc7 2669.I task/[tid]/cwd
c13182ef 2670files will have the same value as the
69119dc7 2671.I /proc/[pid]/cwd
c13182ef 2672file in the parent directory, since all of the threads in a process
afcaf646
MK
2673share a working directory).
2674For attributes that are distinct for each thread,
c13182ef 2675the corresponding files under
69119dc7 2676.I task/[tid]
afcaf646 2677may have different values (e.g., various fields in each of the
69119dc7 2678.I task/[tid]/status
4a40c703
JH
2679files may be different for each thread),
2680.\" in particular: "children" :/
2681or they might not exist in
2682.I /proc/[pid]
2683at all.
afcaf646
MK
2684.\" The following was still true as at kernel 2.6.13
2685In a multithreaded process, the contents of the
69119dc7 2686.I /proc/[pid]/task
c13182ef 2687directory are not available if the main thread has already terminated
afcaf646
MK
2688(typically by calling
2689.BR pthread_exit (3)).
2dad4c59 2690.IP
4a40c703
JH
2691.TP
2692.IR /proc/[pid]/task/[tid]/children " (since Linux 3.5)"
2693.\" commit 818411616baf46ceba0cff6f05af3a9b294734f7
2694A space-separated list of child tasks of this task.
2695Each child task is represented by its TID.
2dad4c59 2696.IP
4a40c703 2697.\" see comments in get_children_pid() in fs/proc/array.c
45dd5092
MK
2698This option is intended for use by the checkpoint-restore (CRIU) system,
2699and reliably provides a list of children only if all of the child processes
2700are stopped or frozen.
2701It does not work properly if children of the target task exit while
4a40c703 2702the file is being read!
45dd5092 2703Exiting children may cause non-exiting children to be omitted from the list.
4a40c703 2704This makes this interface even more unreliable than classic PID-based
45dd5092
MK
2705approaches if the inspected task and its children aren't frozen,
2706and most code should probably not use this interface.
2dad4c59 2707.IP
7ded2db4
MK
2708Until Linux 4.2, the presence of this file was governed by the
2709.B CONFIG_CHECKPOINT_RESTORE
2710kernel configuration option.
2711Since Linux 4.2,
2712.\" commit 2e13ba54a2682eea24918b87ad3edf70c2cf085b
ae34c521 2713it is governed by the
7ded2db4
MK
2714.B CONFIG_PROC_CHILDREN
2715option.
afcaf646 2716.TP
1509ca0e
MK
2717.IR /proc/[pid]/timers " (since Linux 3.10)"
2718.\" commit 5ed67f05f66c41e39880a6d61358438a25f9fee5
2719.\" commit 48f6a7a511ef8823fdff39afee0320092d43a8a0
2720A list of the POSIX timers for this process.
93691c1e 2721Each timer is listed with a line that starts with the string "ID:".
1509ca0e 2722For example:
2dad4c59 2723.IP
1509ca0e 2724.in +4n
37d5e699 2725.EX
1509ca0e
MK
2726ID: 1
2727signal: 60/00007fff86e452a8
2728notify: signal/pid.2634
2729ClockID: 0
2730ID: 0
2731signal: 60/00007fff86e452a8
2732notify: signal/pid.2634
2733ClockID: 1
37d5e699 2734.EE
1509ca0e 2735.in
2dad4c59 2736.IP
1509ca0e
MK
2737The lines shown for each timer have the following meanings:
2738.RS
2739.TP
2740.I ID
2741The ID for this timer.
2742This is not the same as the timer ID returned by
2743.BR timer_create (2);
2744rather, it is the same kernel-internal ID that is available via the
2745.I si_timerid
2746field of the
2747.IR siginfo_t
2748structure (see
2749.BR sigaction (2)).
2750.TP
2751.I signal
2752This is the signal number that this timer uses to deliver notifications
2753followed by a slash, and then the
7f1ea8fb 2754.I sigev_value
1509ca0e
MK
2755value supplied to the signal handler.
2756Valid only for timers that notify via a signal.
2757.TP
2758.I notify
2759The part before the slash specifies the mechanism
2760that this timer uses to deliver notifications,
2761and is one of "thread", "signal", or "none".
2762Immediately following the slash is either the string "tid" for timers
2763with
2764.B SIGEV_THREAD_ID
2765notification, or "pid" for timers that notify by other mechanisms.
dbe6f88b
MK
2766Following the "." is the PID of the process
2767(or the kernel thread ID of the thread) that will be delivered
1509ca0e
MK
2768a signal if the timer delivers notifications via a signal.
2769.TP
2770.I ClockID
2771This field identifies the clock that the timer uses for measuring time.
2772For most clocks, this is a number that matches one of the user-space
2773.BR CLOCK_*
9d54c087 2774constants exposed via
1509ca0e
MK
2775.IR <time.h> .
2776.B CLOCK_PROCESS_CPUTIME_ID
9bc87ed0 2777timers display with a value of \-6
1509ca0e
MK
2778in this field.
2779.B CLOCK_THREAD_CPUTIME_ID
9bc87ed0 2780timers display with a value of \-2
1509ca0e
MK
2781in this field.
2782.RE
5734da6d
MK
2783.IP
2784This file is available only when the kernel was configured with
2785.BR CONFIG_CHECKPOINT_RESTORE .
1509ca0e 2786.TP
11f60142
MK
2787.IR /proc/[pid]/timerslack_ns " (since Linux 4.6)"
2788.\" commit da8b44d5a9f8bf26da637b7336508ca534d6b319
2789.\" commit 5de23d435e88996b1efe0e2cebe242074ce67c9e
2790This file exposes the process's "current" timer slack value,
2791expressed in nanoseconds.
2792The file is writable,
2793allowing the process's timer slack value to be changed.
2794Writing 0 to this file resets the "current" timer slack to the
2795"default" timer slack value.
2796For further details, see the discussion of
2797.BR PR_SET_TIMERSLACK
2798in
2799.BR prctl (2).
2dad4c59 2800.IP
5daae264
MK
2801Initially,
2802permission to access this file was governed by a ptrace access mode
a62e0e01 2803.B PTRACE_MODE_ATTACH_FSCREDS
5daae264
MK
2804check (see
2805.BR ptrace (2)).
2806However, this was subsequently deemed too strict a requirement
2807(and had the side effect that requiring a process to have the
2808.B CAP_SYS_PTRACE
2809capability would also allow it to view and change any process's memory).
2810Therefore, since Linux 4.9,
2811.\" commit 7abbaf94049914f074306d960b0f968ffe52e59f
2812only the (weaker)
2813.B CAP_SYS_NICE
2814capability is required to access this file.
11f60142 2815.TP
b1aad373
MK
2816.IR /proc/[pid]/uid_map ", " /proc/[pid]/gid_map " (since Linux 3.5)"
2817See
2818.BR user_namespaces (7).
2819.TP
2820.IR /proc/[pid]/wchan " (since Linux 2.6.0)"
2821The symbolic name corresponding to the location
2822in the kernel where the process is sleeping.
2dad4c59 2823.IP
82664739
MK
2824Permission to access this file is governed by a ptrace access mode
2825.B PTRACE_MODE_READ_FSCREDS
2826check; see
2827.BR ptrace (2).
b1aad373
MK
2828.TP
2829.I /proc/apm
2830Advanced power management version and battery information when
2831.B CONFIG_APM
2832is defined at kernel compilation time.
2833.TP
2834.I /proc/buddyinfo
2835This file contains information which is used for diagnosing memory
2836fragmentation issues.
2837Each line starts with the identification of the node and the name
2838of the zone which together identify a memory region
2839This is then
2840followed by the count of available chunks of a certain order in
2841which these zones are split.
2842The size in bytes of a certain order is given by the formula:
2dad4c59 2843.IP
b1aad373 2844 (2^order)\ *\ PAGE_SIZE
2dad4c59 2845.IP
b1aad373
MK
2846The binary buddy allocator algorithm inside the kernel will split
2847one chunk into two chunks of a smaller order (thus with half the
2848size) or combine two contiguous chunks into one larger chunk of
2849a higher order (thus with double the size) to satisfy allocation
2850requests and to counter memory fragmentation.
2851The order matches the column number, when starting to count at zero.
2dad4c59 2852.IP
b5b0d21e 2853For example on an x86-64 system:
2dad4c59 2854.IP
b1aad373 2855.in -12n
37d5e699 2856.EX
b1aad373
MK
2857Node 0, zone DMA 1 1 1 0 2 1 1 0 1 1 3
2858Node 0, zone DMA32 65 47 4 81 52 28 13 10 5 1 404
2859Node 0, zone Normal 216 55 189 101 84 38 37 27 5 3 587
37d5e699 2860.EE
b1aad373 2861.in
2dad4c59 2862.IP
b1aad373
MK
2863In this example, there is one node containing three zones and there
2864are 11 different chunk sizes.
2865If the page size is 4 kilobytes, then the first zone called
2866.I DMA
2867(on x86 the first 16 megabyte of memory) has 1 chunk of 4 kilobytes
2868(order 0) available and has 3 chunks of 4 megabytes (order 10) available.
2dad4c59 2869.IP
b1aad373
MK
2870If the memory is heavily fragmented, the counters for higher
2871order chunks will be zero and allocation of large contiguous areas
2872will fail.
2dad4c59 2873.IP
b1aad373
MK
2874Further information about the zones can be found in
2875.IR /proc/zoneinfo .
2876.TP
2877.I /proc/bus
2878Contains subdirectories for installed busses.
2879.TP
2880.I /proc/bus/pccard
2881Subdirectory for PCMCIA devices when
2882.B CONFIG_PCMCIA
2883is set at kernel compilation time.
2884.TP
fea681da
MK
2885.I /proc/bus/pccard/drivers
2886.TP
2887.I /proc/bus/pci
c13182ef 2888Contains various bus subdirectories and pseudo-files containing
59a40ed7 2889information about PCI busses, installed devices, and device
c13182ef
MK
2890drivers.
2891Some of these files are not ASCII.
fea681da
MK
2892.TP
2893.I /proc/bus/pci/devices
59a40ed7 2894Information about PCI devices.
c13182ef 2895They may be accessed through
fea681da
MK
2896.BR lspci (8)
2897and
2898.BR setpci (8).
2899.TP
12b23dfe
MK
2900.IR /proc/cgroups " (since Linux 2.6.24)"
2901See
2902.BR cgroups (7).
2903.TP
fea681da 2904.I /proc/cmdline
c13182ef
MK
2905Arguments passed to the Linux kernel at boot time.
2906Often done via a boot manager such as
59a40ed7
MK
2907.BR lilo (8)
2908or
2909.BR grub (8).
f6e524c4
MK
2910.TP
2911.IR /proc/config.gz " (since Linux 2.6)"
2912This file exposes the configuration options that were used
c3d9780d 2913to build the currently running kernel,
f6e524c4
MK
2914in the same format as they would be shown in the
2915.I .config
2916file that resulted when configuring the kernel (using
2917.IR "make xconfig" ,
2918.IR "make config" ,
2919or similar).
2920The file contents are compressed; view or search them using
f78ed33a
MK
2921.BR zcat (1)
2922and
2923.BR zgrep (1).
f6e524c4 2924As long as no changes have been made to the following file,
250e01ec
MK
2925the contents of
2926.I /proc/config.gz
37d5e699
MK
2927are the same as those provided by:
2928.IP
f6e524c4 2929.in +4n
37d5e699 2930.EX
c3074d70 2931cat /lib/modules/$(uname \-r)/build/.config
37d5e699 2932.EE
f6e524c4 2933.in
250e01ec
MK
2934.IP
2935.I /proc/config.gz
90878f7c 2936is provided only if the kernel is configured with
250e01ec 2937.BR CONFIG_IKCONFIG_PROC .
fea681da 2938.TP
577c0e20
MK
2939.I /proc/crypto
2940A list of the ciphers provided by the kernel crypto API.
2941For details, see the kernel
2942.I "Linux Kernel Crypto API"
2943documentation available under the kernel source directory
e94de168
ES
2944.I Documentation/crypto/
2945.\" commit 3b72c814a8e8cd638e1ba0da4dfce501e9dff5af
2946(or
2947.I Documentation/DocBook
2948before 4.10;
2949the documentation can be built using a command such as
577c0e20 2950.IR "make htmldocs"
e94de168 2951in the root directory of the kernel source tree).
577c0e20 2952.TP
fea681da
MK
2953.I /proc/cpuinfo
2954This is a collection of CPU and system architecture dependent items,
2955for each supported architecture a different list.
2956Two common entries are \fIprocessor\fP which gives CPU number and
c13182ef
MK
2957\fIbogomips\fP; a system constant that is calculated
2958during kernel initialization.
2959SMP machines have information for
fea681da 2960each CPU.
a091f002
MK
2961The
2962.BR lscpu (1)
2963command gathers its information from this file.
fea681da
MK
2964.TP
2965.I /proc/devices
c13182ef
MK
2966Text listing of major numbers and device groups.
2967This can be used by MAKEDEV scripts for consistency with the kernel.
fea681da
MK
2968.TP
2969.IR /proc/diskstats " (since Linux 2.5.69)"
2970This file contains disk I/O statistics for each disk device.
66a9882e 2971See the Linux kernel source file
fea681da
MK
2972.I Documentation/iostats.txt
2973for further information.
2974.TP
2975.I /proc/dma
c13182ef 2976This is a list of the registered \fIISA\fP DMA (direct memory access)
fea681da
MK
2977channels in use.
2978.TP
2979.I /proc/driver
2980Empty subdirectory.
2981.TP
2982.I /proc/execdomains
2983List of the execution domains (ABI personalities).
2984.TP
2985.I /proc/fb
097585ed
MK
2986Frame buffer information when
2987.B CONFIG_FB
2988is defined during kernel compilation.
fea681da
MK
2989.TP
2990.I /proc/filesystems
9ee4a2b6
MK
2991A text listing of the filesystems which are supported by the kernel,
2992namely filesystems which were compiled into the kernel or whose kernel
6387216b
MK
2993modules are currently loaded.
2994(See also
fb477da2 2995.BR filesystems (5).)
9ee4a2b6 2996If a filesystem is marked with "nodev",
809d0164 2997this means that it does not require a block device to be mounted
9ee4a2b6 2998(e.g., virtual filesystem, network filesystem).
2dad4c59 2999.IP
809d0164
MK
3000Incidentally, this file may be used by
3001.BR mount (8)
9ee4a2b6
MK
3002when no filesystem is specified and it didn't manage to determine the
3003filesystem type.
3004Then filesystems contained in this file are tried
809d0164 3005(excepted those that are marked with "nodev").
fea681da
MK
3006.TP
3007.I /proc/fs
df352acc 3008.\" FIXME Much more needs to be said about /proc/fs
91085d85 3009.\"
df352acc
MK
3010Contains subdirectories that in turn contain files
3011with information about (certain) mounted filesystems.
fea681da
MK
3012.TP
3013.I /proc/ide
3014This directory
59a40ed7
MK
3015exists on systems with the IDE bus.
3016There are directories for each IDE channel and attached device.
c13182ef 3017Files include:
2dad4c59 3018.IP
a08ea57c 3019.in +4n
37d5e699 3020.EX
fea681da
MK
3021cache buffer size in KB
3022capacity number of sectors
3023driver driver version
3024geometry physical and logical geometry
9fdfa163 3025identify in hexadecimal
fea681da
MK
3026media media type
3027model manufacturer's model number
3028settings drive settings
9fdfa163
MK
3029smart_thresholds in hexadecimal
3030smart_values in hexadecimal
37d5e699 3031.EE
a08ea57c 3032.in
2dad4c59 3033.IP
c13182ef 3034The
fea681da
MK
3035.BR hdparm (8)
3036utility provides access to this information in a friendly format.
3037.TP
3038.I /proc/interrupts
23ec6ff0
MK
3039This is used to record the number of interrupts per CPU per IO device.
3040Since Linux 2.6.24,
9ea5bc66 3041for the i386 and x86-64 architectures, at least, this also includes
23ec6ff0
MK
3042interrupts internal to the system (that is, not associated with a device
3043as such), such as NMI (nonmaskable interrupt), LOC (local timer interrupt),
3044and for SMP systems, TLB (TLB flush interrupt), RES (rescheduling
3045interrupt), CAL (remote function call interrupt), and possibly others.
3046Very easy to read formatting, done in ASCII.
fea681da
MK
3047.TP
3048.I /proc/iomem
3049I/O memory map in Linux 2.4.
3050.TP
3051.I /proc/ioports
c13182ef 3052This is a list of currently registered Input-Output port regions that
fea681da
MK
3053are in use.
3054.TP
3055.IR /proc/kallsyms " (since Linux 2.5.71)"
3056This holds the kernel exported symbol definitions used by the
3057.BR modules (X)
3058tools to dynamically link and bind loadable modules.
3059In Linux 2.5.47 and earlier, a similar file with slightly different syntax
3060was named
3061.IR ksyms .
3062.TP
3063.I /proc/kcore
3064This file represents the physical memory of the system and is stored
c13182ef
MK
3065in the ELF core file format.
3066With this pseudo-file, and an unstripped
9a67332e
MK
3067kernel
3068.RI ( /usr/src/linux/vmlinux )
3069binary, GDB can be used to
fea681da 3070examine the current state of any kernel data structures.
2dad4c59 3071.IP
fea681da 3072The total length of the file is the size of physical memory (RAM) plus
ee8655b5 30734\ KiB.
fea681da 3074.TP
653836fb
MK
3075.IR /proc/keys " (since Linux 2.6.10)"
3076See
3077.BR keyrings (7).
3078.TP
3079.IR /proc/key-users " (since Linux 2.6.10)"
3080See
3081.BR keyrings (7).
3082.TP
fea681da
MK
3083.I /proc/kmsg
3084This file can be used instead of the
3085.BR syslog (2)
c13182ef
MK
3086system call to read kernel messages.
3087A process must have superuser
fea681da 3088privileges to read this file, and only one process should read this
c13182ef
MK
3089file.
3090This file should not be read if a syslog process is running
fea681da
MK
3091which uses the
3092.BR syslog (2)
3093system call facility to log kernel messages.
2dad4c59 3094.IP
fea681da 3095Information in this file is retrieved with the
c4517613 3096.BR dmesg (1)
fea681da
MK
3097program.
3098.TP
55d68a94 3099.IR /proc/kpagecgroup " (since Linux 4.3)"
0e462d71 3100.\" commit 80ae2fdceba8313b0433f899bdd9c6c463291a17
55d68a94
OE
3101This file contains a 64-bit inode number of
3102the memory cgroup each page is charged to,
3103indexed by page frame number (see the discussion of
3104.IR /proc/[pid]/pagemap ).
3105.IP
3106The
3107.IR /proc/kpagecgroup
3108file is present only if the
3109.B CONFIG_MEMCG
3110kernel configuration option is enabled.
3111.TP
ff56ac8b
MK
3112.IR /proc/kpagecount " (since Linux 2.6.25)"
3113This file contains a 64-bit count of the number of
3114times each physical page frame is mapped,
3115indexed by page frame number (see the discussion of
3116.IR /proc/[pid]/pagemap ).
3117.IP
3118The
3119.IR /proc/kpagecount
3120file is present only if the
3121.B CONFIG_PROC_PAGE_MONITOR
59d566a9
MK
3122kernel configuration option is enabled.
3123.TP
3124.IR /proc/kpageflags " (since Linux 2.6.25)"
ef4f4031 3125This file contains 64-bit masks corresponding to each physical page frame;
59d566a9
MK
3126it is indexed by page frame number (see the discussion of
3127.IR /proc/[pid]/pagemap ).
3128The bits are as follows:
2dad4c59 3129.IP
59d566a9
MK
3130 0 - KPF_LOCKED
3131 1 - KPF_ERROR
3132 2 - KPF_REFERENCED
3133 3 - KPF_UPTODATE
3134 4 - KPF_DIRTY
3135 5 - KPF_LRU
3136 6 - KPF_ACTIVE
3137 7 - KPF_SLAB
3138 8 - KPF_WRITEBACK
3139 9 - KPF_RECLAIM
3140 10 - KPF_BUDDY
3141 11 - KPF_MMAP (since Linux 2.6.31)
3142 12 - KPF_ANON (since Linux 2.6.31)
3143 13 - KPF_SWAPCACHE (since Linux 2.6.31)
3144 14 - KPF_SWAPBACKED (since Linux 2.6.31)
3145 15 - KPF_COMPOUND_HEAD (since Linux 2.6.31)
3146 16 - KPF_COMPOUND_TAIL (since Linux 2.6.31)
d0ffc687 3147 17 - KPF_HUGE (since Linux 2.6.31)
59d566a9
MK
3148 18 - KPF_UNEVICTABLE (since Linux 2.6.31)
3149 19 - KPF_HWPOISON (since Linux 2.6.31)
3150 20 - KPF_NOPAGE (since Linux 2.6.31)
3151 21 - KPF_KSM (since Linux 2.6.32)
3152 22 - KPF_THP (since Linux 3.4)
5487da4c
MK
3153 23 - KPF_BALLOON (since Linux 3.18)
3154.\" KPF_BALLOON: commit 09316c09dde33aae14f34489d9e3d243ec0d5938
f38dfdf1 3155 24 - KPF_ZERO_PAGE (since Linux 4.0)
c6f182bc 3156.\" KPF_ZERO_PAGE: commit 56873f43abdcd574b25105867a990f067747b2f4
f38dfdf1 3157 25 - KPF_IDLE (since Linux 4.3)
c6f182bc 3158.\" KPF_IDLE: commit f074a8f49eb87cde95ac9d040ad5e7ea4f029738
2dad4c59 3159.IP
59d566a9
MK
3160For further details on the meanings of these bits,
3161see the kernel source file
3162.IR Documentation/vm/pagemap.txt .
3163Before kernel 2.6.29,
3164.\" commit ad3bdefe877afb47480418fdb05ecd42842de65e
3165.\" commit e07a4b9217d1e97d2f3a62b6b070efdc61212110
3166.BR KPF_WRITEBACK ,
3167.BR KPF_RECLAIM ,
3168.BR KPF_BUDDY ,
3169and
3170.BR KPF_LOCKED
3171did not report correctly.
3172.IP
3173The
3174.IR /proc/kpageflags
3175file is present only if the
3176.B CONFIG_PROC_PAGE_MONITOR
ff56ac8b
MK
3177kernel configuration option is enabled.
3178.TP
93f18cbb 3179.IR /proc/ksyms " (Linux 1.1.23\(en2.5.47)"
fea681da
MK
3180See
3181.IR /proc/kallsyms .
3182.TP
3183.I /proc/loadavg
6b05dc38
MK
3184The first three fields in this file are load average figures
3185giving the number of jobs in the run queue (state R)
fea681da
MK
3186or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes.
3187They are the same as the load average numbers given by
3188.BR uptime (1)
3189and other programs.
6b05dc38 3190The fourth field consists of two numbers separated by a slash (/).
78fc91ec
EDB
3191The first of these is the number of currently runnable kernel
3192scheduling entities (processes, threads).
6b05dc38
MK
3193The value after the slash is the number of kernel scheduling entities
3194that currently exist on the system.
3195The fifth field is the PID of the process that was most
3196recently created on the system.
fea681da
MK
3197.TP
3198.I /proc/locks
3199This file shows current file locks
3200.RB ( flock "(2) and " fcntl (2))
3201and leases
3202.RB ( fcntl (2)).
f352b560
MK
3203.IP
3204An example of the content shown in this file is the following:
3205.IP
3206.in +4n
3207.EX
32081: POSIX ADVISORY READ 5433 08:01:7864448 128 128
32092: FLOCK ADVISORY WRITE 2001 08:01:7864554 0 EOF
32103: FLOCK ADVISORY WRITE 1568 00:2f:32388 0 EOF
32114: POSIX ADVISORY WRITE 699 00:16:28457 0 EOF
32125: POSIX ADVISORY WRITE 764 00:16:21448 0 0
32136: POSIX ADVISORY READ 3548 08:01:7867240 1 1
32147: POSIX ADVISORY READ 3548 08:01:7865567 1826 2335
32158: OFDLCK ADVISORY WRITE -1 08:01:8713209 128 191
3216.EE
3217.in
3218.IP
3219The fields shown in each line are as follows:
3220.RS
3221.IP (1) 4
3222The ordinal position of the lock in the list.
3223.IP (2)
3224The lock type.
3225Values that may appear here include:
3226.RS
3227.TP
3228.B FLOCK
3229This is a BSD file lock created using
3230.BR flock (2).
3231.TP
3232.B OFDLCK
3233This is an open file description (OFD) lock created using
3234.BR fcntl (2).
3235.TP
3236.B POSIX
3237This is a POSIX byte-range lock created using
3238.BR fcntl (2).
3239.RE
3240.IP (3)
3241Among the strings that can appear here are the following:
3242.RS
3243.TP
3244.B ADVISORY
3245This is an advisory lock.
3246.TP
3247.B MANDATORY
3248This is a mandatory lock.
3249.RE
3250.IP (4)
3251The type of lock.
3252Values that can appear here are:
3253.RS
3254.TP
3255.B READ
3256This is a POSIX or OFD read lock, or a BSD shared lock.
3257.TP
3258.B WRITE
3259This is a POSIX or OFD write lock, or a BSD exclusive lock.
3260.RE
3261.IP (5)
3262The PID of the process that owns the lock.
3263.IP
3264Because OFD locks are not owned by a single process
3265(since multiple processes may have file descriptors that
3266refer to the same open file description),
3267the value \-1 is displayed in this field for OFD locks.
3268(Before kernel 4.14,
52f842a5 3269.\" commit 9d5b86ac13c573795525ecac6ed2db39ab23e2a8
f352b560
MK
3270a bug meant that the PID of the process that
3271initially acquired the lock was displayed instead of the value \-1.)
3272.IP (6)
3273Three colon-separated subfields that identify the major and minor device
3274ID of the device containing the filesystem where the locked file resides,
3275followed by the inode number of the locked file.
3276.IP (7)
3277The byte offset of the first byte of the lock.
3278For BSD locks, this value is always 0.
3279.IP (8)
3280The byte offset of the last byte of the lock.
3281.B EOF
3282in this field means that the lock extends to the end of the file.
3283For BSD locks, the value shown is always
3284.IR EOF .
3285.RE
3286.IP
8fb9b45a
MK
3287Since Linux 4.9,
3288.\" commit d67fd44f697dff293d7cdc29af929241b669affe
3289the list of locks shown in
3290.I /proc/locks
3291is filtered to show just the locks for the processes in the PID
3292namespace (see
3293.BR pid_namespaces (7))
3294for which the
3295.I /proc
3296filesystem was mounted.
1dbe854b 3297(In the initial PID namespace,
8fb9b45a
MK
3298there is no filtering of the records shown in this file.)
3299.IP
9f1002a1
MK
3300The
3301.BR lslocks (8)
3302command provides a bit more information about each lock.
fea681da 3303.TP
89dd5f8a 3304.IR /proc/malloc " (only up to and including Linux 2.2)"
59a40ed7 3305.\" It looks like this only ever did something back in 1.0 days
90878f7c 3306This file is present only if
89dd5f8a 3307.B CONFIG_DEBUG_MALLOC
097585ed 3308was defined during compilation.
fea681da
MK
3309.TP
3310.I /proc/meminfo
77b802ec
MK
3311This file reports statistics about memory usage on the system.
3312It is used by
fea681da
MK
3313.BR free (1)
3314to report the amount of free and used memory (both physical and swap)
3315on the system as well as the shared memory and buffers used by the
3316kernel.
3ba3d5b1
MK
3317Each line of the file consists of a parameter name, followed by a colon,
3318the value of the parameter, and an option unit of measurement (e.g., "kB").
3319The list below describes the parameter names and
3320the format specifier required to read the field value.
3321Except as noted below,
3322all of the fields have been present since at least Linux 2.6.0.
86cf87d7 3323Some fields are displayed only if the kernel was configured
3ba3d5b1
MK
3324with various options; those dependencies are noted in the list.
3325.RS
3326.TP
3327.IR MemTotal " %lu"
449dd4e2 3328Total usable RAM (i.e., physical RAM minus a few reserved
99e91586 3329bits and the kernel binary code).
3ba3d5b1
MK
3330.TP
3331.IR MemFree " %lu"
7bccb7d4
DP
3332The sum of
3333.IR LowFree + HighFree .
3ba3d5b1 3334.TP
8b4b1f68
MK
3335.IR MemAvailable " %lu (since Linux 3.14)"
3336An estimate of how much memory is available for starting new
3337applications, without swapping.
3338.TP
3ba3d5b1 3339.IR Buffers " %lu"
99e91586 3340Relatively temporary storage for raw disk blocks that
3ba3d5b1
MK
3341shouldn't get tremendously large (20MB or so).
3342.TP
3343.IR Cached " %lu"
3344In-memory cache for files read from the disk (the page cache).
3345Doesn't include
3346.IR SwapCached .
3347.TP
3348.IR SwapCached " %lu"
3349Memory that once was swapped out, is swapped back in but
3350still also is in the swap file.
fa1d2749 3351(If memory pressure is high, these pages
3ba3d5b1 3352don't need to be swapped out again because they are already
99e91586 3353in the swap file.
3ba3d5b1
MK
3354This saves I/O.)
3355.TP
3356.IR Active " %lu"
3357Memory that has been used more recently and usually not
3358reclaimed unless absolutely necessary.
3359.TP
3360.IR Inactive " %lu"
3361Memory which has been less recently used.
3362It is more eligible to be reclaimed for other purposes.
3363.TP
3364.IR Active(anon) " %lu (since Linux 2.6.28)"
3365[To be documented.]
3366.TP
3367.IR Inactive(anon) " %lu (since Linux 2.6.28)"
3368[To be documented.]
3369.TP
3370.IR Active(file) " %lu (since Linux 2.6.28)"
3371[To be documented.]
3372.TP
3373.IR Inactive(file) " %lu (since Linux 2.6.28)"
3374[To be documented.]
3375.TP
3376.IR Unevictable " %lu (since Linux 2.6.28)"
3377(From Linux 2.6.28 to 2.6.30,
3378\fBCONFIG_UNEVICTABLE_LRU\fP was required.)
3379[To be documented.]
3380.TP
46fbfc07 3381.IR Mlocked " %lu (since Linux 2.6.28)"
3ba3d5b1
MK
3382(From Linux 2.6.28 to 2.6.30,
3383\fBCONFIG_UNEVICTABLE_LRU\fP was required.)
3384[To be documented.]
3385.TP
3386.IR HighTotal " %lu"
3387(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
3388Total amount of highmem.
99e91586 3389Highmem is all memory above ~860MB of physical memory.
3ba3d5b1
MK
3390Highmem areas are for use by user-space programs,
3391or for the page cache.
3392The kernel must use tricks to access
3393this memory, making it slower to access than lowmem.
3394.TP
3395.IR HighFree " %lu
3396(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
3397Amount of free highmem.
3398.TP
3399.IR LowTotal " %lu
3400(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
3401Total amount of lowmem.
3402Lowmem is memory which can be used for everything that
3403highmem can be used for, but it is also available for the
3404kernel's use for its own data structures.
3405Among many other things,
99e91586 3406it is where everything from
7bccb7d4
DP
3407.I Slab
3408is allocated.
3ba3d5b1
MK
3409Bad things happen when you're out of lowmem.
3410.TP
3411.IR LowFree " %lu
3412(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
3413Amount of free lowmem.
3414.TP
3415.IR MmapCopy " %lu (since Linux 2.6.29)"
99e91586
DP
3416.RB ( CONFIG_MMU
3417is required.)
3ba3d5b1
MK
3418[To be documented.]
3419.TP
3420.IR SwapTotal " %lu"
3421Total amount of swap space available.
3422.TP
3423.IR SwapFree " %lu"
c16d4f25 3424Amount of swap space that is currently unused.
3ba3d5b1
MK
3425.TP
3426.IR Dirty " %lu"
3427Memory which is waiting to get written back to the disk.
3428.TP
3429.IR Writeback " %lu"
3430Memory which is actively being written back to the disk.
3431.TP
3432.IR AnonPages " %lu (since Linux 2.6.18)"
3433Non-file backed pages mapped into user-space page tables.
3434.TP
3435.IR Mapped " %lu"
fda70f5b
MK
3436Files which have been mapped into memory (with
3437.BR mmap (2)),
3438such as libraries.
3ba3d5b1
MK
3439.TP
3440.IR Shmem " %lu (since Linux 2.6.32)"
eb775c04
MK
3441Amount of memory consumed in
3442.BR tmpfs (5)
3443filesystems.
3ba3d5b1
MK
3444.TP
3445.IR Slab " %lu"
3446In-kernel data structures cache.
5a5bde70
MK
3447(See
3448.BR slabinfo (5).)
3ba3d5b1
MK
3449.TP
3450.IR SReclaimable " %lu (since Linux 2.6.19)"
7bccb7d4
DP
3451Part of
3452.IR Slab ,
3453that might be reclaimed, such as caches.
3ba3d5b1
MK
3454.TP
3455.IR SUnreclaim " %lu (since Linux 2.6.19)"
7bccb7d4
DP
3456Part of
3457.IR Slab ,
3458that cannot be reclaimed on memory pressure.
3ba3d5b1
MK
3459.TP
3460.IR KernelStack " %lu (since Linux 2.6.32)"
3461Amount of memory allocated to kernel stacks.
3462.TP
3463.IR PageTables " %lu (since Linux 2.6.18)"
3464Amount of memory dedicated to the lowest level of page tables.
3465.TP
3466.IR Quicklists " %lu (since Linux 2.6.27)"
3467(\fBCONFIG_QUICKLIST\fP is required.)
3468[To be documented.]
3469.TP
3470.IR NFS_Unstable " %lu (since Linux 2.6.18)"
3471NFS pages sent to the server, but not yet committed to stable storage.
3472.TP
3473.IR Bounce " %lu (since Linux 2.6.18)"
3474Memory used for block device "bounce buffers".
3475.TP
3476.IR WritebackTmp " %lu (since Linux 2.6.26)"
3477Memory used by FUSE for temporary writeback buffers.
3478.TP
3479.IR CommitLimit " %lu (since Linux 2.6.10)"
cd7b6c40
MK
3480This is the total amount of memory currently available to
3481be allocated on the system, expressed in kilobytes.
90878f7c
MK
3482This limit is adhered to
3483only if strict overcommit accounting is enabled (mode 2 in
cd7b6c40
MK
3484.IR /proc/sys/vm/overcommit_memory ).
3485The limit is calculated according to the formula described under
3486.IR /proc/sys/vm/overcommit_memory .
3487For further details, see the kernel source file
3ba3d5b1
MK
3488.IR Documentation/vm/overcommit-accounting .
3489.TP
3490.IR Committed_AS " %lu"
3491The amount of memory presently allocated on the system.
3492The committed memory is a sum of all of the memory which
3493has been allocated by processes, even if it has not been
3494"used" by them as of yet.
3495A process which allocates 1GB of memory (using
3496.BR malloc (3)
33a0ccb2 3497or similar), but touches only 300MB of that memory will show up
90878f7c 3498as using only 300MB of memory even if it has the address space
3ba3d5b1 3499allocated for the entire 1GB.
2dad4c59 3500.IP
3ba3d5b1
MK
3501This 1GB is memory which has been "committed" to by the VM
3502and can be used at any time by the allocating application.
cd7b6c40 3503With strict overcommit enabled on the system (mode 2 in
d9e0f03d 3504.IR /proc/sys/vm/overcommit_memory ),
3ba3d5b1
MK
3505allocations which would exceed the
3506.I CommitLimit
cd7b6c40 3507will not be permitted.
3ba3d5b1
MK
3508This is useful if one needs to guarantee that processes will not
3509fail due to lack of memory once that memory has been successfully allocated.
3510.TP
3511.IR VmallocTotal " %lu"
3512Total size of vmalloc memory area.
3513.TP
3514.IR VmallocUsed " %lu"
3515Amount of vmalloc area which is used.
3516.TP
3517.IR VmallocChunk " %lu"
3518Largest contiguous block of vmalloc area which is free.
3519.TP
3520.IR HardwareCorrupted " %lu (since Linux 2.6.32)"
3521(\fBCONFIG_MEMORY_FAILURE\fP is required.)
3522[To be documented.]
3523.TP
3524.IR AnonHugePages " %lu (since Linux 2.6.38)"
3525(\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.)
7fac88a9 3526Non-file backed huge pages mapped into user-space page tables.
3ba3d5b1 3527.TP
4ad958e1
MK
3528.IR ShmemHugePages " %lu (since Linux 4.8)"
3529(\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.)
4e07c70f
MK
3530Memory used by shared memory (shmem) and
3531.BR tmpfs (5)
3532allocated with huge pages
4ad958e1
MK
3533.TP
3534.IR ShmemPmdMapped " %lu (since Linux 4.8)"
3535(\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.)
956e74b4 3536Shared memory mapped into user space with huge pages.
4ad958e1 3537.TP
43179f55
MK
3538.IR CmaTotal " %lu (since Linux 3.1)"
3539Total CMA (Contiguous Memory Allocator) pages.
3540(\fBCONFIG_CMA\fP is required.)
3541.TP
3542.IR CmaFree " %lu (since Linux 3.1)"
3543Free CMA (Contiguous Memory Allocator) pages.
3544(\fBCONFIG_CMA\fP is required.)
3545.TP
3ba3d5b1
MK
3546.IR HugePages_Total " %lu"
3547(\fBCONFIG_HUGETLB_PAGE\fP is required.)
3548The size of the pool of huge pages.
3549.TP
3550.IR HugePages_Free " %lu"
3551(\fBCONFIG_HUGETLB_PAGE\fP is required.)
3552The number of huge pages in the pool that are not yet allocated.
3553.TP
3554.IR HugePages_Rsvd " %lu (since Linux 2.6.17)"
3555(\fBCONFIG_HUGETLB_PAGE\fP is required.)
3556This is the number of huge pages for
3557which a commitment to allocate from the pool has been made,
3558but no allocation has yet been made.
3559These reserved huge pages
3560guarantee that an application will be able to allocate a
3561huge page from the pool of huge pages at fault time.
3562.TP
aa8a6b4f 3563.IR HugePages_Surp " %lu (since Linux 2.6.24)"
3ba3d5b1
MK
3564(\fBCONFIG_HUGETLB_PAGE\fP is required.)
3565This is the number of huge pages in
3566the pool above the value in
3567.IR /proc/sys/vm/nr_hugepages .
3568The maximum number of surplus huge pages is controlled by
3569.IR /proc/sys/vm/nr_overcommit_hugepages .
3570.TP
3571.IR Hugepagesize " %lu"
3572(\fBCONFIG_HUGETLB_PAGE\fP is required.)
3573The size of huge pages.
d5268de1
MK
3574.TP
3575.IR DirectMap4k " %lu (since Linux 2.6.27)"
3576Number of bytes of RAM linearly mapped by kernel in 4kB pages.
3577(x86.)
3578.TP
3579.IR DirectMap4M " %lu (since Linux 2.6.27)"
3580Number of bytes of RAM linearly mapped by kernel in 4MB pages.
3581(x86 with
3582.BR CONFIG_X86_64
3583or
3584.BR CONFIG_X86_PAE
3585enabled.)
3586.TP
3587.IR DirectMap2M " %lu (since Linux 2.6.27)"
3588Number of bytes of RAM linearly mapped by kernel in 2MB pages.
3589(x86 with neither
3590.BR CONFIG_X86_64
3591nor
3592.BR CONFIG_X86_PAE
3593enabled.)
3594.TP
3595.IR DirectMap1G " %lu (since Linux 2.6.27)"
3596(x86 with
3597.BR CONFIG_X86_64
3598and
3599.B CONFIG_X86_DIRECT_GBPAGES
3600enabled.)
3ba3d5b1 3601.RE
fea681da 3602.TP
aa341984
MK
3603.I /proc/modules
3604A text list of the modules that have been loaded by the system.
3605See also
3606.BR lsmod (8).
3607.TP
fea681da 3608.I /proc/mounts
c1eea65a 3609Before kernel 2.4.19, this file was a list
9ee4a2b6 3610of all the filesystems currently mounted on the system.
ef5b47f6
MK
3611With the introduction of per-process mount namespaces in Linux 2.4.19 (see
3612.BR mount_namespaces (7)),
3613this file became a link to
c1eea65a 3614.IR /proc/self/mounts ,
732e54dd 3615which lists the mount points of the process's own mount namespace.
fea681da 3616The format of this file is documented in
31e9a9ec 3617.BR fstab (5).
fea681da 3618.TP
fea681da 3619.I /proc/mtrr
c13182ef 3620Memory Type Range Registers.
66a9882e 3621See the Linux kernel source file
a8999e1f
ES
3622.I Documentation/x86/mtrr.txt
3623.\" commit 7225e75144b9718cbbe1820d9c011c809d5773fd
3624(or
cfe70b66 3625.I Documentation/mtrr.txt
a8999e1f 3626before Linux 2.6.28)
fea681da
MK
3627for details.
3628.TP
3629.I /proc/net
ccb4bcdc
MK
3630This directory contains various files and subdirectories containing
3631information about the networking layer.
3632The files contain ASCII structures and are,
59a40ed7
MK
3633therefore, readable with
3634.BR cat (1).
c13182ef 3635However, the standard
fea681da
MK
3636.BR netstat (8)
3637suite provides much cleaner access to these files.
2dad4c59 3638.IP
9fb88bc8
MK
3639With the advent of network namespaces,
3640various information relating to the network stack is virtualized (see
3641.BR namespaces (7)).
3642Thus, since Linux 2.6.25,
3643.\" commit e9720acd728a46cb40daa52c99a979f7c4ff195c
3644.IR /proc/net
3645is a symbolic link to the directory
3646.IR /proc/self/net ,
3647which contains the same files and directories as listed below.
3648However, these files and directories now expose information
3649for the network namespace of which the process is a member.
fea681da
MK
3650.TP
3651.I /proc/net/arp
3652This holds an ASCII readable dump of the kernel ARP table used for
c13182ef 3653address resolutions.
01d0a447 3654It will show both dynamically learned and preprogrammed ARP entries.
c13182ef 3655The format is:
c1a022dc
MK
3656.IP
3657.in 7n
3658.EX
fea681da
MK
3659IP address HW type Flags HW address Mask Device
3660192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0
3661192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0
c1a022dc 3662.EE
fea681da 3663.in
c1a022dc 3664.IP
6c04f928 3665Here "IP address" is the IPv4 address of the machine and the "HW type"
c13182ef
MK
3666is the hardware type of the address from RFC\ 826.
3667The flags are the internal
9a67332e
MK
3668flags of the ARP structure (as defined in
3669.IR /usr/include/linux/if_arp.h )
3670and
6c04f928 3671the "HW address" is the data link layer mapping for that IP address if
fea681da
MK
3672it is known.
3673.TP
3674.I /proc/net/dev
c13182ef
MK
3675The dev pseudo-file contains network device status information.
3676This gives
3677the number of received and sent packets, the number of errors and
fea681da 3678collisions
c13182ef
MK
3679and other basic statistics.
3680These are used by the
fea681da 3681.BR ifconfig (8)
c13182ef
MK
3682program to report device status.
3683The format is:
c1a022dc 3684.IP
fea681da 3685.in 1n
c1a022dc 3686.EX
fea681da
MK
3687Inter-| Receive | Transmit
3688 face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
3689 lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0
3690 eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0
3691 ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0
3692 tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0
c1a022dc 3693.EE
fea681da 3694.in
fea681da
MK
3695.\" .TP
3696.\" .I /proc/net/ipx
3697.\" No information.
3698.\" .TP
3699.\" .I /proc/net/ipx_route
3700.\" No information.
3701.TP
3702.I /proc/net/dev_mcast
3703Defined in
3704.IR /usr/src/linux/net/core/dev_mcast.c :
37d5e699
MK
3705.IP
3706.in +4
3707.EX
9fdfa163 3708indx interface_name dmi_u dmi_g dmi_address
fea681da
MK
37092 eth0 1 0 01005e000001
37103 eth1 1 0 01005e000001
37114 eth2 1 0 01005e000001
37d5e699 3712.EE
fea681da 3713.in
fea681da
MK
3714.TP
3715.I /proc/net/igmp
c13182ef
MK
3716Internet Group Management Protocol.
3717Defined in
fea681da
MK
3718.IR /usr/src/linux/net/core/igmp.c .
3719.TP
3720.I /proc/net/rarp
3721This file uses the same format as the
3722.I arp
3723file and contains the current reverse mapping database used to provide
3724.BR rarp (8)
c13182ef
MK
3725reverse address lookup services.
3726If RARP is not configured into the
fea681da
MK
3727kernel,
3728this file will not be present.
3729.TP
3730.I /proc/net/raw
c13182ef
MK
3731Holds a dump of the RAW socket table.
3732Much of the information is not of
fea681da 3733use
c13182ef 3734apart from debugging.
6c04f928 3735The "sl" value is the kernel hash slot for the
fea681da 3736socket,
6c04f928
MK
3737the "local_address" is the local address and protocol number pair.
3738\&"St" is
c13182ef
MK
3739the internal status of the socket.
3740The "tx_queue" and "rx_queue" are the
fea681da 3741outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 3742The "tr", "tm\->when", and "rexmits" fields are not used by RAW.
fdc196f5
MK
3743The "uid"
3744field holds the effective UID of the creator of the socket.
fea681da
MK
3745.\" .TP
3746.\" .I /proc/net/route
3747.\" No information, but looks similar to
3748.\" .BR route (8).
3749.TP
3750.I /proc/net/snmp
c13182ef 3751This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP
fea681da 3752management
763f0e47 3753information bases for an SNMP agent.
fea681da
MK
3754.TP
3755.I /proc/net/tcp
c13182ef
MK
3756Holds a dump of the TCP socket table.
3757Much of the information is not
3758of use apart from debugging.
3759The "sl" value is the kernel hash slot
6beb1671
MK
3760for the socket, the "local_address" is the local address and port number pair.
3761The "rem_address" is the remote address and port number pair
6c04f928
MK
3762(if connected).
3763\&"St" is the internal status of the socket.
3764The "tx_queue" and "rx_queue" are the
fea681da 3765outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 3766The "tr", "tm\->when", and "rexmits" fields hold internal information of
f33774c4 3767the kernel socket state and are useful only for debugging.
fdc196f5
MK
3768The "uid"
3769field holds the effective UID of the creator of the socket.
fea681da
MK
3770.TP
3771.I /proc/net/udp
c13182ef
MK
3772Holds a dump of the UDP socket table.
3773Much of the information is not of
3774use apart from debugging.
3775The "sl" value is the kernel hash slot for the
6beb1671
MK
3776socket, the "local_address" is the local address and port number pair.
3777The "rem_address" is the remote address and port number pair
f2d607ee
MK
3778(if connected).
3779"St" is the internal status of the socket.
fea681da 3780The "tx_queue" and "rx_queue" are the outgoing and incoming data queue
c13182ef 3781in terms of kernel memory usage.
94e9d9fe 3782The "tr", "tm\->when", and "rexmits" fields
c13182ef 3783are not used by UDP.
fdc196f5
MK
3784The "uid"
3785field holds the effective UID of the creator of the socket.
fea681da 3786The format is:
c1a022dc 3787.IP
fea681da 3788.in 1n
c1a022dc 3789.EX
94e9d9fe 3790sl local_address rem_address st tx_queue rx_queue tr rexmits tm\->when uid
fea681da
MK
3791 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0
3792 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0
3793 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0
c1a022dc 3794.EE
fea681da 3795.in
c1a022dc 3796.IP
fea681da
MK
3797.TP
3798.I /proc/net/unix
008f1ecc 3799Lists the UNIX domain sockets present within the system and their
c13182ef
MK
3800status.
3801The format is:
c1a022dc
MK
3802.IP
3803.in 1n
3804.EX
fea681da
MK
3805Num RefCount Protocol Flags Type St Path
3806 0: 00000002 00000000 00000000 0001 03
3807 1: 00000001 00000000 00010000 0001 01 /dev/printer
c1a022dc
MK
3808.EE
3809.in
3810.IP
756f55f6
MK
3811The fields are as follows:
3812.RS
3813.TP 10
3814.IR Num :
3815the kernel table slot number.
3816.TP
3817.IR RefCount :
3818the number of users of the socket.
3819.TP
3820.IR Protocol :
3821currently always 0.
3822.TP
3823.IR Flags :
3824the internal kernel flags holding the status of the socket.
3825.TP
3826.IR Type :
a405066e
MK
3827the socket type.
3828For
3829.BR SOCK_STREAM
3830sockets, this is 0001; for
3831.BR SOCK_DGRAM
3832sockets, it is 0002; and for
3833.BR SOCK_SEQPACKET
3834sockets, it is 0005.
756f55f6
MK
3835.TP
3836.IR St :
3837the internal state of the socket.
3838.TP
3839.IR Path :
590ba7e5 3840the bound pathname (if any) of the socket.
8f8a46fb
MK
3841Sockets in the abstract namespace are included in the list,
3842and are shown with a
3843.I Path
3844that commences with the character '@'.
756f55f6 3845.RE
fea681da 3846.TP
ed8de0e4 3847.I /proc/net/netfilter/nfnetlink_queue
6f858d5c 3848This file contains information about netfilter user-space queueing, if used.
f2d607ee
MK
3849Each line represents a queue.
3850Queues that have not been subscribed to
6f858d5c 3851by user space are not shown.
37d5e699
MK
3852.IP
3853.in +4n
3854.EX
ed8de0e4
FW
3855 1 4207 0 2 65535 0 0 0 1
3856 (1) (2) (3)(4) (5) (6) (7) (8)
37d5e699
MK
3857.EE
3858.in
ed8de0e4
FW
3859.IP
3860The fields in each line are:
3861.RS 7
3862.TP 5
3863(1)
f2d607ee
MK
3864The ID of the queue.
3865This matches what is specified in the
ed8de0e4
FW
3866.B \-\-queue\-num
3867or
3868.B \-\-queue\-balance
3869options to the
3870.BR iptables (8)
f2d607ee
MK
3871NFQUEUE target.
3872See
ed8de0e4
FW
3873.BR iptables-extensions (8)
3874for more information.
3875.TP
3876(2)
7672e08e 3877The netlink port ID subscribed to the queue.
ed8de0e4
FW
3878.TP
3879(3)
3880The number of packets currently queued and waiting to be processed by
3881the application.
3882.TP
3883(4)
f2d607ee
MK
3884The copy mode of the queue.
3885It is either 1 (metadata only) or 2
6f858d5c 3886(also copy payload data to user space).
ed8de0e4
FW
3887.TP
3888(5)
1dea597b 3889Copy range; that is, how many bytes of packet payload should be copied to
6f858d5c 3890user space at most.
ed8de0e4
FW
3891.TP
3892(6)
f2d607ee
MK
3893queue dropped.
3894Number of packets that had to be dropped by the kernel because
6f858d5c 3895too many packets are already waiting for user space to send back the mandatory
ed8de0e4
FW
3896accept/drop verdicts.
3897.TP
3898(7)
f2d607ee
MK
3899queue user dropped.
3900Number of packets that were dropped within the netlink
3901subsystem.
3902Such drops usually happen when the corresponding socket buffer is
6f858d5c 3903full; that is, user space is not able to read messages fast enough.
ed8de0e4
FW
3904.TP
3905(8)
f2d607ee
MK
3906sequence number.
3907Every queued packet is associated with a (32-bit)
ed8de0e4
FW
3908monotonically-increasing sequence number.
3909This shows the ID of the most recent packet queued.
3910.RE
3911.IP
f33774c4 3912The last number exists only for compatibility reasons and is always 1.
ed8de0e4 3913.TP
fea681da 3914.I /proc/partitions
f042d149
MK
3915Contains the major and minor numbers of each partition as well as the number
3916of 1024-byte blocks and the partition name.
fea681da
MK
3917.TP
3918.I /proc/pci
3919This is a listing of all PCI devices found during kernel initialization
3920and their configuration.
2dad4c59 3921.IP
59a40ed7
MK
3922This file has been deprecated in favor of a new
3923.I /proc
2990d781
MK
3924interface for PCI
3925.RI ( /proc/bus/pci ).
3926It became optional in Linux 2.2 (available with
3927.B CONFIG_PCI_OLD_PROC
3928set at kernel compilation).
24b74457 3929It became once more nonoptionally enabled in Linux 2.4.
2990d781
MK
3930Next, it was deprecated in Linux 2.6 (still available with
3931.B CONFIG_PCI_LEGACY_PROC
3932set), and finally removed altogether since Linux 2.6.17.
43d42cc0 3933.\" FIXME Document /proc/sched_debug (since Linux 2.6.23)
69119dc7 3934.\" See also /proc/[pid]/sched
caea7868
MK
3935.TP
3936.IR /proc/profile " (since Linux 2.4)"
3937This file is present only if the kernel was booted with the
3938.I profile=1
3939command-line option.
3940It exposes kernel profiling information in a binary format for use by
3941.BR readprofile (1).
3942Writing (e.g., an empty string) to this file resets the profiling counters;
3943on some architectures,
3944writing a binary integer "profiling multiplier" of size
3945.IR sizeof(int)
8a3ac89a 3946sets the profiling interrupt frequency.
fea681da
MK
3947.TP
3948.I /proc/scsi
59a40ed7
MK
3949A directory with the
3950.I scsi
3951mid-level pseudo-file and various SCSI low-level
2990d781
MK
3952driver directories,
3953which contain a file for each SCSI host in this system, all of
c13182ef
MK
3954which give the status of some part of the SCSI IO subsystem.
3955These files contain ASCII structures and are, therefore, readable with
2990d781 3956.BR cat (1).
2dad4c59 3957.IP
c13182ef 3958You can also write to some of the files to reconfigure the subsystem or
59a40ed7 3959switch certain features on or off.
fea681da
MK
3960.TP
3961.I /proc/scsi/scsi
c13182ef 3962This is a listing of all SCSI devices known to the kernel.
59a40ed7 3963The listing is similar to the one seen during bootup.
c13182ef 3964scsi currently supports only the \fIadd-single-device\fP command which
59a40ed7 3965allows root to add a hotplugged device to the list of known devices.
2dad4c59 3966.IP
59a40ed7 3967The command
37d5e699 3968.IP
59a40ed7 3969.in +4n
37d5e699 3970.EX
59a40ed7 3971echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi
37d5e699 3972.EE
59a40ed7 3973.in
37d5e699 3974.IP
c13182ef
MK
3975will cause
3976host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0.
3977If there
fea681da
MK
3978is already a device known on this address or the address is invalid, an
3979error will be returned.
3980.TP
3981.I /proc/scsi/[drivername]
c13182ef
MK
3982\fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740,
3983aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic,
3984scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000.
3985These directories show up for all drivers that registered at least one
59a40ed7 3986SCSI HBA.
c13182ef 3987Every directory contains one file per registered host.
59a40ed7 3988Every host-file is named after the number the host was assigned during
c13182ef 3989initialization.
2dad4c59 3990.IP
c13182ef 3991Reading these files will usually show driver and host configuration,
f78ed33a 3992statistics, and so on.
2dad4c59 3993.IP
fea681da
MK
3994Writing to these files allows different things on different hosts.
3995For example, with the \fIlatency\fP and \fInolatency\fP commands,
3996root can switch on and off command latency measurement code in the
c13182ef
MK
3997eata_dma driver.
3998With the \fIlockup\fP and \fIunlock\fP commands,
3999root can control bus lockups simulated by the scsi_debug driver.
fea681da
MK
4000.TP
4001.I /proc/self
59a40ed7
MK
4002This directory refers to the process accessing the
4003.I /proc
9ee4a2b6 4004filesystem,
59a40ed7
MK
4005and is identical to the
4006.I /proc
4007directory named by the process ID of the same process.
fea681da
MK
4008.TP
4009.I /proc/slabinfo
c13182ef 4010Information about kernel caches.
c13182ef 4011See
fea681da
MK
4012.BR slabinfo (5)
4013for details.
4014.TP
4015.I /proc/stat
c13182ef
MK
4016kernel/system statistics.
4017Varies with architecture.
4018Common
fea681da
MK
4019entries include:
4020.RS
4021.TP
46f6dbe8
ES
4022.I cpu 10132153 290696 3084719 46828483 16683 0 25195 0 175628 0
4023.TQ
4024.I cpu0 1393280 32966 572056 13343292 6130 0 17875 0 23933 0
bfbfcd18 4025The amount of time, measured in units of
268f000b
MK
4026USER_HZ (1/100ths of a second on most architectures, use
4027.IR sysconf(_SC_CLK_TCK)
4028to obtain the right value),
b81087ab 4029.\" 1024 on Alpha and ia64
46f6dbe8
ES
4030that the system ("cpu" line) or the specific CPU ("cpu\fIN\fR" line)
4031spent in various states:
ae3b8047
MK
4032.RS
4033.TP
4034.I user
ea0841f6 4035(1) Time spent in user mode.
ae3b8047
MK
4036.TP
4037.I nice
0633f951 4038(2) Time spent in user mode with low priority (nice).
9f1b9726 4039.TP
ae3b8047 4040.I system
0633f951 4041(3) Time spent in system mode.
ae3b8047
MK
4042.TP
4043.I idle
ea0841f6 4044(4) Time spent in the idle task.
bea08fec 4045.\" FIXME . Actually, the following info about the /proc/stat 'cpu' field
e04a1f93
MK
4046.\" does not seem to be quite right (at least in 2.6.12 or 3.6):
4047.\" the idle time in /proc/uptime does not quite match this value
4048This value should be USER_HZ times the
4cb1deb7
MK
4049second entry in the
4050.I /proc/uptime
4051pseudo-file.
ae3b8047
MK
4052.TP
4053.IR iowait " (since Linux 2.5.41)"
ea0841f6 4054(5) Time waiting for I/O to complete.
e0a73a31
MK
4055This value is not reliable, for the following reasons:
4056.\" See kernel commit 9c240d757658a3ae9968dd309e674c61f07c7f48
4057.RS
4058.IP 1. 3
4059The CPU will not wait for I/O to complete;
4060iowait is the time that a task is waiting for I/O to complete.
4061When a CPU goes into idle state for outstanding task I/O,
4062another task will be scheduled on this CPU.
4063.IP 2.
4064On a multi-core CPU,
4065the task waiting for I/O to complete is not running on any CPU,
4066so the iowait of each CPU is difficult to calculate.
4067.IP 3.
4068The value in this field may
4069.I decrease
4070in certain conditions.
2d3fb75b 4071.RE
ae3b8047
MK
4072.TP
4073.IR irq " (since Linux 2.6.0-test4)"
ea0841f6 4074(6) Time servicing interrupts.
ae3b8047 4075.TP
0633f951 4076.IR softirq " (since Linux 2.6.0-test4)"
ea0841f6 4077(7) Time servicing softirqs.
ae3b8047
MK
4078.TP
4079.IR steal " (since Linux 2.6.11)"
ea0841f6 4080(8) Stolen time, which is the time spent in other operating systems when
9de1f6cc 4081running in a virtualized environment
ae3b8047
MK
4082.TP
4083.IR guest " (since Linux 2.6.24)"
0633f951 4084(9) Time spent running a virtual CPU for guest
afef1764 4085operating systems under the control of the Linux kernel.
14c06953 4086.\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de
d4fd4120
MK
4087.TP
4088.IR guest_nice " (since Linux 2.6.33)"
4089.\" commit ce0e7b28fb75cb003cfc8d0238613aaf1c55e797
4090(10) Time spent running a niced guest (virtual CPU for guest
4091operating systems under the control of the Linux kernel).
ae3b8047 4092.RE
fea681da
MK
4093.TP
4094\fIpage 5741 1808\fP
4095The number of pages the system paged in and the number that were paged
4096out (from disk).
4097.TP
4098\fIswap 1 0\fP
4099The number of swap pages that have been brought in and out.
4100.TP
bea08fec 4101.\" FIXME . The following is not the full picture for the 'intr' of
777f5a9e 4102.\" /proc/stat on 2.6:
fea681da 4103\fIintr 1462898\fP
bfbfcd18
MK
4104This line shows counts of interrupts serviced since boot time,
4105for each of the possible system interrupts.
d63ff76e 4106The first column is the total of all interrupts serviced
d6a56978
MK
4107including unnumbered architecture specific interrupts;
4108each subsequent column is the total for that particular numbered interrupt.
d63ff76e 4109Unnumbered interrupts are not shown, only summed into the total.
fea681da
MK
4110.TP
4111\fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP...
636297e9 4112(major,disk_idx):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written)
bfbfcd18
MK
4113.br
4114(Linux 2.4 only)
fea681da
MK
4115.TP
4116\fIctxt 115315\fP
4117The number of context switches that the system underwent.
4118.TP
4119\fIbtime 769041601\fP
f49c451a 4120boot time, in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
fea681da
MK
4121.TP
4122\fIprocesses 86031\fP
4123Number of forks since boot.
bfbfcd18
MK
4124.TP
4125\fIprocs_running 6\fP
4126Number of processes in runnable state.
5fab2e7c 4127(Linux 2.5.45 onward.)
bfbfcd18
MK
4128.TP
4129\fIprocs_blocked 2\fP
4130Number of processes blocked waiting for I/O to complete.
5fab2e7c 4131(Linux 2.5.45 onward.)
76f6f102
ES
4132.TP
4133.I softirq 229245889 94 60001584 13619 5175704 2471304 28 51212741 59130143 0 51240672
4134.\" commit d3d64df21d3d0de675a0d3ffa7c10514f3644b30
4135This line shows the number of softirq for all CPUs.
4136The first column is the total of all softirqs and
4137each subsequent column is the total for particular softirq.
d7f23d0b 4138(Linux 2.6.31 onward.)
fea681da
MK
4139.RE
4140.TP
4141.I /proc/swaps
c13182ef
MK
4142Swap areas in use.
4143See also
fea681da
MK
4144.BR swapon (8).
4145.TP
4146.I /proc/sys
4147This directory (present since 1.3.57) contains a number of files
4148and subdirectories corresponding to kernel variables.
4149These variables can be read and sometimes modified using
9ee4a2b6 4150the \fI/proc\fP filesystem, and the (deprecated)
fea681da 4151.BR sysctl (2)
c13182ef 4152system call.
2dad4c59 4153.IP
e8aa7100 4154String values may be terminated by either \(aq\\0\(aq or \(aq\\n\(aq.
2dad4c59 4155.IP
84ff8c1e
HS
4156Integer and long values may be written either in decimal or in
4157hexadecimal notation (e.g. 0x3FFF).
e8aa7100
MK
4158When writing multiple integer or long values, these may be separated
4159by any of the following whitespace characters:
4160\(aq\ \(aq, \(aq\\t\(aq, or \(aq\\n\(aq.
4161Using other separators leads to the error
84ff8c1e 4162.BR EINVAL .
fea681da 4163.TP
6ab7c0aa 4164.IR /proc/sys/abi " (since Linux 2.4.10)"
fea681da 4165This directory may contain files with application binary information.
6ab7c0aa 4166.\" On some systems, it is not present.
66a9882e 4167See the Linux kernel source file
6ab7c0aa
MK
4168.I Documentation/sysctl/abi.txt
4169for more information.
fea681da
MK
4170.TP
4171.I /proc/sys/debug
4172This directory may be empty.
4173.TP
4174.I /proc/sys/dev
e2badfdf 4175This directory contains device-specific information (e.g.,
9a67332e 4176.IR dev/cdrom/info ).
fea681da
MK
4177On
4178some systems, it may be empty.
4179.TP
4180.I /proc/sys/fs
49236d3c 4181This directory contains the files and subdirectories for kernel variables
9ee4a2b6 4182related to filesystems.
fea681da
MK
4183.TP
4184.I /proc/sys/fs/binfmt_misc
c13182ef 4185Documentation for files in this directory can be found
a2923df0
MK
4186in the Linux kernel source in the file
4187.IR Documentation/admin-guide/binfmt-misc.rst
4188(or in
4189.IR Documentation/binfmt_misc.txt
4190on older kernels).
fea681da 4191.TP
59a40ed7
MK
4192.IR /proc/sys/fs/dentry-state " (since Linux 2.2)"
4193This file contains information about the status of the
4194directory cache (dcache).
4195The file contains six numbers,
c13182ef 4196.IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), "
59a40ed7 4197.I want_pages
fea681da 4198(pages requested by system) and two dummy values.
59a40ed7
MK
4199.RS
4200.IP * 2
4201.I nr_dentry
4202is the number of allocated dentries (dcache entries).
4203This field is unused in Linux 2.2.
4204.IP *
4205.I nr_unused
4206is the number of unused dentries.
4207.IP *
4208.I age_limit
4209.\" looks like this is unused in kernels 2.2 to 2.6
4210is the age in seconds after which dcache entries
4211can be reclaimed when memory is short.
4212.IP *
4213.I want_pages
4214.\" looks like this is unused in kernels 2.2 to 2.6
c7094399 4215is nonzero when the kernel has called shrink_dcache_pages() and the
fea681da 4216dcache isn't pruned yet.
59a40ed7 4217.RE
fea681da
MK
4218.TP
4219.I /proc/sys/fs/dir-notify-enable
4220This file can be used to disable or enable the
4221.I dnotify
4222interface described in
4223.BR fcntl (2)
4224on a system-wide basis.
4225A value of 0 in this file disables the interface,
4226and a value of 1 enables it.
4227.TP
4228.I /proc/sys/fs/dquot-max
4229This file shows the maximum number of cached disk quota entries.
4230On some (2.4) systems, it is not present.
4231If the number of free cached disk quota entries is very low and
4232you have some awesome number of simultaneous system users,
4233you might want to raise the limit.
4234.TP
4235.I /proc/sys/fs/dquot-nr
4236This file shows the number of allocated disk quota
4237entries and the number of free disk quota entries.
4238.TP
24cb4a4b 4239.IR /proc/sys/fs/epoll " (since Linux 2.6.28)"
242b46af
MK
4240This directory contains the file
4241.IR max_user_watches ,
24cb4a4b
MK
4242which can be used to limit the amount of kernel memory consumed by the
4243.I epoll
4244interface.
4245For further details, see