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