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