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