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