]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/proc.5
gethostbyname.3: Minor tweaks
[thirdparty/man-pages.git] / man5 / proc.5
CommitLineData
fea681da 1.\" Copyright (C) 1994, 1995 by Daniel Quinlan (quinlan@yggdrasil.com)
b4e9ee8f 2.\" and Copyright (C) 2002-2008 Michael Kerrisk <mtk.manpages@gmail.com>
fea681da
MK
3.\" with networking additions from Alan Cox (A.Cox@swansea.ac.uk)
4.\" and scsi additions from Michael Neuffer (neuffer@mail.uni-mainz.de)
5.\" and sysctl additions from Andries Brouwer (aeb@cwi.nl)
6.\" and System V IPC (as well as various other) additions from
c11b1abf 7.\" Michael Kerrisk <mtk.manpages@gmail.com>
fea681da 8.\"
1dd72f9c 9.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
fea681da
MK
10.\" This is free documentation; you can redistribute it and/or
11.\" modify it under the terms of the GNU General Public License as
12.\" published by the Free Software Foundation; either version 2 of
13.\" the License, or (at your option) any later version.
14.\"
15.\" The GNU General Public License's references to "object code"
16.\" and "executables" are to be interpreted as the output of any
17.\" document formatting or typesetting system, including
18.\" intermediate and printed output.
19.\"
20.\" This manual is distributed in the hope that it will be useful,
21.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
22.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23.\" GNU General Public License for more details.
24.\"
25.\" You should have received a copy of the GNU General Public
c715f741
MK
26.\" License along with this manual; if not, see
27.\" <http://www.gnu.org/licenses/>.
6a8d8745 28.\" %%%LICENSE_END
fea681da
MK
29.\"
30.\" Modified 1995-05-17 by faith@cs.unc.edu
31.\" Minor changes by aeb and Marty Leisner (leisner@sdsp.mc.xerox.com).
32.\" Modified 1996-04-13, 1996-07-22 by aeb@cwi.nl
33.\" Modified 2001-12-16 by rwhron@earthlink.net
34.\" Modified 2002-07-13 by jbelton@shaw.ca
35.\" Modified 2002-07-22, 2003-05-27, 2004-04-06, 2004-05-25
c11b1abf 36.\" by Michael Kerrisk <mtk.manpages@gmail.com>
5d6d14a0
MK
37.\" 2004-11-17, mtk -- updated notes on /proc/loadavg
38.\" 2004-12-01, mtk, rtsig-max and rtsig-nr went away in 2.6.8
568105c6
MK
39.\" 2004-12-14, mtk, updated 'statm', and fixed error in order of list
40.\" 2005-05-12, mtk, updated 'stat'
6d64ca9c 41.\" 2005-07-13, mtk, added /proc/sys/fs/mqueue/*
363f747c
MK
42.\" 2005-09-16, mtk, Added /proc/sys/fs/suid_dumpable
43.\" 2005-09-19, mtk, added /proc/zoneinfo
b4e9ee8f 44.\" 2005-03-01, mtk, moved /proc/sys/fs/mqueue/* material to mq_overview.7.
69119dc7
MK
45.\" 2008-06-05, mtk, Added /proc/[pid]/oom_score, /proc/[pid]/oom_adj,
46.\" /proc/[pid]/limits, /proc/[pid]/mountinfo, /proc/[pid]/mountstats,
47.\" and /proc/[pid]/fdinfo/*.
48.\" 2008-06-19, mtk, Documented /proc/[pid]/status.
cc2d5c36 49.\" 2008-07-15, mtk, added /proc/config.gz
363f747c 50.\"
bea08fec 51.\" FIXME . cross check against Documentation/filesystems/proc.txt
c13182ef 52.\" to see what information could be imported from that file
c533af9d 53.\" into this file.
fea681da 54.\"
1e64c86b 55.TH PROC 5 2015-03-29 "Linux" "Linux Programmer's Manual"
fea681da 56.SH NAME
9ee4a2b6 57proc \- process information pseudo-filesystem
fea681da
MK
58.SH DESCRIPTION
59The
60.I proc
ac8727b6 61filesystem is a pseudo-filesystem which provides an interface to
c13182ef
MK
62kernel data structures.
63It is commonly mounted at
fea681da 64.IR /proc .
c13182ef 65Most of it is read-only, but some files allow kernel variables to be
fea681da
MK
66changed.
67.LP
ac8727b6 68The following list describes many of the files and directories under the
743638fd
MK
69.I /proc
70hierarchy.
fea681da
MK
71.PD 1
72.TP
69119dc7 73.I /proc/[pid]
fea681da
MK
74There is a numerical subdirectory for each running process; the
75subdirectory is named by the process ID.
76Each such subdirectory contains the following
77pseudo-files and directories.
b7a42567
MK
78.TP
79.I /proc/[pid]/attr
80.\" https://lwn.net/Articles/28222/
81.\" From: Stephen Smalley <sds@epoch.ncsc.mil>
82.\" To: LKML and others
83.\" Subject: [RFC][PATCH] Process Attribute API for Security Modules
84.\" Date: 08 Apr 2003 16:17:52 -0400
85.\"
b3fb99e8
MK
86.\" http://www.nsa.gov/research/_files/selinux/papers/module/x362.shtml
87.\"
b7a42567
MK
88The files in this directory provide an API for security modules.
89The contents of this directory are files that can be read and written
90in order to set security-related attributes.
91This directory was added to support SELinux,
92but the intention was that the API be general enough to support
93other security modules.
94For the purpose of explanation,
95examples of how SELinux uses these files are provided below.
96
97This directory is present only if the kernel was configured with
98.BR CONFIG_SECURITY .
99.TP
100.IR /proc/[pid]/attr/current " (since Linux 2.6.0)"
101The contents of this file represent the current
102security attributes of the process.
103
fd44bdc7
TY
104In SELinux, this file is used to get the security context of a process.
105Prior to Linux 2.6.11, this file could not be used to set the security
106context (a write was always denied), since SELinux limited process security
107transitions to
b7a42567
MK
108.BR execve (2)
109(see the description of
110.IR /proc/[pid]/attr/exec ,
111below).
fd44bdc7
TY
112Since Linux 2.6.11, SELinux lifted this restriction and began supporting
113"set" operations via writes to this node if authorized by policy,
114although use of this operation is only suitable for applications that are
115trusted to maintain any desired separation between the old and new security
b6620a25
MK
116contexts.
117Prior to Linux 2.6.28, SELinux did not allow threads within a
fd44bdc7
TY
118multi-threaded process to set their security context via this node
119as it would yield an inconsistency among the security contexts of the
b6620a25
MK
120threads sharing the same memory space.
121Since Linux 2.6.28, SELinux lifted
fd44bdc7 122this restriction and began supporting "set" operations for threads within
b6620a25 123a multithreaded process if the new security context is bounded by the old
fd44bdc7
TY
124security context, where the bounded relation is defined in policy and
125guarantees that the new security context has a subset of the permissions
126of the old security context.
b7a42567
MK
127Other security modules may choose to support "set" operations via
128writes to this node.
129.TP
130.IR /proc/[pid]/attr/exec " (since Linux 2.6.0)"
131This file represents the attributes to assign to the
132process upon a subsequent
133.BR execve (2).
134
135In SELinux,
136this is needed to support role/domain transitions, and
137.BR execve (2)
138is the preferred point to make such transitions because it offers better
139control over the initialization of the process in the new security label
140and the inheritance of state.
141In SELinux, this attribute is reset on
142.BR execve (2)
143so that the new program reverts to the default behavior for any
144.BR execve (2)
145calls that it may make.
146In SELinux, a process can set
147only its own
148.I /proc/[pid]/attr/exec
149attribute.
150.TP
151.IR /proc/[pid]/attr/fscreate " (since Linux 2.6.0)"
152This file represents the attributes to assign to files
153created by subsequent calls to
154.BR open (2),
155.BR mkdir (2),
156.BR symlink (2),
157and
158.BR mknod (2)
159
160SELinux employs this file to support creation of a file
161(using the aforementioned system calls)
162in a secure state,
163so that there is no risk of inappropriate access being obtained
164between the time of creation and the time that attributes are set.
165In SELinux, this attribute is reset on
166.BR execve (2),
167so that the new program reverts to the default behavior for
168any file creation calls it may make, but the attribute will persist
169across multiple file creation calls within a program unless it is
170explicitly reset.
171In SELinux, a process can set only its own
172.IR /proc/[pid]/attr/fscreate
173attribute.
174.TP
175.IR /proc/[pid]/attr/prev " (since Linux 2.6.0)"
176This file contains the security context of the process before the last
177.BR execve (2);
178that is, the previous value of
179.IR /proc/[pid]/attr/current .
666db07e
MK
180.TP
181.IR /proc/[pid]/attr/keycreate " (since Linux 2.6.18)"
182.\" commit 4eb582cf1fbd7b9e5f466e3718a59c957e75254e
183.\" /Documentation/keys.txt
184If a process writes a security context into this file,
185all subsequently created keys
186.RB ( add_key (2))
187will be labeled with this context.
188For further information, see the kernel source file
189.IR Documentation/keys.txt .
2702dc21
MK
190.TP
191.IR /proc/[pid]/attr/socketcreate " (since Linux 2.6.18)"
192.\" commit 42c3e03ef6b298813557cdb997bd6db619cd65a2
193If a process writes a security context into this file,
194all subsequently created sockets will be labeled with this context.
b3fb99e8
MK
195.\"
196.\" FIXME Describe /proc/[pid]/autogroup
197.\" 2.6.38
198.\" commit 5091faa449ee0b7d73bc296a93bca9540fc51d0a
199.\" CONFIG_SCHED_AUTOGROUP
b4e9ee8f 200.\"
fea681da 201.TP
69119dc7 202.IR /proc/[pid]/auxv " (since 2.6.0-test7)"
857f1942 203This contains the contents of the ELF interpreter information passed
c13182ef 204to the process at exec time.
857f1942 205The format is one \fIunsigned long\fP ID
c13182ef 206plus one \fIunsigned long\fP value for each entry.
857f1942 207The last entry contains two zeros.
4c69c692
MK
208See also
209.BR getauxval (3).
b5d204d0 210.TP
8d708d6b 211.IR /proc/[pid]/cgroup " (since Linux 2.6.24)"
b5d204d0
MK
212.\" Info in Documentation/cgroups/cgroups.txt
213This file describes control groups to which the process/task belongs.
214For each cgroup hierarchy there is one entry containing
215colon-separated fields of the form:
216.nf
217.ft CW
218
219 5:cpuacct,cpu,cpuset:/daemons
220.ft
221.fi
222.IP
223The colon-separated fields are, from left to right:
224.RS 11
225.IP 1. 3
226hierarchy ID number
227.IP 2.
228set of subsystems bound to the hierarchy
229.IP 3.
230control group in the hierarchy to which the process belongs
231.RE
232.IP
90878f7c 233This file is present only if the
b5d204d0
MK
234.B CONFIG_CGROUPS
235kernel configuration option is enabled.
76e0451c
MK
236.TP
237.IR /proc/[pid]/clear_refs " (since Linux 2.6.22)"
238.\" commit b813e931b4c8235bb42e301096ea97dbdee3e8fe (2.6.22)
239.\" commit 398499d5f3613c47f2143b8c54a04efb5d7a6da9 (2.6.32)
240.\" commit 040fa02077de01c7e08fa75be6125e4ca5636011 (3.11)
b4e9ee8f 241.\"
b4e9ee8f 242.\" "Clears page referenced bits shown in smaps output"
76e0451c
MK
243.\" write-only, writable only by the owner of the process
244
245This is a write-only file, writable only by owner of the process.
246
247The following values may be written to the file:
248.RS
249.TP
2501 (since Linux 2.6.22)
251.\" Internally: CLEAR_REFS_ALL
252Reset the PG_Referenced and ACCESSED/YOUNG
253bits for all the pages associated with the process.
254(Before kernel 2.6.32, writing any nonzero value to this file
255had this effect.)
256.TP
2572 (since Linux 2.6.32)
258.\" Internally: CLEAR_REFS_ANON
259Reset the PG_Referenced and ACCESSED/YOUNG
260bits for all anonymous pages associated with the process.
261.TP
2623 (since Linux 2.6.32)
263.\" Internally: CLEAR_REFS_MAPPED
264Reset the PG_Referenced and ACCESSED/YOUNG
265bits for all file-mapped pages associated with the process.
266.RE
267.IP
268Clearing the PG_Referenced and ACCESSED/YOUNG bits provides a method
269to measure approximately how much memory a process is using.
322d49fb 270One first inspects the values in the "Referenced" fields
76e0451c
MK
271for the VMAs shown in
272.IR /proc/[pid]/smaps
273to get an idea of the memory footprint of the
274process.
275One then clears the PG_Referenced and ACCESSED/YOUNG bits
276and, after some measured time interval,
322d49fb 277once again inspects the values in the "Referenced" fields
76e0451c
MK
278to get an idea of the change in memory footprint of the
279process during the measured interval.
280If one is interested only in inspecting the selected mapping types,
281then the value 2 or 3 can be used instead of 1.
282
283A further value can be written to affect a different bit:
284.RS
285.TP
2864 (since Linux 3.11)
287Clear the soft-dirty bit for all the pages associated with the process.
288.\" Internally: CLEAR_REFS_SOFT_DIRTY
289This is used (in conjunction with
290.IR /proc/[pid]/pagemap )
291by the check-point restore system to discover which pages of a process
292have been dirtied since the file
293.IR /proc/[pid]/clear_refs
294was written to.
295.RE
296.IP
297Writing any value to
298.IR /proc/[pid]/clear_refs
299other than those listed above has no effect.
300
301The
302.IR /proc/[pid]/clear_refs
303file is present only if the
304.B CONFIG_PROC_PAGE_MONITOR
305kernel configuration option is enabled.
857f1942 306.TP
69119dc7 307.I /proc/[pid]/cmdline
6975c16e 308This read-only file holds the complete command line for the process,
b447cd58
MK
309unless the process is a zombie.
310.\" In 2.3.26, this also used to be true if the process was swapped out.
311In the latter case, there is nothing in this file:
75b94dc3 312that is, a read on this file will return 0 characters.
b447cd58 313The command-line arguments appear in this file as a set of
6596d270
MK
314strings separated by null bytes (\(aq\\0\(aq),
315with a further null byte after the last string.
32d7ef00
MK
316.TP
317.IR /proc/[pid]/comm " (since Linux 2.6.33)"
318.\" commit 4614a696bd1c3a9af3a08f0e5874830a85b889d4
319This file exposes the process's
320.I comm
321value\(emthat is, the command name associated with the process.
322Different threads in the same process may have different
323.I comm
324values, accessible via
325.IR /proc/[pid]/task/[tid]/comm .
326A thread may modify its
327.I comm
328value, or that of any of other thread in the same thread group (see
329the discussion of
330.B CLONE_THREAD
331in
332.BR clone (2)),
333by writing to the file
334.IR /proc/self/task/[tid]/comm .
335Strings longer than
336.B TASK_COMM_LEN
337(16) characters are silently truncated.
338
ef4f4031 339This file provides a superset of the
32d7ef00
MK
340.BR prctl (2)
341.B PR_SET_NAME
342and
343.B PR_GET_NAME
344operations, and is employed by
345.BR pthread_setname_np (3)
346when used to rename threads other than the caller.
fea681da 347.TP
7e07d950 348.IR /proc/[pid]/coredump_filter " (since Linux 2.6.23)"
b4e9ee8f
MK
349See
350.BR core (5).
5c411b17 351.TP
7e07d950
MK
352.IR /proc/[pid]/cpuset " (since Linux 2.6.12)"
353.\" and/proc/[pid]/task/[tid]/cpuset
5c411b17
MK
354See
355.BR cpuset (7).
b4e9ee8f 356.TP
69119dc7 357.I /proc/[pid]/cwd
c13182ef 358This is a symbolic link to the current working directory of the process.
59a40ed7
MK
359To find out the current working directory of process 20,
360for instance, you can do this:
fea681da 361
59a40ed7 362.in +4n
fea681da 363.nf
b43a3b30 364.RB "$" " cd /proc/20/cwd; /bin/pwd"
fea681da 365.fi
59a40ed7 366.in
fea681da 367
c13182ef
MK
368Note that the
369.I pwd
e7b489f0 370command is often a shell built-in, and might
c13182ef 371not work properly.
743638fd
MK
372In
373.BR bash (1),
374you may use
375.IR "pwd\ \-P" .
afcaf646
MK
376
377.\" The following was still true as at kernel 2.6.13
c13182ef
MK
378In a multithreaded process, the contents of this symbolic link
379are not available if the main thread has already terminated
afcaf646 380(typically by calling
59a40ed7 381.BR pthread_exit (3)).
fea681da 382.TP
69119dc7 383.I /proc/[pid]/environ
fea681da 384This file contains the environment for the process.
f81fb444 385The entries are separated by null bytes (\(aq\\0\(aq),
b4e9ee8f 386and there may be a null byte at the end.
fea681da 387Thus, to print out the environment of process 1, you would do:
a08ea57c 388.in +4n
fea681da 389.nf
a08ea57c 390
fea681da 391.ft CW
13912780 392.RB "$" " strings /proc/1/environ"
fea681da
MK
393.fi
394.ft P
a08ea57c 395.in
fea681da 396.TP
69119dc7 397.I /proc/[pid]/exe
fea681da 398Under Linux 2.2 and later, this file is a symbolic link
2d7195b8 399containing the actual pathname of the executed command.
c13182ef
MK
400This symbolic link can be dereferenced normally; attempting to open
401it will open the executable.
402You can even type
69119dc7 403.I /proc/[pid]/exe
c13182ef 404to run another copy of the same executable as is being run by
69119dc7 405process [pid].
afcaf646 406.\" The following was still true as at kernel 2.6.13
c13182ef
MK
407In a multithreaded process, the contents of this symbolic link
408are not available if the main thread has already terminated
afcaf646
MK
409(typically by calling
410.BR pthread_exit (3)).
fea681da 411
eb9a0b2f 412Under Linux 2.0 and earlier,
69119dc7 413.I /proc/[pid]/exe
c13182ef
MK
414is a pointer to the binary which was executed,
415and appears as a symbolic link.
416A
fea681da
MK
417.BR readlink (2)
418call on this file under Linux 2.0 returns a string in the format:
419
59a40ed7 420 [device]:inode
fea681da
MK
421
422For example, [0301]:1502 would be inode 1502 on device major 03 (IDE,
423MFM, etc. drives) minor 01 (first partition on the first drive).
424
425.BR find (1)
59a40ed7
MK
426with the
427.I \-inum
428option can be used to locate the file.
fea681da 429.TP
d4529654 430.I /proc/[pid]/fd/
fea681da
MK
431This is a subdirectory containing one entry for each file which the
432process has open, named by its file descriptor, and which is a
c13182ef 433symbolic link to the actual file.
f78ed33a 434Thus, 0 is standard input, 1 standard output, 2 standard error, and so on.
fea681da 435
f75715e0
MK
436For file descriptors for pipes and sockets,
437the entries will be symbolic links whose content is the
438file type with the inode.
d4529654
MF
439A
440.BR readlink (2)
441call on this file returns a string in the format:
f75715e0 442
d4529654 443 type:[inode]
f75715e0
MK
444
445For example,
446.I socket:[2248868]
447will be a socket and its inode is 2248868.
448For sockets, that inode can be used to find more information
449in one of the files under
d4529654
MF
450.IR /proc/net/ .
451
2b7a2ac5
MK
452For file descriptors that have no corresponding inode
453(e.g., file descriptors produced by
454.BR epoll_create (2),
455.BR eventfd (2),
456.BR inotify_init (2),
457.BR signalfd (2),
458and
459.BR timerfd (2)),
460the entry will be a symbolic link with contents of the form
461
462 anon_inode:<file-type>
463
464In some cases, the
465.I file-type
466is surrounded by square brackets.
467
468For example, an epoll file descriptor will have a symbolic link
469whose content is the string
470.IR "anon_inode:[eventpoll]" .
471
d4529654 472.\"The following was still true as at kernel 2.6.13
afcaf646 473In a multithreaded process, the contents of this directory
c13182ef 474are not available if the main thread has already terminated
afcaf646
MK
475(typically by calling
476.BR pthread_exit (3)).
477
59a40ed7
MK
478Programs that will take a filename as a command-line argument,
479but will not take input from standard input if no argument is supplied,
480or that write to a file named as a command-line argument,
481but will not send their output to standard output
482if no argument is supplied, can nevertheless be made to use
483standard input or standard out using
69119dc7 484.IR /proc/[pid]/fd .
59a40ed7
MK
485For example, assuming that
486.I \-i
487is the flag designating an input file and
488.I \-o
489is the flag designating an output file:
a08ea57c 490.in +4n
fea681da
MK
491.nf
492
b43a3b30 493.RB "$" " foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ..."
fea681da 494.fi
a08ea57c
MK
495.in
496
fea681da
MK
497and you have a working filter.
498.\" The following is not true in my tests (MTK):
499.\" Note that this will not work for
500.\" programs that seek on their files, as the files in the fd directory
501.\" are not seekable.
502
59a40ed7
MK
503.I /proc/self/fd/N
504is approximately the same as
505.I /dev/fd/N
008f1ecc 506in some UNIX and UNIX-like systems.
c13182ef 507Most Linux MAKEDEV scripts symbolically link
59a40ed7
MK
508.I /dev/fd
509to
510.IR /proc/self/fd ,
511in fact.
512
513Most systems provide symbolic links
514.IR /dev/stdin ,
515.IR /dev/stdout ,
516and
517.IR /dev/stderr ,
518which respectively link to the files
519.IR 0 ,
520.IR 1 ,
521and
522.IR 2
523in
524.IR /proc/self/fd .
525Thus the example command above could be written as:
526.in +4n
527.nf
528
b43a3b30 529.RB "$" " foobar \-i /dev/stdin \-o /dev/stdout ..."
59a40ed7
MK
530.fi
531.in
69ab425e
MK
532.\" FIXME Describe /proc/[pid]/loginuid
533.\" Added in 2.6.11; updating requires CAP_AUDIT_CONTROL
534.\" CONFIG_AUDITSYSCALL
535.TP
7e07d950 536.IR /proc/[pid]/fdinfo/ " (since Linux 2.6.22)"
69ab425e
MK
537This is a subdirectory containing one entry for each file which the
538process has open, named by its file descriptor.
0275956d 539The files in this directory are readable only by the owner of the process.
69ab425e 540The contents of each file can be read to obtain information
0275956d
MK
541about the corresponding file descriptor.
542The content depends on the type of file referred to by the
543corresponding descriptor.
544
545For regular files and directories, we see something like:
69ab425e
MK
546.in +4n
547.nf
548
549.RB "$" " cat /proc/12015/fdinfo/4"
550pos: 1000
551flags: 01002002
0275956d 552mnt_id: 21
69ab425e
MK
553.fi
554.in
555
556The
557.I pos
558field is a decimal number showing the current file offset.
559The
560.I flags
561field is an octal number that displays the
562file access mode and file status flags (see
563.BR open (2)).
0275956d
MK
564The
565.I mnt_id
566field, present since Linux 3.15,
567.\" commit 49d063cb353265c3af701bab215ac438ca7df36d
568is the ID of the mount point containing this file.
569See the description of
570.IR /proc/[pid]/mountinfo .
69ab425e 571
6e7622ee
MK
572For eventfd file descriptors (see
573.BR eventfd (2)),
574we see the following fields:
575
576.in +4n
577.nf
578pos: 0
579flags: 02
580mnt_id: 10
581eventfd-count: 40
582.fi
583.in
584
585.I eventfd-count
586is the current value of the eventfd counter, in hexadecimal.
587
58d375dd
MK
588For epoll file descriptors (see
589.BR epoll (7)),
590we see the following fields:
591
592.in +4n
593.nf
594pos: 0
595flags: 02
596mnt_id: 10
597tfd: 9 events: 19 data: 74253d2500000009
598tfd: 7 events: 19 data: 74253d2500000007
599.fi
600.in
601
602Each of the lines beginning
603.I tfd
604describes one of the file descriptors being monitored via
605the epoll file descriptor (see
606.BR epoll_ctl (2)
607for some details).
608The
609.IR tfd
610field is the number of the file descriptor.
611The
612.I events
613field is a hexadecimal mask of the events being monitored for this file
614descriptor.
615The
616.I data
617field is the data value associated with this file descriptor.
618
f8a14cac
MK
619For signalfd file descriptors (see
620.BR signalfd (2)),
621we see the following fields:
622
623.in +4n
624.nf
625pos: 0
626flags: 02
627mnt_id: 10
628sigmask: 0000000000000006
629.fi
630.in
631
632.I sigmask
633is the hexadecimal mask of signals that are accepted via this
634signalfd file descriptor.
635(In this example, bits 2 and 3 are set, corresponding to the signals
636.B SIGINT
637and
638.BR SIGQUIT ;
639see
640.BR signal (7).)
43a8bfc6
MK
641.\" FIXME
642.\" Certain file types include additional info; see
643.\" Documentation/filesystems/proc.txt
644.\"
645.\" Especially interesting is this:
646.\"
647.\" commit ab49bdecc3ebb46ab661f5f05d5c5ea9606406c6
648.\" Author: Cyrill Gorcunov <gorcunov@openvz.org>
649.\" Date: Mon Dec 17 16:05:06 2012 -0800
650.\"
fa1d49a6 651.\" Basically, the /proc/PID/fdinfo/ entry for an inotify FD
43a8bfc6
MK
652.\" includes the file handles for all watched FDs
653.\"
0ca2fc4d
PS
654.TP
655.IR /proc/[pid]/io " (since kernel 2.6.20)"
68f11066
MK
656.\" commit 7c3ab7381e79dfc7db14a67c6f4f3285664e1ec2
657This file contains I/O statistics for the process, for example:
0ca2fc4d
PS
658.in +4n
659.nf
660
661.RB "#" " cat /proc/3828/io"
662rchar: 323934931
663wchar: 323929600
664syscr: 632687
665syscw: 632675
666read_bytes: 0
667write_bytes: 323932160
668cancelled_write_bytes: 0
669.fi
670.in
671
672The fields are as follows:
673.RS
68f11066
MK
674.TP
675.IR rchar ": characters read"
0ca2fc4d
PS
676The number of bytes which this task has caused to be read from storage.
677This is simply the sum of bytes which this process passed to
678.BR read (2)
68f11066 679and similar system calls.
11256884 680It includes things such as terminal I/O and
68f11066
MK
681is unaffected by whether or not actual
682physical disk I/O was required (the read might have been satisfied from
0ca2fc4d 683pagecache).
68f11066
MK
684.TP
685.IR wchar ": characters written"
0ca2fc4d
PS
686The number of bytes which this task has caused, or shall cause to be written
687to disk.
688Similar caveats apply here as with
689.IR rchar .
68f11066
MK
690.TP
691.IR syscr ": read syscalls"
692Attempt to count the number of read I/O operations\(emthat is,
693system calls such as
0ca2fc4d
PS
694.BR read (2)
695and
696.BR pread (2).
68f11066
MK
697.TP
698.IR syscw ": write syscalls"
699Attempt to count the number of write I/O operations\(emthat is,
700system calls such as
0ca2fc4d
PS
701.BR write (2)
702and
703.BR pwrite (2).
68f11066
MK
704.TP
705.IR read_bytes ": bytes read"
0ca2fc4d
PS
706Attempt to count the number of bytes which this process really did cause to
707be fetched from the storage layer.
708This is accurate for block-backed filesystems.
68f11066
MK
709.TP
710.IR write_bytes ": bytes written"
0ca2fc4d
PS
711Attempt to count the number of bytes which this process caused to be sent to
712the storage layer.
68f11066 713.TP
0ca2fc4d 714.IR cancelled_write_bytes :
0ca2fc4d
PS
715The big inaccuracy here is truncate.
716If a process writes 1MB to a file and then deletes the file,
717it will in fact perform no writeout.
718But it will have been accounted as having caused 1MB of write.
68f11066 719In other words: this field represents the number of bytes which this process
0ca2fc4d 720caused to not happen, by truncating pagecache.
68f11066 721A task can cause "negative" I/O too.
0ca2fc4d 722If this task truncates some dirty pagecache,
68f11066
MK
723some I/O which another task has been accounted for
724(in its
725.IR write_bytes )
726will not be happening.
727.RE
0ca2fc4d
PS
728.IP
729.IR Note :
68f11066 730In the current implementation, things are a bit racy on 32-bit systems:
0ca2fc4d
PS
731if process A reads process B's
732.I /proc/[pid]/io
68f11066 733while process B is updating one of these 64-bit counters,
0ca2fc4d 734process A could see an intermediate result.
f6e17121 735.TP
ccdc8958 736.IR /proc/[pid]/gid_map " (since Linux 3.5)"
d06a6170
MK
737See
738.BR user_namespaces (7).
69ab425e 739.TP
7e07d950 740.IR /proc/[pid]/limits " (since Linux 2.6.24)"
69ab425e
MK
741This file displays the soft limit, hard limit, and units of measurement
742for each of the process's resource limits (see
743.BR getrlimit (2)).
744Up to and including Linux 2.6.35,
745this file is protected to allow reading only by the real UID of the process.
746Since Linux 2.6.36,
747.\" commit 3036e7b490bf7878c6dae952eec5fb87b1106589
748this file is readable by all users on the system.
b4f89985
PE
749.TP
750.IR /proc/[pid]/map_files/ " (since kernel 3.3)
18cdd0ac
MK
751.\" commit 640708a2cff7f81e246243b0073c66e6ece7e53e
752This subdirectory contains entries corresponding to memory-mapped
b4f89985
PE
753files (see
754.BR mmap (2)).
18cdd0ac
MK
755Entries are named by memory region start and end
756address pair (expressed as hexadecimal numbers),
757and are symbolic links to the mapped files themselves.
758Here is an example, with the output wrapped and reformatted to fit on an 80-column display:
b4f89985
PE
759.in +4n
760.nf
761
f2aa4dcc 762.RB "#" " ls -l /proc/self/map_files/"
18cdd0ac
MK
763lr\-\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:31
764 3252e00000\-3252e20000 \-> /usr/lib64/ld-2.15.so
b4f89985
PE
765\&...
766.fi
767.in
768
769Although these entries are present for memory regions that were
d6a56978 770mapped with the
b4f89985 771.BR MAP_FILE
18cdd0ac 772flag, the way anonymous shared memory (regions created with the
b4f89985
PE
773.B MAP_ANON | MAP_SHARED
774flags)
775is implemented in Linux
18cdd0ac
MK
776means that such regions also appear on this directory.
777Here is an example where the target file is the deleted
778.I /dev/zero
779one:
b4f89985
PE
780.in +4n
781.nf
782
783.RB
18cdd0ac
MK
784lrw\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:33
785 7fc075d2f000\-7fc075e6f000 \-> /dev/zero (deleted)
b4f89985
PE
786.fi
787.in
788
789This directory appears only if the
790.B CONFIG_CHECKPOINT_RESTORE
791kernel configuration option is enabled.
f2aa4dcc
MK
792Privilege
793.RB ( CAP_SYS_ADMIN )
794.\" FIXME
795.\" This may change. See the mail thread
796.\" [RFC][PATCH v2] procfs: Always expose /proc/<pid>/map_files/ and make it readable
797.\" from Jan 2015
798is required to view the contents of this directory.
fea681da 799.TP
69119dc7 800.I /proc/[pid]/maps
fea681da
MK
801A file containing the currently mapped memory regions and their access
802permissions.
bbf9f397
MK
803See
804.BR mmap (2)
805for some further information about memory mappings.
fea681da 806
dd0c3b96 807The format of the file is:
fea681da 808
21781757 809.in -7n
fea681da
MK
810.nf
811.ft CW
fea681da 812.ft
21781757
MK
813.I "address perms offset dev inode pathname"
81400400000-00452000 r-xp 00000000 08:02 173521 /usr/bin/dbus-daemon
81500651000-00652000 r--p 00051000 08:02 173521 /usr/bin/dbus-daemon
81600652000-00655000 rw-p 00052000 08:02 173521 /usr/bin/dbus-daemon
81700e03000-00e24000 rw-p 00000000 00:00 0 [heap]
81800e24000-011f7000 rw-p 00000000 00:00 0 [heap]
182090db 819\&...
21781757
MK
82035b1800000-35b1820000 r-xp 00000000 08:02 135522 /usr/lib64/ld-2.15.so
82135b1a1f000-35b1a20000 r--p 0001f000 08:02 135522 /usr/lib64/ld-2.15.so
82235b1a20000-35b1a21000 rw-p 00020000 08:02 135522 /usr/lib64/ld-2.15.so
7d2e6d74 82335b1a21000-35b1a22000 rw-p 00000000 00:00 0
21781757
MK
82435b1c00000-35b1dac000 r-xp 00000000 08:02 135870 /usr/lib64/libc-2.15.so
82535b1dac000-35b1fac000 ---p 001ac000 08:02 135870 /usr/lib64/libc-2.15.so
82635b1fac000-35b1fb0000 r--p 001ac000 08:02 135870 /usr/lib64/libc-2.15.so
82735b1fb0000-35b1fb2000 rw-p 001b0000 08:02 135870 /usr/lib64/libc-2.15.so
182090db 828\&...
21781757 829f2c6ff8c000-7f2c7078c000 rw-p 00000000 00:00 0 [stack:986]
182090db 830\&...
21781757
MK
8317fffb2c0d000-7fffb2c2e000 rw-p 00000000 00:00 0 [stack]
8327fffb2d48000-7fffb2d49000 r-xp 00000000 00:00 0 [vdso]
fea681da 833.fi
21781757 834.in
fea681da 835
7d2e6d74 836The
3eb8c588
MK
837.I address
838field is the address space in the process that the mapping occupies.
839The
840.I perms
841field is a set of permissions:
fea681da
MK
842
843.nf
844.in +5
845r = read
846w = write
847x = execute
848s = shared
849p = private (copy on write)
850.fi
851.in
852
3eb8c588
MK
853The
854.I offset
b844cf04 855field is the offset into the file/whatever;
3eb8c588
MK
856.I dev
857is the device
dd0c3b96 858(major:minor);
3eb8c588
MK
859.I inode
860is the inode on that device.
59a40ed7 8610 indicates that no inode is associated with the memory region,
16e64bae 862as would be the case with BSS (uninitialized data).
fea681da 863
3eb8c588
MK
864The
865.I pathname
866field will usually be the file that is backing the mapping.
491ea6f1 867For ELF files,
3eb8c588
MK
868you can easily coordinate with the
869.I offset
870field by looking at the
491ea6f1
MK
871Offset field in the ELF program headers
872.RI ( "readelf\ \-l" ).
37d32c38 873
491ea6f1 874There are additional helpful pseudo-paths:
61b0b1f4
MK
875.RS 12
876.TP
877.IR [stack]
16e64bae 878The initial process's (also known as the main thread's) stack.
61b0b1f4 879.TP
3eb8c588 880.IR [stack:<tid>] " (since Linux 3.4)"
a60894c5 881.\" commit b76437579d1344b612cf1851ae610c636cec7db0
61b0b1f4 882A thread's stack (where the
3eb8c588 883.IR <tid>
61b0b1f4 884is a thread ID).
491ea6f1 885It corresponds to the
3eb8c588 886.IR /proc/[pid]/task/[tid]/
37d32c38 887path.
61b0b1f4 888.TP
7d2e6d74 889.IR [vdso]
61b0b1f4
MK
890The virtual dynamically linked shared object.
891.TP
7d2e6d74 892.IR [heap]
61b0b1f4
MK
893The process's heap.
894.in
61b0b1f4
MK
895.RE
896.IP
3eb8c588
MK
897If the
898.I pathname
899field is blank,
491ea6f1 900this is an anonymous mapping as obtained via the
37d32c38 901.BR mmap (2)
491ea6f1 902function.
61b0b1f4
MK
903There is no easy way to coordinate this back to a process's source,
904short of running it through
491ea6f1
MK
905.BR gdb (1),
906.BR strace (1),
907or similar.
37d32c38 908
eb9a0b2f 909Under Linux 2.0, there is no field giving pathname.
fea681da 910.TP
69119dc7 911.I /proc/[pid]/mem
fea681da
MK
912This file can be used to access the pages of a process's memory through
913.BR open (2),
914.BR read (2),
915and
ccb2bb0d 916.BR lseek (2).
b4e9ee8f 917.TP
69119dc7 918.IR /proc/[pid]/mountinfo " (since Linux 2.6.26)"
b4e9ee8f
MK
919.\" This info adapted from Documentation/filesystems/proc.txt
920This file contains information about mount points.
921It contains lines of the form:
922.nf
923.ft CW
b4e9ee8f
MK
924
92536 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue
926(1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11)
b4e9ee8f
MK
927.ft
928.fi
929.IP
930The numbers in parentheses are labels for the descriptions below:
3bc960c2 931.RS 7
b4e9ee8f
MK
932.TP 5
933(1)
934mount ID: unique identifier of the mount (may be reused after
935.BR umount (2)).
936.TP
937(2)
938parent ID: ID of parent mount (or of self for the top of the mount tree).
939.TP
940(3)
941major:minor: value of
942.I st_dev
9ee4a2b6 943for files on filesystem (see
b4e9ee8f
MK
944.BR stat (2)).
945.TP
946(4)
9ee4a2b6 947root: root of the mount within the filesystem.
b4e9ee8f
MK
948.TP
949(5)
950mount point: mount point relative to the process's root.
951.TP
952(6)
953mount options: per-mount options.
954.TP
955(7)
956optional fields: zero or more fields of the form "tag[:value]".
957.TP
958(8)
959separator: marks the end of the optional fields.
960.TP
961(9)
9ee4a2b6 962filesystem type: name of filesystem in the form "type[.subtype]".
b4e9ee8f
MK
963.TP
964(10)
9ee4a2b6 965mount source: filesystem-specific information or "none".
b4e9ee8f
MK
966.TP
967(11)
68d86eac 968super options: per-superblock options.
b4e9ee8f
MK
969.RE
970.IP
971Parsers should ignore all unrecognized optional fields.
972Currently the possible optional fields are:
973.RS 12
974.TP 18
975shared:X
976mount is shared in peer group X
977.TP
978master:X
979mount is slave to peer group X
980.TP
981propagate_from:X
982mount is slave and receives propagation from peer group X (*)
983.TP
984unbindable
985mount is unbindable
986.RE
987.IP
988(*) X is the closest dominant peer group under the process's root.
989If X is the immediate master of the mount,
990or if there is no dominant peer group under the same root,
991then only the "master:X" field is present
992and not the "propagate_from:X" field.
993
994For more information on mount propagation see:
995.I Documentation/filesystems/sharedsubtree.txt
66a9882e 996in the Linux kernel source tree.
b4e9ee8f 997.TP
cea61382 998.IR /proc/[pid]/mounts " (since Linux 2.4.19)"
9ee4a2b6 999This is a list of all the filesystems currently mounted in the
732e54dd 1000process's mount namespace.
cea61382
MK
1001The format of this file is documented in
1002.BR fstab (5).
1003Since kernel version 2.6.15, this file is pollable:
1004after opening the file for reading, a change in this file
9ee4a2b6 1005(i.e., a filesystem mount or unmount) causes
cea61382
MK
1006.BR select (2)
1007to mark the file descriptor as readable, and
1008.BR poll (2)
1009and
1010.BR epoll_wait (2)
1011mark the file as having an error condition.
357002ec
MK
1012See
1013.BR namespaces (7)
1014for more information.
cea61382 1015.TP
69119dc7 1016.IR /proc/[pid]/mountstats " (since Linux 2.6.17)"
783a6233 1017This file exports information (statistics, configuration information)
0bafc692 1018about the mount points in the process's mount namespace.
b4e9ee8f
MK
1019Lines in this file have the form:
1020.nf
1021
1022device /dev/sda7 mounted on /home with fstype ext3 [statistics]
1023( 1 ) ( 2 ) (3 ) (4)
1024.fi
1025.IP
1026The fields in each line are:
3bc960c2 1027.RS 7
b4e9ee8f
MK
1028.TP 5
1029(1)
1030The name of the mounted device
1031(or "nodevice" if there is no corresponding device).
1032.TP
1033(2)
9ee4a2b6 1034The mount point within the filesystem tree.
b4e9ee8f
MK
1035.TP
1036(3)
9ee4a2b6 1037The filesystem type.
b4e9ee8f
MK
1038.TP
1039(4)
1040Optional statistics and configuration information.
9ee4a2b6 1041Currently (as at Linux 2.6.26), only NFS filesystems export
b4e9ee8f
MK
1042information via this field.
1043.RE
1044.IP
90878f7c 1045This file is readable only by the owner of the process.
4716a1dd
MK
1046
1047See
1048.BR namespaces (7)
1049for more information.
b4e9ee8f 1050.TP
b4a185e5 1051.IR /proc/[pid]/ns/ " (since Linux 3.0)"
2c4201f0 1052.\" See commit 6b4e306aa3dc94a0545eb9279475b1ab6209a31f
b4a185e5
EB
1053This is a subdirectory containing one entry for each namespace that
1054supports being manipulated by
80e63655 1055.BR setns (2).
cf8bfe6d
MK
1056For more information, see
1057.BR namespaces (7).
ec1dd85d 1058
b4a185e5 1059.TP
69119dc7 1060.IR /proc/[pid]/numa_maps " (since Linux 2.6.14)"
610f75cc
MK
1061See
1062.BR numa (7).
7388733a 1063.TP
69119dc7 1064.IR /proc/[pid]/oom_adj " (since Linux 2.6.11)"
b4e9ee8f 1065This file can be used to adjust the score used to select which process
0425de01 1066should be killed in an out-of-memory (OOM) situation.
b4e9ee8f
MK
1067The kernel uses this value for a bit-shift operation of the process's
1068.IR oom_score
1069value:
5b8dbfd4
MK
1070valid values are in the range \-16 to +15,
1071plus the special value \-17,
b4e9ee8f
MK
1072which disables OOM-killing altogether for this process.
1073A positive score increases the likelihood of this
1074process being killed by the OOM-killer;
1075a negative score decreases the likelihood.
de8e9cc1 1076.IP
b4e9ee8f
MK
1077The default value for this file is 0;
1078a new process inherits its parent's
1079.I oom_adj
1080setting.
1081A process must be privileged
1082.RB ( CAP_SYS_RESOURCE )
1083to update this file.
f2c8b197
MK
1084.IP
1085Since Linux 2.6.36, use of this file is deprecated in favor of
1086.IR /proc/[pid]/oom_score_adj .
b4e9ee8f 1087.TP
69119dc7 1088.IR /proc/[pid]/oom_score " (since Linux 2.6.11)"
b4e9ee8f
MK
1089.\" See mm/oom_kill.c::badness() in the 2.6.25 sources
1090This file displays the current score that the kernel gives to
1091this process for the purpose of selecting a process
1092for the OOM-killer.
1093A higher score means that the process is more likely to be
1094selected by the OOM-killer.
1095The basis for this score is the amount of memory used by the process,
1096with increases (+) or decreases (\-) for factors including:
1097.\" See mm/oom_kill.c::badness() in the 2.6.25 sources
1098.RS
1099.IP * 2
1100whether the process creates a lot of children using
1101.BR fork (2)
1102(+);
1103.IP *
1104whether the process has been running a long time,
1105or has used a lot of CPU time (\-);
1106.IP *
1107whether the process has a low nice value (i.e., > 0) (+);
1108.IP *
1109whether the process is privileged (\-); and
1110.\" More precisely, if it has CAP_SYS_ADMIN or CAP_SYS_RESOURCE
1111.IP *
1112whether the process is making direct hardware access (\-).
1113.\" More precisely, if it has CAP_SYS_RAWIO
1114.RE
1115.IP
1116The
1117.I oom_score
f2c8b197
MK
1118also reflects the adjustment specified by the
1119.I oom_score_adj
1120or
b4e9ee8f
MK
1121.I oom_adj
1122setting for the process.
f2c8b197
MK
1123.TP
1124.IR /proc/[pid]/oom_score_adj " (since Linux 2.6.36)"
1125.\" Text taken from 3.7 Documentation/filesystems/proc.txt
1126This file can be used to adjust the badness heuristic used to select which
1127process gets killed in out-of-memory conditions.
1128
1129The badness heuristic assigns a value to each candidate task ranging from 0
1130(never kill) to 1000 (always kill) to determine which process is targeted.
1131The units are roughly a proportion along that range of
1132allowed memory the process may allocate from,
1133based on an estimation of its current memory and swap use.
1134For example, if a task is using all allowed memory,
1135its badness score will be 1000.
1136If it is using half of its allowed memory, its score will be 500.
1137
1138There is an additional factor included in the badness score: root
1139processes are given 3% extra memory over other tasks.
1140
1141The amount of "allowed" memory depends on the context
0633f951 1142in which the OOM-killer was called.
f2c8b197
MK
1143If it is due to the memory assigned to the allocating task's cpuset
1144being exhausted,
1145the allowed memory represents the set of mems assigned to that
1146cpuset (see
1147.BR cpuset (7)).
1148If it is due to a mempolicy's node(s) being exhausted,
1149the allowed memory represents the set of mempolicy nodes.
1150If it is due to a memory limit (or swap limit) being reached,
1151the allowed memory is that configured limit.
1152Finally, if it is due to the entire system being out of memory, the
1153allowed memory represents all allocatable resources.
1154
1155The value of
0633f951 1156.I oom_score_adj
f2c8b197
MK
1157is added to the badness score before it
1158is used to determine which task to kill.
1159Acceptable values range from \-1000
1160(OOM_SCORE_ADJ_MIN) to +1000 (OOM_SCORE_ADJ_MAX).
0633f951 1161This allows user space to control the preference for OOM-killing,
f2c8b197 1162ranging from always preferring a certain
f082ada4 1163task or completely disabling it from OOM killing.
f2c8b197 1164The lowest possible value, \-1000, is
0633f951 1165equivalent to disabling OOM-killing entirely for that task,
f2c8b197
MK
1166since it will always report a badness score of 0.
1167
1168Consequently, it is very simple for user space to define
1169the amount of memory to consider for each task.
1170Setting a
1171.I oom_score_adj
1172value of +500, for example,
1173is roughly equivalent to allowing the remainder of tasks sharing the
1174same system, cpuset, mempolicy, or memory controller resources
1175to use at least 50% more memory.
1176A value of \-500, on the other hand, would be roughly
1177equivalent to discounting 50% of the task's
1178allowed memory from being considered as scoring against the task.
1179
0633f951 1180For backward compatibility with previous kernels,
f2c8b197
MK
1181.I /proc/[pid]/oom_adj
1182can still be used to tune the badness score.
1183Its value is
9f1b9726 1184scaled linearly with
f2c8b197
MK
1185.IR oom_score_adj .
1186
1187Writing to
1188.IR /proc/[pid]/oom_score_adj
1189or
1190.IR /proc/[pid]/oom_adj
1191will change the other with its scaled value.
b0aa1e51
MK
1192.TP
1193.IR /proc/[pid]/pagemap " (since Linux 2.6.25)"
1194This file shows the mapping of each of the process's virtual pages
1195into physical page frames or swap area.
1196It contains one 64-bit value for each virtual page,
1197with the bits set as follows:
1198.RS 12
1199.TP
120063
1201If set, the page is present in RAM.
1202.TP
120362
1204If set, the page is in swap space
1205.TP
120661 (since Linux 3.5)
1207The page is a file-mapped page or a shared anonymous page.
1208.TP
120960-56 (since Linux 3.11)
1210Zero
1211.\" Not quite true; see commit 541c237c0923f567c9c4cabb8a81635baadc713f
1212.TP
121355 (Since Linux 3.11)
1214PTE is soft-dirty
1215(see the kernel source file
1216.IR Documentation/vm/soft-dirty.txt ).
1217.TP
121854-0
1219If the page is present in RAM (bit 63), then these bits
1220provide the page frame number, which can be used to index
1221.IR /proc/kpageflags
1222and
1223.IR /proc/kpagecount .
1224If the page is present in swap (bit 62),
1225then bits 4-0 give the swap type, and bits 54-5 encode the swap offset.
1226.RE
1227.IP
1228Before Linux 3.11, bits 60-55 were
1229used to encode the base-2 log of the page size.
1230.IP
1231To employ
1232.IR /proc/[pid]/pagemap
1233efficiently, use
1234.IR /proc/[pid]/maps
1235to determine which areas of memory are actually mapped and seek
1236to skip over unmapped regions.
1237.IP
1238The
1239.IR /proc/[pid]/pagemap
1240file is present only if the
1241.B CONFIG_PROC_PAGE_MONITOR
1242kernel configuration option is enabled.
7c2905d1
MK
1243.TP
1244.IR /proc/[pid]/personality " (since Linux 2.6.28)"
1245.\" commit 478307230810d7e2a753ed220db9066dfdf88718
1246This read-only file exposes the process's execution domain, as set by
1247.BR personality (2).
1248The value is displayed in hexadecimal notation.
fea681da 1249.TP
69119dc7 1250.I /proc/[pid]/root
008f1ecc 1251UNIX and Linux support the idea of a per-process root of the
9ee4a2b6 1252filesystem, set by the
fea681da 1253.BR chroot (2)
c13182ef
MK
1254system call.
1255This file is a symbolic link that points to the process's
14d70713
MK
1256root directory, and behaves in the same way as
1257.IR exe ,
1258and
1259.IR fd/* .
afcaf646
MK
1260
1261.\" The following was still true as at kernel 2.6.13
c13182ef
MK
1262In a multithreaded process, the contents of this symbolic link
1263are not available if the main thread has already terminated
afcaf646
MK
1264(typically by calling
1265.BR pthread_exit (3)).
f34f0182
MK
1266.\" FIXME Describe /proc/[pid]/projid_map
1267.\" Added in 3.7, commit f76d207a66c3a53defea67e7d36c3eb1b7d6d61d
69119dc7 1268.\" FIXME Describe /proc/[pid]/seccomp
6aefb6df 1269.\" Added in 2.6.12
bea08fec 1270.\"
69119dc7 1271.\" FIXME Describe /proc/[pid]/sessionid
b4e9ee8f 1272.\" Added in 2.6.25; read-only; only readable by real UID
b3fb99e8 1273.\" commit 1e0bd7550ea9cf474b1ad4c6ff5729a507f75fdc
b4e9ee8f 1274.\" CONFIG_AUDITSYSCALL
bea08fec 1275.\"
69119dc7 1276.\" FIXME Describe /proc/[pid]/sched
b4e9ee8f
MK
1277.\" Added in 2.6.23
1278.\" CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS
1279.\" Displays various scheduling parameters
1280.\" This file can be written, to reset stats
ef4f4031 1281.\" The set of fields exposed by this file have changed
b3fb99e8
MK
1282.\" significantly over time.
1283.\" commit 43ae34cb4cd650d1eb4460a8253a8e747ba052ac
1284.\"
69119dc7
MK
1285.\" FIXME Describe /proc/[pid]/schedstats and
1286.\" /proc/[pid]/task/[tid]/schedstats
b4e9ee8f
MK
1287.\" Added in 2.6.9
1288.\" CONFIG_SCHEDSTATS
fea681da 1289.TP
51dea63a
MK
1290.IR /proc/[pid]/seccomp " (from Linux 2.6.12 to 2.6.22)"
1291Read/set the seccomp mode for the process.
1292If this file contains the value zero, seccomp mode is not enabled.
1293Writing the value 1 to this file (irreversibly) places the process in
1294seccomp mode: the only permitted system calls are
1295.BR read (2),
1296.BR write (2),
1297.BR _exit (2),
1298and
1299.BR sigreturn (2).
1300This file went away in Linux 2.6.23,
1301.\" commit 1d9d02feeee89e9132034d504c9a45eeaf618a3d
1302when it was replaced by a
1303.BR prctl (2)-based
1304mechanism.
1305.TP
5c92b1b7 1306.IR /proc/[pid]/setgroups " (since Linux 3.19)"
ab28dba9
MK
1307See
1308.BR user_namespaces (7).
d520465b 1309.TP
69119dc7 1310.IR /proc/[pid]/smaps " (since Linux 2.6.14)"
b07b19c4 1311This file shows memory consumption for each of the process's mappings.
859503c3
MK
1312(The
1313.BR pmap (1)
1314command displays similar information,
1315in a form that may be easier for parsing.)
1f0add28 1316For each mapping there is a series of lines such as the following:
a08ea57c 1317.in +4n
b07b19c4
MK
1318.nf
1319
1f0add28 132000400000-0048a000 r-xp 00000000 fd:03 960637 /bin/bash
95fe794d
PG
1321Size: 552 kB
1322Rss: 460 kB
1323Pss: 100 kB
1324Shared_Clean: 452 kB
1325Shared_Dirty: 0 kB
1326Private_Clean: 8 kB
1327Private_Dirty: 0 kB
1328Referenced: 460 kB
1329Anonymous: 0 kB
1330AnonHugePages: 0 kB
1331Swap: 0 kB
1332KernelPageSize: 4 kB
1333MMUPageSize: 4 kB
1334Locked: 0 kB
b07b19c4
MK
1335
1336.fi
a08ea57c 1337.in
b07b19c4
MK
1338The first of these lines shows the same information as is displayed
1339for the mapping in
69119dc7 1340.IR /proc/[pid]/maps .
b07b19c4 1341The remaining lines show the size of the mapping,
95fe794d
PG
1342the amount of the mapping that is currently resident in RAM ("Rss"),
1343the process' proportional share of this mapping ("Pss"),
1f0add28 1344the number of clean and dirty shared pages in the mapping,
c7ce200d 1345and the number of clean and dirty private pages in the mapping.
95fe794d 1346"Referenced" indicates the amount of memory currently marked as
1f0add28
MK
1347referenced or accessed.
1348"Anonymous" shows the amount of memory
1349that does not belong to any file.
1350"Swap" shows how much
95fe794d
PG
1351would-be-anonymous memory is also used, but out on swap.
1352
d6a56978 1353The "KernelPageSize" entry is the page size used by the kernel to back a VMA.
1f0add28
MK
1354This matches the size used by the MMU in the majority of cases.
1355However, one counter-example occurs on PPC64 kernels
1356whereby a kernel using 64K as a base page size may still use 4K
1357pages for the MMU on older processors.
1358To distinguish, this
1359patch reports "MMUPageSize" as the page size used by the MMU.
95fe794d
PG
1360
1361The "Locked" indicates whether the mapping is locked in memory
1362or not.
1363
1364"VmFlags" field represents the kernel flags associated with
1f0add28
MK
1365the particular virtual memory area in two letter encoded manner.
1366The codes are the following:
1367
95fe794d 1368 rd - readable
1f0add28 1369 wr - writable
95fe794d
PG
1370 ex - executable
1371 sh - shared
1372 mr - may read
1373 mw - may write
1374 me - may execute
1375 ms - may share
723e333c 1376 gd - stack segment grows down
95fe794d
PG
1377 pf - pure PFN range
1378 dw - disabled write to the mapped file
1379 lo - pages are locked in memory
1380 io - memory mapped I/O area
1381 sr - sequential read advise provided
1382 rr - random read advise provided
1383 dc - do not copy area on fork
1384 de - do not expand area on remapping
1385 ac - area is accountable
1386 nr - swap space is not reserved for the area
1387 ht - area uses huge tlb pages
1388 nl - non-linear mapping
1389 ar - architecture specific flag
1390 dd - do not include area into core dump
1391 sd - soft-dirty flag
1392 mm - mixed map area
1393 hg - huge page advise flag
1394 nh - no-huge page advise flag
b5408a0f 1395 mg - mergeable advise flag
b07b19c4 1396
e618d945
MK
1397The
1398.IR /proc/[pid]/smaps
1399file is present only if the
1400.B CONFIG_PROC_PAGE_MONITOR
1401kernel configuration option is enabled.
b07b19c4 1402.TP
67aac6fb
MK
1403.IR /proc/[pid]/stack " (since Linux 2.6.29)"
1404.\" 2ec220e27f5040aec1e88901c1b6ea3d135787ad
1405This file provides a symbolic trace of the function calls in this
1406process's kernel stack.
1407This file is provided only if the kernel was built with the
1408.B CONFIG_STACKTRACE
1409configuration option.
1410.TP
69119dc7 1411.I /proc/[pid]/stat
c13182ef
MK
1412Status information about the process.
1413This is used by
1414.BR ps (1).
082bf5b8
MK
1415It is defined in the kernel source file
1416.IR fs/proc/array.c "."
fea681da
MK
1417
1418The fields, in order, with their proper
1419.BR scanf (3)
1420format specifiers, are:
1421.RS
62e4a418
MK
1422.TP 10
1423(1) \fIpid\fP \ %d
1424.br
1425The process ID.
fea681da 1426.TP
62e4a418
MK
1427(2) \fIcomm\fP \ %s
1428The filename of the executable, in parentheses.
c13182ef 1429This is visible whether or not the executable is swapped out.
fea681da 1430.TP
62e4a418 1431(3) \fIstate\fP \ %c
31293f37
MK
1432One of the following characters, indicating process state:
1433.RS
1434.IP R 3
1435Running
1436.IP S
1437Sleeping in an interruptible wait
1438.IP D
1439Waiting in uninterruptible
1440disk sleep
1441.IP Z
1442Zombie
1443.IP T
1444Stopped (on a signal) or (before Linux 2.6.33) trace stopped
1445.IP t
1446.\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
1447Tracing stop (Linux 2.6.33 onward)
1448.IP W
1449Paging (only before Linux 2.6.0)
1450.IP X
ef4f4031 1451Dead (from Linux 2.6.0 onward)
31293f37
MK
1452.IP x
1453.\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
1454Dead (Linux 2.6.33 to
1455.\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
14563.13 only)
1457.IP K
1458.\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
1459Wakekill (Linux 2.6.33 to
1460.\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
14613.13 only)
1462.IP W
1463.\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
1464Waking (Linux 2.6.33 to
1465.\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
14663.13 only)
1467.IP P
1468.\" commit f2530dc71cf0822f90bb63ea4600caaef33a66bb
1469Parked (Linux 3.9 to
1470.\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
14713.13 only)
1472.RE
fea681da 1473.TP
62e4a418 1474(4) \fIppid\fP \ %d
e0fdc57c 1475The PID of the parent of this process.
fea681da 1476.TP
62e4a418
MK
1477(5) \fIpgrp\fP \ %d
1478The process group ID of the process.
fea681da 1479.TP
62e4a418
MK
1480(6) \fIsession\fP \ %d
1481The session ID of the process.
fea681da 1482.TP
62e4a418
MK
1483(7) \fItty_nr\fP \ %d
1484The controlling terminal of the process.
59a40ed7
MK
1485(The minor device number is contained in the combination of bits
148631 to 20 and 7 to 0;
b97deb97 1487the major device number is in bits 15 to 8.)
fea681da 1488.TP
62e4a418 1489(8) \fItpgid\fP \ %d
fea681da 1490.\" This field and following, up to and including wchan added 0.99.1
62e4a418 1491The ID of the foreground process group of the controlling
59a40ed7 1492terminal of the process.
fea681da 1493.TP
62e4a418
MK
1494(9) \fIflags\fP \ %u
1495The kernel flags word of the process.
c13182ef 1496For bit meanings,
66a9882e 1497see the PF_* defines in the Linux kernel source file
00702acc 1498.IR include/linux/sched.h .
fea681da 1499Details depend on the kernel version.
62e4a418
MK
1500
1501The format for this field was %lu before Linux 2.6.
fea681da 1502.TP
ee566744 1503(10) \fIminflt\fP \ %lu
62e4a418 1504The number of minor faults the process has made which have not
fea681da
MK
1505required loading a memory page from disk.
1506.TP
62e4a418
MK
1507(11) \fIcminflt\fP \ %lu
1508The number of minor faults that the process's
fea681da
MK
1509waited-for children have made.
1510.TP
62e4a418
MK
1511(12) \fImajflt\fP \ %lu
1512The number of major faults the process has made which have
fea681da
MK
1513required loading a memory page from disk.
1514.TP
62e4a418
MK
1515(13) \fIcmajflt\fP \ %lu
1516The number of major faults that the process's
fea681da
MK
1517waited-for children have made.
1518.TP
62e4a418
MK
1519(14) \fIutime\fP \ %lu
1520Amount of time that this process has been scheduled in user mode,
7a017e24 1521measured in clock ticks (divide by
67914165 1522.IR sysconf(_SC_CLK_TCK) ).
a1c9dc59
MK
1523This includes guest time, \fIguest_time\fP
1524(time spent running a virtual CPU, see below),
1525so that applications that are not aware of the guest time field
1526do not lose that time from their calculations.
fea681da 1527.TP
62e4a418
MK
1528(15) \fIstime\fP \ %lu
1529Amount of time that this process has been scheduled in kernel mode,
7a017e24 1530measured in clock ticks (divide by
67914165 1531.IR sysconf(_SC_CLK_TCK) ).
fea681da 1532.TP
62e4a418
MK
1533(16) \fIcutime\fP \ %ld
1534Amount of time that this process's
7a017e24
MK
1535waited-for children have been scheduled in user mode,
1536measured in clock ticks (divide by
67914165 1537.IR sysconf(_SC_CLK_TCK) ).
c13182ef 1538(See also
fea681da 1539.BR times (2).)
a1c9dc59
MK
1540This includes guest time, \fIcguest_time\fP
1541(time spent running a virtual CPU, see below).
fea681da 1542.TP
62e4a418
MK
1543(17) \fIcstime\fP \ %ld
1544Amount of time that this process's
7a017e24
MK
1545waited-for children have been scheduled in kernel mode,
1546measured in clock ticks (divide by
67914165 1547.IR sysconf(_SC_CLK_TCK) ).
fea681da 1548.TP
62e4a418
MK
1549(18) \fIpriority\fP \ %ld
1550(Explanation for Linux 2.6)
59a40ed7
MK
1551For processes running a real-time scheduling policy
1552.RI ( policy
1553below; see
1554.BR sched_setscheduler (2)),
1555this is the negated scheduling priority, minus one;
1556that is, a number in the range \-2 to \-100,
1557corresponding to real-time priorities 1 to 99.
1558For processes running under a non-real-time scheduling policy,
1559this is the raw nice value
1560.RB ( setpriority (2))
1561as represented in the kernel.
1562The kernel stores nice values as numbers
1563in the range 0 (high) to 39 (low),
1564corresponding to the user-visible nice range of \-20 to 19.
1565
1566Before Linux 2.6, this was a scaled value based on
1567the scheduler weighting given to this process.
1568.\" And back in kernel 1.2 days things were different again.
fea681da 1569.TP
62e4a418
MK
1570(19) \fInice\fP \ %ld
1571The nice value (see
59a40ed7
MK
1572.BR setpriority (2)),
1573a value in the range 19 (low priority) to \-20 (high priority).
1574.\" Back in kernel 1.2 days things were different.
fea681da
MK
1575.\" .TP
1576.\" \fIcounter\fP %ld
1577.\" The current maximum size in jiffies of the process's next timeslice,
1578.\" or what is currently left of its current timeslice, if it is the
1579.\" currently running process.
1580.\" .TP
1581.\" \fItimeout\fP %u
1582.\" The time in jiffies of the process's next timeout.
0e94f77b 1583.\" timeout was removed sometime around 2.1/2.2
aa610245 1584.TP
62e4a418
MK
1585(20) \fInum_threads\fP \ %ld
1586Number of threads in this process (since Linux 2.6).
bb83d1b9 1587Before kernel 2.6, this field was hard coded to 0 as a placeholder
0e94f77b 1588for an earlier removed field.
fea681da 1589.TP
62e4a418
MK
1590(21) \fIitrealvalue\fP \ %ld
1591The time in jiffies before the next
8bd58774
MK
1592.B SIGALRM
1593is sent to the process due to an interval timer.
0e94f77b
MK
1594Since kernel 2.6.17, this field is no longer maintained,
1595and is hard coded as 0.
fea681da 1596.TP
62e4a418
MK
1597(22) \fIstarttime\fP \ %llu
1598The time the process started after system boot.
055024ed
MK
1599In kernels before Linux 2.6, this value was expressed in jiffies.
1600Since Linux 2.6, the value is expressed in clock ticks (divide by
1601.IR sysconf(_SC_CLK_TCK) ).
62e4a418
MK
1602
1603The format for this field was %lu before Linux 2.6.
fea681da 1604.TP
62e4a418
MK
1605(23) \fIvsize\fP \ %lu
1606Virtual memory size in bytes.
fea681da 1607.TP
62e4a418
MK
1608(24) \fIrss\fP \ %ld
1609Resident Set Size: number of pages the process has in real memory.
c13182ef 1610This is just the pages which
5fab2e7c 1611count toward text, data, or stack space.
c13182ef 1612This does not include pages
fea681da
MK
1613which have not been demand-loaded in, or which are swapped out.
1614.TP
62e4a418
MK
1615(25) \fIrsslim\fP \ %lu
1616Current soft limit in bytes on the rss of the process;
59a40ed7
MK
1617see the description of
1618.B RLIMIT_RSS
1619in
2b5407af 1620.BR getrlimit (2).
fea681da 1621.TP
62e4a418
MK
1622(26) \fIstartcode\fP \ %lu
1623The address above which program text can run.
fea681da 1624.TP
62e4a418
MK
1625(27) \fIendcode\fP \ %lu
1626The address below which program text can run.
fea681da 1627.TP
62e4a418
MK
1628(28) \fIstartstack\fP \ %lu
1629The address of the start (i.e., bottom) of the stack.
fea681da 1630.TP
62e4a418
MK
1631(29) \fIkstkesp\fP \ %lu
1632The current value of ESP (stack pointer), as found in the
fea681da
MK
1633kernel stack page for the process.
1634.TP
62e4a418
MK
1635(30) \fIkstkeip\fP \ %lu
1636The current EIP (instruction pointer).
fea681da 1637.TP
62e4a418
MK
1638(31) \fIsignal\fP \ %lu
1639The bitmap of pending signals, displayed as a decimal number.
59a40ed7 1640Obsolete, because it does not provide information on real-time signals; use
69119dc7 1641.I /proc/[pid]/status
59a40ed7 1642instead.
fea681da 1643.TP
62e4a418
MK
1644(32) \fIblocked\fP \ %lu
1645The bitmap of blocked signals, displayed as a decimal number.
59a40ed7 1646Obsolete, because it does not provide information on real-time signals; use
69119dc7 1647.I /proc/[pid]/status
59a40ed7 1648instead.
fea681da 1649.TP
62e4a418
MK
1650(33) \fIsigignore\fP \ %lu
1651The bitmap of ignored signals, displayed as a decimal number.
59a40ed7 1652Obsolete, because it does not provide information on real-time signals; use
69119dc7 1653.I /proc/[pid]/status
59a40ed7 1654instead.
fea681da 1655.TP
62e4a418
MK
1656(34) \fIsigcatch\fP \ %lu
1657The bitmap of caught signals, displayed as a decimal number.
59a40ed7 1658Obsolete, because it does not provide information on real-time signals; use
69119dc7 1659.I /proc/[pid]/status
59a40ed7 1660instead.
fea681da 1661.TP
62e4a418
MK
1662(35) \fIwchan\fP \ %lu
1663This is the "channel" in which the process is waiting.
2054f761
MK
1664It is the address of a location in the kernel where the process is sleeping.
1665The corresponding symbolic name can be found in
1666.IR /proc/[pid]/wchan .
fea681da 1667.TP
62e4a418 1668(36) \fInswap\fP \ %lu
0633f951 1669.\" nswap was added in 2.0
4d9b6984 1670Number of pages swapped (not maintained).
fea681da 1671.TP
62e4a418 1672(37) \fIcnswap\fP \ %lu
0633f951 1673.\" cnswap was added in 2.0
4d9b6984 1674Cumulative \fInswap\fP for child processes (not maintained).
fea681da 1675.TP
62e4a418
MK
1676(38) \fIexit_signal\fP \ %d \ (since Linux 2.1.22)
1677Signal to be sent to parent when we die.
fea681da 1678.TP
62e4a418
MK
1679(39) \fIprocessor\fP \ %d \ (since Linux 2.2.8)
1680CPU number last executed on.
568105c6 1681.TP
62e4a418
MK
1682(40) \fIrt_priority\fP \ %u \ (since Linux 2.5.19)
1683Real-time scheduling priority, a number in the range 1 to 99 for
59a40ed7
MK
1684processes scheduled under a real-time policy,
1685or 0, for non-real-time processes (see
568105c6
MK
1686.BR sched_setscheduler (2)).
1687.TP
62e4a418
MK
1688(41) \fIpolicy\fP \ %u \ (since Linux 2.5.19)
1689Scheduling policy (see
568105c6 1690.BR sched_setscheduler (2)).
cd60dedd 1691Decode using the SCHED_* constants in
59a40ed7 1692.IR linux/sched.h .
62e4a418
MK
1693
1694The format for this field was %lu before Linux 2.6.22.
167450d6 1695.TP
62e4a418
MK
1696(42) \fIdelayacct_blkio_ticks\fP \ %llu \ (since Linux 2.6.18)
1697Aggregated block I/O delays, measured in clock ticks (centiseconds).
14c06953 1698.TP
62e4a418
MK
1699(43) \fIguest_time\fP \ %lu \ (since Linux 2.6.24)
1700Guest time of the process (time spent running a virtual CPU
7a017e24 1701for a guest operating system), measured in clock ticks (divide by
67914165 1702.IR sysconf(_SC_CLK_TCK) ).
14c06953 1703.TP
62e4a418
MK
1704(44) \fIcguest_time\fP \ %ld \ (since Linux 2.6.24)
1705Guest time of the process's children, measured in clock ticks (divide by
67914165 1706.IR sysconf(_SC_CLK_TCK) ).
fea681da 1707.TP
62e4a418 1708(45) \fIstart_data\fP \ %lu \ (since Linux 3.3)
0be30a54 1709.\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff
62e4a418 1710Address above which program initialized and
426bc8d7 1711uninitialized (BSS) data are placed.
12449ae3 1712.TP
62e4a418 1713(46) \fIend_data\fP \ %lu \ (since Linux 3.3)
0be30a54 1714.\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff
62e4a418 1715Address below which program initialized and
426bc8d7 1716uninitialized (BSS) data are placed.
12449ae3 1717.TP
62e4a418 1718(47) \fIstart_brk\fP \ %lu \ (since Linux 3.3)
0be30a54 1719.\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff
62e4a418 1720Address above which program heap can be expanded with
426bc8d7 1721.BR brk (2).
12449ae3 1722.TP
62e4a418 1723(48) \fIarg_start\fP \ %lu \ (since Linux 3.5)
0be30a54 1724.\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
62e4a418 1725Address above which program command-line arguments
426bc8d7
MK
1726.RI ( argv )
1727are placed.
12449ae3 1728.TP
62e4a418 1729(49) \fIarg_end\fP \ %lu \ (since Linux 3.5)
0be30a54 1730.\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
62e4a418 1731Address below program command-line arguments
426bc8d7
MK
1732.RI ( argv )
1733are placed.
12449ae3 1734.TP
62e4a418 1735(50) \fIenv_start\fP \ %lu \ (since Linux 3.5)
0be30a54 1736.\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
62e4a418 1737Address above which program environment is placed.
12449ae3 1738.TP
62e4a418 1739(51) \fIenv_end\fP \ %lu \ (since Linux 3.5)
0be30a54 1740.\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
62e4a418 1741Address below which program environment is placed.
12449ae3 1742.TP
62e4a418 1743(52) \fIexit_code\fP \ %d \ (since Linux 3.5)
0be30a54 1744.\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
62e4a418 1745The thread's exit status in the form reported by
426bc8d7 1746.BR waitpid (2).
12449ae3 1747.RE
1748.TP
69119dc7 1749.I /proc/[pid]/statm
59a40ed7 1750Provides information about memory usage, measured in pages.
c13182ef 1751The columns are:
a08ea57c
MK
1752.in +4n
1753.nf
1754
cb42fb56 1755size (1) total program size
69119dc7 1756 (same as VmSize in \fI/proc/[pid]/status\fP)
cb42fb56 1757resident (2) resident set size
69119dc7 1758 (same as VmRSS in \fI/proc/[pid]/status\fP)
cb42fb56
MK
1759share (3) shared pages (i.e., backed by a file)
1760text (4) text (code)
59a40ed7 1761.\" (not including libs; broken, includes data segment)
cb42fb56
MK
1762lib (5) library (unused in Linux 2.6)
1763data (6) data + stack
59a40ed7 1764.\" (including libs; broken, includes library text)
cb42fb56 1765dt (7) dirty pages (unused in Linux 2.6)
a08ea57c
MK
1766.fi
1767.in
fea681da 1768.TP
69119dc7 1769.I /proc/[pid]/status
fea681da 1770Provides much of the information in
69119dc7 1771.I /proc/[pid]/stat
fea681da 1772and
69119dc7 1773.I /proc/[pid]/statm
fea681da 1774in a format that's easier for humans to parse.
16b5f7ba
MK
1775Here's an example:
1776.in +4n
1777.nf
1778
b43a3b30 1779.RB "$" " cat /proc/$$/status"
16b5f7ba
MK
1780Name: bash
1781State: S (sleeping)
1782Tgid: 3515
1783Pid: 3515
1784PPid: 3452
1785TracerPid: 0
1786Uid: 1000 1000 1000 1000
1787Gid: 100 100 100 100
1788FDSize: 256
1789Groups: 16 33 100
1790VmPeak: 9136 kB
1791VmSize: 7896 kB
1792VmLck: 0 kB
15789039 1793VmPin: 0 kB
16b5f7ba
MK
1794VmHWM: 7572 kB
1795VmRSS: 6316 kB
1796VmData: 5224 kB
1797VmStk: 88 kB
1798VmExe: 572 kB
1799VmLib: 1708 kB
1800VmPTE: 20 kB
49f6dda7 1801VmSwap: 0 kB
16b5f7ba
MK
1802Threads: 1
1803SigQ: 0/3067
1804SigPnd: 0000000000000000
1805ShdPnd: 0000000000000000
1806SigBlk: 0000000000010000
1807SigIgn: 0000000000384004
1808SigCgt: 000000004b813efb
1809CapInh: 0000000000000000
1810CapPrm: 0000000000000000
1811CapEff: 0000000000000000
1812CapBnd: ffffffffffffffff
039b6546 1813Seccomp: 0
16b5f7ba
MK
1814Cpus_allowed: 00000001
1815Cpus_allowed_list: 0
1816Mems_allowed: 1
1817Mems_allowed_list: 0
1818voluntary_ctxt_switches: 150
1819nonvoluntary_ctxt_switches: 545
1820.fi
1821.in
1822.IP
1823The fields are as follows:
1824.RS
1825.IP * 2
1826.IR Name :
1827Command run by this process.
1828.IP *
1829.IR State :
4175f999
MK
1830Current state of the process.
1831One of
16b5f7ba
MK
1832"R (running)",
1833"S (sleeping)",
1834"D (disk sleep)",
1835"T (stopped)",
1836"T (tracing stop)",
1837"Z (zombie)",
1838or
1839"X (dead)".
1840.IP *
1841.IR Tgid :
1842Thread group ID (i.e., Process ID).
1843.IP *
1844.IR Pid :
1845Thread ID (see
1846.BR gettid (2)).
1847.IP *
a1bc91d5
MK
1848.IR PPid :
1849PID of parent process.
1850.IP *
16b5f7ba
MK
1851.IR TracerPid :
1852PID of process tracing this process (0 if not being traced).
1853.IP *
1854.IR Uid ", " Gid :
9ee4a2b6 1855Real, effective, saved set, and filesystem UIDs (GIDs).
16b5f7ba
MK
1856.IP *
1857.IR FDSize :
1858Number of file descriptor slots currently allocated.
1859.IP *
1860.IR Groups :
1861Supplementary group list.
1862.IP *
1863.IR VmPeak :
1864Peak virtual memory size.
1865.IP *
1866.IR VmSize :
1867Virtual memory size.
1868.IP *
1869.IR VmLck :
fde39195
MK
1870Locked memory size (see
1871.BR mlock (3)).
16b5f7ba 1872.IP *
15789039
TY
1873.IR VmPin :
1874Pinned memory size
1875.\" commit bc3e53f682d93df677dbd5006a404722b3adfe18
1876(since Linux 3.2).
1877These are pages that can't be moved because something needs to
1878directly access physical memory.
1879.IP *
16b5f7ba
MK
1880.IR VmHWM :
1881Peak resident set size ("high water mark").
1882.IP *
1883.IR VmRSS :
1884Resident set size.
1885.IP *
1886.IR VmData ", " VmStk ", " VmExe :
1887Size of data, stack, and text segments.
1888.IP *
1889.IR VmLib :
1890Shared library code size.
1891.IP *
1892.IR VmPTE :
1893Page table entries size (since Linux 2.6.10).
1894.IP *
ac4b0eb3 1895.IR VmSwap :
1ddc1665 1896.\" commit b084d4353ff99d824d3bc5a5c2c22c70b1fba722
fce21149
MK
1897Swapped-out virtual memory size by anonymous private pages;
1898shmem swap usage is not included (since Linux 2.6.34).
49f6dda7 1899.IP *
16b5f7ba
MK
1900.IR Threads :
1901Number of threads in process containing this thread.
1902.IP *
6ee625eb
MK
1903.IR SigQ :
1904This field contains two slash-separated numbers that relate to
1905queued signals for the real user ID of this process.
1906The first of these is the number of currently queued
1907signals for this real user ID, and the second is the
1908resource limit on the number of queued signals for this process
1909(see the description of
1910.BR RLIMIT_SIGPENDING
1911in
1912.BR getrlimit (2)).
1913.IP *
16b5f7ba
MK
1914.IR SigPnd ", " ShdPnd :
1915Number of signals pending for thread and for process as a whole (see
1916.BR pthreads (7)
1917and
1918.BR signal (7)).
1919.IP *
1920.IR SigBlk ", " SigIgn ", " SigCgt :
1921Masks indicating signals being blocked, ignored, and caught (see
1922.BR signal (7)).
1923.IP *
1924.IR CapInh ", " CapPrm ", " CapEff :
1925Masks of capabilities enabled in inheritable, permitted, and effective sets
1926(see
1927.BR capabilities (7)).
1928.IP *
1929.IR CapBnd :
1930Capability Bounding set
7e07d950 1931(since Linux 2.6.26, see
16b5f7ba
MK
1932.BR capabilities (7)).
1933.IP *
039b6546
MK
1934.IR Seccomp :
1935.\" commit 2f4b3bf6b2318cfaa177ec5a802f4d8d6afbd816
1936Seccomp mode of the process
1937(since Linux 3.8, see
1938.BR seccomp (2)).
19390 means
1940.BR SECCOMP_MODE_DISABLED ;
19411 means
1942.BR SECCOMP_MODE_STRICT ;
19432 means
1944.BR SECCOMP_MODE_FILTER .
1945This field is provided only if the kernel was built with the
1946.BR CONFIG_SECCOMP
1947kernel configuration option enabled.
1948.IP *
16b5f7ba
MK
1949.IR Cpus_allowed :
1950Mask of CPUs on which this process may run
1951(since Linux 2.6.24, see
1952.BR cpuset (7)).
1953.IP *
1954.IR Cpus_allowed_list :
1955Same as previous, but in "list format"
1956(since Linux 2.6.26, see
1957.BR cpuset (7)).
1958.IP *
1959.IR Mems_allowed :
1960Mask of memory nodes allowed to this process
1961(since Linux 2.6.24, see
1962.BR cpuset (7)).
1963.IP *
1964.IR Mems_allowed_list :
1965Same as previous, but in "list format"
1966(since Linux 2.6.26, see
1967.BR cpuset (7)).
1968.IP *
7c82878a 1969.IR voluntary_ctxt_switches ", " nonvoluntary_ctxt_switches :
16b5f7ba
MK
1970Number of voluntary and involuntary context switches (since Linux 2.6.23).
1971.RE
afb7b014
MK
1972.TP
1973.IR /proc/[pid]/syscall " (since Linux 2.6.27)"
1974.\" commit ebcb67341fee34061430f3367f2e507e52ee051b
1975This file exposes the system call number and argument registers for the
1976system call currently being executed by the process,
1977followed by the values of the stack pointer and program counter registers.
1978The values of all six argument registers are exposed,
1979although most system calls use fewer registers.
1980
1981If the process is blocked, but not in a system call,
1fb61947 1982then the file displays \-1 in place of the system call number,
afb7b014
MK
1983followed by just the values of the stack pointer and program counter.
1984If process is not blocked, then file contains just the string "running".
1985
1986This file is present only if the kernel was configured with
1987.BR CONFIG_HAVE_ARCH_TRACEHOOK .
fea681da 1988.TP
69119dc7 1989.IR /proc/[pid]/task " (since Linux 2.6.0-test6)"
afcaf646
MK
1990This is a directory that contains one subdirectory
1991for each thread in the process.
69119dc7
MK
1992The name of each subdirectory is the numerical thread ID
1993.RI ( [tid] )
1994of the thread (see
afcaf646
MK
1995.BR gettid (2)).
1996Within each of these subdirectories, there is a set of
1997files with the same names and contents as under the
69119dc7 1998.I /proc/[pid]
afcaf646
MK
1999directories.
2000For attributes that are shared by all threads, the contents for
2001each of the files under the
69119dc7 2002.I task/[tid]
afcaf646 2003subdirectories will be the same as in the corresponding
c13182ef 2004file in the parent
69119dc7 2005.I /proc/[pid]
afcaf646 2006directory
c13182ef 2007(e.g., in a multithreaded process, all of the
69119dc7 2008.I task/[tid]/cwd
c13182ef 2009files will have the same value as the
69119dc7 2010.I /proc/[pid]/cwd
c13182ef 2011file in the parent directory, since all of the threads in a process
afcaf646
MK
2012share a working directory).
2013For attributes that are distinct for each thread,
c13182ef 2014the corresponding files under
69119dc7 2015.I task/[tid]
afcaf646 2016may have different values (e.g., various fields in each of the
69119dc7 2017.I task/[tid]/status
afcaf646
MK
2018files may be different for each thread).
2019
2020.\" The following was still true as at kernel 2.6.13
2021In a multithreaded process, the contents of the
69119dc7 2022.I /proc/[pid]/task
c13182ef 2023directory are not available if the main thread has already terminated
afcaf646
MK
2024(typically by calling
2025.BR pthread_exit (3)).
2026.TP
ccdc8958 2027.IR /proc/[pid]/uid_map ", " /proc/[pid]/gid_map " (since Linux 3.5)"
d06a6170
MK
2028See
2029.BR user_namespaces (7).
f6e17121 2030.TP
2054f761
MK
2031.IR /proc/[pid]/wchan " (since Linux 2.6.0)"
2032The symbolic name corresponding to the location
2033in the kernel where the process is sleeping.
2034.TP
fea681da 2035.I /proc/apm
097585ed
MK
2036Advanced power management version and battery information when
2037.B CONFIG_APM
2038is defined at kernel compilation time.
fea681da 2039.TP
eb7097c2
EDB
2040.I /proc/buddyinfo
2041This file contains information which is used for diagnosing memory
2042fragmentation issues.
2043Each line starts with the identification of the node and the name
b96ddae0
MK
2044of the zone which together identify a memory region
2045This is then
eb7097c2
EDB
2046followed by the count of available chunks of a certain order in
2047which these zones are split.
c3b494c2 2048The size in bytes of a certain order is given by the formula:
b96ddae0
MK
2049
2050 (2^order)\ *\ PAGE_SIZE
2051
eb7097c2
EDB
2052The binary buddy allocator algorithm inside the kernel will split
2053one chunk into two chunks of a smaller order (thus with half the
2054size) or combine two contiguous chunks into one larger chunk of
2055a higher order (thus with double the size) to satisfy allocation
2056requests and to counter memory fragmentation.
2057The order matches the column number, when starting to count at zero.
2058
2059For example on a x86_64 system:
b96ddae0
MK
2060
2061.in -12n
eb7097c2 2062.nf
b96ddae0
MK
2063Node 0, zone DMA 1 1 1 0 2 1 1 0 1 1 3
2064Node 0, zone DMA32 65 47 4 81 52 28 13 10 5 1 404
2065Node 0, zone Normal 216 55 189 101 84 38 37 27 5 3 587
eb7097c2
EDB
2066.fi
2067.in
2068
b96ddae0 2069In this example, there is one node containing three zones and there
eb7097c2 2070are 11 different chunk sizes.
73ba31a9 2071If the page size is 4 kilobytes, then the first zone called
eb7097c2 2072.I DMA
b96ddae0
MK
2073(on x86 the first 16 megabyte of memory) has 1 chunk of 4 kilobytes
2074(order 0) available and has 3 chunks of 4 megabytes (order 10) available.
eb7097c2 2075
73ba31a9 2076If the memory is heavily fragmented, the counters for higher
eb7097c2
EDB
2077order chunks will be zero and allocation of large contiguous areas
2078will fail.
2079
2080Further information about the zones can be found in
2081.IR /proc/zoneinfo .
2082.TP
fea681da
MK
2083.I /proc/bus
2084Contains subdirectories for installed busses.
2085.TP
2086.I /proc/bus/pccard
59a40ed7 2087Subdirectory for PCMCIA devices when
097585ed
MK
2088.B CONFIG_PCMCIA
2089is set at kernel compilation time.
fea681da 2090.TP
1509ca0e
MK
2091.IR /proc/[pid]/timers " (since Linux 3.10)"
2092.\" commit 5ed67f05f66c41e39880a6d61358438a25f9fee5
2093.\" commit 48f6a7a511ef8823fdff39afee0320092d43a8a0
2094A list of the POSIX timers for this process.
93691c1e 2095Each timer is listed with a line that starts with the string "ID:".
1509ca0e
MK
2096For example:
2097
2098.in +4n
2099.nf
2100ID: 1
2101signal: 60/00007fff86e452a8
2102notify: signal/pid.2634
2103ClockID: 0
2104ID: 0
2105signal: 60/00007fff86e452a8
2106notify: signal/pid.2634
2107ClockID: 1
2108.fi
2109.in
2110
2111The lines shown for each timer have the following meanings:
2112.RS
2113.TP
2114.I ID
2115The ID for this timer.
2116This is not the same as the timer ID returned by
2117.BR timer_create (2);
2118rather, it is the same kernel-internal ID that is available via the
2119.I si_timerid
2120field of the
2121.IR siginfo_t
2122structure (see
2123.BR sigaction (2)).
2124.TP
2125.I signal
2126This is the signal number that this timer uses to deliver notifications
2127followed by a slash, and then the
7f1ea8fb 2128.I sigev_value
1509ca0e
MK
2129value supplied to the signal handler.
2130Valid only for timers that notify via a signal.
2131.TP
2132.I notify
2133The part before the slash specifies the mechanism
2134that this timer uses to deliver notifications,
2135and is one of "thread", "signal", or "none".
2136Immediately following the slash is either the string "tid" for timers
2137with
2138.B SIGEV_THREAD_ID
2139notification, or "pid" for timers that notify by other mechanisms.
dbe6f88b
MK
2140Following the "." is the PID of the process
2141(or the kernel thread ID of the thread) that will be delivered
1509ca0e
MK
2142a signal if the timer delivers notifications via a signal.
2143.TP
2144.I ClockID
2145This field identifies the clock that the timer uses for measuring time.
2146For most clocks, this is a number that matches one of the user-space
2147.BR CLOCK_*
9d54c087 2148constants exposed via
1509ca0e
MK
2149.IR <time.h> .
2150.B CLOCK_PROCESS_CPUTIME_ID
2151timers display with a value of -6
2152in this field.
2153.B CLOCK_THREAD_CPUTIME_ID
2154timers display with a value of -2
2155in this field.
2156.RE
5734da6d
MK
2157.IP
2158This file is available only when the kernel was configured with
2159.BR CONFIG_CHECKPOINT_RESTORE .
1509ca0e 2160.TP
fea681da
MK
2161.I /proc/bus/pccard/drivers
2162.TP
2163.I /proc/bus/pci
c13182ef 2164Contains various bus subdirectories and pseudo-files containing
59a40ed7 2165information about PCI busses, installed devices, and device
c13182ef
MK
2166drivers.
2167Some of these files are not ASCII.
fea681da
MK
2168.TP
2169.I /proc/bus/pci/devices
59a40ed7 2170Information about PCI devices.
c13182ef 2171They may be accessed through
fea681da
MK
2172.BR lspci (8)
2173and
2174.BR setpci (8).
2175.TP
2176.I /proc/cmdline
c13182ef
MK
2177Arguments passed to the Linux kernel at boot time.
2178Often done via a boot manager such as
59a40ed7
MK
2179.BR lilo (8)
2180or
2181.BR grub (8).
f6e524c4
MK
2182.TP
2183.IR /proc/config.gz " (since Linux 2.6)"
2184This file exposes the configuration options that were used
c3d9780d 2185to build the currently running kernel,
f6e524c4
MK
2186in the same format as they would be shown in the
2187.I .config
2188file that resulted when configuring the kernel (using
2189.IR "make xconfig" ,
2190.IR "make config" ,
2191or similar).
2192The file contents are compressed; view or search them using
f78ed33a
MK
2193.BR zcat (1)
2194and
2195.BR zgrep (1).
f6e524c4 2196As long as no changes have been made to the following file,
250e01ec
MK
2197the contents of
2198.I /proc/config.gz
2199are the same as those provided by :
f6e524c4
MK
2200.in +4n
2201.nf
2202
c3074d70 2203cat /lib/modules/$(uname \-r)/build/.config
f6e524c4
MK
2204.fi
2205.in
250e01ec
MK
2206.IP
2207.I /proc/config.gz
90878f7c 2208is provided only if the kernel is configured with
250e01ec 2209.BR CONFIG_IKCONFIG_PROC .
fea681da
MK
2210.TP
2211.I /proc/cpuinfo
2212This is a collection of CPU and system architecture dependent items,
2213for each supported architecture a different list.
2214Two common entries are \fIprocessor\fP which gives CPU number and
c13182ef
MK
2215\fIbogomips\fP; a system constant that is calculated
2216during kernel initialization.
2217SMP machines have information for
fea681da 2218each CPU.
a091f002
MK
2219The
2220.BR lscpu (1)
2221command gathers its information from this file.
fea681da
MK
2222.TP
2223.I /proc/devices
c13182ef
MK
2224Text listing of major numbers and device groups.
2225This can be used by MAKEDEV scripts for consistency with the kernel.
fea681da
MK
2226.TP
2227.IR /proc/diskstats " (since Linux 2.5.69)"
2228This file contains disk I/O statistics for each disk device.
66a9882e 2229See the Linux kernel source file
fea681da
MK
2230.I Documentation/iostats.txt
2231for further information.
2232.TP
2233.I /proc/dma
c13182ef 2234This is a list of the registered \fIISA\fP DMA (direct memory access)
fea681da
MK
2235channels in use.
2236.TP
2237.I /proc/driver
2238Empty subdirectory.
2239.TP
2240.I /proc/execdomains
2241List of the execution domains (ABI personalities).
2242.TP
2243.I /proc/fb
097585ed
MK
2244Frame buffer information when
2245.B CONFIG_FB
2246is defined during kernel compilation.
fea681da
MK
2247.TP
2248.I /proc/filesystems
9ee4a2b6
MK
2249A text listing of the filesystems which are supported by the kernel,
2250namely filesystems which were compiled into the kernel or whose kernel
6387216b
MK
2251modules are currently loaded.
2252(See also
fb477da2 2253.BR filesystems (5).)
9ee4a2b6 2254If a filesystem is marked with "nodev",
809d0164 2255this means that it does not require a block device to be mounted
9ee4a2b6 2256(e.g., virtual filesystem, network filesystem).
809d0164
MK
2257
2258Incidentally, this file may be used by
2259.BR mount (8)
9ee4a2b6
MK
2260when no filesystem is specified and it didn't manage to determine the
2261filesystem type.
2262Then filesystems contained in this file are tried
809d0164 2263(excepted those that are marked with "nodev").
fea681da
MK
2264.TP
2265.I /proc/fs
df352acc 2266.\" FIXME Much more needs to be said about /proc/fs
91085d85 2267.\"
df352acc
MK
2268Contains subdirectories that in turn contain files
2269with information about (certain) mounted filesystems.
fea681da
MK
2270.TP
2271.I /proc/ide
2272This directory
59a40ed7
MK
2273exists on systems with the IDE bus.
2274There are directories for each IDE channel and attached device.
c13182ef 2275Files include:
fea681da 2276
a08ea57c 2277.in +4n
fea681da
MK
2278.nf
2279cache buffer size in KB
2280capacity number of sectors
2281driver driver version
2282geometry physical and logical geometry
9fdfa163 2283identify in hexadecimal
fea681da
MK
2284media media type
2285model manufacturer's model number
2286settings drive settings
9fdfa163
MK
2287smart_thresholds in hexadecimal
2288smart_values in hexadecimal
fea681da 2289.fi
a08ea57c 2290.in
fea681da 2291
c13182ef 2292The
fea681da
MK
2293.BR hdparm (8)
2294utility provides access to this information in a friendly format.
2295.TP
2296.I /proc/interrupts
23ec6ff0
MK
2297This is used to record the number of interrupts per CPU per IO device.
2298Since Linux 2.6.24,
2299for the i386 and x86_64 architectures, at least, this also includes
2300interrupts internal to the system (that is, not associated with a device
2301as such), such as NMI (nonmaskable interrupt), LOC (local timer interrupt),
2302and for SMP systems, TLB (TLB flush interrupt), RES (rescheduling
2303interrupt), CAL (remote function call interrupt), and possibly others.
2304Very easy to read formatting, done in ASCII.
fea681da
MK
2305.TP
2306.I /proc/iomem
2307I/O memory map in Linux 2.4.
2308.TP
2309.I /proc/ioports
c13182ef 2310This is a list of currently registered Input-Output port regions that
fea681da
MK
2311are in use.
2312.TP
2313.IR /proc/kallsyms " (since Linux 2.5.71)"
2314This holds the kernel exported symbol definitions used by the
2315.BR modules (X)
2316tools to dynamically link and bind loadable modules.
2317In Linux 2.5.47 and earlier, a similar file with slightly different syntax
2318was named
2319.IR ksyms .
2320.TP
2321.I /proc/kcore
2322This file represents the physical memory of the system and is stored
c13182ef
MK
2323in the ELF core file format.
2324With this pseudo-file, and an unstripped
9a67332e
MK
2325kernel
2326.RI ( /usr/src/linux/vmlinux )
2327binary, GDB can be used to
fea681da
MK
2328examine the current state of any kernel data structures.
2329
2330The total length of the file is the size of physical memory (RAM) plus
23314KB.
2332.TP
2333.I /proc/kmsg
2334This file can be used instead of the
2335.BR syslog (2)
c13182ef
MK
2336system call to read kernel messages.
2337A process must have superuser
fea681da 2338privileges to read this file, and only one process should read this
c13182ef
MK
2339file.
2340This file should not be read if a syslog process is running
fea681da
MK
2341which uses the
2342.BR syslog (2)
2343system call facility to log kernel messages.
2344
2345Information in this file is retrieved with the
c4517613 2346.BR dmesg (1)
fea681da
MK
2347program.
2348.TP
ff56ac8b
MK
2349.IR /proc/kpagecount " (since Linux 2.6.25)"
2350This file contains a 64-bit count of the number of
2351times each physical page frame is mapped,
2352indexed by page frame number (see the discussion of
2353.IR /proc/[pid]/pagemap ).
2354.IP
2355The
2356.IR /proc/kpagecount
2357file is present only if the
2358.B CONFIG_PROC_PAGE_MONITOR
59d566a9
MK
2359kernel configuration option is enabled.
2360.TP
2361.IR /proc/kpageflags " (since Linux 2.6.25)"
ef4f4031 2362This file contains 64-bit masks corresponding to each physical page frame;
59d566a9
MK
2363it is indexed by page frame number (see the discussion of
2364.IR /proc/[pid]/pagemap ).
2365The bits are as follows:
2366
2367 0 - KPF_LOCKED
2368 1 - KPF_ERROR
2369 2 - KPF_REFERENCED
2370 3 - KPF_UPTODATE
2371 4 - KPF_DIRTY
2372 5 - KPF_LRU
2373 6 - KPF_ACTIVE
2374 7 - KPF_SLAB
2375 8 - KPF_WRITEBACK
2376 9 - KPF_RECLAIM
2377 10 - KPF_BUDDY
2378 11 - KPF_MMAP (since Linux 2.6.31)
2379 12 - KPF_ANON (since Linux 2.6.31)
2380 13 - KPF_SWAPCACHE (since Linux 2.6.31)
2381 14 - KPF_SWAPBACKED (since Linux 2.6.31)
2382 15 - KPF_COMPOUND_HEAD (since Linux 2.6.31)
2383 16 - KPF_COMPOUND_TAIL (since Linux 2.6.31)
2384 16 - KPF_HUGE (since Linux 2.6.31)
2385 18 - KPF_UNEVICTABLE (since Linux 2.6.31)
2386 19 - KPF_HWPOISON (since Linux 2.6.31)
2387 20 - KPF_NOPAGE (since Linux 2.6.31)
2388 21 - KPF_KSM (since Linux 2.6.32)
2389 22 - KPF_THP (since Linux 3.4)
2390
2391For further details on the meanings of these bits,
2392see the kernel source file
2393.IR Documentation/vm/pagemap.txt .
2394Before kernel 2.6.29,
2395.\" commit ad3bdefe877afb47480418fdb05ecd42842de65e
2396.\" commit e07a4b9217d1e97d2f3a62b6b070efdc61212110
2397.BR KPF_WRITEBACK ,
2398.BR KPF_RECLAIM ,
2399.BR KPF_BUDDY ,
2400and
2401.BR KPF_LOCKED
2402did not report correctly.
2403.IP
2404The
2405.IR /proc/kpageflags
2406file is present only if the
2407.B CONFIG_PROC_PAGE_MONITOR
ff56ac8b
MK
2408kernel configuration option is enabled.
2409.TP
fea681da
MK
2410.IR /proc/ksyms " (Linux 1.1.23-2.5.47)"
2411See
2412.IR /proc/kallsyms .
2413.TP
2414.I /proc/loadavg
6b05dc38
MK
2415The first three fields in this file are load average figures
2416giving the number of jobs in the run queue (state R)
fea681da
MK
2417or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes.
2418They are the same as the load average numbers given by
2419.BR uptime (1)
2420and other programs.
6b05dc38 2421The fourth field consists of two numbers separated by a slash (/).
78fc91ec
EDB
2422The first of these is the number of currently runnable kernel
2423scheduling entities (processes, threads).
6b05dc38
MK
2424The value after the slash is the number of kernel scheduling entities
2425that currently exist on the system.
2426The fifth field is the PID of the process that was most
2427recently created on the system.
fea681da
MK
2428.TP
2429.I /proc/locks
2430This file shows current file locks
2431.RB ( flock "(2) and " fcntl (2))
2432and leases
2433.RB ( fcntl (2)).
2434.TP
89dd5f8a 2435.IR /proc/malloc " (only up to and including Linux 2.2)"
59a40ed7 2436.\" It looks like this only ever did something back in 1.0 days
90878f7c 2437This file is present only if
89dd5f8a 2438.B CONFIG_DEBUG_MALLOC
097585ed 2439was defined during compilation.
fea681da
MK
2440.TP
2441.I /proc/meminfo
77b802ec
MK
2442This file reports statistics about memory usage on the system.
2443It is used by
fea681da
MK
2444.BR free (1)
2445to report the amount of free and used memory (both physical and swap)
2446on the system as well as the shared memory and buffers used by the
2447kernel.
3ba3d5b1
MK
2448Each line of the file consists of a parameter name, followed by a colon,
2449the value of the parameter, and an option unit of measurement (e.g., "kB").
2450The list below describes the parameter names and
2451the format specifier required to read the field value.
2452Except as noted below,
2453all of the fields have been present since at least Linux 2.6.0.
86cf87d7 2454Some fields are displayed only if the kernel was configured
3ba3d5b1
MK
2455with various options; those dependencies are noted in the list.
2456.RS
2457.TP
2458.IR MemTotal " %lu"
449dd4e2 2459Total usable RAM (i.e., physical RAM minus a few reserved
99e91586 2460bits and the kernel binary code).
3ba3d5b1
MK
2461.TP
2462.IR MemFree " %lu"
7bccb7d4
DP
2463The sum of
2464.IR LowFree + HighFree .
3ba3d5b1
MK
2465.TP
2466.IR Buffers " %lu"
99e91586 2467Relatively temporary storage for raw disk blocks that
3ba3d5b1
MK
2468shouldn't get tremendously large (20MB or so).
2469.TP
2470.IR Cached " %lu"
2471In-memory cache for files read from the disk (the page cache).
2472Doesn't include
2473.IR SwapCached .
2474.TP
2475.IR SwapCached " %lu"
2476Memory that once was swapped out, is swapped back in but
2477still also is in the swap file.
fa1d2749 2478(If memory pressure is high, these pages
3ba3d5b1 2479don't need to be swapped out again because they are already
99e91586 2480in the swap file.
3ba3d5b1
MK
2481This saves I/O.)
2482.TP
2483.IR Active " %lu"
2484Memory that has been used more recently and usually not
2485reclaimed unless absolutely necessary.
2486.TP
2487.IR Inactive " %lu"
2488Memory which has been less recently used.
2489It is more eligible to be reclaimed for other purposes.
2490.TP
2491.IR Active(anon) " %lu (since Linux 2.6.28)"
2492[To be documented.]
2493.TP
2494.IR Inactive(anon) " %lu (since Linux 2.6.28)"
2495[To be documented.]
2496.TP
2497.IR Active(file) " %lu (since Linux 2.6.28)"
2498[To be documented.]
2499.TP
2500.IR Inactive(file) " %lu (since Linux 2.6.28)"
2501[To be documented.]
2502.TP
2503.IR Unevictable " %lu (since Linux 2.6.28)"
2504(From Linux 2.6.28 to 2.6.30,
2505\fBCONFIG_UNEVICTABLE_LRU\fP was required.)
2506[To be documented.]
2507.TP
46fbfc07 2508.IR Mlocked " %lu (since Linux 2.6.28)"
3ba3d5b1
MK
2509(From Linux 2.6.28 to 2.6.30,
2510\fBCONFIG_UNEVICTABLE_LRU\fP was required.)
2511[To be documented.]
2512.TP
2513.IR HighTotal " %lu"
2514(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
2515Total amount of highmem.
99e91586 2516Highmem is all memory above ~860MB of physical memory.
3ba3d5b1
MK
2517Highmem areas are for use by user-space programs,
2518or for the page cache.
2519The kernel must use tricks to access
2520this memory, making it slower to access than lowmem.
2521.TP
2522.IR HighFree " %lu
2523(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
2524Amount of free highmem.
2525.TP
2526.IR LowTotal " %lu
2527(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
2528Total amount of lowmem.
2529Lowmem is memory which can be used for everything that
2530highmem can be used for, but it is also available for the
2531kernel's use for its own data structures.
2532Among many other things,
99e91586 2533it is where everything from
7bccb7d4
DP
2534.I Slab
2535is allocated.
3ba3d5b1
MK
2536Bad things happen when you're out of lowmem.
2537.TP
2538.IR LowFree " %lu
2539(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
2540Amount of free lowmem.
2541.TP
2542.IR MmapCopy " %lu (since Linux 2.6.29)"
99e91586
DP
2543.RB ( CONFIG_MMU
2544is required.)
3ba3d5b1
MK
2545[To be documented.]
2546.TP
2547.IR SwapTotal " %lu"
2548Total amount of swap space available.
2549.TP
2550.IR SwapFree " %lu"
c16d4f25 2551Amount of swap space that is currently unused.
3ba3d5b1
MK
2552.TP
2553.IR Dirty " %lu"
2554Memory which is waiting to get written back to the disk.
2555.TP
2556.IR Writeback " %lu"
2557Memory which is actively being written back to the disk.
2558.TP
2559.IR AnonPages " %lu (since Linux 2.6.18)"
2560Non-file backed pages mapped into user-space page tables.
2561.TP
2562.IR Mapped " %lu"
fda70f5b
MK
2563Files which have been mapped into memory (with
2564.BR mmap (2)),
2565such as libraries.
3ba3d5b1
MK
2566.TP
2567.IR Shmem " %lu (since Linux 2.6.32)"
2568[To be documented.]
2569.TP
2570.IR Slab " %lu"
2571In-kernel data structures cache.
2572.TP
2573.IR SReclaimable " %lu (since Linux 2.6.19)"
7bccb7d4
DP
2574Part of
2575.IR Slab ,
2576that might be reclaimed, such as caches.
3ba3d5b1
MK
2577.TP
2578.IR SUnreclaim " %lu (since Linux 2.6.19)"
7bccb7d4
DP
2579Part of
2580.IR Slab ,
2581that cannot be reclaimed on memory pressure.
3ba3d5b1
MK
2582.TP
2583.IR KernelStack " %lu (since Linux 2.6.32)"
2584Amount of memory allocated to kernel stacks.
2585.TP
2586.IR PageTables " %lu (since Linux 2.6.18)"
2587Amount of memory dedicated to the lowest level of page tables.
2588.TP
2589.IR Quicklists " %lu (since Linux 2.6.27)"
2590(\fBCONFIG_QUICKLIST\fP is required.)
2591[To be documented.]
2592.TP
2593.IR NFS_Unstable " %lu (since Linux 2.6.18)"
2594NFS pages sent to the server, but not yet committed to stable storage.
2595.TP
2596.IR Bounce " %lu (since Linux 2.6.18)"
2597Memory used for block device "bounce buffers".
2598.TP
2599.IR WritebackTmp " %lu (since Linux 2.6.26)"
2600Memory used by FUSE for temporary writeback buffers.
2601.TP
2602.IR CommitLimit " %lu (since Linux 2.6.10)"
cd7b6c40
MK
2603This is the total amount of memory currently available to
2604be allocated on the system, expressed in kilobytes.
90878f7c
MK
2605This limit is adhered to
2606only if strict overcommit accounting is enabled (mode 2 in
cd7b6c40
MK
2607.IR /proc/sys/vm/overcommit_memory ).
2608The limit is calculated according to the formula described under
2609.IR /proc/sys/vm/overcommit_memory .
2610For further details, see the kernel source file
3ba3d5b1
MK
2611.IR Documentation/vm/overcommit-accounting .
2612.TP
2613.IR Committed_AS " %lu"
2614The amount of memory presently allocated on the system.
2615The committed memory is a sum of all of the memory which
2616has been allocated by processes, even if it has not been
2617"used" by them as of yet.
2618A process which allocates 1GB of memory (using
2619.BR malloc (3)
33a0ccb2 2620or similar), but touches only 300MB of that memory will show up
90878f7c 2621as using only 300MB of memory even if it has the address space
3ba3d5b1 2622allocated for the entire 1GB.
cd7b6c40 2623
3ba3d5b1
MK
2624This 1GB is memory which has been "committed" to by the VM
2625and can be used at any time by the allocating application.
cd7b6c40
MK
2626With strict overcommit enabled on the system (mode 2 in
2627IR /proc/sys/vm/overcommit_memory ),
3ba3d5b1
MK
2628allocations which would exceed the
2629.I CommitLimit
cd7b6c40 2630will not be permitted.
3ba3d5b1
MK
2631This is useful if one needs to guarantee that processes will not
2632fail due to lack of memory once that memory has been successfully allocated.
2633.TP
2634.IR VmallocTotal " %lu"
2635Total size of vmalloc memory area.
2636.TP
2637.IR VmallocUsed " %lu"
2638Amount of vmalloc area which is used.
2639.TP
2640.IR VmallocChunk " %lu"
2641Largest contiguous block of vmalloc area which is free.
2642.TP
2643.IR HardwareCorrupted " %lu (since Linux 2.6.32)"
2644(\fBCONFIG_MEMORY_FAILURE\fP is required.)
2645[To be documented.]
2646.TP
2647.IR AnonHugePages " %lu (since Linux 2.6.38)"
2648(\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.)
7fac88a9 2649Non-file backed huge pages mapped into user-space page tables.
3ba3d5b1
MK
2650.TP
2651.IR HugePages_Total " %lu"
2652(\fBCONFIG_HUGETLB_PAGE\fP is required.)
2653The size of the pool of huge pages.
2654.TP
2655.IR HugePages_Free " %lu"
2656(\fBCONFIG_HUGETLB_PAGE\fP is required.)
2657The number of huge pages in the pool that are not yet allocated.
2658.TP
2659.IR HugePages_Rsvd " %lu (since Linux 2.6.17)"
2660(\fBCONFIG_HUGETLB_PAGE\fP is required.)
2661This is the number of huge pages for
2662which a commitment to allocate from the pool has been made,
2663but no allocation has yet been made.
2664These reserved huge pages
2665guarantee that an application will be able to allocate a
2666huge page from the pool of huge pages at fault time.
2667.TP
aa8a6b4f 2668.IR HugePages_Surp " %lu (since Linux 2.6.24)"
3ba3d5b1
MK
2669(\fBCONFIG_HUGETLB_PAGE\fP is required.)
2670This is the number of huge pages in
2671the pool above the value in
2672.IR /proc/sys/vm/nr_hugepages .
2673The maximum number of surplus huge pages is controlled by
2674.IR /proc/sys/vm/nr_overcommit_hugepages .
2675.TP
2676.IR Hugepagesize " %lu"
2677(\fBCONFIG_HUGETLB_PAGE\fP is required.)
2678The size of huge pages.
2679.RE
fea681da 2680.TP
aa341984
MK
2681.I /proc/modules
2682A text list of the modules that have been loaded by the system.
2683See also
2684.BR lsmod (8).
2685.TP
fea681da 2686.I /proc/mounts
c1eea65a 2687Before kernel 2.4.19, this file was a list
9ee4a2b6 2688of all the filesystems currently mounted on the system.
732e54dd 2689With the introduction of per-process mount namespaces in
c1eea65a
MK
2690Linux 2.4.19, this file became a link to
2691.IR /proc/self/mounts ,
732e54dd 2692which lists the mount points of the process's own mount namespace.
fea681da 2693The format of this file is documented in
31e9a9ec 2694.BR fstab (5).
fea681da 2695.TP
fea681da 2696.I /proc/mtrr
c13182ef 2697Memory Type Range Registers.
66a9882e 2698See the Linux kernel source file
cfe70b66 2699.I Documentation/mtrr.txt
fea681da
MK
2700for details.
2701.TP
2702.I /proc/net
2703various net pseudo-files, all of which give the status of some part of
c13182ef
MK
2704the networking layer.
2705These files contain ASCII structures and are,
59a40ed7
MK
2706therefore, readable with
2707.BR cat (1).
c13182ef 2708However, the standard
fea681da
MK
2709.BR netstat (8)
2710suite provides much cleaner access to these files.
2711.TP
2712.I /proc/net/arp
2713This holds an ASCII readable dump of the kernel ARP table used for
c13182ef 2714address resolutions.
01d0a447 2715It will show both dynamically learned and preprogrammed ARP entries.
c13182ef 2716The format is:
fea681da
MK
2717
2718.nf
2719.ft CW
2720.in 8n
2721IP address HW type Flags HW address Mask Device
2722192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0
2723192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0
2724.ft
2725.fi
2726.in
2727
6c04f928 2728Here "IP address" is the IPv4 address of the machine and the "HW type"
c13182ef
MK
2729is the hardware type of the address from RFC\ 826.
2730The flags are the internal
9a67332e
MK
2731flags of the ARP structure (as defined in
2732.IR /usr/include/linux/if_arp.h )
2733and
6c04f928 2734the "HW address" is the data link layer mapping for that IP address if
fea681da
MK
2735it is known.
2736.TP
2737.I /proc/net/dev
c13182ef
MK
2738The dev pseudo-file contains network device status information.
2739This gives
2740the number of received and sent packets, the number of errors and
fea681da 2741collisions
c13182ef
MK
2742and other basic statistics.
2743These are used by the
fea681da 2744.BR ifconfig (8)
c13182ef
MK
2745program to report device status.
2746The format is:
fea681da
MK
2747
2748.nf
2749.ft CW
2750.in 1n
2751Inter-| Receive | Transmit
2752 face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
2753 lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0
2754 eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0
2755 ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0
2756 tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0
2757.in
2758.ft
2759.fi
2760.\" .TP
2761.\" .I /proc/net/ipx
2762.\" No information.
2763.\" .TP
2764.\" .I /proc/net/ipx_route
2765.\" No information.
2766.TP
2767.I /proc/net/dev_mcast
2768Defined in
2769.IR /usr/src/linux/net/core/dev_mcast.c :
2770.nf
2771.in +5
9fdfa163 2772indx interface_name dmi_u dmi_g dmi_address
fea681da
MK
27732 eth0 1 0 01005e000001
27743 eth1 1 0 01005e000001
27754 eth2 1 0 01005e000001
2776.in
2777.fi
2778.TP
2779.I /proc/net/igmp
c13182ef
MK
2780Internet Group Management Protocol.
2781Defined in
fea681da
MK
2782.IR /usr/src/linux/net/core/igmp.c .
2783.TP
2784.I /proc/net/rarp
2785This file uses the same format as the
2786.I arp
2787file and contains the current reverse mapping database used to provide
2788.BR rarp (8)
c13182ef
MK
2789reverse address lookup services.
2790If RARP is not configured into the
fea681da
MK
2791kernel,
2792this file will not be present.
2793.TP
2794.I /proc/net/raw
c13182ef
MK
2795Holds a dump of the RAW socket table.
2796Much of the information is not of
fea681da 2797use
c13182ef 2798apart from debugging.
6c04f928 2799The "sl" value is the kernel hash slot for the
fea681da 2800socket,
6c04f928
MK
2801the "local_address" is the local address and protocol number pair.
2802\&"St" is
c13182ef
MK
2803the internal status of the socket.
2804The "tx_queue" and "rx_queue" are the
fea681da 2805outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 2806The "tr", "tm\->when", and "rexmits" fields are not used by RAW.
fdc196f5
MK
2807The "uid"
2808field holds the effective UID of the creator of the socket.
fea681da
MK
2809.\" .TP
2810.\" .I /proc/net/route
2811.\" No information, but looks similar to
2812.\" .BR route (8).
2813.TP
2814.I /proc/net/snmp
c13182ef 2815This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP
fea681da 2816management
763f0e47 2817information bases for an SNMP agent.
fea681da
MK
2818.TP
2819.I /proc/net/tcp
c13182ef
MK
2820Holds a dump of the TCP socket table.
2821Much of the information is not
2822of use apart from debugging.
2823The "sl" value is the kernel hash slot
6beb1671
MK
2824for the socket, the "local_address" is the local address and port number pair.
2825The "rem_address" is the remote address and port number pair
6c04f928
MK
2826(if connected).
2827\&"St" is the internal status of the socket.
2828The "tx_queue" and "rx_queue" are the
fea681da 2829outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 2830The "tr", "tm\->when", and "rexmits" fields hold internal information of
f33774c4 2831the kernel socket state and are useful only for debugging.
fdc196f5
MK
2832The "uid"
2833field holds the effective UID of the creator of the socket.
fea681da
MK
2834.TP
2835.I /proc/net/udp
c13182ef
MK
2836Holds a dump of the UDP socket table.
2837Much of the information is not of
2838use apart from debugging.
2839The "sl" value is the kernel hash slot for the
6beb1671
MK
2840socket, the "local_address" is the local address and port number pair.
2841The "rem_address" is the remote address and port number pair
f2d607ee
MK
2842(if connected).
2843"St" is the internal status of the socket.
fea681da 2844The "tx_queue" and "rx_queue" are the outgoing and incoming data queue
c13182ef 2845in terms of kernel memory usage.
94e9d9fe 2846The "tr", "tm\->when", and "rexmits" fields
c13182ef 2847are not used by UDP.
fdc196f5
MK
2848The "uid"
2849field holds the effective UID of the creator of the socket.
fea681da
MK
2850The format is:
2851
2852.nf
2853.ft CW
2854.in 1n
94e9d9fe 2855sl local_address rem_address st tx_queue rx_queue tr rexmits tm\->when uid
fea681da
MK
2856 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0
2857 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0
2858 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0
2859.in
2860.ft
2861.fi
2862.TP
2863.I /proc/net/unix
008f1ecc 2864Lists the UNIX domain sockets present within the system and their
c13182ef
MK
2865status.
2866The format is:
fea681da
MK
2867.nf
2868.sp .5
2869.ft CW
2870Num RefCount Protocol Flags Type St Path
2871 0: 00000002 00000000 00000000 0001 03
2872 1: 00000001 00000000 00010000 0001 01 /dev/printer
2873.ft
2874.sp .5
2875.fi
2876
756f55f6
MK
2877The fields are as follows:
2878.RS
2879.TP 10
2880.IR Num :
2881the kernel table slot number.
2882.TP
2883.IR RefCount :
2884the number of users of the socket.
2885.TP
2886.IR Protocol :
2887currently always 0.
2888.TP
2889.IR Flags :
2890the internal kernel flags holding the status of the socket.
2891.TP
2892.IR Type :
a405066e
MK
2893the socket type.
2894For
2895.BR SOCK_STREAM
2896sockets, this is 0001; for
2897.BR SOCK_DGRAM
2898sockets, it is 0002; and for
2899.BR SOCK_SEQPACKET
2900sockets, it is 0005.
756f55f6
MK
2901.TP
2902.IR St :
2903the internal state of the socket.
2904.TP
2905.IR Path :
2906the bound path (if any) of the socket.
8f8a46fb
MK
2907Sockets in the abstract namespace are included in the list,
2908and are shown with a
2909.I Path
2910that commences with the character '@'.
756f55f6 2911.RE
fea681da 2912.TP
ed8de0e4
FW
2913.I /proc/net/netfilter/nfnetlink_queue
2914This file contains information about netfilter userspace queueing, if used.
f2d607ee
MK
2915Each line represents a queue.
2916Queues that have not been subscribed to
ed8de0e4
FW
2917by userspace are not shown.
2918.nf
2919
2920 1 4207 0 2 65535 0 0 0 1
2921 (1) (2) (3)(4) (5) (6) (7) (8)
2922.fi
2923.IP
2924The fields in each line are:
2925.RS 7
2926.TP 5
2927(1)
f2d607ee
MK
2928The ID of the queue.
2929This matches what is specified in the
ed8de0e4
FW
2930.B \-\-queue\-num
2931or
2932.B \-\-queue\-balance
2933options to the
2934.BR iptables (8)
f2d607ee
MK
2935NFQUEUE target.
2936See
ed8de0e4
FW
2937.BR iptables-extensions (8)
2938for more information.
2939.TP
2940(2)
7672e08e 2941The netlink port ID subscribed to the queue.
ed8de0e4
FW
2942.TP
2943(3)
2944The number of packets currently queued and waiting to be processed by
2945the application.
2946.TP
2947(4)
f2d607ee
MK
2948The copy mode of the queue.
2949It is either 1 (metadata only) or 2
ed8de0e4
FW
2950(also copy payload data to userspace).
2951.TP
2952(5)
1dea597b 2953Copy range; that is, how many bytes of packet payload should be copied to
ed8de0e4
FW
2954userspace at most.
2955.TP
2956(6)
f2d607ee
MK
2957queue dropped.
2958Number of packets that had to be dropped by the kernel because
ed8de0e4
FW
2959too many packets are already waiting for userspace to send back the mandatory
2960accept/drop verdicts.
2961.TP
2962(7)
f2d607ee
MK
2963queue user dropped.
2964Number of packets that were dropped within the netlink
2965subsystem.
2966Such drops usually happen when the corresponding socket buffer is
1dea597b 2967full; that is, userspace is not able to read messages fast enough.
ed8de0e4
FW
2968.TP
2969(8)
f2d607ee
MK
2970sequence number.
2971Every queued packet is associated with a (32-bit)
ed8de0e4
FW
2972monotonically-increasing sequence number.
2973This shows the ID of the most recent packet queued.
2974.RE
2975.IP
f33774c4 2976The last number exists only for compatibility reasons and is always 1.
ed8de0e4 2977.TP
fea681da 2978.I /proc/partitions
f042d149
MK
2979Contains the major and minor numbers of each partition as well as the number
2980of 1024-byte blocks and the partition name.
fea681da
MK
2981.TP
2982.I /proc/pci
2983This is a listing of all PCI devices found during kernel initialization
2984and their configuration.
2990d781 2985
59a40ed7
MK
2986This file has been deprecated in favor of a new
2987.I /proc
2990d781
MK
2988interface for PCI
2989.RI ( /proc/bus/pci ).
2990It became optional in Linux 2.2 (available with
2991.B CONFIG_PCI_OLD_PROC
2992set at kernel compilation).
24b74457 2993It became once more nonoptionally enabled in Linux 2.4.
2990d781
MK
2994Next, it was deprecated in Linux 2.6 (still available with
2995.B CONFIG_PCI_LEGACY_PROC
2996set), and finally removed altogether since Linux 2.6.17.
bea08fec
MK
2997.\" FIXME Document /proc/sched_debug
2998.\"
b4e9ee8f
MK
2999.\" .TP
3000.\" .IR /proc/sched_debug " (since Linux 2.6.23)"
69119dc7 3001.\" See also /proc/[pid]/sched
caea7868
MK
3002.TP
3003.IR /proc/profile " (since Linux 2.4)"
3004This file is present only if the kernel was booted with the
3005.I profile=1
3006command-line option.
3007It exposes kernel profiling information in a binary format for use by
3008.BR readprofile (1).
3009Writing (e.g., an empty string) to this file resets the profiling counters;
3010on some architectures,
3011writing a binary integer "profiling multiplier" of size
3012.IR sizeof(int)
8a3ac89a 3013sets the profiling interrupt frequency.
fea681da
MK
3014.TP
3015.I /proc/scsi
59a40ed7
MK
3016A directory with the
3017.I scsi
3018mid-level pseudo-file and various SCSI low-level
2990d781
MK
3019driver directories,
3020which contain a file for each SCSI host in this system, all of
c13182ef
MK
3021which give the status of some part of the SCSI IO subsystem.
3022These files contain ASCII structures and are, therefore, readable with
2990d781 3023.BR cat (1).
fea681da 3024
c13182ef 3025You can also write to some of the files to reconfigure the subsystem or
59a40ed7 3026switch certain features on or off.
fea681da
MK
3027.TP
3028.I /proc/scsi/scsi
c13182ef 3029This is a listing of all SCSI devices known to the kernel.
59a40ed7 3030The listing is similar to the one seen during bootup.
c13182ef 3031scsi currently supports only the \fIadd-single-device\fP command which
59a40ed7
MK
3032allows root to add a hotplugged device to the list of known devices.
3033
3034The command
3035.in +4n
3036.nf
3037
3038echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi
fea681da 3039
59a40ed7
MK
3040.fi
3041.in
c13182ef
MK
3042will cause
3043host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0.
3044If there
fea681da
MK
3045is already a device known on this address or the address is invalid, an
3046error will be returned.
3047.TP
3048.I /proc/scsi/[drivername]
c13182ef
MK
3049\fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740,
3050aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic,
3051scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000.
3052These directories show up for all drivers that registered at least one
59a40ed7 3053SCSI HBA.
c13182ef 3054Every directory contains one file per registered host.
59a40ed7 3055Every host-file is named after the number the host was assigned during
c13182ef 3056initialization.
fea681da 3057
c13182ef 3058Reading these files will usually show driver and host configuration,
f78ed33a 3059statistics, and so on.
fea681da
MK
3060
3061Writing to these files allows different things on different hosts.
3062For example, with the \fIlatency\fP and \fInolatency\fP commands,
3063root can switch on and off command latency measurement code in the
c13182ef
MK
3064eata_dma driver.
3065With the \fIlockup\fP and \fIunlock\fP commands,
3066root can control bus lockups simulated by the scsi_debug driver.
fea681da
MK
3067.TP
3068.I /proc/self
59a40ed7
MK
3069This directory refers to the process accessing the
3070.I /proc
9ee4a2b6 3071filesystem,
59a40ed7
MK
3072and is identical to the
3073.I /proc
3074directory named by the process ID of the same process.
fea681da
MK
3075.TP
3076.I /proc/slabinfo
c13182ef 3077Information about kernel caches.
90878f7c 3078Since Linux 2.6.16 this file is present only if the
821643a8
MK
3079.B CONFIG_SLAB
3080kernel configuration option is enabled.
350038ff 3081The columns in
38f76cd2 3082.I /proc/slabinfo
350038ff 3083are:
a08ea57c 3084.in +4n
fea681da 3085.nf
a08ea57c 3086
fea681da
MK
3087cache-name
3088num-active-objs
3089total-objs
3090object-size
3091num-active-slabs
3092total-slabs
3093num-pages-per-slab
3094.fi
a08ea57c
MK
3095.in
3096
c13182ef 3097See
fea681da
MK
3098.BR slabinfo (5)
3099for details.
3100.TP
3101.I /proc/stat
c13182ef
MK
3102kernel/system statistics.
3103Varies with architecture.
3104Common
fea681da
MK
3105entries include:
3106.RS
3107.TP
3108\fIcpu 3357 0 4313 1362393\fP
bfbfcd18 3109The amount of time, measured in units of
268f000b
MK
3110USER_HZ (1/100ths of a second on most architectures, use
3111.IR sysconf(_SC_CLK_TCK)
3112to obtain the right value),
b81087ab 3113.\" 1024 on Alpha and ia64
ae3b8047
MK
3114that the system spent in various states:
3115.RS
3116.TP
3117.I user
ea0841f6 3118(1) Time spent in user mode.
ae3b8047
MK
3119.TP
3120.I nice
0633f951 3121(2) Time spent in user mode with low priority (nice).
9f1b9726 3122.TP
ae3b8047 3123.I system
0633f951 3124(3) Time spent in system mode.
ae3b8047
MK
3125.TP
3126.I idle
ea0841f6 3127(4) Time spent in the idle task.
bea08fec 3128.\" FIXME . Actually, the following info about the /proc/stat 'cpu' field
e04a1f93
MK
3129.\" does not seem to be quite right (at least in 2.6.12 or 3.6):
3130.\" the idle time in /proc/uptime does not quite match this value
3131This value should be USER_HZ times the
4cb1deb7
MK
3132second entry in the
3133.I /proc/uptime
3134pseudo-file.
ae3b8047
MK
3135.TP
3136.IR iowait " (since Linux 2.5.41)"
ea0841f6 3137(5) Time waiting for I/O to complete.
ae3b8047
MK
3138.TP
3139.IR irq " (since Linux 2.6.0-test4)"
ea0841f6 3140(6) Time servicing interrupts.
ae3b8047 3141.TP
0633f951 3142.IR softirq " (since Linux 2.6.0-test4)"
ea0841f6 3143(7) Time servicing softirqs.
ae3b8047
MK
3144.TP
3145.IR steal " (since Linux 2.6.11)"
ea0841f6 3146(8) Stolen time, which is the time spent in other operating systems when
9de1f6cc 3147running in a virtualized environment
ae3b8047
MK
3148.TP
3149.IR guest " (since Linux 2.6.24)"
0633f951 3150(9) Time spent running a virtual CPU for guest
afef1764 3151operating systems under the control of the Linux kernel.
14c06953 3152.\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de
d4fd4120
MK
3153.TP
3154.IR guest_nice " (since Linux 2.6.33)"
3155.\" commit ce0e7b28fb75cb003cfc8d0238613aaf1c55e797
3156(10) Time spent running a niced guest (virtual CPU for guest
3157operating systems under the control of the Linux kernel).
ae3b8047 3158.RE
fea681da
MK
3159.TP
3160\fIpage 5741 1808\fP
3161The number of pages the system paged in and the number that were paged
3162out (from disk).
3163.TP
3164\fIswap 1 0\fP
3165The number of swap pages that have been brought in and out.
3166.TP
bea08fec 3167.\" FIXME . The following is not the full picture for the 'intr' of
777f5a9e 3168.\" /proc/stat on 2.6:
fea681da 3169\fIintr 1462898\fP
bfbfcd18
MK
3170This line shows counts of interrupts serviced since boot time,
3171for each of the possible system interrupts.
d63ff76e 3172The first column is the total of all interrupts serviced
d6a56978
MK
3173including unnumbered architecture specific interrupts;
3174each subsequent column is the total for that particular numbered interrupt.
d63ff76e 3175Unnumbered interrupts are not shown, only summed into the total.
fea681da
MK
3176.TP
3177\fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP...
636297e9 3178(major,disk_idx):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written)
bfbfcd18
MK
3179.br
3180(Linux 2.4 only)
fea681da
MK
3181.TP
3182\fIctxt 115315\fP
3183The number of context switches that the system underwent.
3184.TP
3185\fIbtime 769041601\fP
f49c451a 3186boot time, in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
fea681da
MK
3187.TP
3188\fIprocesses 86031\fP
3189Number of forks since boot.
bfbfcd18
MK
3190.TP
3191\fIprocs_running 6\fP
3192Number of processes in runnable state.
5fab2e7c 3193(Linux 2.5.45 onward.)
bfbfcd18
MK
3194.TP
3195\fIprocs_blocked 2\fP
3196Number of processes blocked waiting for I/O to complete.
5fab2e7c 3197(Linux 2.5.45 onward.)
fea681da
MK
3198.RE
3199.TP
3200.I /proc/swaps
c13182ef
MK
3201Swap areas in use.
3202See also
fea681da
MK
3203.BR swapon (8).
3204.TP
3205.I /proc/sys
3206This directory (present since 1.3.57) contains a number of files
3207and subdirectories corresponding to kernel variables.
3208These variables can be read and sometimes modified using
9ee4a2b6 3209the \fI/proc\fP filesystem, and the (deprecated)
fea681da 3210.BR sysctl (2)
c13182ef 3211system call.
fea681da 3212.TP
6ab7c0aa 3213.IR /proc/sys/abi " (since Linux 2.4.10)"
fea681da 3214This directory may contain files with application binary information.
6ab7c0aa 3215.\" On some systems, it is not present.
66a9882e 3216See the Linux kernel source file
6ab7c0aa
MK
3217.I Documentation/sysctl/abi.txt
3218for more information.
fea681da
MK
3219.TP
3220.I /proc/sys/debug
3221This directory may be empty.
3222.TP
3223.I /proc/sys/dev
e2badfdf 3224This directory contains device-specific information (e.g.,
9a67332e 3225.IR dev/cdrom/info ).
fea681da
MK
3226On
3227some systems, it may be empty.
3228.TP
3229.I /proc/sys/fs
49236d3c 3230This directory contains the files and subdirectories for kernel variables
9ee4a2b6 3231related to filesystems.
fea681da
MK
3232.TP
3233.I /proc/sys/fs/binfmt_misc
c13182ef 3234Documentation for files in this directory can be found
66a9882e 3235in the Linux kernel sources in
fea681da
MK
3236.IR Documentation/binfmt_misc.txt .
3237.TP
59a40ed7
MK
3238.IR /proc/sys/fs/dentry-state " (since Linux 2.2)"
3239This file contains information about the status of the
3240directory cache (dcache).
3241The file contains six numbers,
c13182ef 3242.IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), "
59a40ed7 3243.I want_pages
fea681da 3244(pages requested by system) and two dummy values.
59a40ed7
MK
3245.RS
3246.IP * 2
3247.I nr_dentry
3248is the number of allocated dentries (dcache entries).
3249This field is unused in Linux 2.2.
3250.IP *
3251.I nr_unused
3252is the number of unused dentries.
3253.IP *
3254.I age_limit
3255.\" looks like this is unused in kernels 2.2 to 2.6
3256is the age in seconds after which dcache entries
3257can be reclaimed when memory is short.
3258.IP *
3259.I want_pages
3260.\" looks like this is unused in kernels 2.2 to 2.6
c7094399 3261is nonzero when the kernel has called shrink_dcache_pages() and the
fea681da 3262dcache isn't pruned yet.
59a40ed7 3263.RE
fea681da
MK
3264.TP
3265.I /proc/sys/fs/dir-notify-enable
3266This file can be used to disable or enable the
3267.I dnotify
3268interface described in
3269.BR fcntl (2)
3270on a system-wide basis.
3271A value of 0 in this file disables the interface,
3272and a value of 1 enables it.
3273.TP
3274.I /proc/sys/fs/dquot-max
3275This file shows the maximum number of cached disk quota entries.
3276On some (2.4) systems, it is not present.
3277If the number of free cached disk quota entries is very low and
3278you have some awesome number of simultaneous system users,
3279you might want to raise the limit.
3280.TP
3281.I /proc/sys/fs/dquot-nr
3282This file shows the number of allocated disk quota
3283entries and the number of free disk quota entries.
3284.TP
24cb4a4b 3285.IR /proc/sys/fs/epoll " (since Linux 2.6.28)"
242b46af
MK
3286This directory contains the file
3287.IR max_user_watches ,
24cb4a4b
MK
3288which can be used to limit the amount of kernel memory consumed by the
3289.I epoll
3290interface.
3291For further details, see