OSDN Git Service

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