OSDN Git Service

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