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