OSDN Git Service

aa42c772a5369ff7aeff86c46eb898950b02ad38
[linuxjm/LDP_man-pages.git] / original / man5 / proc.5
1 .\" Copyright (C) 1994, 1995 by Daniel Quinlan (quinlan@yggdrasil.com)
2 .\" and Copyright (C) 2002-2008 Michael Kerrisk <mtk.manpages@gmail.com>
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
7 .\" Michael Kerrisk <mtk.manpages@gmail.com>
8 .\"
9 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
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
26 .\" License along with this manual; if not, see
27 .\" <http://www.gnu.org/licenses/>.
28 .\" %%%LICENSE_END
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
36 .\"    by Michael Kerrisk <mtk.manpages@gmail.com>
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
39 .\" 2004-12-14, mtk, updated 'statm', and fixed error in order of list
40 .\" 2005-05-12, mtk, updated 'stat'
41 .\" 2005-07-13, mtk, added /proc/sys/fs/mqueue/*
42 .\" 2005-09-16, mtk, Added /proc/sys/fs/suid_dumpable
43 .\" 2005-09-19, mtk, added /proc/zoneinfo
44 .\" 2005-03-01, mtk, moved /proc/sys/fs/mqueue/* material to mq_overview.7.
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.
49 .\" 2008-07-15, mtk, added /proc/config.gz
50 .\"
51 .\" FIXME 2.6.13 seems to have /proc/vmcore implemented
52 .\" in the source code, but there is no option available under
53 .\" 'make xconfig'; eventually this should be fixed, and then info
54 .\" from the patch-2.6.13 and change log could be used to write an
55 .\" entry in this man page.
56 .\" Needs CONFIG_VMCORE
57 .\"
58 .\" FIXME cross check against Documentation/filesystems/proc.txt
59 .\" to see what information could be imported from that file
60 .\" into this file.
61 .\"
62 .TH PROC 5 2013-09-04 "Linux" "Linux Programmer's Manual"
63 .SH NAME
64 proc \- process information pseudo-filesystem
65 .SH DESCRIPTION
66 The
67 .I proc
68 filesystem is a pseudo-filesystem which provides an interface to
69 kernel data structures.
70 It is commonly mounted at
71 .IR /proc .
72 Most of it is read-only, but some files allow kernel variables to be
73 changed.
74 .LP
75 The following list describes many of the files and directories under the
76 .I /proc
77 hierarchy.
78 .PD 1
79 .TP
80 .I /proc/[pid]
81 There is a numerical subdirectory for each running process; the
82 subdirectory is named by the process ID.
83 Each such subdirectory contains the following
84 pseudo-files and directories.
85 .\" FIXME Describe /proc/[pid]/attr and
86 .\"       /proc/[pid]/task/[tid]/attr
87 .\"       This is a directory
88 .\"       Added in ???
89 .\"       CONFIG_SECURITY
90 .\"
91 .TP
92 .IR /proc/[pid]/auxv " (since 2.6.0-test7)"
93 This contains the contents of the ELF interpreter information passed
94 to the process at exec time.
95 The format is one \fIunsigned long\fP ID
96 plus one \fIunsigned long\fP value for each entry.
97 The last entry contains two zeros.
98 .TP
99 .IR /proc/[pid]/cgroup " (since Linux 2.6.24)"
100 .\"       Info in Documentation/cgroups/cgroups.txt
101 This file describes control groups to which the process/task belongs.
102 For each cgroup hierarchy there is one entry containing
103 colon-separated fields of the form:
104 .nf
105 .ft CW
106
107     5:cpuacct,cpu,cpuset:/daemons
108 .ft
109 .fi
110 .IP
111 The colon-separated fields are, from left to right:
112 .RS 11
113 .IP 1. 3
114 hierarchy ID number
115 .IP 2.
116 set of subsystems bound to the hierarchy
117 .IP 3.
118 control group in the hierarchy to which the process belongs
119 .RE
120 .IP
121 This file is present only if the
122 .B CONFIG_CGROUPS
123 kernel configuration option is enabled.
124 .\"
125 .\" FIXME Describe /proc/[pid]/clear_refs
126 .\"       Added in 2.6.22
127 .\"       "Clears page referenced bits shown in smaps output"
128 .\"       write-only
129 .\"       CONFIG_PROC_PAGE_MONITOR
130 .TP
131 .I /proc/[pid]/cmdline
132 This holds the complete command line for the process,
133 unless the process is a zombie.
134 .\" In 2.3.26, this also used to be true if the process was swapped out.
135 In the latter case, there is nothing in this file:
136 that is, a read on this file will return 0 characters.
137 The command-line arguments appear in this file as a set of
138 strings separated by null bytes (\(aq\\0\(aq),
139 with a further null byte after the last string.
140 .TP
141 .IR /proc/[pid]/coredump_filter " (since kernel 2.6.23)"
142 See
143 .BR core (5).
144 .TP
145 .IR /proc/[pid]/cpuset " (since kernel 2.6.12)"
146 .\" and/proc/[pid]/task/[tid]/cpuset
147 See
148 .BR cpuset (7).
149 .TP
150 .I /proc/[pid]/cwd
151 This is a symbolic link to the current working directory of the process.
152 To find out the current working directory of process 20,
153 for instance, you can do this:
154
155 .in +4n
156 .nf
157 .RB "$" " cd /proc/20/cwd; /bin/pwd"
158 .fi
159 .in
160
161 Note that the
162 .I pwd
163 command is often a shell built-in, and might
164 not work properly.
165 In
166 .BR bash (1),
167 you may use
168 .IR "pwd\ \-P" .
169
170 .\" The following was still true as at kernel 2.6.13
171 In a multithreaded process, the contents of this symbolic link
172 are not available if the main thread has already terminated
173 (typically by calling
174 .BR pthread_exit (3)).
175 .TP
176 .I /proc/[pid]/environ
177 This file contains the environment for the process.
178 The entries are separated by null bytes (\(aq\\0\(aq),
179 and there may be a null byte at the end.
180 Thus, to print out the environment of process 1, you would do:
181 .in +4n
182 .nf
183
184 .ft CW
185 .RB "$" " strings /proc/1/environ"
186 .fi
187 .ft P
188 .in
189 .TP
190 .I /proc/[pid]/exe
191 Under Linux 2.2 and later, this file is a symbolic link
192 containing the actual pathname of the executed command.
193 This symbolic link can be dereferenced normally; attempting to open
194 it will open the executable.
195 You can even type
196 .I /proc/[pid]/exe
197 to run another copy of the same executable as is being run by
198 process [pid].
199 .\" The following was still true as at kernel 2.6.13
200 In a multithreaded process, the contents of this symbolic link
201 are not available if the main thread has already terminated
202 (typically by calling
203 .BR pthread_exit (3)).
204
205 Under Linux 2.0 and earlier
206 .I /proc/[pid]/exe
207 is a pointer to the binary which was executed,
208 and appears as a symbolic link.
209 A
210 .BR readlink (2)
211 call on this file under Linux 2.0 returns a string in the format:
212
213     [device]:inode
214
215 For example, [0301]:1502 would be inode 1502 on device major 03 (IDE,
216 MFM, etc. drives) minor 01 (first partition on the first drive).
217
218 .BR find (1)
219 with the
220 .I \-inum
221 option can be used to locate the file.
222 .TP
223 .I /proc/[pid]/fd/
224 This is a subdirectory containing one entry for each file which the
225 process has open, named by its file descriptor, and which is a
226 symbolic link to the actual file.
227 Thus, 0 is standard input, 1 standard output, 2 standard error, etc.
228
229 For file descriptors for pipes and sockets,
230 the entries will be symbolic links whose content is the
231 file type with the inode.
232 A
233 .BR readlink (2)
234 call on this file returns a string in the format:
235
236     type:[inode]
237
238 For example,
239 .I socket:[2248868]
240 will be a socket and its inode is 2248868.
241 For sockets, that inode can be used to find more information
242 in one of the files under
243 .IR /proc/net/ .
244
245 For file descriptors that have no corresponding inode
246 (e.g., file descriptors produced by
247 .BR epoll_create (2),
248 .BR eventfd (2),
249 .BR inotify_init (2),
250 .BR signalfd (2),
251 and
252 .BR timerfd (2)),
253 the entry will be a symbolic link with contents of the form
254
255     anon_inode:<file-type>
256
257 In some cases, the
258 .I file-type
259 is surrounded by square brackets.
260
261 For example, an epoll file descriptor will have a symbolic link
262 whose content is the string
263 .IR "anon_inode:[eventpoll]" .
264
265 .\"The following was still true as at kernel 2.6.13
266 In a multithreaded process, the contents of this directory
267 are not available if the main thread has already terminated
268 (typically by calling
269 .BR pthread_exit (3)).
270
271 Programs that will take a filename as a command-line argument,
272 but will not take input from standard input if no argument is supplied,
273 or that write to a file named as a command-line argument,
274 but will not send their output to standard output
275 if no argument is supplied, can nevertheless be made to use
276 standard input or standard out using
277 .IR /proc/[pid]/fd .
278 For example, assuming that
279 .I \-i
280 is the flag designating an input file and
281 .I \-o
282 is the flag designating an output file:
283 .in +4n
284 .nf
285
286 .RB "$" " foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ..."
287 .fi
288 .in
289
290 and you have a working filter.
291 .\" The following is not true in my tests (MTK):
292 .\" Note that this will not work for
293 .\" programs that seek on their files, as the files in the fd directory
294 .\" are not seekable.
295
296 .I /proc/self/fd/N
297 is approximately the same as
298 .I /dev/fd/N
299 in some UNIX and UNIX-like systems.
300 Most Linux MAKEDEV scripts symbolically link
301 .I /dev/fd
302 to
303 .IR /proc/self/fd ,
304 in fact.
305
306 Most systems provide symbolic links
307 .IR /dev/stdin ,
308 .IR /dev/stdout ,
309 and
310 .IR /dev/stderr ,
311 which respectively link to the files
312 .IR 0 ,
313 .IR 1 ,
314 and
315 .IR 2
316 in
317 .IR /proc/self/fd .
318 Thus the example command above could be written as:
319 .in +4n
320 .nf
321
322 .RB "$" " foobar \-i /dev/stdin \-o /dev/stdout ..."
323 .fi
324 .in
325 .\" FIXME Describe /proc/[pid]/loginuid
326 .\"       Added in 2.6.11; updating requires CAP_AUDIT_CONTROL
327 .\"       CONFIG_AUDITSYSCALL
328 .TP
329 .IR /proc/[pid]/fdinfo/ " (since kernel 2.6.22)"
330 This is a subdirectory containing one entry for each file which the
331 process has open, named by its file descriptor.
332 The contents of each file can be read to obtain information
333 about the corresponding file descriptor, for example:
334 .in +4n
335 .nf
336
337 .RB "$" " cat /proc/12015/fdinfo/4"
338 pos:    1000
339 flags:  01002002
340 .fi
341 .in
342
343 The
344 .I pos
345 field is a decimal number showing the current file offset.
346 The
347 .I flags
348 field is an octal number that displays the
349 file access mode and file status flags (see
350 .BR open (2)).
351
352 The files in this directory are readable only by the owner of the process.
353 .TP
354 .IR /proc/[pid]/io " (since kernel 2.6.20)"
355 .\" commit 7c3ab7381e79dfc7db14a67c6f4f3285664e1ec2
356 This file contains I/O statistics for the process, for example:
357 .in +4n
358 .nf
359
360 .RB "#" " cat /proc/3828/io"
361 rchar: 323934931
362 wchar: 323929600
363 syscr: 632687
364 syscw: 632675
365 read_bytes: 0
366 write_bytes: 323932160
367 cancelled_write_bytes: 0
368 .fi
369 .in
370
371 The fields are as follows:
372 .RS
373 .TP
374 .IR rchar ": characters read"
375 The number of bytes which this task has caused to be read from storage.
376 This is simply the sum of bytes which this process passed to
377 .BR read (2)
378 and similar system calls.
379 It includes things such as terminal I/O and
380 is unaffected by whether or not actual
381 physical disk I/O was required (the read might have been satisfied from
382 pagecache).
383 .TP
384 .IR wchar ": characters written"
385 The number of bytes which this task has caused, or shall cause to be written
386 to disk.
387 Similar caveats apply here as with
388 .IR rchar .
389 .TP
390 .IR syscr ": read syscalls"
391 Attempt to count the number of read I/O operations\(emthat is,
392 system calls such as
393 .BR read (2)
394 and
395 .BR pread (2).
396 .TP
397 .IR syscw ": write syscalls"
398 Attempt to count the number of write I/O operations\(emthat is,
399 system calls such as
400 .BR write (2)
401 and
402 .BR pwrite (2).
403 .TP
404 .IR read_bytes ": bytes read"
405 Attempt to count the number of bytes which this process really did cause to
406 be fetched from the storage layer.
407 This is accurate for block-backed filesystems.
408 .TP
409 .IR write_bytes ": bytes written"
410 Attempt to count the number of bytes which this process caused to be sent to
411 the storage layer.
412 .TP
413 .IR cancelled_write_bytes :
414 The big inaccuracy here is truncate.
415 If a process writes 1MB to a file and then deletes the file,
416 it will in fact perform no writeout.
417 But it will have been accounted as having caused 1MB of write.
418 In other words: this field represents the number of bytes which this process
419 caused to not happen, by truncating pagecache.
420 A task can cause "negative" I/O too.
421 If this task truncates some dirty pagecache,
422 some I/O which another task has been accounted for
423 (in its
424 .IR write_bytes )
425 will not be happening.
426 .RE
427 .IP
428 .IR Note :
429 In the current implementation, things are a bit racy on 32-bit systems:
430 if process A reads process B's
431 .I /proc/[pid]/io
432 while process B is updating one of these 64-bit counters,
433 process A could see an intermediate result.
434 .RE
435 .TP
436 .IR /proc/[pid]/limits " (since kernel 2.6.24)"
437 This file displays the soft limit, hard limit, and units of measurement
438 for each of the process's resource limits (see
439 .BR getrlimit (2)).
440 Up to and including Linux 2.6.35,
441 this file is protected to allow reading only by the real UID of the process.
442 Since Linux 2.6.36,
443 .\" commit 3036e7b490bf7878c6dae952eec5fb87b1106589
444 this file is readable by all users on the system.
445 .TP
446 .IR /proc/[pid]/map_files/ " (since kernel 3.3)
447 .\" commit 640708a2cff7f81e246243b0073c66e6ece7e53e
448 This subdirectory contains entries corresponding to memory-mapped
449 files (see
450 .BR mmap (2)).
451 Entries are named by memory region start and end
452 address pair (expressed as hexadecimal numbers),
453 and are symbolic links to the mapped files themselves.
454 Here is an example, with the output wrapped and reformatted to fit on an 80-column display:
455 .in +4n
456 .nf
457
458 .RB "$" " ls -l /proc/self/map_files/"
459 lr\-\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:31
460             3252e00000\-3252e20000 \-> /usr/lib64/ld-2.15.so
461 \&...
462 .fi
463 .in
464
465 Although these entries are present for memory regions that were
466 mapped with  the
467 .BR MAP_FILE
468 flag, the way anonymous shared memory (regions created with the
469 .B MAP_ANON | MAP_SHARED
470 flags)
471 is implemented in Linux
472 means that such regions also appear on this directory.
473 Here is an example where the target file is the deleted
474 .I /dev/zero
475 one:
476 .in +4n
477 .nf
478
479 .RB
480 lrw\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:33
481             7fc075d2f000\-7fc075e6f000 \-> /dev/zero (deleted)
482 .fi
483 .in
484
485 This directory appears only if the
486 .B CONFIG_CHECKPOINT_RESTORE
487 kernel configuration option is enabled.
488 .TP
489 .I /proc/[pid]/maps
490 A file containing the currently mapped memory regions and their access
491 permissions.
492 See
493 .BR mmap (2)
494 for some further information about memory mappings.
495
496 The format of the file is:
497
498 .in -7n
499 .nf
500 .ft CW
501 .ft
502 .I "address           perms offset  dev   inode       pathname"
503 00400000-00452000 r-xp 00000000 08:02 173521      /usr/bin/dbus-daemon
504 00651000-00652000 r--p 00051000 08:02 173521      /usr/bin/dbus-daemon
505 00652000-00655000 rw-p 00052000 08:02 173521      /usr/bin/dbus-daemon
506 00e03000-00e24000 rw-p 00000000 00:00 0           [heap]
507 00e24000-011f7000 rw-p 00000000 00:00 0           [heap]
508 \&...
509 35b1800000-35b1820000 r-xp 00000000 08:02 135522  /usr/lib64/ld-2.15.so
510 35b1a1f000-35b1a20000 r--p 0001f000 08:02 135522  /usr/lib64/ld-2.15.so
511 35b1a20000-35b1a21000 rw-p 00020000 08:02 135522  /usr/lib64/ld-2.15.so
512 35b1a21000-35b1a22000 rw-p 00000000 00:00 0
513 35b1c00000-35b1dac000 r-xp 00000000 08:02 135870  /usr/lib64/libc-2.15.so
514 35b1dac000-35b1fac000 ---p 001ac000 08:02 135870  /usr/lib64/libc-2.15.so
515 35b1fac000-35b1fb0000 r--p 001ac000 08:02 135870  /usr/lib64/libc-2.15.so
516 35b1fb0000-35b1fb2000 rw-p 001b0000 08:02 135870  /usr/lib64/libc-2.15.so
517 \&...
518 f2c6ff8c000-7f2c7078c000 rw-p 00000000 00:00 0    [stack:986]
519 \&...
520 7fffb2c0d000-7fffb2c2e000 rw-p 00000000 00:00 0   [stack]
521 7fffb2d48000-7fffb2d49000 r-xp 00000000 00:00 0   [vdso]
522 .fi
523 .in
524
525 The
526 .I address
527 field is the address space in the process that the mapping occupies.
528 The
529 .I perms
530 field is a set of permissions:
531
532 .nf
533 .in +5
534 r = read
535 w = write
536 x = execute
537 s = shared
538 p = private (copy on write)
539 .fi
540 .in
541
542 The
543 .I offset
544 field is the offset into the file/whatever;
545 .I dev
546 is the device
547 (major:minor);
548 .I inode
549 is the inode on that device.
550 0 indicates that no inode is associated with the memory region,
551 as would be the case with BSS (uninitialized data).
552
553 The
554 .I pathname
555 field will usually be the file that is backing the mapping.
556 For ELF files,
557 you can easily coordinate with the
558 .I offset
559 field by looking at the
560 Offset field in the ELF program headers
561 .RI ( "readelf\ \-l" ).
562
563 There are additional helpful pseudo-paths:
564 .RS 12
565 .TP
566 .IR [stack]
567 The initial process's (also known as the main thread's) stack.
568 .TP
569 .IR [stack:<tid>] " (since Linux 3.4)"
570 .\" commit b76437579d1344b612cf1851ae610c636cec7db0
571 A thread's stack (where the
572 .IR <tid>
573 is a thread ID).
574 It corresponds to the
575 .IR /proc/[pid]/task/[tid]/
576 path.
577 .TP
578 .IR [vdso]
579 The virtual dynamically linked shared object.
580 .TP
581 .IR [heap]
582 The process's heap.
583 .in
584 .fi
585 .RE
586 .IP
587 If the
588 .I pathname
589 field is blank,
590 this is an anonymous mapping as obtained via the
591 .BR mmap (2)
592 function.
593 There is no easy way to coordinate this back to a process's source,
594 short of running it through
595 .BR gdb (1),
596 .BR strace (1),
597 or similar.
598
599 Under Linux 2.0 there is no field giving pathname.
600 .TP
601 .I /proc/[pid]/mem
602 This file can be used to access the pages of a process's memory through
603 .BR open (2),
604 .BR read (2),
605 and
606 .BR lseek (2).
607 .TP
608 .IR /proc/[pid]/mountinfo " (since Linux 2.6.26)"
609 .\" This info adapted from Documentation/filesystems/proc.txt
610 This file contains information about mount points.
611 It contains lines of the form:
612 .nf
613 .ft CW
614
615 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue
616 (1)(2)(3)   (4)   (5)      (6)      (7)   (8) (9)   (10)         (11)
617 .ft
618 .fi
619 .IP
620 The numbers in parentheses are labels for the descriptions below:
621 .RS 7
622 .TP 5
623 (1)
624 mount ID: unique identifier of the mount (may be reused after
625 .BR umount (2)).
626 .TP
627 (2)
628 parent ID: ID of parent mount (or of self for the top of the mount tree).
629 .TP
630 (3)
631 major:minor: value of
632 .I st_dev
633 for files on filesystem (see
634 .BR stat (2)).
635 .TP
636 (4)
637 root: root of the mount within the filesystem.
638 .TP
639 (5)
640 mount point: mount point relative to the process's root.
641 .TP
642 (6)
643 mount options: per-mount options.
644 .TP
645 (7)
646 optional fields: zero or more fields of the form "tag[:value]".
647 .TP
648 (8)
649 separator: marks the end of the optional fields.
650 .TP
651 (9)
652 filesystem type: name of filesystem in the form "type[.subtype]".
653 .TP
654 (10)
655 mount source: filesystem-specific information or "none".
656 .TP
657 (11)
658 super options: per-super block options.
659 .RE
660 .IP
661 Parsers should ignore all unrecognized optional fields.
662 Currently the possible optional fields are:
663 .RS 12
664 .TP 18
665 shared:X
666 mount is shared in peer group X
667 .TP
668 master:X
669 mount is slave to peer group X
670 .TP
671 propagate_from:X
672 mount is slave and receives propagation from peer group X (*)
673 .TP
674 unbindable
675 mount is unbindable
676 .RE
677 .IP
678 (*) X is the closest dominant peer group under the process's root.
679 If X is the immediate master of the mount,
680 or if there is no dominant peer group under the same root,
681 then only the "master:X" field is present
682 and not the "propagate_from:X" field.
683
684 For more information on mount propagation see:
685 .I Documentation/filesystems/sharedsubtree.txt
686 in the Linux kernel source tree.
687 .TP
688 .IR /proc/[pid]/mounts " (since Linux 2.4.19)"
689 This is a list of all the filesystems currently mounted in the
690 process's mount namespace.
691 The format of this file is documented in
692 .BR fstab (5).
693 Since kernel version 2.6.15, this file is pollable:
694 after opening the file for reading, a change in this file
695 (i.e., a filesystem mount or unmount) causes
696 .BR select (2)
697 to mark the file descriptor as readable, and
698 .BR poll (2)
699 and
700 .BR epoll_wait (2)
701 mark the file as having an error condition.
702 .TP
703 .IR /proc/[pid]/mountstats " (since Linux 2.6.17)"
704 This file exports information (statistics, configuration information)
705 about the mount points in the process's name space.
706 Lines in this file have the form:
707 .nf
708
709 device /dev/sda7 mounted on /home with fstype ext3 [statistics]
710 (       1      )            ( 2 )             (3 ) (4)
711 .fi
712 .IP
713 The fields in each line are:
714 .RS 7
715 .TP 5
716 (1)
717 The name of the mounted device
718 (or "nodevice" if there is no corresponding device).
719 .TP
720 (2)
721 The mount point within the filesystem tree.
722 .TP
723 (3)
724 The filesystem type.
725 .TP
726 (4)
727 Optional statistics and configuration information.
728 Currently (as at Linux 2.6.26), only NFS filesystems export
729 information via this field.
730 .RE
731 .IP
732 This file is readable only by the owner of the process.
733 .TP
734 .IR /proc/[pid]/ns/ " (since Linux 3.0)"
735 .\" See commit 6b4e306aa3dc94a0545eb9279475b1ab6209a31f
736 This is a subdirectory containing one entry for each namespace that
737 supports being manipulated by
738 .BR setns (2).
739 For information about namespaces, see
740 .BR clone (2).
741 .TP
742 .IR /proc/[pid]/ns/ipc " (since Linux 3.0)"
743 Bind mounting this file (see
744 .BR mount (2))
745 to somewhere else in the filesystem keeps
746 the IPC namespace of the process specified by
747 .I pid
748 alive even if all processes currently in the namespace terminate.
749
750 Opening this file returns a file handle for the IPC namespace
751 of the process specified by
752 .IR pid .
753 As long as this file descriptor remains open,
754 the IPC namespace will remain alive,
755 even if all processes in the namespace terminate.
756 The file descriptor can be passed to
757 .BR setns (2).
758 .TP
759 .IR /proc/[pid]/ns/net " (since Linux 3.0)"
760 Bind mounting this file (see
761 .BR mount (2))
762 to somewhere else in the filesystem keeps
763 the network namespace of the process specified by
764 .I pid
765 alive even if all processes in the namespace terminate.
766
767 Opening this file returns a file handle for the network namespace
768 of the process specified by
769 .IR pid .
770 As long as this file descriptor remains open,
771 the network namespace will remain alive,
772 even if all processes in the namespace terminate.
773 The file descriptor can be passed to
774 .BR setns (2).
775 .TP
776 .IR /proc/[pid]/ns/uts " (since Linux 3.0)"
777 Bind mounting this file (see
778 .BR mount (2))
779 to somewhere else in the filesystem keeps
780 the UTS namespace of the process specified by
781 .I pid
782 alive even if all processes currently in the namespace terminate.
783
784 Opening this file returns a file handle for the UTS namespace
785 of the process specified by
786 .IR pid .
787 As long as this file descriptor remains open,
788 the UTS namespace will remain alive,
789 even if all processes in the namespace terminate.
790 The file descriptor can be passed to
791 .BR setns (2).
792 .TP
793 .IR /proc/[pid]/numa_maps " (since Linux 2.6.14)"
794 See
795 .BR numa (7).
796 .TP
797 .IR /proc/[pid]/oom_adj " (since Linux 2.6.11)"
798 This file can be used to adjust the score used to select which process
799 should be killed in an out-of-memory (OOM) situation.
800 The kernel uses this value for a bit-shift operation of the process's
801 .IR oom_score
802 value:
803 valid values are in the range \-16 to +15,
804 plus the special value \-17,
805 which disables OOM-killing altogether for this process.
806 A positive score increases the likelihood of this
807 process being killed by the OOM-killer;
808 a negative score decreases the likelihood.
809 .IP
810 The default value for this file is 0;
811 a new process inherits its parent's
812 .I oom_adj
813 setting.
814 A process must be privileged
815 .RB ( CAP_SYS_RESOURCE )
816 to update this file.
817 .IP
818 Since Linux 2.6.36, use of this file is deprecated in favor of
819 .IR /proc/[pid]/oom_score_adj .
820 .TP
821 .IR /proc/[pid]/oom_score " (since Linux 2.6.11)"
822 .\" See mm/oom_kill.c::badness() in the 2.6.25 sources
823 This file displays the current score that the kernel gives to
824 this process for the purpose of selecting a process
825 for the OOM-killer.
826 A higher score means that the process is more likely to be
827 selected by the OOM-killer.
828 The basis for this score is the amount of memory used by the process,
829 with increases (+) or decreases (\-) for factors including:
830 .\" See mm/oom_kill.c::badness() in the 2.6.25 sources
831 .RS
832 .IP * 2
833 whether the process creates a lot of children using
834 .BR fork (2)
835 (+);
836 .IP *
837 whether the process has been running a long time,
838 or has used a lot of CPU time (\-);
839 .IP *
840 whether the process has a low nice value (i.e., > 0) (+);
841 .IP *
842 whether the process is privileged (\-); and
843 .\" More precisely, if it has CAP_SYS_ADMIN or CAP_SYS_RESOURCE
844 .IP *
845 whether the process is making direct hardware access (\-).
846 .\" More precisely, if it has CAP_SYS_RAWIO
847 .RE
848 .IP
849 The
850 .I oom_score
851 also reflects the adjustment specified by the
852 .I oom_score_adj
853 or
854 .I oom_adj
855 setting for the process.
856 .TP
857 .IR /proc/[pid]/oom_score_adj " (since Linux 2.6.36)"
858 .\" Text taken from 3.7 Documentation/filesystems/proc.txt
859 This file can be used to adjust the badness heuristic used to select which
860 process gets killed in out-of-memory conditions.
861
862 The badness heuristic assigns a value to each candidate task ranging from 0
863 (never kill) to 1000 (always kill) to determine which process is targeted.
864 The units are roughly a proportion along that range of
865 allowed memory the process may allocate from,
866 based on an estimation of its current memory and swap use.
867 For example, if a task is using all allowed memory,
868 its badness score will be 1000.
869 If it is using half of its allowed memory, its score will be 500.
870
871 There is an additional factor included in the badness score: root
872 processes are given 3% extra memory over other tasks.
873
874 The amount of "allowed" memory depends on the context
875 in which the OOM-killer was called.
876 If it is due to the memory assigned to the allocating task's cpuset
877 being exhausted,
878 the allowed memory represents the set of mems assigned to that
879 cpuset (see
880 .BR cpuset (7)).
881 If it is due to a mempolicy's node(s) being exhausted,
882 the allowed memory represents the set of mempolicy nodes.
883 If it is due to a memory limit (or swap limit) being reached,
884 the allowed memory is that configured limit.
885 Finally, if it is due to the entire system being out of memory, the
886 allowed memory represents all allocatable resources.
887
888 The value of
889 .I oom_score_adj
890 is added to the badness score before it
891 is used to determine which task to kill.
892 Acceptable values range from \-1000
893 (OOM_SCORE_ADJ_MIN) to +1000 (OOM_SCORE_ADJ_MAX).
894 This allows user space to control the preference for OOM-killing,
895 ranging from always preferring a certain
896 task or completely disabling it from OOM-killing.
897 The lowest possible value, \-1000, is
898 equivalent to disabling OOM-killing entirely for that task,
899 since it will always report a badness score of 0.
900
901 Consequently, it is very simple for user space to define
902 the amount of memory to consider for each task.
903 Setting a
904 .I oom_score_adj
905 value of +500, for example,
906 is roughly equivalent to allowing the remainder of tasks sharing the
907 same system, cpuset, mempolicy, or memory controller resources
908 to use at least 50% more memory.
909 A value of \-500, on the other hand, would be roughly
910 equivalent to discounting 50% of the task's
911 allowed memory from being considered as scoring against the task.
912
913 For backward compatibility with previous kernels,
914 .I /proc/[pid]/oom_adj
915 can still be used to tune the badness score.
916 Its value is
917 scaled linearly with
918 .IR oom_score_adj .
919
920 Writing to
921 .IR /proc/[pid]/oom_score_adj
922 or
923 .IR /proc/[pid]/oom_adj
924 will change the other with its scaled value.
925 .\" FIXME Describe /proc/[pid]/pagemap
926 .\"       Added in 2.6.25
927 .\"       CONFIG_PROC_PAGE_MONITOR
928 .TP
929 .I /proc/[pid]/root
930 UNIX and Linux support the idea of a per-process root of the
931 filesystem, set by the
932 .BR chroot (2)
933 system call.
934 This file is a symbolic link that points to the process's
935 root directory, and behaves as exe, fd/*, etc. do.
936
937 .\" The following was still true as at kernel 2.6.13
938 In a multithreaded process, the contents of this symbolic link
939 are not available if the main thread has already terminated
940 (typically by calling
941 .BR pthread_exit (3)).
942 .\" FIXME Describe /proc/[pid]/seccomp
943 .\"       Added in 2.6.12
944 .\" FIXME Describe /proc/[pid]/sessionid
945 .\"       Added in 2.6.25; read-only; only readable by real UID
946 .\"       CONFIG_AUDITSYSCALL
947 .\" FIXME Describe /proc/[pid]/sched
948 .\"       Added in 2.6.23
949 .\"       CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS
950 .\"       Displays various scheduling parameters
951 .\"       This file can be written, to reset stats
952 .\" FIXME Describe /proc/[pid]/schedstats and
953 .\"       /proc/[pid]/task/[tid]/schedstats
954 .\"       Added in 2.6.9
955 .\"       CONFIG_SCHEDSTATS
956 .TP
957 .IR /proc/[pid]/smaps " (since Linux 2.6.14)"
958 .\"       CONFIG_PROC_PAGE_MONITOR
959 This file shows memory consumption for each of the process's mappings.
960 For each of mappings there is a series of lines such as the following:
961 .in +4n
962 .nf
963
964 08048000-080bc000 r-xp 00000000 03:02 13130      /bin/bash
965 Size:               464 kB
966 Rss:                424 kB
967 Shared_Clean:       424 kB
968 Shared_Dirty:         0 kB
969 Private_Clean:        0 kB
970 Private_Dirty:        0 kB
971
972 .fi
973 .in
974 The first of these lines shows the same information as is displayed
975 for the mapping in
976 .IR /proc/[pid]/maps .
977 The remaining lines show the size of the mapping,
978 the amount of the mapping that is currently resident in RAM,
979 the number of clean and dirty shared pages in the mapping,
980 and the number of clean and dirty private pages in the mapping.
981
982 This file is present only if the
983 .B CONFIG_MMU
984 kernel configuration
985 option is enabled.
986 .TP
987 .I /proc/[pid]/stat
988 Status information about the process.
989 This is used by
990 .BR ps (1).
991 It is defined in
992 .IR /usr/src/linux/fs/proc/array.c "."
993
994 The fields, in order, with their proper
995 .BR scanf (3)
996 format specifiers, are:
997 .RS
998 .TP 12
999 \fIpid\fP %d
1000 (1) The process ID.
1001 .TP
1002 \fIcomm\fP %s
1003 (2) The filename of the executable, in parentheses.
1004 This is visible whether or not the executable is swapped out.
1005 .TP
1006 \fIstate\fP %c
1007 (3) One character from the string "RSDZTW" where R is running, S is
1008 sleeping in an interruptible wait, D is waiting in uninterruptible
1009 disk sleep, Z is zombie, T is traced or stopped (on a signal),
1010 and W is paging.
1011 .TP
1012 \fIppid\fP %d
1013 (4) The PID of the parent.
1014 .TP
1015 \fIpgrp\fP %d
1016 (5) The process group ID of the process.
1017 .TP
1018 \fIsession\fP %d
1019 (6) The session ID of the process.
1020 .TP
1021 \fItty_nr\fP %d
1022 (7) The controlling terminal of the process.
1023 (The minor device number is contained in the combination of bits
1024 31 to 20 and 7 to 0;
1025 the major device number is in bits 15 to 8.)
1026 .TP
1027 \fItpgid\fP %d
1028 .\" This field and following, up to and including wchan added 0.99.1
1029 (8) The ID of the foreground process group of the controlling
1030 terminal of the process.
1031 .TP
1032 \fIflags\fP %u (%lu before Linux 2.6.22)
1033 (9) The kernel flags word of the process.
1034 For bit meanings,
1035 see the PF_* defines in the Linux kernel source file
1036 .IR include/linux/sched.h .
1037 Details depend on the kernel version.
1038 .TP
1039 \fIminflt\fP %lu
1040 (10) The number of minor faults the process has made which have not
1041 required loading a memory page from disk.
1042 .TP
1043 \fIcminflt\fP %lu
1044 (11) The number of minor faults that the process's
1045 waited-for children have made.
1046 .TP
1047 \fImajflt\fP %lu
1048 (12) The number of major faults the process has made which have
1049 required loading a memory page from disk.
1050 .TP
1051 \fIcmajflt\fP %lu
1052 (13) The number of major faults that the process's
1053 waited-for children have made.
1054 .TP
1055 \fIutime\fP %lu
1056 (14) Amount of time that this process has been scheduled in user mode,
1057 measured in clock ticks (divide by
1058 .IR sysconf(_SC_CLK_TCK) ).
1059 This includes guest time, \fIguest_time\fP
1060 (time spent running a virtual CPU, see below),
1061 so that applications that are not aware of the guest time field
1062 do not lose that time from their calculations.
1063 .TP
1064 \fIstime\fP %lu
1065 (15) Amount of time that this process has been scheduled in kernel mode,
1066 measured in clock ticks (divide by
1067 .IR sysconf(_SC_CLK_TCK) ).
1068 .TP
1069 \fIcutime\fP %ld
1070 (16) Amount of time that this process's
1071 waited-for children have been scheduled in user mode,
1072 measured in clock ticks (divide by
1073 .IR sysconf(_SC_CLK_TCK) ).
1074 (See also
1075 .BR times (2).)
1076 This includes guest time, \fIcguest_time\fP
1077 (time spent running a virtual CPU, see below).
1078 .TP
1079 \fIcstime\fP %ld
1080 (17) Amount of time that this process's
1081 waited-for children have been scheduled in kernel mode,
1082 measured in clock ticks (divide by
1083 .IR sysconf(_SC_CLK_TCK) ).
1084 .TP
1085 \fIpriority\fP %ld
1086 (18) (Explanation for Linux 2.6)
1087 For processes running a real-time scheduling policy
1088 .RI ( policy
1089 below; see
1090 .BR sched_setscheduler (2)),
1091 this is the negated scheduling priority, minus one;
1092 that is, a number in the range \-2 to \-100,
1093 corresponding to real-time priorities 1 to 99.
1094 For processes running under a non-real-time scheduling policy,
1095 this is the raw nice value
1096 .RB ( setpriority (2))
1097 as represented in the kernel.
1098 The kernel stores nice values as numbers
1099 in the range 0 (high) to 39 (low),
1100 corresponding to the user-visible nice range of \-20 to 19.
1101
1102 Before Linux 2.6, this was a scaled value based on
1103 the scheduler weighting given to this process.
1104 .\" And back in kernel 1.2 days things were different again.
1105 .TP
1106 \fInice\fP %ld
1107 (19) The nice value (see
1108 .BR setpriority (2)),
1109 a value in the range 19 (low priority) to \-20 (high priority).
1110 .\" Back in kernel 1.2 days things were different.
1111 .\" .TP
1112 .\" \fIcounter\fP %ld
1113 .\" The current maximum size in jiffies of the process's next timeslice,
1114 .\" or what is currently left of its current timeslice, if it is the
1115 .\" currently running process.
1116 .\" .TP
1117 .\" \fItimeout\fP %u
1118 .\" The time in jiffies of the process's next timeout.
1119 .\" timeout was removed sometime around 2.1/2.2
1120 .TP
1121 \fInum_threads\fP %ld
1122 (20) Number of threads in this process (since Linux 2.6).
1123 Before kernel 2.6, this field was hard coded to 0 as a placeholder
1124 for an earlier removed field.
1125 .TP
1126 \fIitrealvalue\fP %ld
1127 (21) The time in jiffies before the next
1128 .B SIGALRM
1129 is sent to the process due to an interval timer.
1130 Since kernel 2.6.17, this field is no longer maintained,
1131 and is hard coded as 0.
1132 .TP
1133 \fIstarttime\fP %llu (was %lu before Linux 2.6)
1134 (22) The time the process started after system boot.
1135 In kernels before Linux 2.6, this value was expressed in jiffies.
1136 Since Linux 2.6, the value is expressed in clock ticks (divide by
1137 .IR sysconf(_SC_CLK_TCK) ).
1138 .TP
1139 \fIvsize\fP %lu
1140 (23) Virtual memory size in bytes.
1141 .TP
1142 \fIrss\fP %ld
1143 (24) Resident Set Size: number of pages the process has in real memory.
1144 This is just the pages which
1145 count toward text, data, or stack space.
1146 This does not include pages
1147 which have not been demand-loaded in, or which are swapped out.
1148 .TP
1149 \fIrsslim\fP %lu
1150 (25) Current soft limit in bytes on the rss of the process;
1151 see the description of
1152 .B RLIMIT_RSS
1153 in
1154 .BR getrlimit (2).
1155 .TP
1156 \fIstartcode\fP %lu
1157 (26) The address above which program text can run.
1158 .TP
1159 \fIendcode\fP %lu
1160 (27) The address below which program text can run.
1161 .TP
1162 \fIstartstack\fP %lu
1163 (28) The address of the start (i.e., bottom) of the stack.
1164 .TP
1165 \fIkstkesp\fP %lu
1166 (29) The current value of ESP (stack pointer), as found in the
1167 kernel stack page for the process.
1168 .TP
1169 \fIkstkeip\fP %lu
1170 (30) The current EIP (instruction pointer).
1171 .TP
1172 \fIsignal\fP %lu
1173 (31) The bitmap of pending signals, displayed as a decimal number.
1174 Obsolete, because it does not provide information on real-time signals; use
1175 .I /proc/[pid]/status
1176 instead.
1177 .TP
1178 \fIblocked\fP %lu
1179 (32) The bitmap of blocked signals, displayed as a decimal number.
1180 Obsolete, because it does not provide information on real-time signals; use
1181 .I /proc/[pid]/status
1182 instead.
1183 .TP
1184 \fIsigignore\fP %lu
1185 (33) The bitmap of ignored signals, displayed as a decimal number.
1186 Obsolete, because it does not provide information on real-time signals; use
1187 .I /proc/[pid]/status
1188 instead.
1189 .TP
1190 \fIsigcatch\fP %lu
1191 (34) The bitmap of caught signals, displayed as a decimal number.
1192 Obsolete, because it does not provide information on real-time signals; use
1193 .I /proc/[pid]/status
1194 instead.
1195 .TP
1196 \fIwchan\fP %lu
1197 (35) This is the "channel" in which the process is waiting.
1198 It is the
1199 address of a system call, and can be looked up in a namelist if you
1200 need a textual name.
1201 (If you have an up-to-date
1202 .IR /etc/psdatabase ,
1203 then
1204 try \fIps \-l\fP to see the WCHAN field in action.)
1205 .TP
1206 \fInswap\fP %lu
1207 (36)
1208 .\" nswap was added in 2.0
1209 Number of pages swapped (not maintained).
1210 .TP
1211 \fIcnswap\fP %lu
1212 (37)
1213 .\" cnswap was added in 2.0
1214 Cumulative \fInswap\fP for child processes (not maintained).
1215 .TP
1216 \fIexit_signal\fP %d (since Linux 2.1.22)
1217 (38) Signal to be sent to parent when we die.
1218 .TP
1219 \fIprocessor\fP %d (since Linux 2.2.8)
1220 (39) CPU number last executed on.
1221 .TP
1222 \fIrt_priority\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
1223 (40) Real-time scheduling priority, a number in the range 1 to 99 for
1224 processes scheduled under a real-time policy,
1225 or 0, for non-real-time processes (see
1226 .BR sched_setscheduler (2)).
1227 .TP
1228 \fIpolicy\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
1229 (41) Scheduling policy (see
1230 .BR sched_setscheduler (2)).
1231 Decode using the SCHED_* constants in
1232 .IR linux/sched.h .
1233 .TP
1234 \fIdelayacct_blkio_ticks\fP %llu (since Linux 2.6.18)
1235 (42) Aggregated block I/O delays, measured in clock ticks (centiseconds).
1236 .TP
1237 \fIguest_time\fP %lu (since Linux 2.6.24)
1238 (43) Guest time of the process (time spent running a virtual CPU
1239 for a guest operating system), measured in clock ticks (divide by
1240 .IR sysconf(_SC_CLK_TCK) ).
1241 .TP
1242 \fIcguest_time\fP %ld (since Linux 2.6.24)
1243 (44) Guest time of the process's children, measured in clock ticks (divide by
1244 .IR sysconf(_SC_CLK_TCK) ).
1245 .RE
1246 .TP
1247 .I /proc/[pid]/statm
1248 Provides information about memory usage, measured in pages.
1249 The columns are:
1250 .in +4n
1251 .nf
1252
1253 size       (1) total program size
1254            (same as VmSize in \fI/proc/[pid]/status\fP)
1255 resident   (2) resident set size
1256            (same as VmRSS in \fI/proc/[pid]/status\fP)
1257 share      (3) shared pages (i.e., backed by a file)
1258 text       (4) text (code)
1259 .\" (not including libs; broken, includes data segment)
1260 lib        (5) library (unused in Linux 2.6)
1261 data       (6) data + stack
1262 .\" (including libs; broken, includes library text)
1263 dt         (7) dirty pages (unused in Linux 2.6)
1264 .fi
1265 .in
1266 .TP
1267 .I /proc/[pid]/status
1268 Provides much of the information in
1269 .I /proc/[pid]/stat
1270 and
1271 .I /proc/[pid]/statm
1272 in a format that's easier for humans to parse.
1273 Here's an example:
1274 .in +4n
1275 .nf
1276
1277 .RB "$" " cat /proc/$$/status"
1278 Name:   bash
1279 State:  S (sleeping)
1280 Tgid:   3515
1281 Pid:    3515
1282 PPid:   3452
1283 TracerPid:      0
1284 Uid:    1000    1000    1000    1000
1285 Gid:    100     100     100     100
1286 FDSize: 256
1287 Groups: 16 33 100
1288 VmPeak:     9136 kB
1289 VmSize:     7896 kB
1290 VmLck:         0 kB
1291 VmHWM:      7572 kB
1292 VmRSS:      6316 kB
1293 VmData:     5224 kB
1294 VmStk:        88 kB
1295 VmExe:       572 kB
1296 VmLib:      1708 kB
1297 VmPTE:        20 kB
1298 Threads:        1
1299 SigQ:   0/3067
1300 SigPnd: 0000000000000000
1301 ShdPnd: 0000000000000000
1302 SigBlk: 0000000000010000
1303 SigIgn: 0000000000384004
1304 SigCgt: 000000004b813efb
1305 CapInh: 0000000000000000
1306 CapPrm: 0000000000000000
1307 CapEff: 0000000000000000
1308 CapBnd: ffffffffffffffff
1309 Cpus_allowed:   00000001
1310 Cpus_allowed_list:      0
1311 Mems_allowed:   1
1312 Mems_allowed_list:      0
1313 voluntary_ctxt_switches:        150
1314 nonvoluntary_ctxt_switches:     545
1315 .fi
1316 .in
1317 .IP
1318 The fields are as follows:
1319 .RS
1320 .IP * 2
1321 .IR Name :
1322 Command run by this process.
1323 .IP *
1324 .IR State :
1325 Current state of the process.
1326 One of
1327 "R (running)",
1328 "S (sleeping)",
1329 "D (disk sleep)",
1330 "T (stopped)",
1331 "T (tracing stop)",
1332 "Z (zombie)",
1333 or
1334 "X (dead)".
1335 .IP *
1336 .IR Tgid :
1337 Thread group ID (i.e., Process ID).
1338 .IP *
1339 .IR Pid :
1340 Thread ID (see
1341 .BR gettid (2)).
1342 .IP *
1343 .IR PPid :
1344 PID of parent process.
1345 .IP *
1346 .IR TracerPid :
1347 PID of process tracing this process (0 if not being traced).
1348 .IP *
1349 .IR Uid ", " Gid :
1350 Real, effective, saved set, and filesystem UIDs (GIDs).
1351 .IP *
1352 .IR FDSize :
1353 Number of file descriptor slots currently allocated.
1354 .IP *
1355 .IR Groups :
1356 Supplementary group list.
1357 .IP *
1358 .IR VmPeak :
1359 Peak virtual memory size.
1360 .IP *
1361 .IR VmSize :
1362 Virtual memory size.
1363 .IP *
1364 .IR VmLck :
1365 Locked memory size (see
1366 .BR mlock (3)).
1367 .IP *
1368 .IR VmHWM :
1369 Peak resident set size ("high water mark").
1370 .IP *
1371 .IR VmRSS :
1372 Resident set size.
1373 .IP *
1374 .IR VmData ", " VmStk ", " VmExe :
1375 Size of data, stack, and text segments.
1376 .IP *
1377 .IR VmLib :
1378 Shared library code size.
1379 .IP *
1380 .IR VmPTE :
1381 Page table entries size (since Linux 2.6.10).
1382 .IP *
1383 .IR Threads :
1384 Number of threads in process containing this thread.
1385 .IP *
1386 .IR SigQ :
1387 This field contains two slash-separated numbers that relate to
1388 queued signals for the real user ID of this process.
1389 The first of these is the number of currently queued
1390 signals for this real user ID, and the second is the
1391 resource limit on the number of queued signals for this process
1392 (see the description of
1393 .BR RLIMIT_SIGPENDING
1394 in
1395 .BR getrlimit (2)).
1396 .IP *
1397 .IR SigPnd ", " ShdPnd :
1398 Number of signals pending for thread and for process as a whole (see
1399 .BR pthreads (7)
1400 and
1401 .BR signal (7)).
1402 .IP *
1403 .IR SigBlk ", " SigIgn ", " SigCgt :
1404 Masks indicating signals being blocked, ignored, and caught (see
1405 .BR signal (7)).
1406 .IP *
1407 .IR CapInh ", " CapPrm ", " CapEff :
1408 Masks of capabilities enabled in inheritable, permitted, and effective sets
1409 (see
1410 .BR capabilities (7)).
1411 .IP *
1412 .IR CapBnd :
1413 Capability Bounding set
1414 (since kernel 2.6.26, see
1415 .BR capabilities (7)).
1416 .IP *
1417 .IR Cpus_allowed :
1418 Mask of CPUs on which this process may run
1419 (since Linux 2.6.24, see
1420 .BR cpuset (7)).
1421 .IP *
1422 .IR Cpus_allowed_list :
1423 Same as previous, but in "list format"
1424 (since Linux 2.6.26, see
1425 .BR cpuset (7)).
1426 .IP *
1427 .IR Mems_allowed :
1428 Mask of memory nodes allowed to this process
1429 (since Linux 2.6.24, see
1430 .BR cpuset (7)).
1431 .IP *
1432 .IR Mems_allowed_list :
1433 Same as previous, but in "list format"
1434 (since Linux 2.6.26, see
1435 .BR cpuset (7)).
1436 .IP *
1437 .IR voluntary_context_switches ", " nonvoluntary_context_switches :
1438 Number of voluntary and involuntary context switches (since Linux 2.6.23).
1439 .RE
1440 .TP
1441 .IR /proc/[pid]/task " (since Linux 2.6.0-test6)"
1442 This is a directory that contains one subdirectory
1443 for each thread in the process.
1444 The name of each subdirectory is the numerical thread ID
1445 .RI ( [tid] )
1446 of the thread (see
1447 .BR gettid (2)).
1448 Within each of these subdirectories, there is a set of
1449 files with the same names and contents as under the
1450 .I /proc/[pid]
1451 directories.
1452 For attributes that are shared by all threads, the contents for
1453 each of the files under the
1454 .I task/[tid]
1455 subdirectories will be the same as in the corresponding
1456 file in the parent
1457 .I /proc/[pid]
1458 directory
1459 (e.g., in a multithreaded process, all of the
1460 .I task/[tid]/cwd
1461 files will have the same value as the
1462 .I /proc/[pid]/cwd
1463 file in the parent directory, since all of the threads in a process
1464 share a working directory).
1465 For attributes that are distinct for each thread,
1466 the corresponding files under
1467 .I task/[tid]
1468 may have different values (e.g., various fields in each of the
1469 .I task/[tid]/status
1470 files may be different for each thread).
1471
1472 .\" The following was still true as at kernel 2.6.13
1473 In a multithreaded process, the contents of the
1474 .I /proc/[pid]/task
1475 directory are not available if the main thread has already terminated
1476 (typically by calling
1477 .BR pthread_exit (3)).
1478 .TP
1479 .I /proc/apm
1480 Advanced power management version and battery information when
1481 .B CONFIG_APM
1482 is defined at kernel compilation time.
1483 .TP
1484 .I /proc/bus
1485 Contains subdirectories for installed busses.
1486 .TP
1487 .I /proc/bus/pccard
1488 Subdirectory for PCMCIA devices when
1489 .B CONFIG_PCMCIA
1490 is set at kernel compilation time.
1491 .TP
1492 .I /proc/bus/pccard/drivers
1493 .TP
1494 .I /proc/bus/pci
1495 Contains various bus subdirectories and pseudo-files containing
1496 information about PCI busses, installed devices, and device
1497 drivers.
1498 Some of these files are not ASCII.
1499 .TP
1500 .I /proc/bus/pci/devices
1501 Information about PCI devices.
1502 They may be accessed through
1503 .BR lspci (8)
1504 and
1505 .BR setpci (8).
1506 .TP
1507 .I /proc/cmdline
1508 Arguments passed to the Linux kernel at boot time.
1509 Often done via a boot manager such as
1510 .BR lilo (8)
1511 or
1512 .BR grub (8).
1513 .TP
1514 .IR /proc/config.gz " (since Linux 2.6)"
1515 This file exposes the configuration options that were used
1516 to build the currently running kernel,
1517 in the same format as they would be shown in the
1518 .I .config
1519 file that resulted when configuring the kernel (using
1520 .IR "make xconfig" ,
1521 .IR "make config" ,
1522 or similar).
1523 The file contents are compressed; view or search them using
1524 .BR zcat (1),
1525 .BR zgrep (1),
1526 etc.
1527 As long as no changes have been made to the following file,
1528 the contents of
1529 .I /proc/config.gz
1530 are the same as those provided by :
1531 .in +4n
1532 .nf
1533
1534 cat /lib/modules/$(uname \-r)/build/.config
1535 .fi
1536 .in
1537 .IP
1538 .I /proc/config.gz
1539 is provided only if the kernel is configured with
1540 .BR CONFIG_IKCONFIG_PROC .
1541 .TP
1542 .I /proc/cpuinfo
1543 This is a collection of CPU and system architecture dependent items,
1544 for each supported architecture a different list.
1545 Two common entries are \fIprocessor\fP which gives CPU number and
1546 \fIbogomips\fP; a system constant that is calculated
1547 during kernel initialization.
1548 SMP machines have information for
1549 each CPU.
1550 The
1551 .BR lscpu (1)
1552 command gathers its information from this file.
1553 .TP
1554 .I /proc/devices
1555 Text listing of major numbers and device groups.
1556 This can be used by MAKEDEV scripts for consistency with the kernel.
1557 .TP
1558 .IR /proc/diskstats " (since Linux 2.5.69)"
1559 This file contains disk I/O statistics for each disk device.
1560 See the Linux kernel source file
1561 .I Documentation/iostats.txt
1562 for further information.
1563 .TP
1564 .I /proc/dma
1565 This is a list of the registered \fIISA\fP DMA (direct memory access)
1566 channels in use.
1567 .TP
1568 .I /proc/driver
1569 Empty subdirectory.
1570 .TP
1571 .I /proc/execdomains
1572 List of the execution domains (ABI personalities).
1573 .TP
1574 .I /proc/fb
1575 Frame buffer information when
1576 .B CONFIG_FB
1577 is defined during kernel compilation.
1578 .TP
1579 .I /proc/filesystems
1580 A text listing of the filesystems which are supported by the kernel,
1581 namely filesystems which were compiled into the kernel or whose kernel
1582 modules are currently loaded.
1583 (See also
1584 .BR filesystems (5).)
1585 If a filesystem is marked with "nodev",
1586 this means that it does not require a block device to be mounted
1587 (e.g., virtual filesystem, network filesystem).
1588
1589 Incidentally, this file may be used by
1590 .BR mount (8)
1591 when no filesystem is specified and it didn't manage to determine the
1592 filesystem type.
1593 Then filesystems contained in this file are tried
1594 (excepted those that are marked with "nodev").
1595 .TP
1596 .I /proc/fs
1597 Empty subdirectory.
1598 .TP
1599 .I /proc/ide
1600 This directory
1601 exists on systems with the IDE bus.
1602 There are directories for each IDE channel and attached device.
1603 Files include:
1604
1605 .in +4n
1606 .nf
1607 cache              buffer size in KB
1608 capacity           number of sectors
1609 driver             driver version
1610 geometry           physical and logical geometry
1611 identify           in hexadecimal
1612 media              media type
1613 model              manufacturer's model number
1614 settings           drive settings
1615 smart_thresholds   in hexadecimal
1616 smart_values       in hexadecimal
1617 .fi
1618 .in
1619
1620 The
1621 .BR hdparm (8)
1622 utility provides access to this information in a friendly format.
1623 .TP
1624 .I /proc/interrupts
1625 This is used to record the number of interrupts per CPU per IO device.
1626 Since Linux 2.6.24,
1627 for the i386 and x86_64 architectures, at least, this also includes
1628 interrupts internal to the system (that is, not associated with a device
1629 as such), such as NMI (nonmaskable interrupt), LOC (local timer interrupt),
1630 and for SMP systems, TLB (TLB flush interrupt), RES (rescheduling
1631 interrupt), CAL (remote function call interrupt), and possibly others.
1632 Very easy to read formatting, done in ASCII.
1633 .TP
1634 .I /proc/iomem
1635 I/O memory map in Linux 2.4.
1636 .TP
1637 .I /proc/ioports
1638 This is a list of currently registered Input-Output port regions that
1639 are in use.
1640 .TP
1641 .IR /proc/kallsyms " (since Linux 2.5.71)"
1642 This holds the kernel exported symbol definitions used by the
1643 .BR modules (X)
1644 tools to dynamically link and bind loadable modules.
1645 In Linux 2.5.47 and earlier, a similar file with slightly different syntax
1646 was named
1647 .IR ksyms .
1648 .TP
1649 .I /proc/kcore
1650 This file represents the physical memory of the system and is stored
1651 in the ELF core file format.
1652 With this pseudo-file, and an unstripped
1653 kernel
1654 .RI ( /usr/src/linux/vmlinux )
1655 binary, GDB can be used to
1656 examine the current state of any kernel data structures.
1657
1658 The total length of the file is the size of physical memory (RAM) plus
1659 4KB.
1660 .TP
1661 .I /proc/kmsg
1662 This file can be used instead of the
1663 .BR syslog (2)
1664 system call to read kernel messages.
1665 A process must have superuser
1666 privileges to read this file, and only one process should read this
1667 file.
1668 This file should not be read if a syslog process is running
1669 which uses the
1670 .BR syslog (2)
1671 system call facility to log kernel messages.
1672
1673 Information in this file is retrieved with the
1674 .BR dmesg (1)
1675 program.
1676 .TP
1677 .IR /proc/ksyms " (Linux 1.1.23-2.5.47)"
1678 See
1679 .IR /proc/kallsyms .
1680 .TP
1681 .I /proc/loadavg
1682 The first three fields in this file are load average figures
1683 giving the number of jobs in the run queue (state R)
1684 or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes.
1685 They are the same as the load average numbers given by
1686 .BR uptime (1)
1687 and other programs.
1688 The fourth field consists of two numbers separated by a slash (/).
1689 The first of these is the number of currently runnable kernel
1690 scheduling entities (processes, threads).
1691 The value after the slash is the number of kernel scheduling entities
1692 that currently exist on the system.
1693 The fifth field is the PID of the process that was most
1694 recently created on the system.
1695 .TP
1696 .I /proc/locks
1697 This file shows current file locks
1698 .RB ( flock "(2) and " fcntl (2))
1699 and leases
1700 .RB ( fcntl (2)).
1701 .TP
1702 .IR /proc/malloc " (only up to and including Linux 2.2)"
1703 .\" It looks like this only ever did something back in 1.0 days
1704 This file is present only if
1705 .B CONFIG_DEBUG_MALLOC
1706 was defined during compilation.
1707 .TP
1708 .I /proc/meminfo
1709 This file reports statistics about memory usage on the system.
1710 It is used by
1711 .BR free (1)
1712 to report the amount of free and used memory (both physical and swap)
1713 on the system as well as the shared memory and buffers used by the
1714 kernel.
1715 Each line of the file consists of a parameter name, followed by a colon,
1716 the value of the parameter, and an option unit of measurement (e.g., "kB").
1717 The list below describes the parameter names and
1718 the format specifier required to read the field value.
1719 Except as noted below,
1720 all of the fields have been present since at least Linux 2.6.0.
1721 Some fileds are displayed only if the kernel was configured
1722 with various options; those dependencies are noted in the list.
1723 .RS
1724 .TP
1725 .IR MemTotal " %lu"
1726 Total usable RAM (i.e. physical RAM minus a few reserved
1727 bits and the kernel binary code).
1728 .TP
1729 .IR MemFree " %lu"
1730 The sum of
1731 .IR LowFree + HighFree .
1732 .TP
1733 .IR Buffers " %lu"
1734 Relatively temporary storage for raw disk blocks that
1735 shouldn't get tremendously large (20MB or so).
1736 .TP
1737 .IR Cached " %lu"
1738 In-memory cache for files read from the disk (the page cache).
1739 Doesn't include
1740 .IR SwapCached .
1741 .TP
1742 .IR SwapCached " %lu"
1743 Memory that once was swapped out, is swapped back in but
1744 still also is in the swap file.
1745 (If memory pressure is high, these pages
1746 don't need to be swapped out again because they are already
1747 in the swap file.
1748 This saves I/O.)
1749 .TP
1750 .IR Active " %lu"
1751 Memory that has been used more recently and usually not
1752 reclaimed unless absolutely necessary.
1753 .TP
1754 .IR Inactive " %lu"
1755 Memory which has been less recently used.
1756 It is more eligible to be reclaimed for other purposes.
1757 .TP
1758 .IR Active(anon) " %lu (since Linux 2.6.28)"
1759 [To be documented.]
1760 .TP
1761 .IR Inactive(anon) " %lu (since Linux 2.6.28)"
1762 [To be documented.]
1763 .TP
1764 .IR Active(file) " %lu (since Linux 2.6.28)"
1765 [To be documented.]
1766 .TP
1767 .IR Inactive(file) " %lu (since Linux 2.6.28)"
1768 [To be documented.]
1769 .TP
1770 .IR Unevictable " %lu (since Linux 2.6.28)"
1771 (From Linux 2.6.28 to 2.6.30,
1772 \fBCONFIG_UNEVICTABLE_LRU\fP was required.)
1773 [To be documented.]
1774 .TP
1775 .IR Mlocked " %lu (since Linux 2.6.28)"
1776 (From Linux 2.6.28 to 2.6.30,
1777 \fBCONFIG_UNEVICTABLE_LRU\fP was required.)
1778 [To be documented.]
1779 .TP
1780 .IR HighTotal " %lu"
1781 (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1782 Total amount of highmem.
1783 Highmem is all memory above ~860MB of physical memory.
1784 Highmem areas are for use by user-space programs,
1785 or for the page cache.
1786 The kernel must use tricks to access
1787 this memory, making it slower to access than lowmem.
1788 .TP
1789 .IR HighFree " %lu
1790 (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1791 Amount of free highmem.
1792 .TP
1793 .IR LowTotal " %lu
1794 (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1795 Total amount of lowmem.
1796 Lowmem is memory which can be used for everything that
1797 highmem can be used for, but it is also available for the
1798 kernel's use for its own data structures.
1799 Among many other things,
1800 it is where everything from
1801 .I Slab
1802 is allocated.
1803 Bad things happen when you're out of lowmem.
1804 .TP
1805 .IR LowFree " %lu
1806 (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1807 Amount of free lowmem.
1808 .TP
1809 .IR MmapCopy " %lu (since Linux 2.6.29)"
1810 .RB ( CONFIG_MMU
1811 is required.)
1812 [To be documented.]
1813 .TP
1814 .IR SwapTotal " %lu"
1815 Total amount of swap space available.
1816 .TP
1817 .IR SwapFree " %lu"
1818 Amount of swap space that is currently unused.
1819 .TP
1820 .IR Dirty " %lu"
1821 Memory which is waiting to get written back to the disk.
1822 .TP
1823 .IR Writeback " %lu"
1824 Memory which is actively being written back to the disk.
1825 .TP
1826 .IR AnonPages " %lu (since Linux 2.6.18)"
1827 Non-file backed pages mapped into user-space page tables.
1828 .TP
1829 .IR Mapped " %lu"
1830 Files which have been mmaped, such as libraries.
1831 .TP
1832 .IR Shmem " %lu (since Linux 2.6.32)"
1833 [To be documented.]
1834 .TP
1835 .IR Slab " %lu"
1836 In-kernel data structures cache.
1837 .TP
1838 .IR SReclaimable " %lu (since Linux 2.6.19)"
1839 Part of
1840 .IR Slab ,
1841 that might be reclaimed, such as caches.
1842 .TP
1843 .IR SUnreclaim " %lu (since Linux 2.6.19)"
1844 Part of
1845 .IR Slab ,
1846 that cannot be reclaimed on memory pressure.
1847 .TP
1848 .IR KernelStack " %lu (since Linux 2.6.32)"
1849 Amount of memory allocated to kernel stacks.
1850 .TP
1851 .IR PageTables " %lu (since Linux 2.6.18)"
1852 Amount of memory dedicated to the lowest level of page tables.
1853 .TP
1854 .IR Quicklists " %lu (since Linux 2.6.27)"
1855 (\fBCONFIG_QUICKLIST\fP is required.)
1856 [To be documented.]
1857 .TP
1858 .IR NFS_Unstable " %lu (since Linux 2.6.18)"
1859 NFS pages sent to the server, but not yet committed to stable storage.
1860 .TP
1861 .IR Bounce " %lu (since Linux 2.6.18)"
1862 Memory used for block device "bounce buffers".
1863 .TP
1864 .IR WritebackTmp " %lu (since Linux 2.6.26)"
1865 Memory used by FUSE for temporary writeback buffers.
1866 .TP
1867 .IR CommitLimit " %lu (since Linux 2.6.10)"
1868 Based on the overcommit ratio ('vm.overcommit_ratio'),
1869 this is the total amount of  memory currently available to
1870 be allocated on the system.
1871 This limit is adhered to
1872 only if strict overcommit accounting is enabled (mode 2 in
1873 .IR /proc/sys/vm/overcommit_ratio ).
1874 The
1875 .I CommitLimit
1876 is calculated using the following formula:
1877
1878     CommitLimit = (overcommit_ratio * Physical RAM) + Swap
1879
1880 For example, on a system with 1GB of physical RAM and 7GB
1881 of swap with a
1882 .I overcommit_ratio
1883 of 30, this formula yields a
1884 .I CommitLimit
1885 of 7.3GB.
1886 For more details, see the memory overcommit documentation
1887 in the kernel source file
1888 .IR Documentation/vm/overcommit-accounting .
1889 .TP
1890 .IR Committed_AS " %lu"
1891 The amount of memory presently allocated on the system.
1892 The committed memory is a sum of all of the memory which
1893 has been allocated by processes, even if it has not been
1894 "used" by them as of yet.
1895 A process which allocates 1GB of memory (using
1896 .BR malloc (3)
1897 or similar), but touches only 300MB of that memory will show up
1898 as using only 300MB of memory even if it has the address space
1899 allocated for the entire 1GB.
1900 This 1GB is memory which has been "committed" to by the VM
1901 and can be used at any time by the allocating application.
1902 With strict overcommit enabled on the system (mode 2
1903 .IR /proc/sys/vm/overcommit_memory ),
1904 allocations which would exceed the
1905 .I CommitLimit
1906 (detailed above) will not be permitted.
1907 This is useful if one needs to guarantee that processes will not
1908 fail due to lack of memory once that memory has been successfully allocated.
1909 .TP
1910 .IR VmallocTotal " %lu"
1911 Total size of vmalloc memory area.
1912 .TP
1913 .IR VmallocUsed " %lu"
1914 Amount of vmalloc area which is used.
1915 .TP
1916 .IR VmallocChunk " %lu"
1917 Largest contiguous block of vmalloc area which is free.
1918 .TP
1919 .IR HardwareCorrupted " %lu (since Linux 2.6.32)"
1920 (\fBCONFIG_MEMORY_FAILURE\fP is required.)
1921 [To be documented.]
1922 .TP
1923 .IR AnonHugePages " %lu (since Linux 2.6.38)"
1924 (\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.)
1925 Non-file backed huge pages mapped into user-space page tables.
1926 .TP
1927 .IR HugePages_Total " %lu"
1928 (\fBCONFIG_HUGETLB_PAGE\fP is required.)
1929 The size of the pool of huge pages.
1930 .TP
1931 .IR HugePages_Free " %lu"
1932 (\fBCONFIG_HUGETLB_PAGE\fP is required.)
1933 The number of huge pages in the pool that are not yet allocated.
1934 .TP
1935 .IR HugePages_Rsvd " %lu (since Linux 2.6.17)"
1936 (\fBCONFIG_HUGETLB_PAGE\fP is required.)
1937 This is the number of huge pages for
1938 which a commitment to allocate from the pool has been made,
1939 but no allocation has yet been made.
1940 These reserved huge pages
1941 guarantee that an application will be able to allocate a
1942 huge page from the pool of huge pages at fault time.
1943 .TP
1944 .IR HugePages_Surp " %lu (since Linux 2.6.24)"
1945 (\fBCONFIG_HUGETLB_PAGE\fP is required.)
1946 This is the number of huge pages in
1947 the pool above the value in
1948 .IR /proc/sys/vm/nr_hugepages .
1949 The maximum number of surplus huge pages is controlled by
1950 .IR /proc/sys/vm/nr_overcommit_hugepages .
1951 .TP
1952 .IR Hugepagesize " %lu"
1953 (\fBCONFIG_HUGETLB_PAGE\fP is required.)
1954 The size of huge pages.
1955 .RE
1956 .TP
1957 .I /proc/modules
1958 A text list of the modules that have been loaded by the system.
1959 See also
1960 .BR lsmod (8).
1961 .TP
1962 .I /proc/mounts
1963 Before kernel 2.4.19, this file was a list
1964 of all the filesystems currently mounted on the system.
1965 With the introduction of per-process mount namespaces in
1966 Linux 2.4.19, this file became a link to
1967 .IR /proc/self/mounts ,
1968 which lists the mount points of the process's own mount namespace.
1969 The format of this file is documented in
1970 .BR fstab (5).
1971 .TP
1972 .I /proc/mtrr
1973 Memory Type Range Registers.
1974 See the Linux kernel source file
1975 .I Documentation/mtrr.txt
1976 for details.
1977 .TP
1978 .I /proc/net
1979 various net pseudo-files, all of which give the status of some part of
1980 the networking layer.
1981 These files contain ASCII structures and are,
1982 therefore, readable with
1983 .BR cat (1).
1984 However, the standard
1985 .BR netstat (8)
1986 suite provides much cleaner access to these files.
1987 .TP
1988 .I /proc/net/arp
1989 This holds an ASCII readable dump of the kernel ARP table used for
1990 address resolutions.
1991 It will show both dynamically learned and preprogrammed ARP entries.
1992 The format is:
1993
1994 .nf
1995 .ft CW
1996 .in 8n
1997 IP address     HW type   Flags     HW address          Mask   Device
1998 192.168.0.50   0x1       0x2       00:50:BF:25:68:F3   *      eth0
1999 192.168.0.250  0x1       0xc       00:00:00:00:00:00   *      eth0
2000 .ft
2001 .fi
2002 .in
2003
2004 Here "IP address" is the IPv4 address of the machine and the "HW type"
2005 is the hardware type of the address from RFC\ 826.
2006 The flags are the internal
2007 flags of the ARP structure (as defined in
2008 .IR /usr/include/linux/if_arp.h )
2009 and
2010 the "HW address" is the data link layer mapping for that IP address if
2011 it is known.
2012 .TP
2013 .I /proc/net/dev
2014 The dev pseudo-file contains network device status information.
2015 This gives
2016 the number of received and sent packets, the number of errors and
2017 collisions
2018 and other basic statistics.
2019 These are used by the
2020 .BR ifconfig (8)
2021 program to report device status.
2022 The format is:
2023
2024 .nf
2025 .ft CW
2026 .in 1n
2027 Inter-|   Receive                                                |  Transmit
2028  face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
2029     lo: 2776770   11307    0    0    0     0          0         0  2776770   11307    0    0    0     0       0          0
2030   eth0: 1215645    2751    0    0    0     0          0         0  1782404    4324    0    0    0   427       0          0
2031   ppp0: 1622270    5552    1    0    0     0          0         0   354130    5669    0    0    0     0       0          0
2032   tap0:    7714      81    0    0    0     0          0         0     7714      81    0    0    0     0       0          0
2033 .in
2034 .ft
2035 .fi
2036 .\" .TP
2037 .\" .I /proc/net/ipx
2038 .\" No information.
2039 .\" .TP
2040 .\" .I /proc/net/ipx_route
2041 .\" No information.
2042 .TP
2043 .I /proc/net/dev_mcast
2044 Defined in
2045 .IR /usr/src/linux/net/core/dev_mcast.c :
2046 .nf
2047 .in +5
2048 indx interface_name  dmi_u dmi_g dmi_address
2049 2    eth0            1     0     01005e000001
2050 3    eth1            1     0     01005e000001
2051 4    eth2            1     0     01005e000001
2052 .in
2053 .fi
2054 .TP
2055 .I /proc/net/igmp
2056 Internet Group Management Protocol.
2057 Defined in
2058 .IR /usr/src/linux/net/core/igmp.c .
2059 .TP
2060 .I /proc/net/rarp
2061 This file uses the same format as the
2062 .I arp
2063 file and contains the current reverse mapping database used to provide
2064 .BR rarp (8)
2065 reverse address lookup services.
2066 If RARP is not configured into the
2067 kernel,
2068 this file will not be present.
2069 .TP
2070 .I /proc/net/raw
2071 Holds a dump of the RAW socket table.
2072 Much of the information is not of
2073 use
2074 apart from debugging.
2075 The "sl" value is the kernel hash slot for the
2076 socket,
2077 the "local_address" is the local address and protocol number pair.
2078 \&"St" is
2079 the internal status of the socket.
2080 The "tx_queue" and "rx_queue" are the
2081 outgoing and incoming data queue in terms of kernel memory usage.
2082 The "tr", "tm\->when", and "rexmits" fields are not used by RAW.
2083 The "uid"
2084 field holds the effective UID of the creator of the socket.
2085 .\" .TP
2086 .\" .I /proc/net/route
2087 .\" No information, but looks similar to
2088 .\" .BR route (8).
2089 .TP
2090 .I /proc/net/snmp
2091 This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP
2092 management
2093 information bases for an SNMP agent.
2094 .TP
2095 .I /proc/net/tcp
2096 Holds a dump of the TCP socket table.
2097 Much of the information is not
2098 of use apart from debugging.
2099 The "sl" value is the kernel hash slot
2100 for the socket, the "local_address" is the local address and port number pair.
2101 The "rem_address" is the remote address and port number pair
2102 (if connected).
2103 \&"St" is the internal status of the socket.
2104 The "tx_queue" and "rx_queue" are the
2105 outgoing and incoming data queue in terms of kernel memory usage.
2106 The "tr", "tm\->when", and "rexmits" fields hold internal information of
2107 the kernel socket state and are only useful for debugging.
2108 The "uid"
2109 field holds the effective UID of the creator of the socket.
2110 .TP
2111 .I /proc/net/udp
2112 Holds a dump of the UDP socket table.
2113 Much of the information is not of
2114 use apart from debugging.
2115 The "sl" value is the kernel hash slot for the
2116 socket, the "local_address" is the local address and port number pair.
2117 The "rem_address" is the remote address and port number pair
2118 (if connected). "St" is the internal status of the socket.
2119 The "tx_queue" and "rx_queue" are the outgoing and incoming data queue
2120 in terms of kernel memory usage.
2121 The "tr", "tm\->when", and "rexmits" fields
2122 are not used by UDP.
2123 The "uid"
2124 field holds the effective UID of the creator of the socket.
2125 The format is:
2126
2127 .nf
2128 .ft CW
2129 .in 1n
2130 sl  local_address rem_address   st tx_queue rx_queue tr rexmits  tm\->when uid
2131  1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0
2132  1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0
2133  1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0
2134 .in
2135 .ft
2136 .fi
2137 .TP
2138 .I /proc/net/unix
2139 Lists the UNIX domain sockets present within the system and their
2140 status.
2141 The format is:
2142 .nf
2143 .sp .5
2144 .ft CW
2145 Num RefCount Protocol Flags    Type St Path
2146  0: 00000002 00000000 00000000 0001 03
2147  1: 00000001 00000000 00010000 0001 01 /dev/printer
2148 .ft
2149 .sp .5
2150 .fi
2151
2152 Here "Num" is the kernel table slot number, "RefCount" is the number
2153 of users of the socket, "Protocol" is currently always 0, "Flags"
2154 represent the internal kernel flags holding the status of the
2155 socket.
2156 Currently, type is always "1" (UNIX domain datagram sockets are
2157 not yet supported in the kernel).
2158 \&"St" is the internal state of the
2159 socket and Path is the bound path (if any) of the socket.
2160 .TP
2161 .I /proc/partitions
2162 Contains the major and minor numbers of each partition as well as the number
2163 of 1024-byte blocks and the partition name.
2164 .TP
2165 .I /proc/pci
2166 This is a listing of all PCI devices found during kernel initialization
2167 and their configuration.
2168
2169 This file has been deprecated in favor of a new
2170 .I /proc
2171 interface for PCI
2172 .RI ( /proc/bus/pci ).
2173 It became optional in Linux 2.2 (available with
2174 .B CONFIG_PCI_OLD_PROC
2175 set at kernel compilation).
2176 It became once more nonoptionally enabled in Linux 2.4.
2177 Next, it was deprecated in Linux 2.6 (still available with
2178 .B CONFIG_PCI_LEGACY_PROC
2179 set), and finally removed altogether since Linux 2.6.17.
2180 .\" FIXME /proc/sched_debug
2181 .\" .TP
2182 .\" .IR /proc/sched_debug " (since Linux 2.6.23)"
2183 .\" See also /proc/[pid]/sched
2184 .TP
2185 .IR /proc/profile " (since Linux 2.4)"
2186 This file is present only if the kernel was booted with the
2187 .I profile=1
2188 command-line option.
2189 It exposes kernel profiling information in a binary format for use by
2190 .BR readprofile (1).
2191 Writing (e.g., an empty string) to this file resets the profiling counters;
2192 on some architectures,
2193 writing a binary integer "profiling multiplier" of size
2194 .IR sizeof(int)
2195 sets the profiling interrupt frequency.
2196 .TP
2197 .I /proc/scsi
2198 A directory with the
2199 .I scsi
2200 mid-level pseudo-file and various SCSI low-level
2201 driver directories,
2202 which contain a file for each SCSI host in this system, all of
2203 which give the status of some part of the SCSI IO subsystem.
2204 These files contain ASCII structures and are, therefore, readable with
2205 .BR cat (1).
2206
2207 You can also write to some of the files to reconfigure the subsystem or
2208 switch certain features on or off.
2209 .TP
2210 .I /proc/scsi/scsi
2211 This is a listing of all SCSI devices known to the kernel.
2212 The listing is similar to the one seen during bootup.
2213 scsi currently supports only the \fIadd-single-device\fP command which
2214 allows root to add a hotplugged device to the list of known devices.
2215
2216 The command
2217 .in +4n
2218 .nf
2219
2220 echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi
2221
2222 .fi
2223 .in
2224 will cause
2225 host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0.
2226 If there
2227 is already a device known on this address or the address is invalid, an
2228 error will be returned.
2229 .TP
2230 .I /proc/scsi/[drivername]
2231 \fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740,
2232 aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic,
2233 scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000.
2234 These directories show up for all drivers that registered at least one
2235 SCSI HBA.
2236 Every directory contains one file per registered host.
2237 Every host-file is named after the number the host was assigned during
2238 initialization.
2239
2240 Reading these files will usually show driver and host configuration,
2241 statistics, etc.
2242
2243 Writing to these files allows different things on different hosts.
2244 For example, with the \fIlatency\fP and \fInolatency\fP commands,
2245 root can switch on and off command latency measurement code in the
2246 eata_dma driver.
2247 With the \fIlockup\fP and \fIunlock\fP commands,
2248 root can control bus lockups simulated by the scsi_debug driver.
2249 .TP
2250 .I /proc/self
2251 This directory refers to the process accessing the
2252 .I /proc
2253 filesystem,
2254 and is identical to the
2255 .I /proc
2256 directory named by the process ID of the same process.
2257 .TP
2258 .I /proc/slabinfo
2259 Information about kernel caches.
2260 Since Linux 2.6.16 this file is present only if the
2261 .B CONFIG_SLAB
2262 kernel configuration option is enabled.
2263 The columns in
2264 .I /proc/slabinfo
2265 are:
2266 .in +4n
2267 .nf
2268
2269 cache-name
2270 num-active-objs
2271 total-objs
2272 object-size
2273 num-active-slabs
2274 total-slabs
2275 num-pages-per-slab
2276 .fi
2277 .in
2278
2279 See
2280 .BR slabinfo (5)
2281 for details.
2282 .TP
2283 .I /proc/stat
2284 kernel/system statistics.
2285 Varies with architecture.
2286 Common
2287 entries include:
2288 .RS
2289 .TP
2290 \fIcpu  3357 0 4313 1362393\fP
2291 The amount of time, measured in units of
2292 USER_HZ (1/100ths of a second on most architectures, use
2293 .IR sysconf(_SC_CLK_TCK)
2294 to obtain the right value),
2295 .\" 1024 on Alpha and ia64
2296 that the system spent in various states:
2297 .RS
2298 .TP
2299 .I user
2300 (1) Time spent in user mode.
2301 .TP
2302 .I nice
2303 (2) Time spent in user mode with low priority (nice).
2304 .TP
2305 .I system
2306 (3) Time spent in system mode.
2307 .TP
2308 .I idle
2309 (4) Time spent in the idle task.
2310 .\" FIXME Actually, the following info about the /proc/stat 'cpu' field
2311 .\"       does not seem to be quite right (at least in 2.6.12 or 3.6):
2312 .\"       the idle time in /proc/uptime does not quite match this value
2313 This value should be USER_HZ times the
2314 second entry in the
2315 .I /proc/uptime
2316 pseudo-file.
2317 .TP
2318 .IR iowait " (since Linux 2.5.41)"
2319 (5) Time waiting for I/O to complete.
2320 .TP
2321 .IR irq " (since Linux 2.6.0-test4)"
2322 (6) Time servicing interrupts.
2323 .TP
2324 .IR softirq " (since Linux 2.6.0-test4)"
2325 (7) Time servicing softirqs.
2326 .TP
2327 .IR steal " (since Linux 2.6.11)"
2328 (8) Stolen time, which is the time spent in other operating systems when
2329 running in a virtualized environment
2330 .TP
2331 .IR guest " (since Linux 2.6.24)"
2332 (9) Time spent running a virtual CPU for guest
2333 operating systems under the control of the Linux kernel.
2334 .\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de
2335 .TP
2336 .IR guest_nice " (since Linux 2.6.33)"
2337 .\" commit ce0e7b28fb75cb003cfc8d0238613aaf1c55e797
2338 (10) Time spent running a niced guest (virtual CPU for guest
2339 operating systems under the control of the Linux kernel).
2340 .RE
2341 .TP
2342 \fIpage 5741 1808\fP
2343 The number of pages the system paged in and the number that were paged
2344 out (from disk).
2345 .TP
2346 \fIswap 1 0\fP
2347 The number of swap pages that have been brought in and out.
2348 .TP
2349 .\" FIXME The following is not the full picture for the 'intr' of
2350 .\"       /proc/stat on 2.6:
2351 \fIintr 1462898\fP
2352 This line shows counts of interrupts serviced since boot time,
2353 for each of the possible system interrupts.
2354 The first column is the total of all interrupts serviced;
2355 each subsequent column is the total for a particular interrupt.
2356 .TP
2357 \fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP...
2358 (major,disk_idx):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written)
2359 .br
2360 (Linux 2.4 only)
2361 .TP
2362 \fIctxt 115315\fP
2363 The number of context switches that the system underwent.
2364 .TP
2365 \fIbtime 769041601\fP
2366 boot time, in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
2367 .TP
2368 \fIprocesses 86031\fP
2369 Number of forks since boot.
2370 .TP
2371 \fIprocs_running 6\fP
2372 Number of processes in runnable state.
2373 (Linux 2.5.45 onward.)
2374 .TP
2375 \fIprocs_blocked 2\fP
2376 Number of processes blocked waiting for I/O to complete.
2377 (Linux 2.5.45 onward.)
2378 .RE
2379 .TP
2380 .I /proc/swaps
2381 Swap areas in use.
2382 See also
2383 .BR swapon (8).
2384 .TP
2385 .I /proc/sys
2386 This directory (present since 1.3.57) contains a number of files
2387 and subdirectories corresponding to kernel variables.
2388 These variables can be read and sometimes modified using
2389 the \fI/proc\fP filesystem, and the (deprecated)
2390 .BR sysctl (2)
2391 system call.
2392 .TP
2393 .IR /proc/sys/abi " (since Linux 2.4.10)"
2394 This directory may contain files with application binary information.
2395 .\" On some systems, it is not present.
2396 See the Linux kernel source file
2397 .I Documentation/sysctl/abi.txt
2398 for more information.
2399 .TP
2400 .I /proc/sys/debug
2401 This directory may be empty.
2402 .TP
2403 .I /proc/sys/dev
2404 This directory contains device-specific information (e.g.,
2405 .IR dev/cdrom/info ).
2406 On
2407 some systems, it may be empty.
2408 .TP
2409 .I /proc/sys/fs
2410 This directory contains the files and subdirectories for kernel variables
2411 related to filesystems.
2412 .TP
2413 .I /proc/sys/fs/binfmt_misc
2414 Documentation for files in this directory can be found
2415 in the Linux kernel sources in
2416 .IR Documentation/binfmt_misc.txt .
2417 .TP
2418 .IR /proc/sys/fs/dentry-state " (since Linux 2.2)"
2419 This file contains information about the status of the
2420 directory cache (dcache).
2421 The file contains six numbers,
2422 .IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), "
2423 .I want_pages
2424 (pages requested by system) and two dummy values.
2425 .RS
2426 .IP * 2
2427 .I nr_dentry
2428 is the number of allocated dentries (dcache entries).
2429 This field is unused in Linux 2.2.
2430 .IP *
2431 .I nr_unused
2432 is the number of unused dentries.
2433 .IP *
2434 .I age_limit
2435 .\" looks like this is unused in kernels 2.2 to 2.6
2436 is the age in seconds after which dcache entries
2437 can be reclaimed when memory is short.
2438 .IP *
2439 .I want_pages
2440 .\" looks like this is unused in kernels 2.2 to 2.6
2441 is nonzero when the kernel has called shrink_dcache_pages() and the
2442 dcache isn't pruned yet.
2443 .RE
2444 .TP
2445 .I /proc/sys/fs/dir-notify-enable
2446 This file can be used to disable or enable the
2447 .I dnotify
2448 interface described in
2449 .BR fcntl (2)
2450 on a system-wide basis.
2451 A value of 0 in this file disables the interface,
2452 and a value of 1 enables it.
2453 .TP
2454 .I /proc/sys/fs/dquot-max
2455 This file shows the maximum number of cached disk quota entries.
2456 On some (2.4) systems, it is not present.
2457 If the number of free cached disk quota entries is very low and
2458 you have some awesome number of simultaneous system users,
2459 you might want to raise the limit.
2460 .TP
2461 .I /proc/sys/fs/dquot-nr
2462 This file shows the number of allocated disk quota
2463 entries and the number of free disk quota entries.
2464 .TP
2465 .IR /proc/sys/fs/epoll " (since Linux 2.6.28)"
2466 This directory contains the file
2467 .IR max_user_watches ,
2468 which can be used to limit the amount of kernel memory consumed by the
2469 .I epoll
2470 interface.
2471 For further details, see
2472 .BR epoll (7).
2473 .TP
2474 .I /proc/sys/fs/file-max
2475 This file defines
2476 a system-wide limit on the number of open files for all processes.
2477 (See also
2478 .BR setrlimit (2),
2479 which can be used by a process to set the per-process limit,
2480 .BR RLIMIT_NOFILE ,
2481 on the number of files it may open.)
2482 If you get lots
2483 of error messages in the kernel log about running out of file handles
2484 (look for "VFS: file-max limit <number> reached"),
2485 try increasing this value:
2486 .br
2487
2488 .br
2489 .nf
2490 .ft CW
2491     echo 100000 > /proc/sys/fs/file-max
2492 .fi
2493 .ft
2494
2495 The kernel constant
2496 .B NR_OPEN
2497 imposes an upper limit on the value that may be placed in
2498 .IR file-max .
2499
2500 Privileged processes
2501 .RB ( CAP_SYS_ADMIN )
2502 can override the
2503 .I file-max
2504 limit.
2505 .TP
2506 .I /proc/sys/fs/file-nr
2507 This (read-only) file contains three numbers:
2508 the number of allocated file handles
2509 (i.e., the number of files presently opened);
2510 the number of free file handles;
2511 and the maximum number of file handles (i.e., the same value as
2512 .IR /proc/sys/fs/file-max ).
2513 If the number of allocated file handles is close to the
2514 maximum, you should consider increasing the maximum.
2515 Before Linux 2.6,
2516 the kernel allocated file handles dynamically,
2517 but it didn't free them again.
2518 Instead the free file handles were kept in a list for reallocation;
2519 the "free file handles" value indicates the size of that list.
2520 A large number of free file handles indicates that there was
2521 a past peak in the usage of open file handles.
2522 Since Linux 2.6, the kernel does deallocate freed file handles,
2523 and the "free file handles" value is always zero.
2524 .TP
2525 .IR /proc/sys/fs/inode-max " (only present until Linux 2.2)"
2526 This file contains the maximum number of in-memory inodes.
2527 This value should be 3-4 times larger
2528 than the value in
2529 .IR file-max ,
2530 since \fIstdin\fP, \fIstdout\fP
2531 and network sockets also need an inode to handle them.
2532 When you regularly run out of inodes, you need to increase this value.
2533
2534 Starting with Linux 2.4,
2535 there is no longer a static limit on the number of inodes,
2536 and this file is removed.
2537 .TP
2538 .I /proc/sys/fs/inode-nr
2539 This file contains the first two values from
2540 .IR inode-state .
2541 .TP
2542 .I /proc/sys/fs/inode-state
2543 This file
2544 contains seven numbers:
2545 .IR nr_inodes ,
2546 .IR nr_free_inodes ,
2547 .IR preshrink ,
2548 and four dummy values (always zero).
2549
2550 .I nr_inodes
2551 is the number of inodes the system has allocated.
2552 .\" This can be slightly more than
2553 .\" .I inode-max
2554 .\" because Linux allocates them one page full at a time.
2555 .I nr_free_inodes
2556 represents the number of free inodes.
2557
2558 .I preshrink
2559 is nonzero when the
2560 .I nr_inodes
2561 >
2562 .I inode-max
2563 and the system needs to prune the inode list instead of allocating more;
2564 since Linux 2.4, this field is a dummy value (always zero).
2565 .TP
2566 .IR /proc/sys/fs/inotify " (since Linux 2.6.13)"
2567 This directory contains files
2568 .IR max_queued_events ", " max_user_instances ", and " max_user_watches ,
2569 that can be used to limit the amount of kernel memory consumed by the
2570 .I inotify
2571 interface.
2572 For further details, see
2573 .BR inotify (7).
2574 .TP
2575 .I /proc/sys/fs/lease-break-time
2576 This file specifies the grace period that the kernel grants to a process
2577 holding a file lease
2578 .RB ( fcntl (2))
2579 after it has sent a signal to that process notifying it
2580 that another process is waiting to open the file.
2581 If the lease holder does not remove or downgrade the lease within
2582 this grace period, the kernel forcibly breaks the lease.
2583 .TP
2584 .I /proc/sys/fs/leases-enable
2585 This file can be used to enable or disable file leases
2586 .RB ( fcntl (2))
2587 on a system-wide basis.
2588 If this file contains the value 0, leases are disabled.
2589 A nonzero value enables leases.
2590 .TP
2591 .IR /proc/sys/fs/mqueue " (since Linux 2.6.6)"
2592 This directory contains files
2593 .IR msg_max ", " msgsize_max ", and " queues_max ,
2594 controlling the resources used by POSIX message queues.
2595 See
2596 .BR mq_overview (7)
2597 for details.
2598 .TP
2599 .IR /proc/sys/fs/overflowgid " and " /proc/sys/fs/overflowuid
2600 These files
2601 allow you to change the value of the fixed UID and GID.
2602 The default is 65534.
2603 Some filesystems support only 16-bit UIDs and GIDs, although in Linux
2604 UIDs and GIDs are 32 bits.
2605 When one of these filesystems is mounted
2606 with writes enabled, any UID or GID that would exceed 65535 is translated
2607 to the overflow value before being written to disk.
2608 .TP
2609 .IR /proc/sys/fs/pipe-max-size " (since Linux 2.6.35)"
2610 The value in this file defines an upper limit for raising the capacity
2611 of a pipe using the
2612 .BR fcntl (2)
2613 .B F_SETPIPE_SZ
2614 operation.
2615 This limit applies only to unprivileged processes.
2616 The default value for this file is 1,048,576.
2617 The value assigned to this file may be rounded upward,
2618 to reflect the value actually employed for a convenient implementation.
2619 To determine the rounded-up value,
2620 display the contents of this file after assigning a value to it.
2621 The minimum value that can be assigned to this file is the system page size.
2622 .TP
2623 .IR /proc/sys/fs/protected_hardlinks " (since Linux 3.6)"
2624 .\" commit 800179c9b8a1e796e441674776d11cd4c05d61d7
2625 When the value in this file is 0,
2626 no restrictions are placed on the creation of hard links
2627 (i.e., this is the historical behaviour before Linux 3.6).
2628 When the value in this file is 1,
2629 a hard link can be created to a target file
2630 only if one of the following conditions is true:
2631 .RS
2632 .IP * 3
2633 The caller has the
2634 .BR CAP_FOWNER
2635 capability.
2636 .IP *
2637 The filesystem UID of the process creating the link matches
2638 the owner (UID) of the target file
2639 (as described in
2640 .BR credentials (7),
2641 a process's filesystem UID is normally the same as its effective UID).
2642 .IP *
2643 All of the following conditions are true:
2644 .RS 4
2645 .IP \(bu 3
2646 the target is a regular file;
2647 .IP \(bu
2648 the target file does not have its set-user-ID permission bit enabled;
2649 .IP \(bu
2650 the target file does not have both its set-group-ID and
2651 group-executable permission bits enabled; and
2652 .IP \(bu
2653 the caller has permission to read and write the target file
2654 (either via the file's permissions mask or because it has
2655 suitable capabilities).
2656 .RE
2657 .RE
2658 .IP
2659 The default value in this file is 0.
2660 Setting the value to 1
2661 prevents a longstanding class of security issues caused by
2662 hard-link-based time-of-check, time-of-use races,
2663 most commonly seen in world-writable directories such as
2664 .IR /tmp .
2665 The common method of exploiting this flaw
2666 is to cross privilege boundaries when following a given hard link
2667 (i.e., a root process follows a hard link created by another user).
2668 Additionally, on systems without separated partitions,
2669 this stops unauthorized users from "pinning" vulnerable set-user-ID and
2670 set-group-ID files against being upgraded by
2671 the administrator, or linking to special files.
2672 .TP
2673 .IR /proc/sys/fs/protected_symlinks " (since Linux 3.6)"
2674 .\" commit 800179c9b8a1e796e441674776d11cd4c05d61d7
2675 When the value in this file is 0,
2676 no restrictions are placed on following symbolic links
2677 (i.e., this is the historical behaviour before Linux 3.6).
2678 When the value in this file is 1, symbolic links are followed only
2679 in the following circumstances:
2680 .RS
2681 .IP * 3
2682 the filesystem UID of the process following the link matches
2683 the owner (UID) of the symbolic link
2684 (as described in
2685 .BR credentials (7),
2686 a process's filesystem UID is normally the same as its effective UID);
2687 .IP *
2688 the link is not in a sticky world-writable directory; or
2689 .IP *
2690 the symbolic link and and its parent directory have the same owner (UID)
2691 .RE
2692 .IP
2693 A system call that fails to follow a symbolic link
2694 because of the above restrictions returns the error
2695 .BR EACCES
2696 in
2697 .IR errno .
2698 .IP
2699 The default value in this file is 0.
2700 Setting the value to 1 avoids a longstanding class of security issues
2701 based on time-of-check, time-of-use races when accessing symbolic links.
2702 .TP
2703 .IR /proc/sys/fs/suid_dumpable " (since Linux 2.6.13)"
2704 .\" The following is based on text from Documentation/sysctl/kernel.txt
2705 The value in this file determines whether core dump files are
2706 produced for set-user-ID or otherwise protected/tainted binaries.
2707 Three different integer values can be specified:
2708 .RS
2709 .TP
2710 \fI0\ (default)\fP
2711 This provides the traditional (pre-Linux 2.6.13) behavior.
2712 A core dump will not be produced for a process which has
2713 changed credentials (by calling
2714 .BR seteuid (2),
2715 .BR setgid (2),
2716 or similar, or by executing a set-user-ID or set-group-ID program)
2717 or whose binary does not have read permission enabled.
2718 .TP
2719 \fI1\ ("debug")\fP
2720 All processes dump core when possible.
2721 The core dump is owned by the filesystem user ID of the dumping process
2722 and no security is applied.
2723 This is intended for system debugging situations only.
2724 Ptrace is unchecked.
2725 .TP
2726 \fI2\ ("suidsafe")\fP
2727 Any binary which normally would not be dumped (see "0" above)
2728 is dumped readable by root only.
2729 This allows the user to remove the core dump file but not to read it.
2730 For security reasons core dumps in this mode will not overwrite one
2731 another or other files.
2732 This mode is appropriate when administrators are
2733 attempting to debug problems in a normal environment.
2734 .IP
2735 Additionally, since Linux 3.6,
2736 .\" 9520628e8ceb69fa9a4aee6b57f22675d9e1b709
2737 .I /proc/sys/kernel/core_pattern
2738 must either be an absolute pathname
2739 or a pipe command, as detailed in
2740 .BR core (5).
2741 Warnings will be written to the kernel log if
2742 .I core_pattern
2743 does not follow these rules, and no core dump will be produced.
2744 .\" 54b501992dd2a839e94e76aa392c392b55080ce8
2745 .RE
2746 .TP
2747 .I /proc/sys/fs/super-max
2748 This file
2749 controls the maximum number of superblocks, and
2750 thus the maximum number of mounted filesystems the kernel
2751 can have.
2752 You need increase only
2753 .I super-max
2754 if you need to mount more filesystems than the current value in
2755 .I super-max
2756 allows you to.
2757 .TP
2758 .I /proc/sys/fs/super-nr
2759 This file
2760 contains the number of filesystems currently mounted.
2761 .TP
2762 .I /proc/sys/kernel
2763 This directory contains files controlling a range of kernel parameters,
2764 as described below.
2765 .TP
2766 .I /proc/sys/kernel/acct
2767 This file
2768 contains three numbers:
2769 .IR highwater ,
2770 .IR lowwater ,
2771 and
2772 .IR frequency .
2773 If BSD-style process accounting is enabled these values control
2774 its behavior.
2775 If free space on filesystem where the log lives goes below
2776 .I lowwater
2777 percent accounting suspends.
2778 If free space gets above
2779 .I highwater
2780 percent accounting resumes.
2781 .I frequency
2782 determines
2783 how often the kernel checks the amount of free space (value is in
2784 seconds).
2785 Default values are 4, 2 and 30.
2786 That is, suspend accounting if 2% or less space is free; resume it
2787 if 4% or more space is free; consider information about amount of free space
2788 valid for 30 seconds.
2789 .TP
2790 .IR /proc/sys/kernel/cap_last_cap " (since Linux 3.2)"
2791 See
2792 .BR capabilities (7).
2793 .TP
2794 .IR /proc/sys/kernel/cap-bound " (from Linux 2.2 to 2.6.24)"
2795 This file holds the value of the kernel
2796 .I "capability bounding set"
2797 (expressed as a signed decimal number).
2798 This set is ANDed against the capabilities permitted to a process
2799 during
2800 .BR execve (2).
2801 Starting with Linux 2.6.25,
2802 the system-wide capability bounding set disappeared,
2803 and was replaced by a per-thread bounding set; see
2804 .BR capabilities (7).
2805 .TP
2806 .I /proc/sys/kernel/core_pattern
2807 See
2808 .BR core (5).
2809 .TP
2810 .I /proc/sys/kernel/core_uses_pid
2811 See
2812 .BR core (5).
2813 .TP
2814 .I /proc/sys/kernel/ctrl-alt-del
2815 This file
2816 controls the handling of Ctrl-Alt-Del from the keyboard.
2817 When the value in this file is 0, Ctrl-Alt-Del is trapped and
2818 sent to the
2819 .BR init (8)
2820 program to handle a graceful restart.
2821 When the value is greater than zero, Linux's reaction to a Vulcan
2822 Nerve Pinch (tm) will be an immediate reboot, without even
2823 syncing its dirty buffers.
2824 Note: when a program (like dosemu) has the keyboard in "raw"
2825 mode, the ctrl-alt-del is intercepted by the program before it
2826 ever reaches the kernel tty layer, and it's up to the program
2827 to decide what to do with it.
2828 .TP
2829 .IR /proc/sys/kernel/dmesg_restrict " (since Linux 2.6.37)"
2830 The value in this file determines who can see kernel syslog contents.
2831 A value of 0 in this file imposes no restrictions.
2832 If the value is 1, only privileged users can read the kernel syslog.
2833 (See
2834 .BR syslog (2)
2835 for more details.)
2836 Since Linux 3.4,
2837 .\" commit 620f6e8e855d6d447688a5f67a4e176944a084e8
2838 only users with the
2839 .BR CAP_SYS_ADMIN
2840 capability may change the value in this file.
2841 .TP
2842 .IR /proc/sys/kernel/domainname " and " /proc/sys/kernel/hostname
2843 can be used to set the NIS/YP domainname and the
2844 hostname of your box in exactly the same way as the commands
2845 .BR domainname (1)
2846 and
2847 .BR hostname (1),
2848 that is:
2849
2850 .in +4n
2851 .nf
2852 .RB "#" " echo \(aqdarkstar\(aq > /proc/sys/kernel/hostname"
2853 .RB "#" " echo \(aqmydomain\(aq > /proc/sys/kernel/domainname"
2854 .fi
2855 .in
2856
2857 has the same effect as
2858
2859 .in +4n
2860 .nf
2861 .RB "#" " hostname \(aqdarkstar\(aq"
2862 .RB "#" " domainname \(aqmydomain\(aq"
2863 .fi
2864 .in
2865
2866 Note, however, that the classic darkstar.frop.org has the
2867 hostname "darkstar" and DNS (Internet Domain Name Server)
2868 domainname "frop.org", not to be confused with the NIS (Network
2869 Information Service) or YP (Yellow Pages) domainname.
2870 These two
2871 domain names are in general different.
2872 For a detailed discussion
2873 see the
2874 .BR hostname (1)
2875 man page.
2876 .TP
2877 .I /proc/sys/kernel/hotplug
2878 This file
2879 contains the path for the hotplug policy agent.
2880 The default value in this file is
2881 .IR /sbin/hotplug .
2882 .TP
2883 .I /proc/sys/kernel/htab-reclaim
2884 (PowerPC only) If this file is set to a nonzero value,
2885 the PowerPC htab
2886 (see kernel file
2887 .IR Documentation/powerpc/ppc_htab.txt )
2888 is pruned
2889 each time the system hits the idle loop.
2890 .TP
2891 .IR /proc/sys/kernel/kptr_restrict " (since Linux 2.6.38)"
2892 .\" 455cd5ab305c90ffc422dd2e0fb634730942b257
2893 The value in this file determines whether kernel addresses are exposed via
2894 .I /proc
2895 files and other interfaces.
2896 A value of 0 in this file imposes no restrictions.
2897 If the value is 1, kernel pointers printed using the
2898 .I %pK
2899 format specifier will be replaced with zeros unless the user has the
2900 .BR CAP_SYSLOG
2901 capability.
2902 If the value is 2, kernel pointers printed using the
2903 .I %pK
2904 format specifier will be replaced with zeros regardless
2905 of the user's capabilities.
2906 The initial default value for this file was 1,
2907 but the default was changed
2908 .\" commit 411f05f123cbd7f8aa1edcae86970755a6e2a9d9
2909 to 0 in Linux 2.6.39.
2910 Since Linux 3.4,
2911 .\" commit 620f6e8e855d6d447688a5f67a4e176944a084e8
2912 only users with the
2913 .BR CAP_SYS_ADMIN
2914 capability can change the value in this file.
2915 .TP
2916 .I /proc/sys/kernel/l2cr
2917 (PowerPC only) This file
2918 contains a flag that controls the L2 cache of G3 processor
2919 boards.
2920 If 0, the cache is disabled.
2921 Enabled if nonzero.
2922 .TP
2923 .I /proc/sys/kernel/modprobe
2924 This file contains the path for the kernel module loader.
2925 The default value is
2926 .IR /sbin/modprobe .
2927 The file is present only if the kernel is built with the
2928 .B CONFIG_MODULES
2929 .RB ( CONFIG_KMOD
2930 in Linux 2.6.26 and earlier)
2931 option enabled.
2932 It is described by the Linux kernel source file
2933 .I Documentation/kmod.txt
2934 (present only in kernel 2.4 and earlier).
2935 .TP
2936 .IR /proc/sys/kernel/modules_disabled " (since Linux 2.6.31)"
2937 .\" 3d43321b7015387cfebbe26436d0e9d299162ea1
2938 .\" From Documentation/sysctl/kernel.txt
2939 A toggle value indicating if modules are allowed to be loaded
2940 in an otherwise modular kernel.
2941 This toggle defaults to off (0), but can be set true (1).
2942 Once true, modules can be neither loaded nor unloaded,
2943 and the toggle cannot be set back to false.
2944 The file is present only if the kernel is built with the
2945 .B CONFIG_MODULES
2946 option enabled.
2947 .TP
2948 .I /proc/sys/kernel/msgmax
2949 This file defines
2950 a system-wide limit specifying the maximum number of bytes in
2951 a single message written on a System V message queue.
2952 .TP
2953 .IR /proc/sys/kernel/msgmni " (since Linux 2.4)"
2954 This file defines the system-wide limit on the number of
2955 message queue identifiers.
2956 .TP
2957 .I /proc/sys/kernel/msgmnb
2958 This file defines a system-wide parameter used to initialize the
2959 .I msg_qbytes
2960 setting for subsequently created message queues.
2961 The
2962 .I msg_qbytes
2963 setting specifies the maximum number of bytes that may be written to the
2964 message queue.
2965 .TP
2966 .IR /proc/sys/kernel/ostype " and " /proc/sys/kernel/osrelease
2967 These files
2968 give substrings of
2969 .IR /proc/version .
2970 .TP
2971 .IR /proc/sys/kernel/overflowgid " and " /proc/sys/kernel/overflowuid
2972 These files duplicate the files
2973 .I /proc/sys/fs/overflowgid
2974 and
2975 .IR /proc/sys/fs/overflowuid .
2976 .TP
2977 .I /proc/sys/kernel/panic
2978 This file gives read/write access to the kernel variable
2979 .IR panic_timeout .
2980 If this is zero, the kernel will loop on a panic; if nonzero
2981 it indicates that the kernel should autoreboot after this number
2982 of seconds.
2983 When you use the
2984 software watchdog device driver, the recommended setting is 60.
2985 .TP
2986 .IR /proc/sys/kernel/panic_on_oops " (since Linux 2.5.68)"
2987 This file controls the kernel's behavior when an oops
2988 or BUG is encountered.
2989 If this file contains 0, then the system
2990 tries to continue operation.
2991 If it contains 1, then the system
2992 delays a few seconds (to give klogd time to record the oops output)
2993 and then panics.
2994 If the
2995 .I /proc/sys/kernel/panic
2996 file is also nonzero then the machine will be rebooted.
2997 .TP
2998 .IR /proc/sys/kernel/pid_max " (since Linux 2.5.34)"
2999 This file specifies the value at which PIDs wrap around
3000 (i.e., the value in this file is one greater than the maximum PID).
3001 The default value for this file, 32768,
3002 results in the same range of PIDs as on earlier kernels.
3003 On 32-bit platforms, 32768 is the maximum value for
3004 .IR pid_max .
3005 On 64-bit systems,
3006 .I pid_max
3007 can be set to any value up to 2^22
3008 .RB ( PID_MAX_LIMIT ,
3009 approximately 4 million).
3010 .\" Prior to 2.6.10, pid_max could also be raised above 32768 on 32-bit
3011 .\" platforms, but this broke /proc/[pid]
3012 .\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=109513010926152&w=2
3013 .TP
3014 .IR /proc/sys/kernel/powersave-nap " (PowerPC only)"
3015 This file contains a flag.
3016 If set, Linux-PPC will use the "nap" mode of
3017 powersaving,
3018 otherwise the "doze" mode will be used.
3019 .TP
3020 .I /proc/sys/kernel/printk
3021 The four values in this file are
3022 .IR console_loglevel ,
3023 .IR default_message_loglevel ,
3024 .IR minimum_console_level ,
3025 and
3026 .IR default_console_loglevel .
3027 These values influence
3028 .I printk()
3029 behavior when printing or logging error messages.
3030 See
3031 .BR syslog (2)
3032 for more info on the different loglevels.
3033 Messages with a higher priority than
3034 .I console_loglevel
3035 will be printed to the console.
3036 Messages without an explicit priority will be printed with priority
3037 .IR default_message_level .
3038 .I minimum_console_loglevel
3039 is the minimum (highest) value to which
3040 .I console_loglevel
3041 can be set.
3042 .I default_console_loglevel
3043 is the default value for
3044 .IR console_loglevel .
3045 .TP
3046 .IR /proc/sys/kernel/pty " (since Linux 2.6.4)"
3047 This directory contains two files relating to the number of UNIX 98
3048 pseudoterminals (see
3049 .BR pts (4))
3050 on the system.
3051 .TP
3052 .I /proc/sys/kernel/pty/max
3053 This file defines the maximum number of pseudoterminals.
3054 .TP
3055 .I /proc/sys/kernel/pty/nr
3056 This read-only file
3057 indicates how many pseudoterminals are currently in use.
3058 .TP
3059 .I /proc/sys/kernel/random
3060 This directory
3061 contains various parameters controlling the operation of the file
3062 .IR /dev/random .
3063 See
3064 .BR random (4)
3065 for further information.
3066 .TP
3067 .I /proc/sys/kernel/real-root-dev
3068 This file is documented in the Linux kernel source file
3069 .IR Documentation/initrd.txt .
3070 .TP
3071 .IR /proc/sys/kernel/reboot-cmd " (Sparc only) "
3072 This file seems to be a way to give an argument to the SPARC
3073 ROM/Flash boot loader.
3074 Maybe to tell it what to do after
3075 rebooting?
3076 .TP
3077 .I /proc/sys/kernel/rtsig-max
3078 (Only in kernels up to and including 2.6.7; see
3079 .BR setrlimit (2))
3080 This file can be used to tune the maximum number
3081 of POSIX real-time (queued) signals that can be outstanding
3082 in the system.
3083 .TP
3084 .I /proc/sys/kernel/rtsig-nr
3085 (Only in kernels up to and including 2.6.7.)
3086 This file shows the number POSIX real-time signals currently queued.
3087 .TP
3088 .IR /proc/sys/kernel/sched_rr_timeslice_ms " (since Linux 3.9)"
3089 See
3090 .BR sched_rr_get_interval (2).
3091 .TP
3092 .IR /proc/sys/kernel/sem " (since Linux 2.4)"
3093 This file contains 4 numbers defining limits for System V IPC semaphores.
3094 These fields are, in order:
3095 .RS
3096 .IP SEMMSL 8
3097 The maximum semaphores per semaphore set.
3098 .IP SEMMNS 8
3099 A system-wide limit on the number of semaphores in all semaphore sets.
3100 .IP SEMOPM 8
3101 The maximum number of operations that may be specified in a
3102 .BR semop (2)
3103 call.
3104 .IP SEMMNI 8
3105 A system-wide limit on the maximum number of semaphore identifiers.
3106 .RE
3107 .TP
3108 .I /proc/sys/kernel/sg-big-buff
3109 This file
3110 shows the size of the generic SCSI device (sg) buffer.
3111 You can't tune it just yet, but you could change it at
3112 compile time by editing
3113 .I include/scsi/sg.h
3114 and changing
3115 the value of
3116 .BR SG_BIG_BUFF .
3117 However, there shouldn't be any reason to change this value.
3118 .TP
3119 .IR /proc/sys/kernel/shm_rmid_forced " (since Linux 3.1)"
3120 .\" commit b34a6b1da371ed8af1221459a18c67970f7e3d53
3121 .\" See also Documentation/sysctl/kernel.txt
3122 If this file is set to 1, all System V shared memory segments will
3123 be marked for destruction as soon as the number of attached processes
3124 falls to zero;
3125 in other words, it is no longer possible to create shared memory segments
3126 that exist independently of any attached process.
3127 .IP
3128 The effect is as though a
3129 .BR shmctl (2)
3130 .B IPC_RMID
3131 is performed on all existing  segments as well as all segments
3132 created in the future (until this file is reset to 0).
3133 Note that existing segments that are attached to no process will be
3134 immediately destroyed when this file is set to 1.
3135 Setting this option will also destroy segments that were created,
3136 but never attached,
3137 upon termination of the process that created the segment with
3138 .BR shmget (2).
3139 .IP
3140 Setting this file to 1 provides a way of ensuring that
3141 all System V shared memory segments are counted against the
3142 resource usage and resource limits (see the description of
3143 .B RLIMIT_AS
3144 in
3145 .BR getrlimit (2))
3146 of at least one process.
3147 .IP
3148 Because setting this file to 1 produces behavior that is nonstandard
3149 and could also break existing applications,
3150 the default value in this file is 0.
3151 Only set this file to 1 if you have a good understanding
3152 of the semantics of the applications using
3153 System V shared memory on your system.
3154 .TP
3155 .I /proc/sys/kernel/shmall
3156 This file
3157 contains the system-wide limit on the total number of pages of
3158 System V shared memory.
3159 .TP
3160 .I /proc/sys/kernel/shmmax
3161 This file
3162 can be used to query and set the run-time limit
3163 on the maximum (System V IPC) shared memory segment size that can be
3164 created.
3165 Shared memory segments up to 1GB are now supported in the
3166 kernel.
3167 This value defaults to
3168 .BR SHMMAX .
3169 .TP
3170 .IR /proc/sys/kernel/shmmni " (since Linux 2.4)"
3171 This file
3172 specifies the system-wide maximum number of System V shared memory
3173 segments that can be created.
3174 .TP
3175 .I /proc/sys/kernel/sysrq
3176 This file controls the functions allowed to be invoked by the SysRq key.
3177 By default,
3178 the file contains 1 meaning that every possible SysRq request is allowed
3179 (in older kernel versions, SysRq was disabled by default,
3180 and you were required to specifically enable it at run-time,
3181 but this is not the case any more).
3182 Possible values in this file are:
3183
3184    0 - disable sysrq completely
3185    1 - enable all functions of sysrq
3186   >1 - bit mask of allowed sysrq functions, as follows:
3187           2 - enable control of console logging level
3188           4 - enable control of keyboard (SAK, unraw)
3189           8 - enable debugging dumps of processes etc.
3190          16 - enable sync command
3191          32 - enable remount read-only
3192          64 - enable signalling of processes (term, kill, oom-kill)
3193         128 - allow reboot/poweroff
3194         256 - allow nicing of all real-time tasks
3195
3196 This file is present only if the
3197 .B CONFIG_MAGIC_SYSRQ
3198 kernel configuration option is enabled.
3199 For further details see the Linux kernel source file
3200 .IR Documentation/sysrq.txt .
3201 .TP
3202 .I /proc/sys/kernel/version
3203 This file contains a string like:
3204
3205     #5 Wed Feb 25 21:49:24 MET 1998
3206
3207 The "#5" means that
3208 this is the fifth kernel built from this source base and the
3209 date behind it indicates the time the kernel was built.
3210 .TP
3211 .IR /proc/sys/kernel/threads-max " (since Linux 2.3.11)"
3212 This file specifies the system-wide limit on the number of
3213 threads (tasks) that can be created on the system.
3214 .TP
3215 .IR /proc/sys/kernel/zero-paged " (PowerPC only) "
3216 This file
3217 contains a flag.
3218 When enabled (nonzero), Linux-PPC will pre-zero pages in
3219 the idle loop, possibly speeding up get_free_pages.
3220 .TP
3221 .I /proc/sys/net
3222 This directory contains networking stuff.
3223 Explanations for some of the files under this directory can be found in
3224 .BR tcp (7)
3225 and
3226 .BR ip (7).
3227 .TP
3228 .I /proc/sys/net/core/somaxconn
3229 This file defines a ceiling value for the
3230 .I backlog
3231 argument of
3232 .BR listen (2);
3233 see the
3234 .BR listen (2)
3235 manual page for details.
3236 .TP
3237 .I /proc/sys/proc
3238 This directory may be empty.
3239 .TP
3240 .I /proc/sys/sunrpc
3241 This directory supports Sun remote procedure call for network filesystem
3242 (NFS).
3243 On some systems, it is not present.
3244 .TP
3245 .I /proc/sys/vm
3246 This directory contains files for memory management tuning, buffer and
3247 cache management.
3248 .TP
3249 .IR /proc/sys/vm/drop_caches " (since Linux 2.6.16)"
3250 Writing to this file causes the kernel to drop clean caches, dentries, and
3251 inodes from memory, causing that memory to become free.
3252 This can be useful for memory management testing and
3253 performing reproducible filesystem benchmarks.
3254 Because writing to this file causes the benefits of caching to be lost,
3255 it can degrade overall system performance.
3256
3257 To free pagecache, use:
3258
3259     echo 1 > /proc/sys/vm/drop_caches
3260
3261 To free dentries and inodes, use:
3262
3263     echo 2 > /proc/sys/vm/drop_caches
3264
3265 To free pagecache, dentries and inodes, use:
3266
3267     echo 3 > /proc/sys/vm/drop_caches
3268
3269 Because writing to this file is a nondestructive operation and dirty objects
3270 are not freeable, the
3271 user should run
3272 .BR sync (8)
3273 first.
3274 .TP
3275 .IR /proc/sys/vm/legacy_va_layout " (since Linux 2.6.9)"
3276 .\" The following is from Documentation/filesystems/proc.txt
3277 If nonzero, this disables the new 32-bit memory-mapping layout;
3278 the kernel will use the legacy (2.4) layout for all processes.
3279 .TP
3280 .IR /proc/sys/vm/memory_failure_early_kill " (since Linux 2.6.32)"
3281 .\" The following is based on the text in Documentation/sysctl/vm.txt
3282 Control how to kill processes when an uncorrected memory error
3283 (typically a 2-bit error in a memory module)
3284 that cannot be handled by the kernel
3285 is detected in the background by hardware.
3286 In some cases (like the page still having a valid copy on disk),
3287 the kernel will handle the failure
3288 transparently without affecting any applications.
3289 But if there is no other up-to-date copy of the data,
3290 it will kill processes to prevent any data corruptions from propagating.
3291
3292 The file has one of the following values:
3293 .RS
3294 .IP 1: 4
3295 Kill all processes that have the corrupted-and-not-reloadable page mapped
3296 as soon as the corruption is detected.
3297 Note this is not supported for a few types of pages, like kernel internally
3298 allocated data or the swap cache, but works for the majority of user pages.
3299 .IP 0: 4
3300 Only unmap the corrupted page from all processes and kill only a process
3301 that tries to access it.
3302 .RE
3303 .IP
3304 The kill is performed using a
3305 .B SIGBUS
3306 signal with
3307 .I si_code
3308 set to
3309 .BR BUS_MCEERR_AO .
3310 Processes can handle this if they want to; see
3311 .BR sigaction (2)
3312 for more details.
3313
3314 This feature is active only on architectures/platforms with advanced machine
3315 check handling and depends on the hardware capabilities.
3316
3317 Applications can override the
3318 .I memory_failure_early_kill
3319 setting individually with the
3320 .BR prctl (2)
3321 .B PR_MCE_KILL
3322 operation.
3323 .IP
3324 Only present if the kernel was configured with
3325 .BR CONFIG_MEMORY_FAILURE .
3326 .TP
3327 .IR /proc/sys/vm/memory_failure_recovery " (since Linux 2.6.32)"
3328 .\" The following is based on the text in Documentation/sysctl/vm.txt
3329 Enable memory failure recovery (when supported by the platform)
3330 .RS
3331 .IP 1: 4
3332 Attempt recovery.
3333 .IP 0: 4
3334 Always panic on a memory failure.
3335 .RE
3336 .IP
3337 Only present if the kernel was configured with
3338 .BR CONFIG_MEMORY_FAILURE .
3339 .TP
3340 .IR /proc/sys/vm/oom_dump_tasks " (since Linux 2.6.25)"
3341 .\" The following is from Documentation/sysctl/vm.txt
3342 Enables a system-wide task dump (excluding kernel threads) to be
3343 produced when the kernel performs an OOM-killing.
3344 The dump includes the following information
3345 for each task (thread, process):
3346 thread ID, real user ID, thread group ID (process ID),
3347 virtual memory size, resident set size,
3348 the CPU that the task is scheduled on,
3349 oom_adj score (see the description of
3350 .IR /proc/[pid]/oom_adj ),
3351 and command name.
3352 This is helpful to determine why the OOM-killer was invoked
3353 and to identify the rogue task that caused it.
3354
3355 If this contains the value zero, this information is suppressed.
3356 On very large systems with thousands of tasks,
3357 it may not be feasible to dump the memory state information for each one.
3358 Such systems should not be forced to incur a performance penalty in
3359 OOM situations when the information may not be desired.
3360
3361 If this is set to nonzero, this information is shown whenever the
3362 OOM-killer actually kills a memory-hogging task.
3363
3364 The default value is 0.
3365 .TP
3366 .IR /proc/sys/vm/oom_kill_allocating_task " (since Linux 2.6.24)"
3367 .\" The following is from Documentation/sysctl/vm.txt
3368 This enables or disables killing the OOM-triggering task in
3369 out-of-memory situations.
3370
3371 If this is set to zero, the OOM-killer will scan through the entire
3372 tasklist and select a task based on heuristics to kill.
3373 This normally selects a rogue memory-hogging task that
3374 frees up a large amount of memory when killed.
3375
3376 If this is set to nonzero, the OOM-killer simply kills the task that
3377 triggered the out-of-memory condition.
3378 This avoids a possibly expensive tasklist scan.
3379
3380 If
3381 .I /proc/sys/vm/panic_on_oom
3382 is nonzero, it takes precedence over whatever value is used in
3383 .IR /proc/sys/vm/oom_kill_allocating_task .
3384
3385 The default value is 0.
3386 .TP
3387 .I /proc/sys/vm/overcommit_memory
3388 This file contains the kernel virtual memory accounting mode.
3389 Values are:
3390 .RS
3391 .IP
3392 0: heuristic overcommit (this is the default)
3393 .br
3394 1: always overcommit, never check
3395 .br
3396 2: always check, never overcommit
3397 .RE
3398 .IP
3399 In mode 0, calls of
3400 .BR mmap (2)
3401 with
3402 .B MAP_NORESERVE
3403 are not checked, and the default check is very weak,
3404 leading to the risk of getting a process "OOM-killed".
3405 Under Linux 2.4 any nonzero value implies mode 1.
3406 In mode 2 (available since Linux 2.6), the total virtual address space
3407 on the system is limited to (SS + RAM*(r/100)),
3408 where SS is the size of the swap space, and RAM
3409 is the size of the physical memory, and r is the contents of the file
3410 .IR /proc/sys/vm/overcommit_ratio .
3411 .TP
3412 .I /proc/sys/vm/overcommit_ratio
3413 See the description of
3414 .IR /proc/sys/vm/overcommit_memory .
3415 .TP
3416 .IR /proc/sys/vm/panic_on_oom " (since Linux 2.6.18)"
3417 .\" The following is adapted from Documentation/sysctl/vm.txt
3418 This enables or disables a kernel panic in
3419 an out-of-memory situation.
3420
3421 If this file is set to the value 0,
3422 the kernel's OOM-killer will kill some rogue process.
3423 Usually, the OOM-killer is able to kill a rogue process and the
3424 system will survive.
3425
3426 If this file is set to the value 1,
3427 then the kernel normally panics when out-of-memory happens.
3428 However, if a process limits allocations to certain nodes
3429 using memory policies
3430 .RB ( mbind  (2)
3431 .BR MPOL_BIND )
3432 or cpusets
3433 .RB ( cpuset (7))
3434 and those nodes reach memory exhaustion status,
3435 one process may be killed by the OOM-killer.
3436 No panic occurs in this case:
3437 because other nodes' memory may be free,
3438 this means the system as a whole may not have reached
3439 an out-of-memory situation yet.
3440
3441 If this file is set to the value 2,
3442 the kernel always panics when an out-of-memory condition occurs.
3443
3444 The default value is 0.
3445 1 and 2 are for failover of clustering.
3446 Select either according to your policy of failover.
3447 .TP
3448 .IR /proc/sys/vm/swappiness
3449 .\" The following is from Documentation/sysctl/vm.txt
3450 The value in this file controls how aggressively the kernel will swap
3451 memory pages.
3452 Higher values increase aggressiveness, lower values
3453 decrease aggressiveness.
3454 The default value is 60.
3455 .TP
3456 .IR /proc/sysrq-trigger " (since Linux 2.4.21)"
3457 Writing a character to this file triggers the same SysRq function as
3458 typing ALT-SysRq-<character> (see the description of
3459 .IR /proc/sys/kernel/sysrq ).
3460 This file is normally writable only by
3461 .IR root .
3462 For further details see the Linux kernel source file
3463 .IR Documentation/sysrq.txt .
3464 .TP
3465 .I /proc/sysvipc
3466 Subdirectory containing the pseudo-files
3467 .IR msg ", "  sem " and "  shm "."
3468 These files list the System V Interprocess Communication (IPC) objects
3469 (respectively: message queues, semaphores, and shared memory)
3470 that currently exist on the system,
3471 providing similar information to that available via
3472 .BR ipcs (1).
3473 These files have headers and are formatted (one IPC object per line)
3474 for easy understanding.
3475 .BR svipc (7)
3476 provides further background on the information shown by these files.
3477 .TP
3478 .I /proc/tty
3479 Subdirectory containing the pseudo-files and subdirectories for
3480 tty drivers and line disciplines.
3481 .TP
3482 .I /proc/uptime
3483 This file contains two numbers: the uptime of the system (seconds),
3484 and the amount of time spent in idle process (seconds).
3485 .TP
3486 .I /proc/version
3487 This string identifies the kernel version that is currently running.
3488 It includes the contents of
3489 .IR /proc/sys/kernel/ostype ,
3490 .I /proc/sys/kernel/osrelease
3491 and
3492 .IR /proc/sys/kernel/version .
3493 For example:
3494 .nf
3495 .in -2
3496 .ft CW
3497 Linux version 1.0.9 (quinlan@phaze) #1 Sat May 14 01:51:54 EDT 1994
3498 .ft
3499 .in +2
3500 .fi
3501 .\" FIXME Document /proc/timer_list
3502 .\" .TP
3503 .\" .IR /proc/timer_list " (since Linux 2.6.21)"
3504 .\" See the 2.6.21 Change log
3505 .\" FIXME Document /proc/timer_stats
3506 .\" .TP
3507 .\" .IR /proc/timer_stats " (since Linux 2.6.21)"
3508 .\" See the 2.6.21 Change log
3509 .TP
3510 .IR /proc/vmstat " (since Linux 2.6)"
3511 This file displays various virtual memory statistics.
3512 .TP
3513 .IR /proc/zoneinfo " (since Linux 2.6.13)"
3514 This file display information about memory zones.
3515 This is useful for analyzing virtual memory behavior.
3516 .\" FIXME more should be said about /proc/zoneinfo
3517 .SH NOTES
3518 Many strings (i.e., the environment and command line) are in
3519 the internal format, with subfields terminated by null bytes (\(aq\\0\(aq),
3520 so you
3521 may find that things are more readable if you use \fIod \-c\fP or \fItr
3522 "\\000" "\\n"\fP to read them.
3523 Alternatively, \fIecho \`cat <file>\`\fP works well.
3524
3525 This manual page is incomplete, possibly inaccurate, and is the kind
3526 of thing that needs to be updated very often.
3527 .\" .SH ACKNOWLEDGEMENTS
3528 .\" The material on /proc/sys/fs and /proc/sys/kernel is closely based on
3529 .\" kernel source documentation files written by Rik van Riel.
3530 .SH SEE ALSO
3531 .BR cat (1),
3532 .BR dmesg (1),
3533 .BR find (1),
3534 .BR free (1),
3535 .BR ps (1),
3536 .BR tr (1),
3537 .BR uptime (1),
3538 .BR chroot (2),
3539 .BR mmap (2),
3540 .BR readlink (2),
3541 .BR syslog (2),
3542 .BR slabinfo (5),
3543 .BR hier (7),
3544 .BR time (7),
3545 .BR arp (8),
3546 .BR hdparm (8),
3547 .BR ifconfig (8),
3548 .BR init (8),
3549 .BR lsmod (8),
3550 .BR lspci (8),
3551 .BR mount (8),
3552 .BR netstat (8),
3553 .BR procinfo (8),
3554 .BR route (8),
3555 .BR sysctl (8)
3556
3557 The Linux kernel source files:
3558 .IR Documentation/filesystems/proc.txt
3559 and
3560 .IR Documentation/sysctl/vm.txt .