]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/proc.5
CPU_ZERO_S.3: New link to new CPU_SET.3
[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
MK
8.\"
9.\" This is free documentation; you can redistribute it and/or
10.\" modify it under the terms of the GNU General Public License as
11.\" published by the Free Software Foundation; either version 2 of
12.\" the License, or (at your option) any later version.
13.\"
14.\" The GNU General Public License's references to "object code"
15.\" and "executables" are to be interpreted as the output of any
16.\" document formatting or typesetting system, including
17.\" intermediate and printed output.
18.\"
19.\" This manual is distributed in the hope that it will be useful,
20.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
21.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22.\" GNU General Public License for more details.
23.\"
24.\" You should have received a copy of the GNU General Public
25.\" License along with this manual; if not, write to the Free
26.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
27.\" USA.
28.\"
29.\" Modified 1995-05-17 by faith@cs.unc.edu
30.\" Minor changes by aeb and Marty Leisner (leisner@sdsp.mc.xerox.com).
31.\" Modified 1996-04-13, 1996-07-22 by aeb@cwi.nl
32.\" Modified 2001-12-16 by rwhron@earthlink.net
33.\" Modified 2002-07-13 by jbelton@shaw.ca
34.\" Modified 2002-07-22, 2003-05-27, 2004-04-06, 2004-05-25
c11b1abf 35.\" by Michael Kerrisk <mtk.manpages@gmail.com>
5d6d14a0
MK
36.\" 2004-11-17, mtk -- updated notes on /proc/loadavg
37.\" 2004-12-01, mtk, rtsig-max and rtsig-nr went away in 2.6.8
568105c6
MK
38.\" 2004-12-14, mtk, updated 'statm', and fixed error in order of list
39.\" 2005-05-12, mtk, updated 'stat'
6d64ca9c 40.\" 2005-07-13, mtk, added /proc/sys/fs/mqueue/*
363f747c
MK
41.\" 2005-09-16, mtk, Added /proc/sys/fs/suid_dumpable
42.\" 2005-09-19, mtk, added /proc/zoneinfo
b4e9ee8f 43.\" 2005-03-01, mtk, moved /proc/sys/fs/mqueue/* material to mq_overview.7.
69119dc7
MK
44.\" 2008-06-05, mtk, Added /proc/[pid]/oom_score, /proc/[pid]/oom_adj,
45.\" /proc/[pid]/limits, /proc/[pid]/mountinfo, /proc/[pid]/mountstats,
46.\" and /proc/[pid]/fdinfo/*.
47.\" 2008-06-19, mtk, Documented /proc/[pid]/status.
cc2d5c36 48.\" 2008-07-15, mtk, added /proc/config.gz
363f747c 49.\"
c533af9d 50.\" FIXME 2.6.13 seems to have /proc/vmcore implemented
c13182ef
MK
51.\" in the source code, but there is no option available under
52.\" 'make xconfig'; eventually this should be fixed, and then info
53.\" from the patch-2.6.13 and change log could be used to write an
c533af9d 54.\" entry in this man page.
cc2d5c36 55.\" Needs CONFIG_VMCORE
8cf9de1b 56.\"
c13182ef
MK
57.\" FIXME cross check against Documentation/filesystems/proc.txt
58.\" to see what information could be imported from that file
c533af9d 59.\" into this file.
fea681da 60.\"
fa802e7b 61.TH PROC 5 2008-10-16 "Linux" "Linux Programmer's Manual"
fea681da 62.SH NAME
24d01c53 63proc \- process information pseudo-file system
fea681da
MK
64.SH DESCRIPTION
65The
66.I proc
24d01c53 67file system is a pseudo-file system which is used as an interface to
c13182ef
MK
68kernel data structures.
69It is commonly mounted at
fea681da 70.IR /proc .
c13182ef 71Most of it is read-only, but some files allow kernel variables to be
fea681da
MK
72changed.
73.LP
743638fd
MK
74The following outline gives a quick tour through the
75.I /proc
76hierarchy.
fea681da
MK
77.PD 1
78.TP
69119dc7 79.I /proc/[pid]
fea681da
MK
80There is a numerical subdirectory for each running process; the
81subdirectory is named by the process ID.
82Each such subdirectory contains the following
83pseudo-files and directories.
69119dc7
MK
84.\" FIXME Describe /proc/[pid]/attr and
85.\" /proc/[pid]/task/[tid]/attr
b4e9ee8f
MK
86.\" This is a directory
87.\" Added in ???
88.\" CONFIG_SECURITY
89.\"
fea681da 90.TP
69119dc7 91.IR /proc/[pid]/auxv " (since 2.6.0-test7)"
857f1942 92This contains the contents of the ELF interpreter information passed
c13182ef 93to the process at exec time.
857f1942 94The format is one \fIunsigned long\fP ID
c13182ef 95plus one \fIunsigned long\fP value for each entry.
857f1942 96The last entry contains two zeros.
69119dc7
MK
97.\" FIXME Describe /proc/[pid]/cgroup and
98.\" /proc/[pid]/task/[tid]/cgroup
b4e9ee8f
MK
99.\" Info in Documentation/cgroups.txt
100.\" Added in 2.6.24
101.\" CONFIG_CGROUPS
102.\"
69119dc7 103.\" FIXME Describe /proc/[pid]/clear_refs
b4e9ee8f
MK
104.\" Added in 2.6.22
105.\" "Clears page referenced bits shown in smaps output"
106.\" write-only
107.\" CONFIG_PROC_PAGE_MONITOR
857f1942 108.TP
69119dc7 109.I /proc/[pid]/cmdline
b447cd58
MK
110This holds the complete command line for the process,
111unless the process is a zombie.
112.\" In 2.3.26, this also used to be true if the process was swapped out.
113In the latter case, there is nothing in this file:
75b94dc3 114that is, a read on this file will return 0 characters.
b447cd58 115The command-line arguments appear in this file as a set of
59a40ed7
MK
116null-separated strings,
117with a further null byte (\(aq\\0\(aq) after the last string.
fea681da 118.TP
69119dc7 119.IR /proc/[pid]/coredump_filter " (since kernel 2.6.23)"
b4e9ee8f
MK
120See
121.BR core (5).
5c411b17 122.TP
69119dc7
MK
123.IR /proc/[pid]/cpuset " (since kernel 2.6.12)"
124.\" and/proc/[pid]/task/[tid]/cpuset
5c411b17
MK
125See
126.BR cpuset (7).
b4e9ee8f 127.TP
69119dc7 128.I /proc/[pid]/cwd
c13182ef 129This is a symbolic link to the current working directory of the process.
59a40ed7
MK
130To find out the current working directory of process 20,
131for instance, you can do this:
fea681da 132
59a40ed7 133.in +4n
fea681da 134.nf
b43a3b30 135.RB "$" " cd /proc/20/cwd; /bin/pwd"
fea681da 136.fi
59a40ed7 137.in
fea681da 138
c13182ef
MK
139Note that the
140.I pwd
e7b489f0 141command is often a shell built-in, and might
c13182ef 142not work properly.
743638fd
MK
143In
144.BR bash (1),
145you may use
146.IR "pwd\ \-P" .
afcaf646
MK
147
148.\" The following was still true as at kernel 2.6.13
c13182ef
MK
149In a multithreaded process, the contents of this symbolic link
150are not available if the main thread has already terminated
afcaf646 151(typically by calling
59a40ed7 152.BR pthread_exit (3)).
fea681da 153.TP
69119dc7 154.I /proc/[pid]/environ
fea681da 155This file contains the environment for the process.
f81fb444 156The entries are separated by null bytes (\(aq\\0\(aq),
b4e9ee8f 157and there may be a null byte at the end.
fea681da 158Thus, to print out the environment of process 1, you would do:
a08ea57c 159.in +4n
fea681da 160.nf
a08ea57c 161
fea681da 162.ft CW
b43a3b30 163.RB "$" " (cat /proc/1/environ; echo) | tr \(aq\e000\(aq \(aq\en\(aq"
fea681da
MK
164.fi
165.ft P
a08ea57c 166.in
fea681da 167.TP
69119dc7 168.I /proc/[pid]/exe
fea681da 169Under Linux 2.2 and later, this file is a symbolic link
2d7195b8 170containing the actual pathname of the executed command.
c13182ef
MK
171This symbolic link can be dereferenced normally; attempting to open
172it will open the executable.
173You can even type
69119dc7 174.I /proc/[pid]/exe
c13182ef 175to run another copy of the same executable as is being run by
69119dc7 176process [pid].
afcaf646 177.\" The following was still true as at kernel 2.6.13
c13182ef
MK
178In a multithreaded process, the contents of this symbolic link
179are not available if the main thread has already terminated
afcaf646
MK
180(typically by calling
181.BR pthread_exit (3)).
fea681da
MK
182
183Under Linux 2.0 and earlier
69119dc7 184.I /proc/[pid]/exe
c13182ef
MK
185is a pointer to the binary which was executed,
186and appears as a symbolic link.
187A
fea681da
MK
188.BR readlink (2)
189call on this file under Linux 2.0 returns a string in the format:
190
59a40ed7 191 [device]:inode
fea681da
MK
192
193For example, [0301]:1502 would be inode 1502 on device major 03 (IDE,
194MFM, etc. drives) minor 01 (first partition on the first drive).
195
196.BR find (1)
59a40ed7
MK
197with the
198.I \-inum
199option can be used to locate the file.
fea681da 200.TP
69119dc7 201.I /proc/[pid]/fd
fea681da
MK
202This is a subdirectory containing one entry for each file which the
203process has open, named by its file descriptor, and which is a
c13182ef
MK
204symbolic link to the actual file.
205Thus, 0 is standard input, 1 standard output, 2 standard error, etc.
fea681da 206
afcaf646
MK
207.\" The following was still true as at kernel 2.6.13
208In a multithreaded process, the contents of this directory
c13182ef 209are not available if the main thread has already terminated
afcaf646
MK
210(typically by calling
211.BR pthread_exit (3)).
212
59a40ed7
MK
213Programs that will take a filename as a command-line argument,
214but will not take input from standard input if no argument is supplied,
215or that write to a file named as a command-line argument,
216but will not send their output to standard output
217if no argument is supplied, can nevertheless be made to use
218standard input or standard out using
69119dc7 219.IR /proc/[pid]/fd .
59a40ed7
MK
220For example, assuming that
221.I \-i
222is the flag designating an input file and
223.I \-o
224is the flag designating an output file:
a08ea57c 225.in +4n
fea681da
MK
226.nf
227
b43a3b30 228.RB "$" " foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ..."
fea681da 229.fi
a08ea57c
MK
230.in
231
fea681da
MK
232and you have a working filter.
233.\" The following is not true in my tests (MTK):
234.\" Note that this will not work for
235.\" programs that seek on their files, as the files in the fd directory
236.\" are not seekable.
237
59a40ed7
MK
238.I /proc/self/fd/N
239is approximately the same as
240.I /dev/fd/N
8ee190da 241in some Unix and Unix-like systems.
c13182ef 242Most Linux MAKEDEV scripts symbolically link
59a40ed7
MK
243.I /dev/fd
244to
245.IR /proc/self/fd ,
246in fact.
247
248Most systems provide symbolic links
249.IR /dev/stdin ,
250.IR /dev/stdout ,
251and
252.IR /dev/stderr ,
253which respectively link to the files
254.IR 0 ,
255.IR 1 ,
256and
257.IR 2
258in
259.IR /proc/self/fd .
260Thus the example command above could be written as:
261.in +4n
262.nf
263
b43a3b30 264.RB "$" " foobar \-i /dev/stdin \-o /dev/stdout ..."
59a40ed7
MK
265.fi
266.in
69119dc7 267.\" FIXME Describe /proc/[pid]/loginuid
b877b392 268.\" Added in 2.6.11; updating requires CAP_AUDIT_CONTROL
b4e9ee8f
MK
269.\" CONFIG_AUDITSYSCALL
270.TP
69119dc7 271.IR /proc/[pid]/fdinfo/ " (since kernel 2.6.22)"
b4e9ee8f
MK
272This is a subdirectory containing one entry for each file which the
273process has open, named by its file descriptor.
274The contents of each file can be read to obtain information
275about the corresponding file descriptor, for example:
276.in +4n
277.nf
278
b43a3b30 279.RB "$" " cat /proc/12015/fdinfo/4"
b4e9ee8f
MK
280pos: 1000
281flags: 01002002
282.fi
283.in
284
285The
286.I pos
287field is a decimal number showing the current file offset.
288The
289.I flags
290field is an octal number that displays the
291file access mode and file status flags (see
292.BR open (2)).
293
294The files in this directory are readable only by the owner of the process.
69119dc7 295.\" FIXME document /proc/[pid]/io
b4e9ee8f 296.\" .TP
69119dc7 297.\" .IR /proc/[pid]/io " (since kernel 2.6.20)"
b4e9ee8f 298.TP
69119dc7 299.IR /proc/[pid]/limits " (since kernel 2.6.24)"
b4e9ee8f
MK
300This file displays the soft limit, hard limit, and units of measurement
301for each of the process's resource limits (see
59a40ed7 302.BR getrlimit (2)).
b4e9ee8f 303The file is protected to only allow reading by the real UID of the process.
fea681da 304.TP
69119dc7 305.I /proc/[pid]/maps
fea681da
MK
306A file containing the currently mapped memory regions and their access
307permissions.
308
309The format is:
310
311.nf
312.ft CW
3bc960c2
MK
313address perms offset dev inode pathname
31408048000-08056000 r-xp 00000000 03:0c 64593 /usr/sbin/gpm
31508056000-08058000 rw-p 0000d000 03:0c 64593 /usr/sbin/gpm
fea681da 31608058000-0805b000 rwxp 00000000 00:00 0
3bc960c2
MK
31740000000-40013000 r-xp 00000000 03:0c 4165 /lib/ld-2.2.4.so
31840013000-40015000 rw-p 00012000 03:0c 4165 /lib/ld-2.2.4.so
3194001f000-40135000 r-xp 00000000 03:0c 45494 /lib/libc-2.2.4.so
32040135000-4013e000 rw-p 00115000 03:0c 45494 /lib/libc-2.2.4.so
fea681da
MK
3214013e000-40142000 rw-p 00000000 00:00 0
322bffff000-c0000000 rwxp 00000000 00:00 0
323.ft
324.fi
fea681da 325
59a40ed7
MK
326where "address" is the address space in the process that it occupies,
327"perms" is a set of permissions:
fea681da
MK
328
329.nf
330.in +5
331r = read
332w = write
333x = execute
334s = shared
335p = private (copy on write)
336.fi
337.in
338
59a40ed7
MK
339"offset" is the offset into the file/whatever, "dev" is the device
340(major:minor), and "inode" is the inode on that device.
3410 indicates that no inode is associated with the memory region,
342as the case would be with BSS (uninitialized data).
fea681da
MK
343
344Under Linux 2.0 there is no field giving pathname.
345.TP
69119dc7 346.I /proc/[pid]/mem
fea681da
MK
347This file can be used to access the pages of a process's memory through
348.BR open (2),
349.BR read (2),
350and
ccb2bb0d 351.BR lseek (2).
b4e9ee8f 352.TP
69119dc7 353.IR /proc/[pid]/mountinfo " (since Linux 2.6.26)"
b4e9ee8f
MK
354.\" This info adapted from Documentation/filesystems/proc.txt
355This file contains information about mount points.
356It contains lines of the form:
357.nf
358.ft CW
b4e9ee8f
MK
359
36036 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue
361(1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11)
b4e9ee8f
MK
362.ft
363.fi
364.IP
365The numbers in parentheses are labels for the descriptions below:
3bc960c2 366.RS 7
b4e9ee8f
MK
367.TP 5
368(1)
369mount ID: unique identifier of the mount (may be reused after
370.BR umount (2)).
371.TP
372(2)
373parent ID: ID of parent mount (or of self for the top of the mount tree).
374.TP
375(3)
376major:minor: value of
377.I st_dev
378for files on file system (see
379.BR stat (2)).
380.TP
381(4)
382root: root of the mount within the file system.
383.TP
384(5)
385mount point: mount point relative to the process's root.
386.TP
387(6)
388mount options: per-mount options.
389.TP
390(7)
391optional fields: zero or more fields of the form "tag[:value]".
392.TP
393(8)
394separator: marks the end of the optional fields.
395.TP
396(9)
397file system type: name of file system in the form "type[.subtype]".
398.TP
399(10)
400mount source: file system-specific information or "none".
401.TP
402(11)
403super options: per-super block options.
404.RE
405.IP
406Parsers should ignore all unrecognized optional fields.
407Currently the possible optional fields are:
408.RS 12
409.TP 18
410shared:X
411mount is shared in peer group X
412.TP
413master:X
414mount is slave to peer group X
415.TP
416propagate_from:X
417mount is slave and receives propagation from peer group X (*)
418.TP
419unbindable
420mount is unbindable
421.RE
422.IP
423(*) X is the closest dominant peer group under the process's root.
424If X is the immediate master of the mount,
425or if there is no dominant peer group under the same root,
426then only the "master:X" field is present
427and not the "propagate_from:X" field.
428
429For more information on mount propagation see:
430.I Documentation/filesystems/sharedsubtree.txt
431in the kernel source tree.
432.TP
cea61382
MK
433.IR /proc/[pid]/mounts " (since Linux 2.4.19)"
434This is a list of all the file systems currently mounted in the
435process's namespace.
436The format of this file is documented in
437.BR fstab (5).
438Since kernel version 2.6.15, this file is pollable:
439after opening the file for reading, a change in this file
440(i.e., a file system mount or unmount) causes
441.BR select (2)
442to mark the file descriptor as readable, and
443.BR poll (2)
444and
445.BR epoll_wait (2)
446mark the file as having an error condition.
447.TP
69119dc7 448.IR /proc/[pid]/mountstats " (since Linux 2.6.17)"
783a6233 449This file exports information (statistics, configuration information)
b4e9ee8f
MK
450about the mount points in the process's name space.
451Lines in this file have the form:
452.nf
453
454device /dev/sda7 mounted on /home with fstype ext3 [statistics]
455( 1 ) ( 2 ) (3 ) (4)
456.fi
457.IP
458The fields in each line are:
3bc960c2 459.RS 7
b4e9ee8f
MK
460.TP 5
461(1)
462The name of the mounted device
463(or "nodevice" if there is no corresponding device).
464.TP
465(2)
466The mount point within the file system tree.
467.TP
468(3)
469The file system type.
470.TP
471(4)
472Optional statistics and configuration information.
473Currently (as at Linux 2.6.26), only NFS file systems export
474information via this field.
475.RE
476.IP
477This file is only readable by the owner of the process.
b4e9ee8f 478.TP
69119dc7 479.IR /proc/[pid]/numa_maps " (since Linux 2.6.14)"
610f75cc
MK
480See
481.BR numa (7).
7388733a 482.TP
69119dc7 483.IR /proc/[pid]/oom_adj " (since Linux 2.6.11)"
b4e9ee8f 484This file can be used to adjust the score used to select which process
0425de01 485should be killed in an out-of-memory (OOM) situation.
b4e9ee8f
MK
486The kernel uses this value for a bit-shift operation of the process's
487.IR oom_score
488value:
5b8dbfd4
MK
489valid values are in the range \-16 to +15,
490plus the special value \-17,
b4e9ee8f
MK
491which disables OOM-killing altogether for this process.
492A positive score increases the likelihood of this
493process being killed by the OOM-killer;
494a negative score decreases the likelihood.
495The default value for this file is 0;
496a new process inherits its parent's
497.I oom_adj
498setting.
499A process must be privileged
500.RB ( CAP_SYS_RESOURCE )
501to update this file.
502.TP
69119dc7 503.IR /proc/[pid]/oom_score " (since Linux 2.6.11)"
b4e9ee8f
MK
504.\" See mm/oom_kill.c::badness() in the 2.6.25 sources
505This file displays the current score that the kernel gives to
506this process for the purpose of selecting a process
507for the OOM-killer.
508A higher score means that the process is more likely to be
509selected by the OOM-killer.
510The basis for this score is the amount of memory used by the process,
511with increases (+) or decreases (\-) for factors including:
512.\" See mm/oom_kill.c::badness() in the 2.6.25 sources
513.RS
514.IP * 2
515whether the process creates a lot of children using
516.BR fork (2)
517(+);
518.IP *
519whether the process has been running a long time,
520or has used a lot of CPU time (\-);
521.IP *
522whether the process has a low nice value (i.e., > 0) (+);
523.IP *
524whether the process is privileged (\-); and
525.\" More precisely, if it has CAP_SYS_ADMIN or CAP_SYS_RESOURCE
526.IP *
527whether the process is making direct hardware access (\-).
528.\" More precisely, if it has CAP_SYS_RAWIO
529.RE
530.IP
531The
532.I oom_score
533also reflects the bit-shift adjustment specified by the
534.I oom_adj
535setting for the process.
69119dc7 536.\" FIXME Describe /proc/[pid]/pagemap
b4e9ee8f
MK
537.\" Added in 2.6.25
538.\" CONFIG_PROC_PAGE_MONITOR
fea681da 539.TP
69119dc7 540.I /proc/[pid]/root
fea681da 541Unix and Linux support the idea of a per-process root of the
24d01c53 542file system, set by the
fea681da 543.BR chroot (2)
c13182ef
MK
544system call.
545This file is a symbolic link that points to the process's
fea681da 546root directory, and behaves as exe, fd/*, etc. do.
afcaf646
MK
547
548.\" The following was still true as at kernel 2.6.13
c13182ef
MK
549In a multithreaded process, the contents of this symbolic link
550are not available if the main thread has already terminated
afcaf646
MK
551(typically by calling
552.BR pthread_exit (3)).
69119dc7 553.\" FIXME Describe /proc/[pid]/seccomp
6aefb6df 554.\" Added in 2.6.12
69119dc7 555.\" FIXME Describe /proc/[pid]/sessionid
b4e9ee8f
MK
556.\" Added in 2.6.25; read-only; only readable by real UID
557.\" CONFIG_AUDITSYSCALL
69119dc7 558.\" FIXME Describe /proc/[pid]/sched
b4e9ee8f
MK
559.\" Added in 2.6.23
560.\" CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS
561.\" Displays various scheduling parameters
562.\" This file can be written, to reset stats
69119dc7
MK
563.\" FIXME Describe /proc/[pid]/schedstats and
564.\" /proc/[pid]/task/[tid]/schedstats
b4e9ee8f
MK
565.\" Added in 2.6.9
566.\" CONFIG_SCHEDSTATS
fea681da 567.TP
69119dc7 568.IR /proc/[pid]/smaps " (since Linux 2.6.14)"
b4e9ee8f 569.\" CONFIG_PROC_PAGE_MONITOR
b07b19c4 570This file shows memory consumption for each of the process's mappings.
59a40ed7 571For each of mappings there is a series of lines such as the following:
a08ea57c 572.in +4n
b07b19c4
MK
573.nf
574
57508048000-080bc000 r-xp 00000000 03:02 13130 /bin/bash
576Size: 464 kB
577Rss: 424 kB
578Shared_Clean: 424 kB
579Shared_Dirty: 0 kB
580Private_Clean: 0 kB
581Private_Dirty: 0 kB
582
583.fi
a08ea57c 584.in
b07b19c4
MK
585The first of these lines shows the same information as is displayed
586for the mapping in
69119dc7 587.IR /proc/[pid]/maps .
b07b19c4
MK
588The remaining lines show the size of the mapping,
589the amount of the mapping that is currently resident in RAM,
590the number clean and dirty shared pages in the mapping,
591and the number clean and dirty private pages in the mapping.
592
097585ed
MK
593This file is only present if the
594.B CONFIG_MMU
595kernel configuration
b07b19c4
MK
596option is enabled.
597.TP
69119dc7 598.I /proc/[pid]/stat
c13182ef
MK
599Status information about the process.
600This is used by
601.BR ps (1).
602It is defined in
fea681da
MK
603.IR /usr/src/linux/fs/proc/array.c "."
604
605The fields, in order, with their proper
606.BR scanf (3)
607format specifiers, are:
608.RS
59a40ed7 609.TP 12
fea681da 610\fIpid\fP %d
357cf3fe 611The process ID.
fea681da
MK
612.TP
613\fIcomm\fP %s
c13182ef
MK
614The filename of the executable, in parentheses.
615This is visible whether or not the executable is swapped out.
fea681da
MK
616.TP
617\fIstate\fP %c
618One character from the string "RSDZTW" where R is running, S is
619sleeping in an interruptible wait, D is waiting in uninterruptible
620disk sleep, Z is zombie, T is traced or stopped (on a signal),
621and W is paging.
622.TP
623\fIppid\fP %d
624The PID of the parent.
625.TP
626\fIpgrp\fP %d
627The process group ID of the process.
628.TP
629\fIsession\fP %d
630The session ID of the process.
631.TP
fea681da 632\fItty_nr\fP %d
59a40ed7
MK
633The controlling terminal of the process.
634(The minor device number is contained in the combination of bits
63531 to 20 and 7 to 0;
636the major device number is in bits 15 t0 8.)
fea681da
MK
637.TP
638\fItpgid\fP %d
639.\" This field and following, up to and including wchan added 0.99.1
59a40ed7
MK
640The ID of the foreground process group of the controlling
641terminal of the process.
fea681da 642.TP
2ebfeb1b 643\fIflags\fP %u (%lu before Linux 2.6.22)
c13182ef
MK
644The kernel flags word of the process.
645For bit meanings,
fea681da
MK
646see the PF_* defines in
647.IR <linux/sched.h> .
648Details depend on the kernel version.
649.TP
650\fIminflt\fP %lu
651The number of minor faults the process has made which have not
652required loading a memory page from disk.
653.TP
59a40ed7 654.\" field 11
fea681da
MK
655\fIcminflt\fP %lu
656The number of minor faults that the process's
657waited-for children have made.
658.TP
659\fImajflt\fP %lu
660The number of major faults the process has made which have
661required loading a memory page from disk.
662.TP
663\fIcmajflt\fP %lu
664The number of major faults that the process's
665waited-for children have made.
666.TP
667\fIutime\fP %lu
7a017e24
MK
668Amount of time that this process has been scheduled in user mode,
669measured in clock ticks (divide by
670.IR sysconf(_SC_CLK_TCK) .
a1c9dc59
MK
671This includes guest time, \fIguest_time\fP
672(time spent running a virtual CPU, see below),
673so that applications that are not aware of the guest time field
674do not lose that time from their calculations.
fea681da
MK
675.TP
676\fIstime\fP %lu
7a017e24
MK
677Amount of time that this process has been scheduled in kernel mode,
678measured in clock ticks (divide by
679.IR sysconf(_SC_CLK_TCK) .
fea681da
MK
680.TP
681\fIcutime\fP %ld
7a017e24
MK
682Amount of time that this process's
683waited-for children have been scheduled in user mode,
684measured in clock ticks (divide by
685.IR sysconf(_SC_CLK_TCK) .
c13182ef 686(See also
fea681da 687.BR times (2).)
a1c9dc59
MK
688This includes guest time, \fIcguest_time\fP
689(time spent running a virtual CPU, see below).
fea681da
MK
690.TP
691\fIcstime\fP %ld
7a017e24
MK
692Amount of time that this process's
693waited-for children have been scheduled in kernel mode,
694measured in clock ticks (divide by
695.IR sysconf(_SC_CLK_TCK) .
fea681da
MK
696.TP
697\fIpriority\fP %ld
59a40ed7
MK
698(Explanation for Linux 2.6)
699For processes running a real-time scheduling policy
700.RI ( policy
701below; see
702.BR sched_setscheduler (2)),
703this is the negated scheduling priority, minus one;
704that is, a number in the range \-2 to \-100,
705corresponding to real-time priorities 1 to 99.
706For processes running under a non-real-time scheduling policy,
707this is the raw nice value
708.RB ( setpriority (2))
709as represented in the kernel.
710The kernel stores nice values as numbers
711in the range 0 (high) to 39 (low),
712corresponding to the user-visible nice range of \-20 to 19.
713
714Before Linux 2.6, this was a scaled value based on
715the scheduler weighting given to this process.
716.\" And back in kernel 1.2 days things were different again.
fea681da
MK
717.TP
718\fInice\fP %ld
59a40ed7
MK
719The nice value (see
720.BR setpriority (2)),
721a value in the range 19 (low priority) to \-20 (high priority).
722.\" Back in kernel 1.2 days things were different.
fea681da
MK
723.TP
724.\" .TP
725.\" \fIcounter\fP %ld
726.\" The current maximum size in jiffies of the process's next timeslice,
727.\" or what is currently left of its current timeslice, if it is the
728.\" currently running process.
729.\" .TP
730.\" \fItimeout\fP %u
731.\" The time in jiffies of the process's next timeout.
0e94f77b
MK
732.\" timeout was removed sometime around 2.1/2.2
733\fInum_threads\fP %ld
2ebfeb1b 734Number of threads in this process (since Linux 2.6).
bb83d1b9 735Before kernel 2.6, this field was hard coded to 0 as a placeholder
0e94f77b 736for an earlier removed field.
fea681da 737.TP
59a40ed7 738.\" field 21
fea681da 739\fIitrealvalue\fP %ld
8bd58774
MK
740The time in jiffies before the next
741.B SIGALRM
742is sent to the process due to an interval timer.
0e94f77b
MK
743Since kernel 2.6.17, this field is no longer maintained,
744and is hard coded as 0.
fea681da 745.TP
0e94f77b 746\fIstarttime\fP %llu (was %lu before Linux 2.6)
fea681da
MK
747The time in jiffies the process started after system boot.
748.TP
749\fIvsize\fP %lu
750Virtual memory size in bytes.
751.TP
752\fIrss\fP %ld
59a40ed7 753Resident Set Size: number of pages the process has in real memory.
c13182ef
MK
754This is just the pages which
755count towards text, data, or stack space.
756This does not include pages
fea681da
MK
757which have not been demand-loaded in, or which are swapped out.
758.TP
59a40ed7
MK
759\fIrsslim\fP %lu
760Current soft limit in bytes on the rss of the process;
761see the description of
762.B RLIMIT_RSS
763in
764.BR getpriority (2).
fea681da
MK
765.TP
766\fIstartcode\fP %lu
767The address above which program text can run.
768.TP
769\fIendcode\fP %lu
770The address below which program text can run.
771.TP
772\fIstartstack\fP %lu
59a40ed7 773The address of the start (i.e., bottom) of the stack.
fea681da
MK
774.TP
775\fIkstkesp\fP %lu
59a40ed7 776The current value of ESP (stack pointer), as found in the
fea681da
MK
777kernel stack page for the process.
778.TP
779\fIkstkeip\fP %lu
780The current EIP (instruction pointer).
781.TP
59a40ed7 782.\" field 31
fea681da 783\fIsignal\fP %lu
59a40ed7
MK
784The bitmap of pending signals, displayed as a decimal number.
785Obsolete, because it does not provide information on real-time signals; use
69119dc7 786.I /proc/[pid]/status
59a40ed7 787instead.
fea681da
MK
788.TP
789\fIblocked\fP %lu
59a40ed7
MK
790The bitmap of blocked signals, displayed as a decimal number.
791Obsolete, because it does not provide information on real-time signals; use
69119dc7 792.I /proc/[pid]/status
59a40ed7 793instead.
fea681da
MK
794.TP
795\fIsigignore\fP %lu
59a40ed7
MK
796The bitmap of ignored signals, displayed as a decimal number.
797Obsolete, because it does not provide information on real-time signals; use
69119dc7 798.I /proc/[pid]/status
59a40ed7 799instead.
fea681da
MK
800.TP
801\fIsigcatch\fP %lu
59a40ed7
MK
802The bitmap of caught signals, displayed as a decimal number.
803Obsolete, because it does not provide information on real-time signals; use
69119dc7 804.I /proc/[pid]/status
59a40ed7 805instead.
fea681da
MK
806.TP
807\fIwchan\fP %lu
c13182ef
MK
808This is the "channel" in which the process is waiting.
809It is the
fea681da 810address of a system call, and can be looked up in a namelist if you
c13182ef 811need a textual name.
9a67332e
MK
812(If you have an up-to-date
813.IR /etc/psdatabase ,
814then
4d9b6984 815try \fIps \-l\fP to see the WCHAN field in action.)
fea681da
MK
816.TP
817\fInswap\fP %lu
0e94f77b 818.\" nswap was added in 2.0
4d9b6984 819Number of pages swapped (not maintained).
fea681da
MK
820.TP
821\fIcnswap\fP %lu
0e94f77b 822.\" cnswap was added in 2.0
4d9b6984 823Cumulative \fInswap\fP for child processes (not maintained).
fea681da 824.TP
2ebfeb1b 825\fIexit_signal\fP %d (since Linux 2.1.22)
fea681da
MK
826Signal to be sent to parent when we die.
827.TP
2ebfeb1b 828\fIprocessor\fP %d (since Linux 2.2.8)
fea681da 829CPU number last executed on.
568105c6 830.TP
2ebfeb1b 831\fIrt_priority\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
59a40ed7
MK
832Real-time scheduling priority, a number in the range 1 to 99 for
833processes scheduled under a real-time policy,
834or 0, for non-real-time processes (see
568105c6
MK
835.BR sched_setscheduler (2)).
836.TP
59a40ed7 837.\" field 41
2ebfeb1b 838\fIpolicy\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
568105c6
MK
839Scheduling policy (see
840.BR sched_setscheduler (2)).
cd60dedd 841Decode using the SCHED_* constants in
59a40ed7 842.IR linux/sched.h .
167450d6 843.TP
2ebfeb1b 844\fIdelayacct_blkio_ticks\fP %llu (since Linux 2.6.18)
0e94f77b 845Aggregated block I/O delays, measured in clock ticks (centiseconds).
14c06953
MK
846.TP
847\fIguest_time\fP %lu (since Linux 2.6.24)
848Guest time of the process (time spent running a virtual CPU
7a017e24
MK
849for a guest operating system), measured in clock ticks (divide by
850.IR sysconf(_SC_CLK_TCK) .
14c06953
MK
851.TP
852\fIcguest_time\fP %ld (since Linux 2.6.24)
7a017e24
MK
853Guest time of the process's children, measured in clock ticks (divide by
854.IR sysconf(_SC_CLK_TCK) .
fea681da
MK
855.RE
856.TP
69119dc7 857.I /proc/[pid]/statm
59a40ed7 858Provides information about memory usage, measured in pages.
c13182ef 859The columns are:
a08ea57c
MK
860.in +4n
861.nf
862
863size total program size
69119dc7 864 (same as VmSize in \fI/proc/[pid]/status\fP)
a08ea57c 865resident resident set size
69119dc7 866 (same as VmRSS in \fI/proc/[pid]/status\fP)
59a40ed7 867share shared pages (from shared mappings)
a08ea57c 868text text (code)
59a40ed7
MK
869.\" (not including libs; broken, includes data segment)
870lib library (unused in Linux 2.6)
871data data + stack
872.\" (including libs; broken, includes library text)
a08ea57c
MK
873dt dirty pages (unused in Linux 2.6)
874.fi
875.in
fea681da 876.TP
69119dc7 877.I /proc/[pid]/status
fea681da 878Provides much of the information in
69119dc7 879.I /proc/[pid]/stat
fea681da 880and
69119dc7 881.I /proc/[pid]/statm
fea681da 882in a format that's easier for humans to parse.
16b5f7ba
MK
883Here's an example:
884.in +4n
885.nf
886
b43a3b30 887.RB "$" " cat /proc/$$/status"
16b5f7ba
MK
888Name: bash
889State: S (sleeping)
890Tgid: 3515
891Pid: 3515
892PPid: 3452
893TracerPid: 0
894Uid: 1000 1000 1000 1000
895Gid: 100 100 100 100
896FDSize: 256
897Groups: 16 33 100
898VmPeak: 9136 kB
899VmSize: 7896 kB
900VmLck: 0 kB
901VmHWM: 7572 kB
902VmRSS: 6316 kB
903VmData: 5224 kB
904VmStk: 88 kB
905VmExe: 572 kB
906VmLib: 1708 kB
907VmPTE: 20 kB
908Threads: 1
909SigQ: 0/3067
910SigPnd: 0000000000000000
911ShdPnd: 0000000000000000
912SigBlk: 0000000000010000
913SigIgn: 0000000000384004
914SigCgt: 000000004b813efb
915CapInh: 0000000000000000
916CapPrm: 0000000000000000
917CapEff: 0000000000000000
918CapBnd: ffffffffffffffff
919Cpus_allowed: 00000001
920Cpus_allowed_list: 0
921Mems_allowed: 1
922Mems_allowed_list: 0
923voluntary_ctxt_switches: 150
924nonvoluntary_ctxt_switches: 545
925.fi
926.in
927.IP
928The fields are as follows:
929.RS
930.IP * 2
931.IR Name :
932Command run by this process.
933.IP *
934.IR State :
935Current state of the process. One of
936"R (running)",
937"S (sleeping)",
938"D (disk sleep)",
939"T (stopped)",
940"T (tracing stop)",
941"Z (zombie)",
942or
943"X (dead)".
944.IP *
945.IR Tgid :
946Thread group ID (i.e., Process ID).
947.IP *
948.IR Pid :
949Thread ID (see
950.BR gettid (2)).
951.IP *
952.IR TracerPid :
953PID of process tracing this process (0 if not being traced).
954.IP *
955.IR Uid ", " Gid :
956Real, effective, saved set, and file system UIDs (GIDs).
957.IP *
958.IR FDSize :
959Number of file descriptor slots currently allocated.
960.IP *
961.IR Groups :
962Supplementary group list.
963.IP *
964.IR VmPeak :
965Peak virtual memory size.
966.IP *
967.IR VmSize :
968Virtual memory size.
969.IP *
970.IR VmLck :
971Locked memory size.
972.IP *
973.IR VmHWM :
974Peak resident set size ("high water mark").
975.IP *
976.IR VmRSS :
977Resident set size.
978.IP *
979.IR VmData ", " VmStk ", " VmExe :
980Size of data, stack, and text segments.
981.IP *
982.IR VmLib :
983Shared library code size.
984.IP *
985.IR VmPTE :
986Page table entries size (since Linux 2.6.10).
987.IP *
988.IR Threads :
989Number of threads in process containing this thread.
990.IP *
991.IR SigPnd ", " ShdPnd :
992Number of signals pending for thread and for process as a whole (see
993.BR pthreads (7)
994and
995.BR signal (7)).
996.IP *
997.IR SigBlk ", " SigIgn ", " SigCgt :
998Masks indicating signals being blocked, ignored, and caught (see
999.BR signal (7)).
1000.IP *
1001.IR CapInh ", " CapPrm ", " CapEff :
1002Masks of capabilities enabled in inheritable, permitted, and effective sets
1003(see
1004.BR capabilities (7)).
1005.IP *
1006.IR CapBnd :
1007Capability Bounding set
1008(since kernel 2.6.26, see
1009.BR capabilities (7)).
1010.IP *
1011.IR Cpus_allowed :
1012Mask of CPUs on which this process may run
1013(since Linux 2.6.24, see
1014.BR cpuset (7)).
1015.IP *
1016.IR Cpus_allowed_list :
1017Same as previous, but in "list format"
1018(since Linux 2.6.26, see
1019.BR cpuset (7)).
1020.IP *
1021.IR Mems_allowed :
1022Mask of memory nodes allowed to this process
1023(since Linux 2.6.24, see
1024.BR cpuset (7)).
1025.IP *
1026.IR Mems_allowed_list :
1027Same as previous, but in "list format"
1028(since Linux 2.6.26, see
1029.BR cpuset (7)).
1030.IP *
1031.IR voluntary_context_switches ", " nonvoluntary_context_switches :
1032Number of voluntary and involuntary context switches (since Linux 2.6.23).
1033.RE
fea681da 1034.TP
69119dc7 1035.IR /proc/[pid]/task " (since Linux 2.6.0-test6)"
afcaf646
MK
1036This is a directory that contains one subdirectory
1037for each thread in the process.
69119dc7
MK
1038The name of each subdirectory is the numerical thread ID
1039.RI ( [tid] )
1040of the thread (see
afcaf646
MK
1041.BR gettid (2)).
1042Within each of these subdirectories, there is a set of
1043files with the same names and contents as under the
69119dc7 1044.I /proc/[pid]
afcaf646
MK
1045directories.
1046For attributes that are shared by all threads, the contents for
1047each of the files under the
69119dc7 1048.I task/[tid]
afcaf646 1049subdirectories will be the same as in the corresponding
c13182ef 1050file in the parent
69119dc7 1051.I /proc/[pid]
afcaf646 1052directory
c13182ef 1053(e.g., in a multithreaded process, all of the
69119dc7 1054.I task/[tid]/cwd
c13182ef 1055files will have the same value as the
69119dc7 1056.I /proc/[pid]/cwd
c13182ef 1057file in the parent directory, since all of the threads in a process
afcaf646
MK
1058share a working directory).
1059For attributes that are distinct for each thread,
c13182ef 1060the corresponding files under
69119dc7 1061.I task/[tid]
afcaf646 1062may have different values (e.g., various fields in each of the
69119dc7 1063.I task/[tid]/status
afcaf646
MK
1064files may be different for each thread).
1065
1066.\" The following was still true as at kernel 2.6.13
1067In a multithreaded process, the contents of the
69119dc7 1068.I /proc/[pid]/task
c13182ef 1069directory are not available if the main thread has already terminated
afcaf646
MK
1070(typically by calling
1071.BR pthread_exit (3)).
1072.TP
fea681da 1073.I /proc/apm
097585ed
MK
1074Advanced power management version and battery information when
1075.B CONFIG_APM
1076is defined at kernel compilation time.
fea681da
MK
1077.TP
1078.I /proc/bus
1079Contains subdirectories for installed busses.
1080.TP
1081.I /proc/bus/pccard
59a40ed7 1082Subdirectory for PCMCIA devices when
097585ed
MK
1083.B CONFIG_PCMCIA
1084is set at kernel compilation time.
fea681da
MK
1085.TP
1086.I /proc/bus/pccard/drivers
1087.TP
1088.I /proc/bus/pci
c13182ef 1089Contains various bus subdirectories and pseudo-files containing
59a40ed7 1090information about PCI busses, installed devices, and device
c13182ef
MK
1091drivers.
1092Some of these files are not ASCII.
fea681da
MK
1093.TP
1094.I /proc/bus/pci/devices
59a40ed7 1095Information about PCI devices.
c13182ef 1096They may be accessed through
fea681da
MK
1097.BR lspci (8)
1098and
1099.BR setpci (8).
1100.TP
1101.I /proc/cmdline
c13182ef
MK
1102Arguments passed to the Linux kernel at boot time.
1103Often done via a boot manager such as
59a40ed7
MK
1104.BR lilo (8)
1105or
1106.BR grub (8).
f6e524c4
MK
1107.TP
1108.IR /proc/config.gz " (since Linux 2.6)"
1109This file exposes the configuration options that were used
c3d9780d 1110to build the currently running kernel,
f6e524c4
MK
1111in the same format as they would be shown in the
1112.I .config
1113file that resulted when configuring the kernel (using
1114.IR "make xconfig" ,
1115.IR "make config" ,
1116or similar).
1117The file contents are compressed; view or search them using
1118.BR zcat (1),
1119.BR zgrep (1),
1120etc.
1121As long as no changes have been made to the following file,
250e01ec
MK
1122the contents of
1123.I /proc/config.gz
1124are the same as those provided by :
f6e524c4
MK
1125.in +4n
1126.nf
1127
9fd8b185 1128cat /lib/modules/$(uname -r)/build/.config
f6e524c4
MK
1129.fi
1130.in
250e01ec
MK
1131.IP
1132.I /proc/config.gz
1133is only provided if the kernel is configured with
250e01ec 1134.BR CONFIG_IKCONFIG_PROC .
fea681da
MK
1135.TP
1136.I /proc/cpuinfo
1137This is a collection of CPU and system architecture dependent items,
1138for each supported architecture a different list.
1139Two common entries are \fIprocessor\fP which gives CPU number and
c13182ef
MK
1140\fIbogomips\fP; a system constant that is calculated
1141during kernel initialization.
1142SMP machines have information for
fea681da
MK
1143each CPU.
1144.TP
1145.I /proc/devices
c13182ef
MK
1146Text listing of major numbers and device groups.
1147This can be used by MAKEDEV scripts for consistency with the kernel.
fea681da
MK
1148.TP
1149.IR /proc/diskstats " (since Linux 2.5.69)"
1150This file contains disk I/O statistics for each disk device.
1151See the kernel source file
1152.I Documentation/iostats.txt
1153for further information.
1154.TP
1155.I /proc/dma
c13182ef 1156This is a list of the registered \fIISA\fP DMA (direct memory access)
fea681da
MK
1157channels in use.
1158.TP
1159.I /proc/driver
1160Empty subdirectory.
1161.TP
1162.I /proc/execdomains
1163List of the execution domains (ABI personalities).
1164.TP
1165.I /proc/fb
097585ed
MK
1166Frame buffer information when
1167.B CONFIG_FB
1168is defined during kernel compilation.
fea681da
MK
1169.TP
1170.I /proc/filesystems
24d01c53
MK
1171A text listing of the file systems which are supported by the kernel,
1172namely file systems which were compiled into the kernel or whose kernel
6387216b
MK
1173modules are currently loaded.
1174(See also
fb477da2 1175.BR filesystems (5).)
24d01c53 1176If a file system is marked with "nodev",
809d0164 1177this means that it does not require a block device to be mounted
24d01c53 1178(e.g., virtual file system, network file system).
809d0164
MK
1179
1180Incidentally, this file may be used by
1181.BR mount (8)
24d01c53
MK
1182when no file system is specified and it didn't manage to determine the
1183file system type.
1184Then file systems contained in this file are tried
809d0164 1185(excepted those that are marked with "nodev").
fea681da
MK
1186.TP
1187.I /proc/fs
1188Empty subdirectory.
1189.TP
1190.I /proc/ide
1191This directory
59a40ed7
MK
1192exists on systems with the IDE bus.
1193There are directories for each IDE channel and attached device.
c13182ef 1194Files include:
fea681da 1195
a08ea57c 1196.in +4n
fea681da
MK
1197.nf
1198cache buffer size in KB
1199capacity number of sectors
1200driver driver version
1201geometry physical and logical geometry
9fdfa163 1202identify in hexadecimal
fea681da
MK
1203media media type
1204model manufacturer's model number
1205settings drive settings
9fdfa163
MK
1206smart_thresholds in hexadecimal
1207smart_values in hexadecimal
fea681da 1208.fi
a08ea57c 1209.in
fea681da 1210
c13182ef 1211The
fea681da
MK
1212.BR hdparm (8)
1213utility provides access to this information in a friendly format.
1214.TP
1215.I /proc/interrupts
23ec6ff0
MK
1216This is used to record the number of interrupts per CPU per IO device.
1217Since Linux 2.6.24,
1218for the i386 and x86_64 architectures, at least, this also includes
1219interrupts internal to the system (that is, not associated with a device
1220as such), such as NMI (nonmaskable interrupt), LOC (local timer interrupt),
1221and for SMP systems, TLB (TLB flush interrupt), RES (rescheduling
1222interrupt), CAL (remote function call interrupt), and possibly others.
1223Very easy to read formatting, done in ASCII.
fea681da
MK
1224.TP
1225.I /proc/iomem
1226I/O memory map in Linux 2.4.
1227.TP
1228.I /proc/ioports
c13182ef 1229This is a list of currently registered Input-Output port regions that
fea681da
MK
1230are in use.
1231.TP
1232.IR /proc/kallsyms " (since Linux 2.5.71)"
1233This holds the kernel exported symbol definitions used by the
1234.BR modules (X)
1235tools to dynamically link and bind loadable modules.
1236In Linux 2.5.47 and earlier, a similar file with slightly different syntax
1237was named
1238.IR ksyms .
1239.TP
1240.I /proc/kcore
1241This file represents the physical memory of the system and is stored
c13182ef
MK
1242in the ELF core file format.
1243With this pseudo-file, and an unstripped
9a67332e
MK
1244kernel
1245.RI ( /usr/src/linux/vmlinux )
1246binary, GDB can be used to
fea681da
MK
1247examine the current state of any kernel data structures.
1248
1249The total length of the file is the size of physical memory (RAM) plus
12504KB.
1251.TP
1252.I /proc/kmsg
1253This file can be used instead of the
1254.BR syslog (2)
c13182ef
MK
1255system call to read kernel messages.
1256A process must have superuser
fea681da 1257privileges to read this file, and only one process should read this
c13182ef
MK
1258file.
1259This file should not be read if a syslog process is running
fea681da
MK
1260which uses the
1261.BR syslog (2)
1262system call facility to log kernel messages.
1263
1264Information in this file is retrieved with the
1265.BR dmesg (8)
1266program.
1267.TP
1268.IR /proc/ksyms " (Linux 1.1.23-2.5.47)"
1269See
1270.IR /proc/kallsyms .
1271.TP
1272.I /proc/loadavg
6b05dc38
MK
1273The first three fields in this file are load average figures
1274giving the number of jobs in the run queue (state R)
fea681da
MK
1275or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes.
1276They are the same as the load average numbers given by
1277.BR uptime (1)
1278and other programs.
6b05dc38
MK
1279The fourth field consists of two numbers separated by a slash (/).
1280The first of these is the number of currently executing kernel
c13182ef 1281scheduling entities (processes, threads);
6b05dc38
MK
1282this will be less than or equal to the number of CPUs.
1283The value after the slash is the number of kernel scheduling entities
1284that currently exist on the system.
1285The fifth field is the PID of the process that was most
1286recently created on the system.
fea681da
MK
1287.TP
1288.I /proc/locks
1289This file shows current file locks
1290.RB ( flock "(2) and " fcntl (2))
1291and leases
1292.RB ( fcntl (2)).
1293.TP
89dd5f8a 1294.IR /proc/malloc " (only up to and including Linux 2.2)"
59a40ed7 1295.\" It looks like this only ever did something back in 1.0 days
097585ed 1296This file is only present if
89dd5f8a 1297.B CONFIG_DEBUG_MALLOC
097585ed 1298was defined during compilation.
fea681da
MK
1299.TP
1300.I /proc/meminfo
77b802ec
MK
1301This file reports statistics about memory usage on the system.
1302It is used by
fea681da
MK
1303.BR free (1)
1304to report the amount of free and used memory (both physical and swap)
1305on the system as well as the shared memory and buffers used by the
1306kernel.
fea681da
MK
1307.TP
1308.I /proc/mounts
c1eea65a
MK
1309Before kernel 2.4.19, this file was a list
1310of all the file systems currently mounted on the system.
acddbaea 1311With the introduction of per-process namespaces in
c1eea65a
MK
1312Linux 2.4.19, this file became a link to
1313.IR /proc/self/mounts ,
1314which lists the mount points of the process's own namespace.
fea681da 1315The format of this file is documented in
31e9a9ec 1316.BR fstab (5).
fea681da
MK
1317.TP
1318.I /proc/modules
1319A text list of the modules that have been loaded by the system.
1320See also
1321.BR lsmod (8).
1322.TP
1323.I /proc/mtrr
c13182ef
MK
1324Memory Type Range Registers.
1325See
fea681da
MK
1326.I /usr/src/linux/Documentation/mtrr.txt
1327for details.
1328.TP
1329.I /proc/net
1330various net pseudo-files, all of which give the status of some part of
c13182ef
MK
1331the networking layer.
1332These files contain ASCII structures and are,
59a40ed7
MK
1333therefore, readable with
1334.BR cat (1).
c13182ef 1335However, the standard
fea681da
MK
1336.BR netstat (8)
1337suite provides much cleaner access to these files.
1338.TP
1339.I /proc/net/arp
1340This holds an ASCII readable dump of the kernel ARP table used for
c13182ef 1341address resolutions.
59a40ed7 1342It will show both dynamically learned and pre-programmed ARP entries.
c13182ef 1343The format is:
fea681da
MK
1344
1345.nf
1346.ft CW
1347.in 8n
1348IP address HW type Flags HW address Mask Device
1349192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0
1350192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0
1351.ft
1352.fi
1353.in
1354
6c04f928 1355Here "IP address" is the IPv4 address of the machine and the "HW type"
c13182ef
MK
1356is the hardware type of the address from RFC\ 826.
1357The flags are the internal
9a67332e
MK
1358flags of the ARP structure (as defined in
1359.IR /usr/include/linux/if_arp.h )
1360and
6c04f928 1361the "HW address" is the data link layer mapping for that IP address if
fea681da
MK
1362it is known.
1363.TP
1364.I /proc/net/dev
c13182ef
MK
1365The dev pseudo-file contains network device status information.
1366This gives
1367the number of received and sent packets, the number of errors and
fea681da 1368collisions
c13182ef
MK
1369and other basic statistics.
1370These are used by the
fea681da 1371.BR ifconfig (8)
c13182ef
MK
1372program to report device status.
1373The format is:
fea681da
MK
1374
1375.nf
1376.ft CW
1377.in 1n
1378Inter-| Receive | Transmit
1379 face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
1380 lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0
1381 eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0
1382 ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0
1383 tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0
1384.in
1385.ft
1386.fi
1387.\" .TP
1388.\" .I /proc/net/ipx
1389.\" No information.
1390.\" .TP
1391.\" .I /proc/net/ipx_route
1392.\" No information.
1393.TP
1394.I /proc/net/dev_mcast
1395Defined in
1396.IR /usr/src/linux/net/core/dev_mcast.c :
1397.nf
1398.in +5
9fdfa163 1399indx interface_name dmi_u dmi_g dmi_address
fea681da
MK
14002 eth0 1 0 01005e000001
14013 eth1 1 0 01005e000001
14024 eth2 1 0 01005e000001
1403.in
1404.fi
1405.TP
1406.I /proc/net/igmp
c13182ef
MK
1407Internet Group Management Protocol.
1408Defined in
fea681da
MK
1409.IR /usr/src/linux/net/core/igmp.c .
1410.TP
1411.I /proc/net/rarp
1412This file uses the same format as the
1413.I arp
1414file and contains the current reverse mapping database used to provide
1415.BR rarp (8)
c13182ef
MK
1416reverse address lookup services.
1417If RARP is not configured into the
fea681da
MK
1418kernel,
1419this file will not be present.
1420.TP
1421.I /proc/net/raw
c13182ef
MK
1422Holds a dump of the RAW socket table.
1423Much of the information is not of
fea681da 1424use
c13182ef 1425apart from debugging.
6c04f928 1426The "sl" value is the kernel hash slot for the
fea681da 1427socket,
6c04f928
MK
1428the "local_address" is the local address and protocol number pair.
1429\&"St" is
c13182ef
MK
1430the internal status of the socket.
1431The "tx_queue" and "rx_queue" are the
fea681da 1432outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 1433The "tr", "tm\->when", and "rexmits" fields are not used by RAW.
fdc196f5
MK
1434The "uid"
1435field holds the effective UID of the creator of the socket.
fea681da
MK
1436.\" .TP
1437.\" .I /proc/net/route
1438.\" No information, but looks similar to
1439.\" .BR route (8).
1440.TP
1441.I /proc/net/snmp
c13182ef 1442This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP
fea681da 1443management
763f0e47 1444information bases for an SNMP agent.
fea681da
MK
1445.TP
1446.I /proc/net/tcp
c13182ef
MK
1447Holds a dump of the TCP socket table.
1448Much of the information is not
1449of use apart from debugging.
1450The "sl" value is the kernel hash slot
6beb1671
MK
1451for the socket, the "local_address" is the local address and port number pair.
1452The "rem_address" is the remote address and port number pair
6c04f928
MK
1453(if connected).
1454\&"St" is the internal status of the socket.
1455The "tx_queue" and "rx_queue" are the
fea681da 1456outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 1457The "tr", "tm\->when", and "rexmits" fields hold internal information of
fdc196f5
MK
1458the kernel socket state and are only useful for debugging.
1459The "uid"
1460field holds the effective UID of the creator of the socket.
fea681da
MK
1461.TP
1462.I /proc/net/udp
c13182ef
MK
1463Holds a dump of the UDP socket table.
1464Much of the information is not of
1465use apart from debugging.
1466The "sl" value is the kernel hash slot for the
6beb1671
MK
1467socket, the "local_address" is the local address and port number pair.
1468The "rem_address" is the remote address and port number pair
fea681da
MK
1469(if connected). "St" is the internal status of the socket.
1470The "tx_queue" and "rx_queue" are the outgoing and incoming data queue
c13182ef 1471in terms of kernel memory usage.
94e9d9fe 1472The "tr", "tm\->when", and "rexmits" fields
c13182ef 1473are not used by UDP.
fdc196f5
MK
1474The "uid"
1475field holds the effective UID of the creator of the socket.
fea681da
MK
1476The format is:
1477
1478.nf
1479.ft CW
1480.in 1n
94e9d9fe 1481sl local_address rem_address st tx_queue rx_queue tr rexmits tm\->when uid
fea681da
MK
1482 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0
1483 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0
1484 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0
1485.in
1486.ft
1487.fi
1488.TP
1489.I /proc/net/unix
8ee190da 1490Lists the Unix domain sockets present within the system and their
c13182ef
MK
1491status.
1492The format is:
fea681da
MK
1493.nf
1494.sp .5
1495.ft CW
1496Num RefCount Protocol Flags Type St Path
1497 0: 00000002 00000000 00000000 0001 03
1498 1: 00000001 00000000 00010000 0001 01 /dev/printer
1499.ft
1500.sp .5
1501.fi
1502
6c04f928
MK
1503Here "Num" is the kernel table slot number, "RefCount" is the number
1504of users of the socket, "Protocol" is currently always 0, "Flags"
fea681da 1505represent the internal kernel flags holding the status of the
c13182ef 1506socket.
6c04f928
MK
1507Currently, type is always "1" (Unix domain datagram sockets are
1508not yet supported in the kernel).
1509\&"St" is the internal state of the
fea681da
MK
1510socket and Path is the bound path (if any) of the socket.
1511.TP
1512.I /proc/partitions
1513Contains major and minor numbers of each partition as well as number
1514of blocks and partition name.
1515.TP
1516.I /proc/pci
1517This is a listing of all PCI devices found during kernel initialization
1518and their configuration.
2990d781 1519
59a40ed7
MK
1520This file has been deprecated in favor of a new
1521.I /proc
2990d781
MK
1522interface for PCI
1523.RI ( /proc/bus/pci ).
1524It became optional in Linux 2.2 (available with
1525.B CONFIG_PCI_OLD_PROC
1526set at kernel compilation).
1527It became once more non-optionally enabled in Linux 2.4.
1528Next, it was deprecated in Linux 2.6 (still available with
1529.B CONFIG_PCI_LEGACY_PROC
1530set), and finally removed altogether since Linux 2.6.17.
b4e9ee8f
MK
1531.\" FIXME /proc/sched_debug
1532.\" .TP
1533.\" .IR /proc/sched_debug " (since Linux 2.6.23)"
69119dc7 1534.\" See also /proc/[pid]/sched
fea681da
MK
1535.TP
1536.I /proc/scsi
59a40ed7
MK
1537A directory with the
1538.I scsi
1539mid-level pseudo-file and various SCSI low-level
2990d781
MK
1540driver directories,
1541which contain a file for each SCSI host in this system, all of
c13182ef
MK
1542which give the status of some part of the SCSI IO subsystem.
1543These files contain ASCII structures and are, therefore, readable with
2990d781 1544.BR cat (1).
fea681da 1545
c13182ef 1546You can also write to some of the files to reconfigure the subsystem or
59a40ed7 1547switch certain features on or off.
fea681da
MK
1548.TP
1549.I /proc/scsi/scsi
c13182ef 1550This is a listing of all SCSI devices known to the kernel.
59a40ed7 1551The listing is similar to the one seen during bootup.
c13182ef 1552scsi currently supports only the \fIadd-single-device\fP command which
59a40ed7
MK
1553allows root to add a hotplugged device to the list of known devices.
1554
1555The command
1556.in +4n
1557.nf
1558
1559echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi
fea681da 1560
59a40ed7
MK
1561.fi
1562.in
c13182ef
MK
1563will cause
1564host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0.
1565If there
fea681da
MK
1566is already a device known on this address or the address is invalid, an
1567error will be returned.
1568.TP
1569.I /proc/scsi/[drivername]
c13182ef
MK
1570\fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740,
1571aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic,
1572scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000.
1573These directories show up for all drivers that registered at least one
59a40ed7 1574SCSI HBA.
c13182ef 1575Every directory contains one file per registered host.
59a40ed7 1576Every host-file is named after the number the host was assigned during
c13182ef 1577initialization.
fea681da 1578
c13182ef 1579Reading these files will usually show driver and host configuration,
59a40ed7 1580statistics, etc.
fea681da
MK
1581
1582Writing to these files allows different things on different hosts.
1583For example, with the \fIlatency\fP and \fInolatency\fP commands,
1584root can switch on and off command latency measurement code in the
c13182ef
MK
1585eata_dma driver.
1586With the \fIlockup\fP and \fIunlock\fP commands,
1587root can control bus lockups simulated by the scsi_debug driver.
fea681da
MK
1588.TP
1589.I /proc/self
59a40ed7
MK
1590This directory refers to the process accessing the
1591.I /proc
1592file system,
1593and is identical to the
1594.I /proc
1595directory named by the process ID of the same process.
fea681da
MK
1596.TP
1597.I /proc/slabinfo
c13182ef 1598Information about kernel caches.
821643a8
MK
1599Since Linux 2.6.16 this file is only present if the
1600.B CONFIG_SLAB
1601kernel configuration option is enabled.
350038ff 1602The columns in
38f76cd2 1603.I /proc/slabinfo
350038ff 1604are:
a08ea57c 1605.in +4n
fea681da 1606.nf
a08ea57c 1607
fea681da
MK
1608cache-name
1609num-active-objs
1610total-objs
1611object-size
1612num-active-slabs
1613total-slabs
1614num-pages-per-slab
1615.fi
a08ea57c
MK
1616.in
1617
c13182ef 1618See
fea681da
MK
1619.BR slabinfo (5)
1620for details.
1621.TP
1622.I /proc/stat
c13182ef
MK
1623kernel/system statistics.
1624Varies with architecture.
1625Common
fea681da
MK
1626entries include:
1627.RS
1628.TP
1629\fIcpu 3357 0 4313 1362393\fP
bfbfcd18 1630The amount of time, measured in units of
268f000b
MK
1631USER_HZ (1/100ths of a second on most architectures, use
1632.IR sysconf(_SC_CLK_TCK)
1633to obtain the right value),
b81087ab 1634.\" 1024 on Alpha and ia64
bfbfcd18
MK
1635that the system spent in user mode,
1636user mode with low priority (nice), system mode, and the
1637idle task, respectively.
b09b8526 1638.\" FIXME Actually, the following info about the /proc/stat 'cpu' field
777f5a9e 1639.\" does not seem to be quite right (at least in 2.6.12)
bfbfcd18 1640The last value should be USER_HZ times the
fea681da 1641second entry in the uptime pseudo-file.
ca92ce95 1642
bfbfcd18
MK
1643In Linux 2.6 this line includes three additional columns:
1644.I iowait
1645\- time waiting for I/O to complete (since 2.5.41);
1646.I irq
1647\- time servicing interrupts (since 2.6.0-test4);
1648.I softirq
1649\- time servicing softirqs (since 2.6.0-test4).
ca92ce95 1650
9de1f6cc
MK
1651Since Linux 2.6.11, there is an eighth column,
1652.I steal
1653\- stolen time, which is the time spent in other operating systems when
1654running in a virtualized environment
14c06953
MK
1655
1656Since Linux 2.6.24, there is a ninth column,
1657.IR guest ,
1658which is the time spent running a virtual CPU for guest
afef1764 1659operating systems under the control of the Linux kernel.
14c06953 1660.\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de
fea681da
MK
1661.TP
1662\fIpage 5741 1808\fP
1663The number of pages the system paged in and the number that were paged
1664out (from disk).
1665.TP
1666\fIswap 1 0\fP
1667The number of swap pages that have been brought in and out.
1668.TP
c13182ef 1669.\" FIXME The following is not the full picture for the 'intr' of
777f5a9e 1670.\" /proc/stat on 2.6:
fea681da 1671\fIintr 1462898\fP
bfbfcd18
MK
1672This line shows counts of interrupts serviced since boot time,
1673for each of the possible system interrupts.
1674The first column is the total of all interrupts serviced;
1675each subsequent column is the total for a particular interrupt.
fea681da
MK
1676.TP
1677\fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP...
1678(major,minor):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written)
bfbfcd18
MK
1679.br
1680(Linux 2.4 only)
fea681da
MK
1681.TP
1682\fIctxt 115315\fP
1683The number of context switches that the system underwent.
1684.TP
1685\fIbtime 769041601\fP
be9634cf 1686boot time, in seconds since the Epoch (January 1, 1970).
fea681da
MK
1687.TP
1688\fIprocesses 86031\fP
1689Number of forks since boot.
bfbfcd18
MK
1690.TP
1691\fIprocs_running 6\fP
1692Number of processes in runnable state.
1693(Linux 2.5.45 onwards.)
1694.TP
1695\fIprocs_blocked 2\fP
1696Number of processes blocked waiting for I/O to complete.
1697(Linux 2.5.45 onwards.)
fea681da
MK
1698.RE
1699.TP
1700.I /proc/swaps
c13182ef
MK
1701Swap areas in use.
1702See also
fea681da
MK
1703.BR swapon (8).
1704.TP
1705.I /proc/sys
1706This directory (present since 1.3.57) contains a number of files
1707and subdirectories corresponding to kernel variables.
1708These variables can be read and sometimes modified using
59a40ed7 1709the \fI/proc\fP file system, and the
fea681da 1710.BR sysctl (2)
c13182ef
MK
1711system call.
1712Presently, there are subdirectories
fea681da
MK
1713.IR abi ", " debug ", " dev ", " fs ", " kernel ", " net ", " proc ", "
1714.IR rxrpc ", " sunrpc " and " vm
1715that each contain more files and subdirectories.
1716.TP
6ab7c0aa 1717.IR /proc/sys/abi " (since Linux 2.4.10)"
fea681da 1718This directory may contain files with application binary information.
6ab7c0aa
MK
1719.\" On some systems, it is not present.
1720See the kernel source file
1721.I Documentation/sysctl/abi.txt
1722for more information.
fea681da
MK
1723.TP
1724.I /proc/sys/debug
1725This directory may be empty.
1726.TP
1727.I /proc/sys/dev
e2badfdf 1728This directory contains device-specific information (e.g.,
9a67332e 1729.IR dev/cdrom/info ).
fea681da
MK
1730On
1731some systems, it may be empty.
1732.TP
1733.I /proc/sys/fs
6d64ca9c 1734This contains the subdirectories
b877b392 1735.IR binfmt_misc ", " inotify ", and " mqueue ,
fea681da 1736and files
c13182ef
MK
1737.IR dentry-state ", " dir-notify-enable ", " dquot-nr ", " file-max ", "
1738.IR file-nr ", " inode-max ", " inode-nr ", " inode-state ", "
1739.IR lease-break-time ", " leases-enable ", "
43da96f2
MK
1740.IR overflowgid ", " overflowuid ", "
1741.IR suid_dumpable ", "
1742.IR super-max ", and " super-nr .
fea681da
MK
1743.TP
1744.I /proc/sys/fs/binfmt_misc
c13182ef 1745Documentation for files in this directory can be found
b877b392 1746in the kernel sources in
fea681da
MK
1747.IR Documentation/binfmt_misc.txt .
1748.TP
59a40ed7
MK
1749.IR /proc/sys/fs/dentry-state " (since Linux 2.2)"
1750This file contains information about the status of the
1751directory cache (dcache).
1752The file contains six numbers,
c13182ef 1753.IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), "
59a40ed7 1754.I want_pages
fea681da 1755(pages requested by system) and two dummy values.
59a40ed7
MK
1756.RS
1757.IP * 2
1758.I nr_dentry
1759is the number of allocated dentries (dcache entries).
1760This field is unused in Linux 2.2.
1761.IP *
1762.I nr_unused
1763is the number of unused dentries.
1764.IP *
1765.I age_limit
1766.\" looks like this is unused in kernels 2.2 to 2.6
1767is the age in seconds after which dcache entries
1768can be reclaimed when memory is short.
1769.IP *
1770.I want_pages
1771.\" looks like this is unused in kernels 2.2 to 2.6
1772is non-zero when the kernel has called shrink_dcache_pages() and the
fea681da 1773dcache isn't pruned yet.
59a40ed7 1774.RE
fea681da
MK
1775.TP
1776.I /proc/sys/fs/dir-notify-enable
1777This file can be used to disable or enable the
1778.I dnotify
1779interface described in
1780.BR fcntl (2)
1781on a system-wide basis.
1782A value of 0 in this file disables the interface,
1783and a value of 1 enables it.
1784.TP
1785.I /proc/sys/fs/dquot-max
1786This file shows the maximum number of cached disk quota entries.
1787On some (2.4) systems, it is not present.
1788If the number of free cached disk quota entries is very low and
1789you have some awesome number of simultaneous system users,
1790you might want to raise the limit.
1791.TP
1792.I /proc/sys/fs/dquot-nr
1793This file shows the number of allocated disk quota
1794entries and the number of free disk quota entries.
1795.TP
1796.I /proc/sys/fs/file-max
1797This file defines
1798a system-wide limit on the number of open files for all processes.
1799(See also
1800.BR setrlimit (2),
1801which can be used by a process to set the per-process limit,
1802.BR RLIMIT_NOFILE ,
1803on the number of files it may open.)
1804If you get lots
1805of error messages about running out of file handles,
1806try increasing this value:
1807.br
1808
1809.br
1810.nf
1811.ft CW
1812echo 100000 > /proc/sys/fs/file-max
1813.fi
1814.ft
1815
1816The kernel constant
7b2b5ea4 1817.B NR_OPEN
fea681da
MK
1818imposes an upper limit on the value that may be placed in
1819.IR file-max .
1820
c13182ef 1821If you increase
fea681da
MK
1822.IR /proc/sys/fs/file-max ","
1823be sure to increase
1824.I /proc/sys/fs/inode-max
1825to 3-4 times the new
c13182ef 1826value of
fea681da
MK
1827.IR /proc/sys/fs/file-max ","
1828or you will run out of inodes.
1829.TP
1830.I /proc/sys/fs/file-nr
59a40ed7
MK
1831This (read-only) file gives the number of files presently opened.
1832It contains three numbers: the number of allocated file handles;
1833the number of free file handles; and the maximum number of file handles.
c13182ef
MK
1834The kernel allocates file handles dynamically, but it
1835doesn't free them again.
1836If the number of allocated files is close to the
fea681da
MK
1837maximum, you should consider increasing the maximum.
1838When the number of free file handles is
1839large, you've encountered a peak in your usage of file
1840handles and you probably don't need to increase the maximum.
1841.TP
c13182ef 1842.I /proc/sys/fs/inode-max
fea681da 1843This file contains the maximum number of in-memory inodes.
59a40ed7 1844On some (2.4) systems, it may not be present.
c13182ef 1845This value should be 3-4 times larger
59a40ed7
MK
1846than the value in
1847.IR file-max ,
1848since \fIstdin\fP, \fIstdout\fP
1849and network sockets also need an inode to handle them.
1850When you regularly run out of inodes, you need to increase this value.
fea681da
MK
1851.TP
1852.I /proc/sys/fs/inode-nr
59a40ed7
MK
1853This file contains the first two values from
1854.IR inode-state .
fea681da
MK
1855.TP
1856.I /proc/sys/fs/inode-state
1857This file
59a40ed7
MK
1858contains seven numbers:
1859.IR nr_inodes ,
1860.IR nr_free_inodes ,
1861.IR preshrink ,
1862and four dummy values.
1863.I nr_inodes
1864is the number of inodes the system has allocated.
1865This can be slightly more than
1866.I inode-max
1867because Linux allocates them one page full at a time.
1868.I nr_free_inodes
1869represents the number of free inodes.
1870.I preshrink
1871is non-zero when the
1872.I nr_inodes
1873>
1874.I inode-max
1875and the system needs to prune the inode list instead of allocating more.
fea681da 1876.TP
b877b392 1877.IR /proc/sys/fs/inotify " (since Linux 2.6.13)"
c13182ef 1878This directory contains files
b877b392
MK
1879.IR max_queued_events ", " max_user_instances ", and " max_user_watches ,
1880that can be used to limit the amount of kernel memory consumed by the
1881.I inotify
1882interface.
c13182ef 1883For further details, see
435b27cc 1884.BR inotify (7).
b877b392 1885.TP
fea681da 1886.I /proc/sys/fs/lease-break-time
59a40ed7 1887This file specifies the grace period that the kernel grants to a process
fea681da
MK
1888holding a file lease
1889.RB ( fcntl (2))
1890after it has sent a signal to that process notifying it
1891that another process is waiting to open the file.
1892If the lease holder does not remove or downgrade the lease within
1893this grace period, the kernel forcibly breaks the lease.
1894.TP
1895.I /proc/sys/fs/leases-enable
1896This file can be used to enable or disable file leases
1897.RB ( fcntl (2))
1898on a system-wide basis.
1899If this file contains the value 0, leases are disabled.
eba72288 1900A non-zero value enables leases.
6d64ca9c
MK
1901.TP
1902.IR /proc/sys/fs/mqueue " (since Linux 2.6.6)"
c13182ef 1903This directory contains files
6d64ca9c
MK
1904.IR msg_max ", " msgsize_max ", and " queues_max ,
1905controlling the resources used by POSIX message queues.
96018ebe 1906See
c13182ef 1907.BR mq_overview (7)
96018ebe 1908for details.
6d64ca9c
MK
1909.TP
1910.IR /proc/sys/fs/overflowgid " and " /proc/sys/fs/overflowuid
1911These files
1912allow you to change the value of the fixed UID and GID.
1913The default is 65534.
24d01c53 1914Some file systems only support 16-bit UIDs and GIDs, although in Linux
c13182ef 1915UIDs and GIDs are 32 bits.
24d01c53 1916When one of these file systems is mounted
6d64ca9c
MK
1917with writes enabled, any UID or GID that would exceed 65535 is translated
1918to the overflow value before being written to disk.
1919.TP
43da96f2
MK
1920.IR /proc/sys/fs/suid_dumpable " (since Linux 2.6.13)"
1921.\" The following is based on text from Documentation/sysctl/kernel.txt
c13182ef 1922The value in this file determines whether core dump files are
f1162930
MK
1923produced for set-user-ID or otherwise protected/tainted binaries.
1924Three different integer values can be specified:
43da96f2
MK
1925.sp
1926\fI0\ (default)\fP
d9bfdb9c 1927This provides the traditional (pre-Linux 2.6.13) behavior.
c13182ef 1928A core dump will not be produced for a process which has
f1162930 1929changed credentials (by calling
c13182ef
MK
1930.BR seteuid (2),
1931.BR setgid (2),
1932or similar, or by executing a set-user-ID or set-group-ID program)
f1162930 1933or whose binary does not have read permission enabled.
43da96f2 1934.sp
f1162930 1935\fI1\ ("debug")\fP
43da96f2 1936All processes dump core when possible.
c13182ef 1937The core dump is owned by the file system user ID of the dumping process
f1162930 1938and no security is applied.
43da96f2
MK
1939This is intended for system debugging situations only.
1940Ptrace is unchecked.
1941.sp
f1162930 1942\fI2\ ("suidsafe")\fP
c13182ef
MK
1943Any binary which normally would not be dumped (see "0" above)
1944is dumped readable by root only.
f1162930 1945This allows the user to remove the core dump file but not to read it.
c13182ef 1946For security reasons core dumps in this mode will not overwrite one
43da96f2 1947another or other files.
b877b392 1948This mode is appropriate when administrators are
43da96f2 1949attempting to debug problems in a normal environment.
fea681da 1950.TP
c13182ef
MK
1951.I /proc/sys/fs/super-max
1952This file
fea681da 1953controls the maximum number of superblocks, and
24d01c53 1954thus the maximum number of mounted file systems the kernel
c13182ef 1955can have.
59a40ed7
MK
1956You only need to increase
1957.I super-max
1958if you need to mount more file systems than the current value in
1959.I super-max
fea681da
MK
1960allows you to.
1961.TP
1962.I /proc/sys/fs/super-nr
c13182ef 1963This file
24d01c53 1964contains the number of file systems currently mounted.
fea681da
MK
1965.TP
1966.I /proc/sys/kernel
417fceb7 1967This directory contains files controlling a range of kernel parameters,