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