OSDN Git Service

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