OSDN Git Service

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