OSDN Git Service

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