OSDN Git Service

Update README
[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 2015-01-22 "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 (10) \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 VmSwap:        0 kB
1591 Threads:        1
1592 SigQ:   0/3067
1593 SigPnd: 0000000000000000
1594 ShdPnd: 0000000000000000
1595 SigBlk: 0000000000010000
1596 SigIgn: 0000000000384004
1597 SigCgt: 000000004b813efb
1598 CapInh: 0000000000000000
1599 CapPrm: 0000000000000000
1600 CapEff: 0000000000000000
1601 CapBnd: ffffffffffffffff
1602 Seccomp:        0
1603 Cpus_allowed:   00000001
1604 Cpus_allowed_list:      0
1605 Mems_allowed:   1
1606 Mems_allowed_list:      0
1607 voluntary_ctxt_switches:        150
1608 nonvoluntary_ctxt_switches:     545
1609 .fi
1610 .in
1611 .IP
1612 The fields are as follows:
1613 .RS
1614 .IP * 2
1615 .IR Name :
1616 Command run by this process.
1617 .IP *
1618 .IR State :
1619 Current state of the process.
1620 One of
1621 "R (running)",
1622 "S (sleeping)",
1623 "D (disk sleep)",
1624 "T (stopped)",
1625 "T (tracing stop)",
1626 "Z (zombie)",
1627 or
1628 "X (dead)".
1629 .IP *
1630 .IR Tgid :
1631 Thread group ID (i.e., Process ID).
1632 .IP *
1633 .IR Pid :
1634 Thread ID (see
1635 .BR gettid (2)).
1636 .IP *
1637 .IR PPid :
1638 PID of parent process.
1639 .IP *
1640 .IR TracerPid :
1641 PID of process tracing this process (0 if not being traced).
1642 .IP *
1643 .IR Uid ", " Gid :
1644 Real, effective, saved set, and filesystem UIDs (GIDs).
1645 .IP *
1646 .IR FDSize :
1647 Number of file descriptor slots currently allocated.
1648 .IP *
1649 .IR Groups :
1650 Supplementary group list.
1651 .IP *
1652 .IR VmPeak :
1653 Peak virtual memory size.
1654 .IP *
1655 .IR VmSize :
1656 Virtual memory size.
1657 .IP *
1658 .IR VmLck :
1659 Locked memory size (see
1660 .BR mlock (3)).
1661 .IP *
1662 .IR VmHWM :
1663 Peak resident set size ("high water mark").
1664 .IP *
1665 .IR VmRSS :
1666 Resident set size.
1667 .IP *
1668 .IR VmData ", " VmStk ", " VmExe :
1669 Size of data, stack, and text segments.
1670 .IP *
1671 .IR VmLib :
1672 Shared library code size.
1673 .IP *
1674 .IR VmPTE :
1675 Page table entries size (since Linux 2.6.10).
1676 .IP *
1677 .IR VmSwap :
1678 .\" commit b084d4353ff99d824d3bc5a5c2c22c70b1fba722
1679 Swapped-out virtual memory size (since Linux 2.6.34).
1680 .IP *
1681 .IR Threads :
1682 Number of threads in process containing this thread.
1683 .IP *
1684 .IR SigQ :
1685 This field contains two slash-separated numbers that relate to
1686 queued signals for the real user ID of this process.
1687 The first of these is the number of currently queued
1688 signals for this real user ID, and the second is the
1689 resource limit on the number of queued signals for this process
1690 (see the description of
1691 .BR RLIMIT_SIGPENDING
1692 in
1693 .BR getrlimit (2)).
1694 .IP *
1695 .IR SigPnd ", " ShdPnd :
1696 Number of signals pending for thread and for process as a whole (see
1697 .BR pthreads (7)
1698 and
1699 .BR signal (7)).
1700 .IP *
1701 .IR SigBlk ", " SigIgn ", " SigCgt :
1702 Masks indicating signals being blocked, ignored, and caught (see
1703 .BR signal (7)).
1704 .IP *
1705 .IR CapInh ", " CapPrm ", " CapEff :
1706 Masks of capabilities enabled in inheritable, permitted, and effective sets
1707 (see
1708 .BR capabilities (7)).
1709 .IP *
1710 .IR CapBnd :
1711 Capability Bounding set
1712 (since Linux 2.6.26, see
1713 .BR capabilities (7)).
1714 .IP *
1715 .IR Seccomp :
1716 .\" commit 2f4b3bf6b2318cfaa177ec5a802f4d8d6afbd816
1717 Seccomp mode of the process
1718 (since Linux 3.8, see
1719 .BR seccomp (2)).
1720 0 means
1721 .BR SECCOMP_MODE_DISABLED ;
1722 1 means
1723 .BR SECCOMP_MODE_STRICT ;
1724 2 means
1725 .BR SECCOMP_MODE_FILTER .
1726 This field is provided only if the kernel was built with the
1727 .BR CONFIG_SECCOMP
1728 kernel configuration option enabled.
1729 .IP *
1730 .IR Cpus_allowed :
1731 Mask of CPUs on which this process may run
1732 (since Linux 2.6.24, see
1733 .BR cpuset (7)).
1734 .IP *
1735 .IR Cpus_allowed_list :
1736 Same as previous, but in "list format"
1737 (since Linux 2.6.26, see
1738 .BR cpuset (7)).
1739 .IP *
1740 .IR Mems_allowed :
1741 Mask of memory nodes allowed to this process
1742 (since Linux 2.6.24, see
1743 .BR cpuset (7)).
1744 .IP *
1745 .IR Mems_allowed_list :
1746 Same as previous, but in "list format"
1747 (since Linux 2.6.26, see
1748 .BR cpuset (7)).
1749 .IP *
1750 .IR voluntary_ctxt_switches ", " nonvoluntary_ctxt_switches :
1751 Number of voluntary and involuntary context switches (since Linux 2.6.23).
1752 .RE
1753 .TP
1754 .IR /proc/[pid]/syscall " (since Linux 2.6.27)"
1755 .\" commit ebcb67341fee34061430f3367f2e507e52ee051b
1756 This file exposes the system call number and argument registers for the
1757 system call currently being executed by the process,
1758 followed by the values of the stack pointer and program counter registers.
1759 The values of all six argument registers are exposed,
1760 although most system calls use fewer registers.
1761
1762 If the process is blocked, but not in a system call,
1763 then the file displays \-1 in place of the system call number,
1764 followed by just the values of the stack pointer and program counter.
1765 If process is not blocked, then file contains just the string "running".
1766
1767 This file is present only if the kernel was configured with
1768 .BR CONFIG_HAVE_ARCH_TRACEHOOK .
1769 .TP
1770 .IR /proc/[pid]/task " (since Linux 2.6.0-test6)"
1771 This is a directory that contains one subdirectory
1772 for each thread in the process.
1773 The name of each subdirectory is the numerical thread ID
1774 .RI ( [tid] )
1775 of the thread (see
1776 .BR gettid (2)).
1777 Within each of these subdirectories, there is a set of
1778 files with the same names and contents as under the
1779 .I /proc/[pid]
1780 directories.
1781 For attributes that are shared by all threads, the contents for
1782 each of the files under the
1783 .I task/[tid]
1784 subdirectories will be the same as in the corresponding
1785 file in the parent
1786 .I /proc/[pid]
1787 directory
1788 (e.g., in a multithreaded process, all of the
1789 .I task/[tid]/cwd
1790 files will have the same value as the
1791 .I /proc/[pid]/cwd
1792 file in the parent directory, since all of the threads in a process
1793 share a working directory).
1794 For attributes that are distinct for each thread,
1795 the corresponding files under
1796 .I task/[tid]
1797 may have different values (e.g., various fields in each of the
1798 .I task/[tid]/status
1799 files may be different for each thread).
1800
1801 .\" The following was still true as at kernel 2.6.13
1802 In a multithreaded process, the contents of the
1803 .I /proc/[pid]/task
1804 directory are not available if the main thread has already terminated
1805 (typically by calling
1806 .BR pthread_exit (3)).
1807 .TP
1808 .IR /proc/[pid]/uid_map ", " /proc/[pid]/gid_map " (since Linux 3.5)"
1809 .\" commit 22d917d80e842829d0ca0a561967d728eb1d6303
1810 These files expose the mappings for user and group IDs
1811 inside the user namespace for the process
1812 .IR pid .
1813 The description here explains the details for
1814 .IR uid_map ;
1815 .IR gid_map
1816 is exactly the same,
1817 but each instance of "user ID" is replaced by "group ID".
1818
1819 The
1820 .I uid_map
1821 file exposes the mapping of user IDs from the user namespace
1822 of the process
1823 .IR pid
1824 to the user namespace of the process that opened
1825 .IR uid_map
1826 (but see a qualification to this point below).
1827 In other words, processes that are in different user namespaces
1828 will potentially see different values when reading from a particular
1829 .I uid_map
1830 file, depending on the user ID mappings for the user namespaces
1831 of the reading processes.
1832
1833
1834 Each line in the file specifies a 1-to-1 mapping of a range of contiguous
1835 between two user namespaces.
1836 The specification in each line takes the form of
1837 three numbers delimited by white space.
1838 The first two numbers specify the starting user ID in
1839 each user namespace.
1840 The third number specifies the length of the mapped range.
1841 In detail, the fields are interpreted as follows:
1842 .RS
1843 .IP (1) 4
1844 The start of the range of user IDs in
1845 the user namespace of the process
1846 .IR pid .
1847 .IP (2)
1848 The start of the range of user
1849 IDs to which the user IDs specified by field one map.
1850 How field two is interpreted depends on whether the process that opened
1851 .I uid_map
1852 and the process
1853 .IR pid
1854 are in the same user namespace, as follows:
1855 .RS
1856 .IP a) 3
1857 If the two processes are in different user namespaces:
1858 field two is the start of a range of
1859 user IDs in the user namespace of the process that opened
1860 .IR uid_map .
1861 .IP b)
1862 If the two processes are in the same user namespace:
1863 field two is the start of the range of
1864 user IDs in the parent user namespace of the process
1865 .IR pid .
1866 (The "parent user namespace"
1867 is the user namespace of the process that created a user namespace
1868 via a call to
1869 .BR unshare (2)
1870 or
1871 .BR clone (2)
1872 with the
1873 .BR CLONE_NEWUSER
1874 flag.)
1875 This case enables the opener of
1876 .I uid_map
1877 (the common case here is opening
1878 .IR /proc/self/uid_map )
1879 to see the mapping of user IDs into the user namespace of the process
1880 that created this user namespace.
1881 .RE
1882 .IP (3)
1883 The length of the range of user IDs that is mapped between the two
1884 user namespaces.
1885 .RE
1886 .IP
1887 After the creation of a new user namespace, the
1888 .I uid_map
1889 file may be written to exactly once to specify
1890 the mapping of user IDs in the new user namespace.
1891 (An attempt to write more than once to the file fails with the error
1892 .BR EPERM .)
1893 .IP
1894 The lines written to
1895 .IR uid_map
1896 must conform to the following rules:
1897 .RS
1898 .IP * 3
1899 The three fields must be valid numbers,
1900 and the last field must be greater than 0.
1901 .IP *
1902 Lines are terminated by newline characters.
1903 .IP *
1904 There is an (arbitrary) limit on the number of lines in the file.
1905 As at Linux 3.8, the limit is five lines.
1906 .IP *
1907 The range of user IDs specified in each line cannot overlap with the ranges
1908 in any other lines.
1909 In the current implementation (Linux 3.8), this requirement is
1910 satisfied by a simplistic implementation that imposes the further
1911 requirement that
1912 the values in both field 1 and field 2 of successive lines must be
1913 in ascending numerical order.
1914 .RE
1915 .IP
1916 Writes that violate the above rules fail with the error
1917 .BR EINVAL .
1918
1919 In order for a process to write to the
1920 .I /proc/[pid]/uid_map
1921 .RI ( /proc/[pid]/gid_map )
1922 file, the following requirements must be met:
1923 .RS
1924 .IP * 3
1925 The process must have the
1926 .BR CAP_SETUID
1927 .RB ( CAP_SETGID )
1928 capability in the user namespace of the process
1929 .IR pid .
1930 .IP *
1931 The process must have the
1932 .BR CAP_SETUID
1933 .RB ( CAP_SETGID )
1934 capability in the parent user namespace.
1935 .IP *
1936 The process must be in either the user namespace of the process
1937 .I pid
1938 or inside the parent user namespace of the process
1939 .IR pid .
1940 .RE
1941 For further details, see
1942 .BR namespaces (7).
1943 .TP
1944 .IR /proc/[pid]/wchan " (since Linux 2.6.0)"
1945 The symbolic name corresponding to the location
1946 in the kernel where the process is sleeping.
1947 .TP
1948 .I /proc/apm
1949 Advanced power management version and battery information when
1950 .B CONFIG_APM
1951 is defined at kernel compilation time.
1952 .TP
1953 .I /proc/buddyinfo
1954 This file contains information which is used for diagnosing memory
1955 fragmentation issues.
1956 Each line starts with the identification of the node and the name
1957 of the zone which together identify a memory region
1958 This is then
1959 followed by the count of available chunks of a certain order in
1960 which these zones are split.
1961 The size in bytes of a certain order is given by the formual:
1962
1963     (2^order)\ *\ PAGE_SIZE
1964
1965 The binary buddy allocator algorithm inside the kernel will split
1966 one chunk into two chunks of a smaller order (thus with half the
1967 size) or combine two contiguous chunks into one larger chunk of
1968 a higher order (thus with double the size) to satisfy allocation
1969 requests and to counter memory fragmentation.
1970 The order matches the column number, when starting to count at zero.
1971
1972 For example on a x86_64 system:
1973
1974 .in -12n
1975 .nf
1976 Node 0, zone     DMA     1    1    1    0    2    1    1    0    1    1    3
1977 Node 0, zone   DMA32    65   47    4   81   52   28   13   10    5    1  404
1978 Node 0, zone  Normal   216   55  189  101   84   38   37   27    5    3  587
1979 .fi
1980 .in
1981
1982 In this example, there is one node containing three zones and there
1983 are 11 different chunk sizes.
1984 If the page size is 4 kilobytes, then the first zone called
1985 .I DMA
1986 (on x86 the first 16 megabyte of memory) has 1 chunk of 4 kilobytes
1987 (order 0) available and has 3 chunks of 4 megabytes (order 10) available.
1988
1989 If the memory is heavily fragmented, the counters for higher
1990 order chunks will be zero and allocation of large contiguous areas
1991 will fail.
1992
1993 Further information about the zones can be found in
1994 .IR /proc/zoneinfo .
1995 .TP
1996 .I /proc/bus
1997 Contains subdirectories for installed busses.
1998 .TP
1999 .I /proc/bus/pccard
2000 Subdirectory for PCMCIA devices when
2001 .B CONFIG_PCMCIA
2002 is set at kernel compilation time.
2003 .TP
2004 .IR /proc/[pid]/timers " (since Linux 3.10)"
2005 .\" commit 5ed67f05f66c41e39880a6d61358438a25f9fee5
2006 .\" commit 48f6a7a511ef8823fdff39afee0320092d43a8a0
2007 A list of the POSIX timers for this process.
2008 Each timer is listed with a line that started with the string "ID:".
2009 For example:
2010
2011 .in +4n
2012 .nf
2013 ID: 1
2014 signal: 60/00007fff86e452a8
2015 notify: signal/pid.2634
2016 ClockID: 0
2017 ID: 0
2018 signal: 60/00007fff86e452a8
2019 notify: signal/pid.2634
2020 ClockID: 1
2021 .fi
2022 .in
2023
2024 The lines shown for each timer have the following meanings:
2025 .RS
2026 .TP
2027 .I ID
2028 The ID for this timer.
2029 This is not the same as the timer ID returned by
2030 .BR timer_create (2);
2031 rather, it is the same kernel-internal ID that is available via the
2032 .I si_timerid
2033 field of the
2034 .IR siginfo_t
2035 structure (see
2036 .BR sigaction (2)).
2037 .TP
2038 .I signal
2039 This is the signal number that this timer uses to deliver notifications
2040 followed by a slash, and then the
2041 .I sigev_value.sival_ptr
2042 value supplied to the signal handler.
2043 Valid only for timers that notify via a signal.
2044 .TP
2045 .I notify
2046 The part before the slash specifies the mechanism
2047 that this timer uses to deliver notifications,
2048 and is one of "thread", "signal", or "none".
2049 Immediately following the slash is either the string "tid" for timers
2050 with
2051 .B SIGEV_THREAD_ID
2052 notification, or "pid" for timers that notify by other mechanisms.
2053 Following the "." is the PID of the process that will be delivered
2054 a signal if the timer delivers notifications via a signal.
2055 .TP
2056 .I ClockID
2057 This field identifies the clock that the timer uses for measuring time.
2058 For most clocks, this is a number that matches one of the user-space
2059 .BR CLOCK_*
2060 constants exposed via
2061 .IR <time.h> .
2062 .B CLOCK_PROCESS_CPUTIME_ID
2063 timers display with a value of -6
2064 in this field.
2065 .B CLOCK_THREAD_CPUTIME_ID
2066 timers display with a value of -2
2067 in this field.
2068 .RE
2069 .TP
2070 .I /proc/bus/pccard/drivers
2071 .TP
2072 .I /proc/bus/pci
2073 Contains various bus subdirectories and pseudo-files containing
2074 information about PCI busses, installed devices, and device
2075 drivers.
2076 Some of these files are not ASCII.
2077 .TP
2078 .I /proc/bus/pci/devices
2079 Information about PCI devices.
2080 They may be accessed through
2081 .BR lspci (8)
2082 and
2083 .BR setpci (8).
2084 .TP
2085 .I /proc/cmdline
2086 Arguments passed to the Linux kernel at boot time.
2087 Often done via a boot manager such as
2088 .BR lilo (8)
2089 or
2090 .BR grub (8).
2091 .TP
2092 .IR /proc/config.gz " (since Linux 2.6)"
2093 This file exposes the configuration options that were used
2094 to build the currently running kernel,
2095 in the same format as they would be shown in the
2096 .I .config
2097 file that resulted when configuring the kernel (using
2098 .IR "make xconfig" ,
2099 .IR "make config" ,
2100 or similar).
2101 The file contents are compressed; view or search them using
2102 .BR zcat (1)
2103 and
2104 .BR zgrep (1).
2105 As long as no changes have been made to the following file,
2106 the contents of
2107 .I /proc/config.gz
2108 are the same as those provided by :
2109 .in +4n
2110 .nf
2111
2112 cat /lib/modules/$(uname \-r)/build/.config
2113 .fi
2114 .in
2115 .IP
2116 .I /proc/config.gz
2117 is provided only if the kernel is configured with
2118 .BR CONFIG_IKCONFIG_PROC .
2119 .TP
2120 .I /proc/cpuinfo
2121 This is a collection of CPU and system architecture dependent items,
2122 for each supported architecture a different list.
2123 Two common entries are \fIprocessor\fP which gives CPU number and
2124 \fIbogomips\fP; a system constant that is calculated
2125 during kernel initialization.
2126 SMP machines have information for
2127 each CPU.
2128 The
2129 .BR lscpu (1)
2130 command gathers its information from this file.
2131 .TP
2132 .I /proc/devices
2133 Text listing of major numbers and device groups.
2134 This can be used by MAKEDEV scripts for consistency with the kernel.
2135 .TP
2136 .IR /proc/diskstats " (since Linux 2.5.69)"
2137 This file contains disk I/O statistics for each disk device.
2138 See the Linux kernel source file
2139 .I Documentation/iostats.txt
2140 for further information.
2141 .TP
2142 .I /proc/dma
2143 This is a list of the registered \fIISA\fP DMA (direct memory access)
2144 channels in use.
2145 .TP
2146 .I /proc/driver
2147 Empty subdirectory.
2148 .TP
2149 .I /proc/execdomains
2150 List of the execution domains (ABI personalities).
2151 .TP
2152 .I /proc/fb
2153 Frame buffer information when
2154 .B CONFIG_FB
2155 is defined during kernel compilation.
2156 .TP
2157 .I /proc/filesystems
2158 A text listing of the filesystems which are supported by the kernel,
2159 namely filesystems which were compiled into the kernel or whose kernel
2160 modules are currently loaded.
2161 (See also
2162 .BR filesystems (5).)
2163 If a filesystem is marked with "nodev",
2164 this means that it does not require a block device to be mounted
2165 (e.g., virtual filesystem, network filesystem).
2166
2167 Incidentally, this file may be used by
2168 .BR mount (8)
2169 when no filesystem is specified and it didn't manage to determine the
2170 filesystem type.
2171 Then filesystems contained in this file are tried
2172 (excepted those that are marked with "nodev").
2173 .TP
2174 .I /proc/fs
2175 .\" FIXME Much more needs to be said about /proc/fs
2176 .\"
2177 Contains subdirectories that in turn contain files
2178 with information about (certain) mounted filesystems.
2179 .TP
2180 .I /proc/ide
2181 This directory
2182 exists on systems with the IDE bus.
2183 There are directories for each IDE channel and attached device.
2184 Files include:
2185
2186 .in +4n
2187 .nf
2188 cache              buffer size in KB
2189 capacity           number of sectors
2190 driver             driver version
2191 geometry           physical and logical geometry
2192 identify           in hexadecimal
2193 media              media type
2194 model              manufacturer's model number
2195 settings           drive settings
2196 smart_thresholds   in hexadecimal
2197 smart_values       in hexadecimal
2198 .fi
2199 .in
2200
2201 The
2202 .BR hdparm (8)
2203 utility provides access to this information in a friendly format.
2204 .TP
2205 .I /proc/interrupts
2206 This is used to record the number of interrupts per CPU per IO device.
2207 Since Linux 2.6.24,
2208 for the i386 and x86_64 architectures, at least, this also includes
2209 interrupts internal to the system (that is, not associated with a device
2210 as such), such as NMI (nonmaskable interrupt), LOC (local timer interrupt),
2211 and for SMP systems, TLB (TLB flush interrupt), RES (rescheduling
2212 interrupt), CAL (remote function call interrupt), and possibly others.
2213 Very easy to read formatting, done in ASCII.
2214 .TP
2215 .I /proc/iomem
2216 I/O memory map in Linux 2.4.
2217 .TP
2218 .I /proc/ioports
2219 This is a list of currently registered Input-Output port regions that
2220 are in use.
2221 .TP
2222 .IR /proc/kallsyms " (since Linux 2.5.71)"
2223 This holds the kernel exported symbol definitions used by the
2224 .BR modules (X)
2225 tools to dynamically link and bind loadable modules.
2226 In Linux 2.5.47 and earlier, a similar file with slightly different syntax
2227 was named
2228 .IR ksyms .
2229 .TP
2230 .I /proc/kcore
2231 This file represents the physical memory of the system and is stored
2232 in the ELF core file format.
2233 With this pseudo-file, and an unstripped
2234 kernel
2235 .RI ( /usr/src/linux/vmlinux )
2236 binary, GDB can be used to
2237 examine the current state of any kernel data structures.
2238
2239 The total length of the file is the size of physical memory (RAM) plus
2240 4KB.
2241 .TP
2242 .I /proc/kmsg
2243 This file can be used instead of the
2244 .BR syslog (2)
2245 system call to read kernel messages.
2246 A process must have superuser
2247 privileges to read this file, and only one process should read this
2248 file.
2249 This file should not be read if a syslog process is running
2250 which uses the
2251 .BR syslog (2)
2252 system call facility to log kernel messages.
2253
2254 Information in this file is retrieved with the
2255 .BR dmesg (1)
2256 program.
2257 .TP
2258 .IR /proc/kpagecount " (since Linux 2.6.25)"
2259 This file contains a 64-bit count of the number of
2260 times each physical page frame is mapped,
2261 indexed by page frame number (see the discussion of
2262 .IR /proc/[pid]/pagemap ).
2263 .IP
2264 The
2265 .IR /proc/kpagecount
2266 file is present only if the
2267 .B CONFIG_PROC_PAGE_MONITOR
2268 kernel configuration option is enabled.
2269 .TP
2270 .IR /proc/kpageflags " (since Linux 2.6.25)"
2271 This file contains 64-bit masks corresponding to each physical page frame;
2272 it is indexed by page frame number (see the discussion of
2273 .IR /proc/[pid]/pagemap ).
2274 The bits are as follows:
2275
2276      0 - KPF_LOCKED
2277      1 - KPF_ERROR
2278      2 - KPF_REFERENCED
2279      3 - KPF_UPTODATE
2280      4 - KPF_DIRTY
2281      5 - KPF_LRU
2282      6 - KPF_ACTIVE
2283      7 - KPF_SLAB
2284      8 - KPF_WRITEBACK
2285      9 - KPF_RECLAIM
2286     10 - KPF_BUDDY
2287     11 - KPF_MMAP           (since Linux 2.6.31)
2288     12 - KPF_ANON           (since Linux 2.6.31)
2289     13 - KPF_SWAPCACHE      (since Linux 2.6.31)
2290     14 - KPF_SWAPBACKED     (since Linux 2.6.31)
2291     15 - KPF_COMPOUND_HEAD  (since Linux 2.6.31)
2292     16 - KPF_COMPOUND_TAIL  (since Linux 2.6.31)
2293     16 - KPF_HUGE           (since Linux 2.6.31)
2294     18 - KPF_UNEVICTABLE    (since Linux 2.6.31)
2295     19 - KPF_HWPOISON       (since Linux 2.6.31)
2296     20 - KPF_NOPAGE         (since Linux 2.6.31)
2297     21 - KPF_KSM            (since Linux 2.6.32)
2298     22 - KPF_THP            (since Linux 3.4)
2299
2300 For further details on the meanings of these bits,
2301 see the kernel source file
2302 .IR Documentation/vm/pagemap.txt .
2303 Before kernel 2.6.29,
2304 .\" commit ad3bdefe877afb47480418fdb05ecd42842de65e
2305 .\" commit e07a4b9217d1e97d2f3a62b6b070efdc61212110
2306 .BR KPF_WRITEBACK ,
2307 .BR KPF_RECLAIM ,
2308 .BR KPF_BUDDY ,
2309 and
2310 .BR KPF_LOCKED
2311 did not report correctly.
2312 .IP
2313 The
2314 .IR /proc/kpageflags
2315 file is present only if the
2316 .B CONFIG_PROC_PAGE_MONITOR
2317 kernel configuration option is enabled.
2318 .TP
2319 .IR /proc/ksyms " (Linux 1.1.23-2.5.47)"
2320 See
2321 .IR /proc/kallsyms .
2322 .TP
2323 .I /proc/loadavg
2324 The first three fields in this file are load average figures
2325 giving the number of jobs in the run queue (state R)
2326 or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes.
2327 They are the same as the load average numbers given by
2328 .BR uptime (1)
2329 and other programs.
2330 The fourth field consists of two numbers separated by a slash (/).
2331 The first of these is the number of currently runnable kernel
2332 scheduling entities (processes, threads).
2333 The value after the slash is the number of kernel scheduling entities
2334 that currently exist on the system.
2335 The fifth field is the PID of the process that was most
2336 recently created on the system.
2337 .TP
2338 .I /proc/locks
2339 This file shows current file locks
2340 .RB ( flock "(2) and " fcntl (2))
2341 and leases
2342 .RB ( fcntl (2)).
2343 .TP
2344 .IR /proc/malloc " (only up to and including Linux 2.2)"
2345 .\" It looks like this only ever did something back in 1.0 days
2346 This file is present only if
2347 .B CONFIG_DEBUG_MALLOC
2348 was defined during compilation.
2349 .TP
2350 .I /proc/meminfo
2351 This file reports statistics about memory usage on the system.
2352 It is used by
2353 .BR free (1)
2354 to report the amount of free and used memory (both physical and swap)
2355 on the system as well as the shared memory and buffers used by the
2356 kernel.
2357 Each line of the file consists of a parameter name, followed by a colon,
2358 the value of the parameter, and an option unit of measurement (e.g., "kB").
2359 The list below describes the parameter names and
2360 the format specifier required to read the field value.
2361 Except as noted below,
2362 all of the fields have been present since at least Linux 2.6.0.
2363 Some fields are displayed only if the kernel was configured
2364 with various options; those dependencies are noted in the list.
2365 .RS
2366 .TP
2367 .IR MemTotal " %lu"
2368 Total usable RAM (i.e., physical RAM minus a few reserved
2369 bits and the kernel binary code).
2370 .TP
2371 .IR MemFree " %lu"
2372 The sum of
2373 .IR LowFree + HighFree .
2374 .TP
2375 .IR Buffers " %lu"
2376 Relatively temporary storage for raw disk blocks that
2377 shouldn't get tremendously large (20MB or so).
2378 .TP
2379 .IR Cached " %lu"
2380 In-memory cache for files read from the disk (the page cache).
2381 Doesn't include
2382 .IR SwapCached .
2383 .TP
2384 .IR SwapCached " %lu"
2385 Memory that once was swapped out, is swapped back in but
2386 still also is in the swap file.
2387 (If memory pressure is high, these pages
2388 don't need to be swapped out again because they are already
2389 in the swap file.
2390 This saves I/O.)
2391 .TP
2392 .IR Active " %lu"
2393 Memory that has been used more recently and usually not
2394 reclaimed unless absolutely necessary.
2395 .TP
2396 .IR Inactive " %lu"
2397 Memory which has been less recently used.
2398 It is more eligible to be reclaimed for other purposes.
2399 .TP
2400 .IR Active(anon) " %lu (since Linux 2.6.28)"
2401 [To be documented.]
2402 .TP
2403 .IR Inactive(anon) " %lu (since Linux 2.6.28)"
2404 [To be documented.]
2405 .TP
2406 .IR Active(file) " %lu (since Linux 2.6.28)"
2407 [To be documented.]
2408 .TP
2409 .IR Inactive(file) " %lu (since Linux 2.6.28)"
2410 [To be documented.]
2411 .TP
2412 .IR Unevictable " %lu (since Linux 2.6.28)"
2413 (From Linux 2.6.28 to 2.6.30,
2414 \fBCONFIG_UNEVICTABLE_LRU\fP was required.)
2415 [To be documented.]
2416 .TP
2417 .IR Mlocked " %lu (since Linux 2.6.28)"
2418 (From Linux 2.6.28 to 2.6.30,
2419 \fBCONFIG_UNEVICTABLE_LRU\fP was required.)
2420 [To be documented.]
2421 .TP
2422 .IR HighTotal " %lu"
2423 (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
2424 Total amount of highmem.
2425 Highmem is all memory above ~860MB of physical memory.
2426 Highmem areas are for use by user-space programs,
2427 or for the page cache.
2428 The kernel must use tricks to access
2429 this memory, making it slower to access than lowmem.
2430 .TP
2431 .IR HighFree " %lu
2432 (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
2433 Amount of free highmem.
2434 .TP
2435 .IR LowTotal " %lu
2436 (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
2437 Total amount of lowmem.
2438 Lowmem is memory which can be used for everything that
2439 highmem can be used for, but it is also available for the
2440 kernel's use for its own data structures.
2441 Among many other things,
2442 it is where everything from
2443 .I Slab
2444 is allocated.
2445 Bad things happen when you're out of lowmem.
2446 .TP
2447 .IR LowFree " %lu
2448 (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
2449 Amount of free lowmem.
2450 .TP
2451 .IR MmapCopy " %lu (since Linux 2.6.29)"
2452 .RB ( CONFIG_MMU
2453 is required.)
2454 [To be documented.]
2455 .TP
2456 .IR SwapTotal " %lu"
2457 Total amount of swap space available.
2458 .TP
2459 .IR SwapFree " %lu"
2460 Amount of swap space that is currently unused.
2461 .TP
2462 .IR Dirty " %lu"
2463 Memory which is waiting to get written back to the disk.
2464 .TP
2465 .IR Writeback " %lu"
2466 Memory which is actively being written back to the disk.
2467 .TP
2468 .IR AnonPages " %lu (since Linux 2.6.18)"
2469 Non-file backed pages mapped into user-space page tables.
2470 .TP
2471 .IR Mapped " %lu"
2472 Files which have been mapped into memory (with
2473 .BR mmap (2)),
2474 such as libraries.
2475 .TP
2476 .IR Shmem " %lu (since Linux 2.6.32)"
2477 [To be documented.]
2478 .TP
2479 .IR Slab " %lu"
2480 In-kernel data structures cache.
2481 .TP
2482 .IR SReclaimable " %lu (since Linux 2.6.19)"
2483 Part of
2484 .IR Slab ,
2485 that might be reclaimed, such as caches.
2486 .TP
2487 .IR SUnreclaim " %lu (since Linux 2.6.19)"
2488 Part of
2489 .IR Slab ,
2490 that cannot be reclaimed on memory pressure.
2491 .TP
2492 .IR KernelStack " %lu (since Linux 2.6.32)"
2493 Amount of memory allocated to kernel stacks.
2494 .TP
2495 .IR PageTables " %lu (since Linux 2.6.18)"
2496 Amount of memory dedicated to the lowest level of page tables.
2497 .TP
2498 .IR Quicklists " %lu (since Linux 2.6.27)"
2499 (\fBCONFIG_QUICKLIST\fP is required.)
2500 [To be documented.]
2501 .TP
2502 .IR NFS_Unstable " %lu (since Linux 2.6.18)"
2503 NFS pages sent to the server, but not yet committed to stable storage.
2504 .TP
2505 .IR Bounce " %lu (since Linux 2.6.18)"
2506 Memory used for block device "bounce buffers".
2507 .TP
2508 .IR WritebackTmp " %lu (since Linux 2.6.26)"
2509 Memory used by FUSE for temporary writeback buffers.
2510 .TP
2511 .IR CommitLimit " %lu (since Linux 2.6.10)"
2512 This is the total amount of memory currently available to
2513 be allocated on the system, expressed in kilobytes.
2514 This limit is adhered to
2515 only if strict overcommit accounting is enabled (mode 2 in
2516 .IR /proc/sys/vm/overcommit_memory ).
2517 The limit is calculated according to the formula described under
2518 .IR /proc/sys/vm/overcommit_memory .
2519 For further details, see the kernel source file
2520 .IR Documentation/vm/overcommit-accounting .
2521 .TP
2522 .IR Committed_AS " %lu"
2523 The amount of memory presently allocated on the system.
2524 The committed memory is a sum of all of the memory which
2525 has been allocated by processes, even if it has not been
2526 "used" by them as of yet.
2527 A process which allocates 1GB of memory (using
2528 .BR malloc (3)
2529 or similar), but touches only 300MB of that memory will show up
2530 as using only 300MB of memory even if it has the address space
2531 allocated for the entire 1GB.
2532
2533 This 1GB is memory which has been "committed" to by the VM
2534 and can be used at any time by the allocating application.
2535 With strict overcommit enabled on the system (mode 2 in
2536 IR /proc/sys/vm/overcommit_memory ),
2537 allocations which would exceed the
2538 .I CommitLimit
2539 will not be permitted.
2540 This is useful if one needs to guarantee that processes will not
2541 fail due to lack of memory once that memory has been successfully allocated.
2542 .TP
2543 .IR VmallocTotal " %lu"
2544 Total size of vmalloc memory area.
2545 .TP
2546 .IR VmallocUsed " %lu"
2547 Amount of vmalloc area which is used.
2548 .TP
2549 .IR VmallocChunk " %lu"
2550 Largest contiguous block of vmalloc area which is free.
2551 .TP
2552 .IR HardwareCorrupted " %lu (since Linux 2.6.32)"
2553 (\fBCONFIG_MEMORY_FAILURE\fP is required.)
2554 [To be documented.]
2555 .TP
2556 .IR AnonHugePages " %lu (since Linux 2.6.38)"
2557 (\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.)
2558 Non-file backed huge pages mapped into user-space page tables.
2559 .TP
2560 .IR HugePages_Total " %lu"
2561 (\fBCONFIG_HUGETLB_PAGE\fP is required.)
2562 The size of the pool of huge pages.
2563 .TP
2564 .IR HugePages_Free " %lu"
2565 (\fBCONFIG_HUGETLB_PAGE\fP is required.)
2566 The number of huge pages in the pool that are not yet allocated.
2567 .TP
2568 .IR HugePages_Rsvd " %lu (since Linux 2.6.17)"
2569 (\fBCONFIG_HUGETLB_PAGE\fP is required.)
2570 This is the number of huge pages for
2571 which a commitment to allocate from the pool has been made,
2572 but no allocation has yet been made.
2573 These reserved huge pages
2574 guarantee that an application will be able to allocate a
2575 huge page from the pool of huge pages at fault time.
2576 .TP
2577 .IR HugePages_Surp " %lu (since Linux 2.6.24)"
2578 (\fBCONFIG_HUGETLB_PAGE\fP is required.)
2579 This is the number of huge pages in
2580 the pool above the value in
2581 .IR /proc/sys/vm/nr_hugepages .
2582 The maximum number of surplus huge pages is controlled by
2583 .IR /proc/sys/vm/nr_overcommit_hugepages .
2584 .TP
2585 .IR Hugepagesize " %lu"
2586 (\fBCONFIG_HUGETLB_PAGE\fP is required.)
2587 The size of huge pages.
2588 .RE
2589 .TP
2590 .I /proc/modules
2591 A text list of the modules that have been loaded by the system.
2592 See also
2593 .BR lsmod (8).
2594 .TP
2595 .I /proc/mounts
2596 Before kernel 2.4.19, this file was a list
2597 of all the filesystems currently mounted on the system.
2598 With the introduction of per-process mount namespaces in
2599 Linux 2.4.19, this file became a link to
2600 .IR /proc/self/mounts ,
2601 which lists the mount points of the process's own mount namespace.
2602 The format of this file is documented in
2603 .BR fstab (5).
2604 .TP
2605 .I /proc/mtrr
2606 Memory Type Range Registers.
2607 See the Linux kernel source file
2608 .I Documentation/mtrr.txt
2609 for details.
2610 .TP
2611 .I /proc/net
2612 various net pseudo-files, all of which give the status of some part of
2613 the networking layer.
2614 These files contain ASCII structures and are,
2615 therefore, readable with
2616 .BR cat (1).
2617 However, the standard
2618 .BR netstat (8)
2619 suite provides much cleaner access to these files.
2620 .TP
2621 .I /proc/net/arp
2622 This holds an ASCII readable dump of the kernel ARP table used for
2623 address resolutions.
2624 It will show both dynamically learned and preprogrammed ARP entries.
2625 The format is:
2626
2627 .nf
2628 .ft CW
2629 .in 8n
2630 IP address     HW type   Flags     HW address          Mask   Device
2631 192.168.0.50   0x1       0x2       00:50:BF:25:68:F3   *      eth0
2632 192.168.0.250  0x1       0xc       00:00:00:00:00:00   *      eth0
2633 .ft
2634 .fi
2635 .in
2636
2637 Here "IP address" is the IPv4 address of the machine and the "HW type"
2638 is the hardware type of the address from RFC\ 826.
2639 The flags are the internal
2640 flags of the ARP structure (as defined in
2641 .IR /usr/include/linux/if_arp.h )
2642 and
2643 the "HW address" is the data link layer mapping for that IP address if
2644 it is known.
2645 .TP
2646 .I /proc/net/dev
2647 The dev pseudo-file contains network device status information.
2648 This gives
2649 the number of received and sent packets, the number of errors and
2650 collisions
2651 and other basic statistics.
2652 These are used by the
2653 .BR ifconfig (8)
2654 program to report device status.
2655 The format is:
2656
2657 .nf
2658 .ft CW
2659 .in 1n
2660 Inter-|   Receive                                                |  Transmit
2661  face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
2662     lo: 2776770   11307    0    0    0     0          0         0  2776770   11307    0    0    0     0       0          0
2663   eth0: 1215645    2751    0    0    0     0          0         0  1782404    4324    0    0    0   427       0          0
2664   ppp0: 1622270    5552    1    0    0     0          0         0   354130    5669    0    0    0     0       0          0
2665   tap0:    7714      81    0    0    0     0          0         0     7714      81    0    0    0     0       0          0
2666 .in
2667 .ft
2668 .fi
2669 .\" .TP
2670 .\" .I /proc/net/ipx
2671 .\" No information.
2672 .\" .TP
2673 .\" .I /proc/net/ipx_route
2674 .\" No information.
2675 .TP
2676 .I /proc/net/dev_mcast
2677 Defined in
2678 .IR /usr/src/linux/net/core/dev_mcast.c :
2679 .nf
2680 .in +5
2681 indx interface_name  dmi_u dmi_g dmi_address
2682 2    eth0            1     0     01005e000001
2683 3    eth1            1     0     01005e000001
2684 4    eth2            1     0     01005e000001
2685 .in
2686 .fi
2687 .TP
2688 .I /proc/net/igmp
2689 Internet Group Management Protocol.
2690 Defined in
2691 .IR /usr/src/linux/net/core/igmp.c .
2692 .TP
2693 .I /proc/net/rarp
2694 This file uses the same format as the
2695 .I arp
2696 file and contains the current reverse mapping database used to provide
2697 .BR rarp (8)
2698 reverse address lookup services.
2699 If RARP is not configured into the
2700 kernel,
2701 this file will not be present.
2702 .TP
2703 .I /proc/net/raw
2704 Holds a dump of the RAW socket table.
2705 Much of the information is not of
2706 use
2707 apart from debugging.
2708 The "sl" value is the kernel hash slot for the
2709 socket,
2710 the "local_address" is the local address and protocol number pair.
2711 \&"St" is
2712 the internal status of the socket.
2713 The "tx_queue" and "rx_queue" are the
2714 outgoing and incoming data queue in terms of kernel memory usage.
2715 The "tr", "tm\->when", and "rexmits" fields are not used by RAW.
2716 The "uid"
2717 field holds the effective UID of the creator of the socket.
2718 .\" .TP
2719 .\" .I /proc/net/route
2720 .\" No information, but looks similar to
2721 .\" .BR route (8).
2722 .TP
2723 .I /proc/net/snmp
2724 This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP
2725 management
2726 information bases for an SNMP agent.
2727 .TP
2728 .I /proc/net/tcp
2729 Holds a dump of the TCP socket table.
2730 Much of the information is not
2731 of use apart from debugging.
2732 The "sl" value is the kernel hash slot
2733 for the socket, the "local_address" is the local address and port number pair.
2734 The "rem_address" is the remote address and port number pair
2735 (if connected).
2736 \&"St" is the internal status of the socket.
2737 The "tx_queue" and "rx_queue" are the
2738 outgoing and incoming data queue in terms of kernel memory usage.
2739 The "tr", "tm\->when", and "rexmits" fields hold internal information of
2740 the kernel socket state and are useful only for debugging.
2741 The "uid"
2742 field holds the effective UID of the creator of the socket.
2743 .TP
2744 .I /proc/net/udp
2745 Holds a dump of the UDP socket table.
2746 Much of the information is not of
2747 use apart from debugging.
2748 The "sl" value is the kernel hash slot for the
2749 socket, the "local_address" is the local address and port number pair.
2750 The "rem_address" is the remote address and port number pair
2751 (if connected). "St" is the internal status of the socket.
2752 The "tx_queue" and "rx_queue" are the outgoing and incoming data queue
2753 in terms of kernel memory usage.
2754 The "tr", "tm\->when", and "rexmits" fields
2755 are not used by UDP.
2756 The "uid"
2757 field holds the effective UID of the creator of the socket.
2758 The format is:
2759
2760 .nf
2761 .ft CW
2762 .in 1n
2763 sl  local_address rem_address   st tx_queue rx_queue tr rexmits  tm\->when uid
2764  1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0
2765  1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0
2766  1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0
2767 .in
2768 .ft
2769 .fi
2770 .TP
2771 .I /proc/net/unix
2772 Lists the UNIX domain sockets present within the system and their
2773 status.
2774 The format is:
2775 .nf
2776 .sp .5
2777 .ft CW
2778 Num RefCount Protocol Flags    Type St Path
2779  0: 00000002 00000000 00000000 0001 03
2780  1: 00000001 00000000 00010000 0001 01 /dev/printer
2781 .ft
2782 .sp .5
2783 .fi
2784
2785 Here "Num" is the kernel table slot number, "RefCount" is the number
2786 of users of the socket, "Protocol" is currently always 0, "Flags"
2787 represent the internal kernel flags holding the status of the
2788 socket.
2789 Currently, type is always "1" (UNIX domain datagram sockets are
2790 not yet supported in the kernel).
2791 \&"St" is the internal state of the
2792 socket and Path is the bound path (if any) of the socket.
2793 .TP
2794 .I /proc/net/netfilter/nfnetlink_queue
2795 This file contains information about netfilter userspace queueing, if used.
2796 Each line represents a queue.  Queues that have not been subscribed to
2797 by userspace are not shown.
2798 .nf
2799
2800    1   4207     0  2 65535     0     0        0  1
2801   (1)   (2)    (3)(4)  (5)    (6)   (7)      (8)
2802 .fi
2803 .IP
2804 The fields in each line are:
2805 .RS 7
2806 .TP 5
2807 (1)
2808 The ID of the queue.  This matches what is specified in the
2809 .B \-\-queue\-num
2810 or
2811 .B \-\-queue\-balance
2812 options to the
2813 .BR iptables (8)
2814 NFQUEUE target.  See
2815 .BR iptables-extensions (8)
2816 for more information.
2817 .TP
2818 (2)
2819 The netlink port id subscribed to the queue.
2820 .TP
2821 (3)
2822 The number of packets currently queued and waiting to be processed by
2823 the application.
2824 .TP
2825 (4)
2826 The copy mode of the queue. It is either 1 (metadata only) or 2
2827 (also copy payload data to userspace).
2828 .TP
2829 (5)
2830 Copy range, i.e. how many bytes of packet payload should be copied to
2831 userspace at most.
2832 .TP
2833 (6)
2834 queue dropped.  Number of packets that had to be dropped by the kernel because
2835 too many packets are already waiting for userspace to send back the mandatory
2836 accept/drop verdicts.
2837 .TP
2838 (7)
2839 queue user dropped.  Number of packets that were dropped within the netlink
2840 subsystem.  Such drops usually happen when the corresponding socket buffer is
2841 full, i.e.  userspace is not able to read messages fast enough.
2842 .TP
2843 (8)
2844 sequence number. Every queued packet is associated with a (32-bit)
2845 monotonically-increasing sequence number.
2846 This shows the ID of the most recent packet queued.
2847 .RE
2848 .IP
2849 The last number exists only for compatibility reasons and is always 1.
2850 .TP
2851 .I /proc/partitions
2852 Contains the major and minor numbers of each partition as well as the number
2853 of 1024-byte blocks and the partition name.
2854 .TP
2855 .I /proc/pci
2856 This is a listing of all PCI devices found during kernel initialization
2857 and their configuration.
2858
2859 This file has been deprecated in favor of a new
2860 .I /proc
2861 interface for PCI
2862 .RI ( /proc/bus/pci ).
2863 It became optional in Linux 2.2 (available with
2864 .B CONFIG_PCI_OLD_PROC
2865 set at kernel compilation).
2866 It became once more nonoptionally enabled in Linux 2.4.
2867 Next, it was deprecated in Linux 2.6 (still available with
2868 .B CONFIG_PCI_LEGACY_PROC
2869 set), and finally removed altogether since Linux 2.6.17.
2870 .\" FIXME Document /proc/sched_debug
2871 .\"
2872 .\" .TP
2873 .\" .IR /proc/sched_debug " (since Linux 2.6.23)"
2874 .\" See also /proc/[pid]/sched
2875 .TP
2876 .IR /proc/profile " (since Linux 2.4)"
2877 This file is present only if the kernel was booted with the
2878 .I profile=1
2879 command-line option.
2880 It exposes kernel profiling information in a binary format for use by
2881 .BR readprofile (1).
2882 Writing (e.g., an empty string) to this file resets the profiling counters;
2883 on some architectures,
2884 writing a binary integer "profiling multiplier" of size
2885 .IR sizeof(int)
2886 sets the profiling interrupt frequency.
2887 .TP
2888 .I /proc/scsi
2889 A directory with the
2890 .I scsi
2891 mid-level pseudo-file and various SCSI low-level
2892 driver directories,
2893 which contain a file for each SCSI host in this system, all of
2894 which give the status of some part of the SCSI IO subsystem.
2895 These files contain ASCII structures and are, therefore, readable with
2896 .BR cat (1).
2897
2898 You can also write to some of the files to reconfigure the subsystem or
2899 switch certain features on or off.
2900 .TP
2901 .I /proc/scsi/scsi
2902 This is a listing of all SCSI devices known to the kernel.
2903 The listing is similar to the one seen during bootup.
2904 scsi currently supports only the \fIadd-single-device\fP command which
2905 allows root to add a hotplugged device to the list of known devices.
2906
2907 The command
2908 .in +4n
2909 .nf
2910
2911 echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi
2912
2913 .fi
2914 .in
2915 will cause
2916 host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0.
2917 If there
2918 is already a device known on this address or the address is invalid, an
2919 error will be returned.
2920 .TP
2921 .I /proc/scsi/[drivername]
2922 \fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740,
2923 aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic,
2924 scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000.
2925 These directories show up for all drivers that registered at least one
2926 SCSI HBA.
2927 Every directory contains one file per registered host.
2928 Every host-file is named after the number the host was assigned during
2929 initialization.
2930
2931 Reading these files will usually show driver and host configuration,
2932 statistics, and so on.
2933
2934 Writing to these files allows different things on different hosts.
2935 For example, with the \fIlatency\fP and \fInolatency\fP commands,
2936 root can switch on and off command latency measurement code in the
2937 eata_dma driver.
2938 With the \fIlockup\fP and \fIunlock\fP commands,
2939 root can control bus lockups simulated by the scsi_debug driver.
2940 .TP
2941 .I /proc/self
2942 This directory refers to the process accessing the
2943 .I /proc
2944 filesystem,
2945 and is identical to the
2946 .I /proc
2947 directory named by the process ID of the same process.
2948 .TP
2949 .I /proc/slabinfo
2950 Information about kernel caches.
2951 Since Linux 2.6.16 this file is present only if the
2952 .B CONFIG_SLAB
2953 kernel configuration option is enabled.
2954 The columns in
2955 .I /proc/slabinfo
2956 are:
2957 .in +4n
2958 .nf
2959
2960 cache-name
2961 num-active-objs
2962 total-objs
2963 object-size
2964 num-active-slabs
2965 total-slabs
2966 num-pages-per-slab
2967 .fi
2968 .in
2969
2970 See
2971 .BR slabinfo (5)
2972 for details.
2973 .TP
2974 .I /proc/stat
2975 kernel/system statistics.
2976 Varies with architecture.
2977 Common
2978 entries include:
2979 .RS
2980 .TP
2981 \fIcpu  3357 0 4313 1362393\fP
2982 The amount of time, measured in units of
2983 USER_HZ (1/100ths of a second on most architectures, use
2984 .IR sysconf(_SC_CLK_TCK)
2985 to obtain the right value),
2986 .\" 1024 on Alpha and ia64
2987 that the system spent in various states:
2988 .RS
2989 .TP
2990 .I user
2991 (1) Time spent in user mode.
2992 .TP
2993 .I nice
2994 (2) Time spent in user mode with low priority (nice).
2995 .TP
2996 .I system
2997 (3) Time spent in system mode.
2998 .TP
2999 .I idle
3000 (4) Time spent in the idle task.
3001 .\" FIXME . Actually, the following info about the /proc/stat 'cpu' field
3002 .\"       does not seem to be quite right (at least in 2.6.12 or 3.6):
3003 .\"       the idle time in /proc/uptime does not quite match this value
3004 This value should be USER_HZ times the
3005 second entry in the
3006 .I /proc/uptime
3007 pseudo-file.
3008 .TP
3009 .IR iowait " (since Linux 2.5.41)"
3010 (5) Time waiting for I/O to complete.
3011 .TP
3012 .IR irq " (since Linux 2.6.0-test4)"
3013 (6) Time servicing interrupts.
3014 .TP
3015 .IR softirq " (since Linux 2.6.0-test4)"
3016 (7) Time servicing softirqs.
3017 .TP
3018 .IR steal " (since Linux 2.6.11)"
3019 (8) Stolen time, which is the time spent in other operating systems when
3020 running in a virtualized environment
3021 .TP
3022 .IR guest " (since Linux 2.6.24)"
3023 (9) Time spent running a virtual CPU for guest
3024 operating systems under the control of the Linux kernel.
3025 .\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de
3026 .TP
3027 .IR guest_nice " (since Linux 2.6.33)"
3028 .\" commit ce0e7b28fb75cb003cfc8d0238613aaf1c55e797
3029 (10) Time spent running a niced guest (virtual CPU for guest
3030 operating systems under the control of the Linux kernel).
3031 .RE
3032 .TP
3033 \fIpage 5741 1808\fP
3034 The number of pages the system paged in and the number that were paged
3035 out (from disk).
3036 .TP
3037 \fIswap 1 0\fP
3038 The number of swap pages that have been brought in and out.
3039 .TP
3040 .\" FIXME . The following is not the full picture for the 'intr' of
3041 .\"       /proc/stat on 2.6:
3042 \fIintr 1462898\fP
3043 This line shows counts of interrupts serviced since boot time,
3044 for each of the possible system interrupts.
3045 The first column is the total of all interrupts serviced
3046 including unnumbered architecture specific interrupts;
3047 each subsequent column is the total for that particular numbered interrupt.
3048 Unnumbered interrupts are not shown, only summed into the total.
3049 .TP
3050 \fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP...
3051 (major,disk_idx):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written)
3052 .br
3053 (Linux 2.4 only)
3054 .TP
3055 \fIctxt 115315\fP
3056 The number of context switches that the system underwent.
3057 .TP
3058 \fIbtime 769041601\fP
3059 boot time, in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
3060 .TP
3061 \fIprocesses 86031\fP
3062 Number of forks since boot.
3063 .TP
3064 \fIprocs_running 6\fP
3065 Number of processes in runnable state.
3066 (Linux 2.5.45 onward.)
3067 .TP
3068 \fIprocs_blocked 2\fP
3069 Number of processes blocked waiting for I/O to complete.
3070 (Linux 2.5.45 onward.)
3071 .RE
3072 .TP
3073 .I /proc/swaps
3074 Swap areas in use.
3075 See also
3076 .BR swapon (8).
3077 .TP
3078 .I /proc/sys
3079 This directory (present since 1.3.57) contains a number of files
3080 and subdirectories corresponding to kernel variables.
3081 These variables can be read and sometimes modified using
3082 the \fI/proc\fP filesystem, and the (deprecated)
3083 .BR sysctl (2)
3084 system call.
3085 .TP
3086 .IR /proc/sys/abi " (since Linux 2.4.10)"
3087 This directory may contain files with application binary information.
3088 .\" On some systems, it is not present.
3089 See the Linux kernel source file
3090 .I Documentation/sysctl/abi.txt
3091 for more information.
3092 .TP
3093 .I /proc/sys/debug
3094 This directory may be empty.
3095 .TP
3096 .I /proc/sys/dev
3097 This directory contains device-specific information (e.g.,
3098 .IR dev/cdrom/info ).
3099 On
3100 some systems, it may be empty.
3101 .TP
3102 .I /proc/sys/fs
3103 This directory contains the files and subdirectories for kernel variables
3104 related to filesystems.
3105 .TP
3106 .I /proc/sys/fs/binfmt_misc
3107 Documentation for files in this directory can be found
3108 in the Linux kernel sources in
3109 .IR Documentation/binfmt_misc.txt .
3110 .TP
3111 .IR /proc/sys/fs/dentry-state " (since Linux 2.2)"
3112 This file contains information about the status of the
3113 directory cache (dcache).
3114 The file contains six numbers,
3115 .IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), "
3116 .I want_pages
3117 (pages requested by system) and two dummy values.
3118 .RS
3119 .IP * 2
3120 .I nr_dentry
3121 is the number of allocated dentries (dcache entries).
3122 This field is unused in Linux 2.2.
3123 .IP *
3124 .I nr_unused
3125 is the number of unused dentries.
3126 .IP *
3127 .I age_limit
3128 .\" looks like this is unused in kernels 2.2 to 2.6
3129 is the age in seconds after which dcache entries
3130 can be reclaimed when memory is short.
3131 .IP *
3132 .I want_pages
3133 .\" looks like this is unused in kernels 2.2 to 2.6
3134 is nonzero when the kernel has called shrink_dcache_pages() and the
3135 dcache isn't pruned yet.
3136 .RE
3137 .TP
3138 .I /proc/sys/fs/dir-notify-enable
3139 This file can be used to disable or enable the
3140 .I dnotify
3141 interface described in
3142 .BR fcntl (2)
3143 on a system-wide basis.
3144 A value of 0 in this file disables the interface,
3145 and a value of 1 enables it.
3146 .TP
3147 .I /proc/sys/fs/dquot-max
3148 This file shows the maximum number of cached disk quota entries.
3149 On some (2.4) systems, it is not present.
3150 If the number of free cached disk quota entries is very low and
3151 you have some awesome number of simultaneous system users,
3152 you might want to raise the limit.
3153 .TP
3154 .I /proc/sys/fs/dquot-nr
3155 This file shows the number of allocated disk quota
3156 entries and the number of free disk quota entries.
3157 .TP
3158 .IR /proc/sys/fs/epoll " (since Linux 2.6.28)"
3159 This directory contains the file
3160 .IR max_user_watches ,
3161 which can be used to limit the amount of kernel memory consumed by the
3162 .I epoll
3163 interface.
3164 For further details, see
3165 .BR epoll (7).
3166 .TP
3167 .I /proc/sys/fs/file-max
3168 This file defines
3169 a system-wide limit on the number of open files for all processes.
3170 (See also
3171 .BR setrlimit (2),
3172 which can be used by a process to set the per-process limit,
3173 .BR RLIMIT_NOFILE ,
3174 on the number of files it may open.)
3175 If you get lots
3176 of error messages in the kernel log about running out of file handles
3177 (look for "VFS: file-max limit <number> reached"),
3178 try increasing this value:
3179 .br
3180
3181 .br
3182 .nf
3183 .ft CW
3184     echo 100000 > /proc/sys/fs/file-max
3185 .fi
3186 .ft
3187
3188 Privileged processes
3189 .RB ( CAP_SYS_ADMIN )
3190 can override the
3191 .I file-max
3192 limit.
3193 .TP
3194 .I /proc/sys/fs/file-nr
3195 This (read-only) file contains three numbers:
3196 the number of allocated file handles
3197 (i.e., the number of files presently opened);
3198 the number of free file handles;
3199 and the maximum number of file handles (i.e., the same value as
3200 .IR /proc/sys/fs/file-max ).
3201 If the number of allocated file handles is close to the
3202 maximum, you should consider increasing the maximum.
3203 Before Linux 2.6,
3204 the kernel allocated file handles dynamically,
3205 but it didn't free them again.
3206 Instead the free file handles were kept in a list for reallocation;
3207 the "free file handles" value indicates the size of that list.
3208 A large number of free file handles indicates that there was
3209 a past peak in the usage of open file handles.
3210 Since Linux 2.6, the kernel does deallocate freed file handles,
3211 and the "free file handles" value is always zero.
3212 .TP
3213 .IR /proc/sys/fs/inode-max " (only present until Linux 2.2)"
3214 This file contains the maximum number of in-memory inodes.
3215 This value should be 3-4 times larger
3216 than the value in
3217 .IR file-max ,
3218 since \fIstdin\fP, \fIstdout\fP
3219 and network sockets also need an inode to handle them.
3220 When you regularly run out of inodes, you need to increase this value.
3221
3222 Starting with Linux 2.4,
3223 there is no longer a static limit on the number of inodes,
3224 and this file is removed.
3225 .TP
3226 .I /proc/sys/fs/inode-nr
3227 This file contains the first two values from
3228 .IR inode-state .
3229 .TP
3230 .I /proc/sys/fs/inode-state
3231 This file
3232 contains seven numbers:
3233 .IR nr_inodes ,
3234 .IR nr_free_inodes ,
3235 .IR preshrink ,
3236 and four dummy values (always zero).
3237
3238 .I nr_inodes
3239 is the number of inodes the system has allocated.
3240 .\" This can be slightly more than
3241 .\" .I inode-max
3242 .\" because Linux allocates them one page full at a time.
3243 .I nr_free_inodes
3244 represents the number of free inodes.
3245
3246 .I preshrink
3247 is nonzero when the
3248 .I nr_inodes
3249 >
3250 .I inode-max
3251 and the system needs to prune the inode list instead of allocating more;
3252 since Linux 2.4, this field is a dummy value (always zero).
3253 .TP
3254 .IR /proc/sys/fs/inotify " (since Linux 2.6.13)"
3255 This directory contains files
3256 .IR max_queued_events ", " max_user_instances ", and " max_user_watches ,
3257 that can be used to limit the amount of kernel memory consumed by the
3258 .I inotify
3259 interface.
3260 For further details, see
3261 .BR inotify (7).
3262 .TP
3263 .I /proc/sys/fs/lease-break-time
3264 This file specifies the grace period that the kernel grants to a process
3265 holding a file lease
3266 .RB ( fcntl (2))
3267 after it has sent a signal to that process notifying it
3268 that another process is waiting to open the file.
3269 If the lease holder does not remove or downgrade the lease within
3270 this grace period, the kernel forcibly breaks the lease.
3271 .TP
3272 .I /proc/sys/fs/leases-enable
3273 This file can be used to enable or disable file leases
3274 .RB ( fcntl (2))
3275 on a system-wide basis.
3276 If this file contains the value 0, leases are disabled.
3277 A nonzero value enables leases.
3278 .TP
3279 .IR /proc/sys/fs/mqueue " (since Linux 2.6.6)"
3280 This directory contains files
3281 .IR msg_max ", " msgsize_max ", and " queues_max ,
3282 controlling the resources used by POSIX message queues.
3283 See
3284 .BR mq_overview (7)
3285 for details.
3286 .TP
3287 .IR /proc/sys/fs/nr_open " (since Linux 2.6.25)
3288 .\" commit 9cfe015aa424b3c003baba3841a60dd9b5ad319b
3289 This file imposes ceiling on the value to which the
3290 .BR RLIMIT_NOFILE
3291 resource limit can be raised (see
3292 .BR getrlimit (2)).
3293 This ceiling is enforced for both unprivileged and privileged process.
3294 The default value in this file is 1048576.
3295 (Before Linux 2.6.25, the ceiling for
3296 .BR RLIMIT_NOFILE
3297 was hard-coded to the same value.)
3298 .TP
3299 .IR /proc/sys/fs/overflowgid " and " /proc/sys/fs/overflowuid
3300 These files
3301 allow you to change the value of the fixed UID and GID.
3302 The default is 65534.
3303 Some filesystems support only 16-bit UIDs and GIDs, although in Linux
3304 UIDs and GIDs are 32 bits.
3305 When one of these filesystems is mounted
3306 with writes enabled, any UID or GID that would exceed 65535 is translated
3307 to the overflow value before being written to disk.
3308 .TP
3309 .IR /proc/sys/fs/pipe-max-size " (since Linux 2.6.35)"
3310 The value in this file defines an upper limit for raising the capacity
3311 of a pipe using the
3312 .BR fcntl (2)
3313 .B F_SETPIPE_SZ
3314 operation.
3315 This limit applies only to unprivileged processes.
3316 The default value for this file is 1,048,576.
3317 The value assigned to this file may be rounded upward,
3318 to reflect the value actually employed for a convenient implementation.
3319 To determine the rounded-up value,
3320 display the contents of this file after assigning a value to it.
3321 The minimum value that can be assigned to this file is the system page size.
3322 .TP
3323 .IR /proc/sys/fs/protected_hardlinks " (since Linux 3.6)"
3324 .\" commit 800179c9b8a1e796e441674776d11cd4c05d61d7
3325 When the value in this file is 0,
3326 no restrictions are placed on the creation of hard links
3327 (i.e., this is the historical behavior before Linux 3.6).
3328 When the value in this file is 1,
3329 a hard link can be created to a target file
3330 only if one of the following conditions is true:
3331 .RS
3332 .IP * 3
3333 The caller has the
3334 .BR CAP_FOWNER
3335 capability.
3336 .IP *
3337 The filesystem UID of the process creating the link matches
3338 the owner (UID) of the target file
3339 (as described in
3340 .BR credentials (7),
3341 a process's filesystem UID is normally the same as its effective UID).
3342 .IP *
3343 All of the following conditions are true:
3344 .RS 4
3345 .IP \(bu 3
3346 the target is a regular file;
3347 .IP \(bu
3348 the target file does not have its set-user-ID permission bit enabled;
3349 .IP \(bu
3350 the target file does not have both its set-group-ID and
3351 group-executable permission bits enabled; and
3352 .IP \(bu
3353 the caller has permission to read and write the target file
3354 (either via the file's permissions mask or because it has
3355 suitable capabilities).
3356 .RE
3357 .RE
3358 .IP
3359 The default value in this file is 0.
3360 Setting the value to 1
3361 prevents a longstanding class of security issues caused by
3362 hard-link-based time-of-check, time-of-use races,
3363 most commonly seen in world-writable directories such as
3364 .IR /tmp .
3365 The common method of exploiting this flaw
3366 is to cross privilege boundaries when following a given hard link
3367 (i.e., a root process follows a hard link created by another user).
3368 Additionally, on systems without separated partitions,
3369 this stops unauthorized users from "pinning" vulnerable set-user-ID and
3370 set-group-ID files against being upgraded by
3371 the administrator, or linking to special files.
3372 .TP
3373 .IR /proc/sys/fs/protected_symlinks " (since Linux 3.6)"
3374 .\" commit 800179c9b8a1e796e441674776d11cd4c05d61d7
3375 When the value in this file is 0,
3376 no restrictions are placed on following symbolic links
3377 (i.e., this is the historical behavior before Linux 3.6).
3378 When the value in this file is 1, symbolic links are followed only
3379 in the following circumstances:
3380 .RS
3381 .IP * 3
3382 the filesystem UID of the process following the link matches
3383 the owner (UID) of the symbolic link
3384 (as described in
3385 .BR credentials (7),
3386 a process's filesystem UID is normally the same as its effective UID);
3387 .IP *
3388 the link is not in a sticky world-writable directory; or
3389 .IP *
3390 the symbolic link and its parent directory have the same owner (UID)
3391 .RE
3392 .IP
3393 A system call that fails to follow a symbolic link
3394 because of the above restrictions returns the error
3395 .BR EACCES
3396 in
3397 .IR errno .
3398 .IP
3399 The default value in this file is 0.
3400 Setting the value to 1 avoids a longstanding class of security issues
3401 based on time-of-check, time-of-use races when accessing symbolic links.
3402 .TP
3403 .IR /proc/sys/fs/suid_dumpable " (since Linux 2.6.13)"
3404 .\" The following is based on text from Documentation/sysctl/kernel.txt
3405 The value in this file determines whether core dump files are
3406 produced for set-user-ID or otherwise protected/tainted binaries.
3407 Three different integer values can be specified:
3408 .RS
3409 .TP
3410 \fI0\ (default)\fP
3411 This provides the traditional (pre-Linux 2.6.13) behavior.
3412 A core dump will not be produced for a process which has
3413 changed credentials (by calling
3414 .BR seteuid (2),
3415 .BR setgid (2),
3416 or similar, or by executing a set-user-ID or set-group-ID program)
3417 or whose binary does not have read permission enabled.
3418 .TP
3419 \fI1\ ("debug")\fP
3420 All processes dump core when possible.
3421 The core dump is owned by the filesystem user ID of the dumping process
3422 and no security is applied.
3423 This is intended for system debugging situations only.
3424 Ptrace is unchecked.
3425 .TP
3426 \fI2\ ("suidsafe")\fP
3427 Any binary which normally would not be dumped (see "0" above)
3428 is dumped readable by root only.
3429 This allows the user to remove the core dump file but not to read it.
3430 For security reasons core dumps in this mode will not overwrite one
3431 another or other files.
3432 This mode is appropriate when administrators are
3433 attempting to debug problems in a normal environment.
3434 .IP
3435 Additionally, since Linux 3.6,
3436 .\" 9520628e8ceb69fa9a4aee6b57f22675d9e1b709
3437 .I /proc/sys/kernel/core_pattern
3438 must either be an absolute pathname
3439 or a pipe command, as detailed in
3440 .BR core (5).
3441 Warnings will be written to the kernel log if
3442 .I core_pattern
3443 does not follow these rules, and no core dump will be produced.
3444 .\" 54b501992dd2a839e94e76aa392c392b55080ce8
3445 .RE
3446 .TP
3447 .I /proc/sys/fs/super-max
3448 This file
3449 controls the maximum number of superblocks, and
3450 thus the maximum number of mounted filesystems the kernel
3451 can have.
3452 You need increase only
3453 .I super-max
3454 if you need to mount more filesystems than the current value in
3455 .I super-max
3456 allows you to.
3457 .TP
3458 .I /proc/sys/fs/super-nr
3459 This file
3460 contains the number of filesystems currently mounted.
3461 .TP
3462 .I /proc/sys/kernel
3463 This directory contains files controlling a range of kernel parameters,
3464 as described below.
3465 .TP
3466 .I /proc/sys/kernel/acct
3467 This file
3468 contains three numbers:
3469 .IR highwater ,
3470 .IR lowwater ,
3471 and
3472 .IR frequency .
3473 If BSD-style process accounting is enabled, these values control
3474 its behavior.
3475 If free space on filesystem where the log lives goes below
3476 .I lowwater
3477 percent, accounting suspends.
3478 If free space gets above
3479 .I highwater
3480 percent, accounting resumes.
3481 .I frequency
3482 determines
3483 how often the kernel checks the amount of free space (value is in
3484 seconds).
3485 Default values are 4, 2 and 30.
3486 That is, suspend accounting if 2% or less space is free; resume it
3487 if 4% or more space is free; consider information about amount of free space
3488 valid for 30 seconds.
3489 .TP
3490 .IR /proc/sys/kernel/cap_last_cap " (since Linux 3.2)"
3491 See
3492 .BR capabilities (7).
3493 .TP
3494 .IR /proc/sys/kernel/cap-bound " (from Linux 2.2 to 2.6.24)"
3495 This file holds the value of the kernel
3496 .I "capability bounding set"
3497 (expressed as a signed decimal number).
3498 This set is ANDed against the capabilities permitted to a process
3499 during
3500 .BR execve (2).
3501 Starting with Linux 2.6.25,
3502 the system-wide capability bounding set disappeared,
3503 and was replaced by a per-thread bounding set; see
3504 .BR capabilities (7).
3505 .TP
3506 .I /proc/sys/kernel/core_pattern
3507 See
3508 .BR core (5).
3509 .TP
3510 .I /proc/sys/kernel/core_uses_pid
3511 See
3512 .BR core (5).
3513 .TP
3514 .I /proc/sys/kernel/ctrl-alt-del
3515 This file
3516 controls the handling of Ctrl-Alt-Del from the keyboard.
3517 When the value in this file is 0, Ctrl-Alt-Del is trapped and
3518 sent to the
3519 .BR init (1)
3520 program to handle a graceful restart.
3521 When the value is greater than zero, Linux's reaction to a Vulcan
3522 Nerve Pinch (tm) will be an immediate reboot, without even
3523 syncing its dirty buffers.
3524 Note: when a program (like dosemu) has the keyboard in "raw"
3525 mode, the ctrl-alt-del is intercepted by the program before it
3526 ever reaches the kernel tty layer, and it's up to the program
3527 to decide what to do with it.
3528 .TP
3529 .IR /proc/sys/kernel/dmesg_restrict " (since Linux 2.6.37)"
3530 The value in this file determines who can see kernel syslog contents.
3531 A value of 0 in this file imposes no restrictions.
3532 If the value is 1, only privileged users can read the kernel syslog.
3533 (See
3534 .BR syslog (2)
3535 for more details.)
3536 Since Linux 3.4,
3537 .\" commit 620f6e8e855d6d447688a5f67a4e176944a084e8
3538 only users with the
3539 .BR CAP_SYS_ADMIN
3540 capability may change the value in this file.
3541 .TP
3542 .IR /proc/sys/kernel/domainname " and " /proc/sys/kernel/hostname
3543 can be used to set the NIS/YP domainname and the
3544 hostname of your box in exactly the same way as the commands
3545 .BR domainname (1)
3546 and
3547 .BR hostname (1),
3548 that is:
3549
3550 .in +4n
3551 .nf
3552 .RB "#" " echo \(aqdarkstar\(aq > /proc/sys/kernel/hostname"
3553 .RB "#" " echo \(aqmydomain\(aq > /proc/sys/kernel/domainname"
3554 .fi
3555 .in
3556
3557 has the same effect as
3558
3559 .in +4n
3560 .nf
3561 .RB "#" " hostname \(aqdarkstar\(aq"
3562 .RB "#" " domainname \(aqmydomain\(aq"
3563 .fi
3564 .in
3565
3566 Note, however, that the classic darkstar.frop.org has the
3567 hostname "darkstar" and DNS (Internet Domain Name Server)
3568 domainname "frop.org", not to be confused with the NIS (Network
3569 Information Service) or YP (Yellow Pages) domainname.
3570 These two
3571 domain names are in general different.
3572 For a detailed discussion
3573 see the
3574 .BR hostname (1)
3575 man page.
3576 .TP
3577 .I /proc/sys/kernel/hotplug
3578 This file
3579 contains the path for the hotplug policy agent.
3580 The default value in this file is
3581 .IR /sbin/hotplug .
3582 .TP
3583 .I /proc/sys/kernel/htab-reclaim
3584 (PowerPC only) If this file is set to a nonzero value,
3585 the PowerPC htab
3586 (see kernel file
3587 .IR Documentation/powerpc/ppc_htab.txt )
3588 is pruned
3589 each time the system hits the idle loop.
3590 .TP
3591 .IR /proc/sys/kernel/kptr_restrict " (since Linux 2.6.38)"
3592 .\" 455cd5ab305c90ffc422dd2e0fb634730942b257
3593 The value in this file determines whether kernel addresses are exposed via
3594 .I /proc
3595 files and other interfaces.
3596 A value of 0 in this file imposes no restrictions.
3597 If the value is 1, kernel pointers printed using the
3598 .I %pK
3599 format specifier will be replaced with zeros unless the user has the
3600 .BR CAP_SYSLOG
3601 capability.
3602 If the value is 2, kernel pointers printed using the
3603 .I %pK
3604 format specifier will be replaced with zeros regardless
3605 of the user's capabilities.
3606 The initial default value for this file was 1,
3607 but the default was changed
3608 .\" commit 411f05f123cbd7f8aa1edcae86970755a6e2a9d9
3609 to 0 in Linux 2.6.39.
3610 Since Linux 3.4,
3611 .\" commit 620f6e8e855d6d447688a5f67a4e176944a084e8
3612 only users with the
3613 .BR CAP_SYS_ADMIN
3614 capability can change the value in this file.
3615 .TP
3616 .I /proc/sys/kernel/l2cr
3617 (PowerPC only) This file
3618 contains a flag that controls the L2 cache of G3 processor
3619 boards.
3620 If 0, the cache is disabled.
3621 Enabled if nonzero.
3622 .TP
3623 .I /proc/sys/kernel/modprobe
3624 This file contains the path for the kernel module loader.
3625 The default value is
3626 .IR /sbin/modprobe .
3627 The file is present only if the kernel is built with the
3628 .B CONFIG_MODULES
3629 .RB ( CONFIG_KMOD
3630 in Linux 2.6.26 and earlier)
3631 option enabled.
3632 It is described by the Linux kernel source file
3633 .I Documentation/kmod.txt
3634 (present only in kernel 2.4 and earlier).
3635 .TP
3636 .IR /proc/sys/kernel/modules_disabled " (since Linux 2.6.31)"
3637 .\" 3d43321b7015387cfebbe26436d0e9d299162ea1
3638 .\" From Documentation/sysctl/kernel.txt
3639 A toggle value indicating if modules are allowed to be loaded
3640 in an otherwise modular kernel.
3641 This toggle defaults to off (0), but can be set true (1).
3642 Once true, modules can be neither loaded nor unloaded,
3643 and the toggle cannot be set back to false.
3644 The file is present only if the kernel is built with the
3645 .B CONFIG_MODULES
3646 option enabled.
3647 .TP
3648 .IR /proc/sys/kernel/msgmax " (since Linux 2.2)"
3649 This file defines
3650 a system-wide limit specifying the maximum number of bytes in
3651 a single message written on a System V message queue.
3652 .TP
3653 .IR /proc/sys/kernel/msgmni " (since Linux 2.4)"
3654 This file defines the system-wide limit on the number of
3655 message queue identifiers.
3656 .TP
3657 .IR /proc/sys/kernel/msgmnb " (since Linux 2.2)"
3658 This file defines a system-wide parameter used to initialize the
3659 .I msg_qbytes
3660 setting for subsequently created message queues.
3661 The
3662 .I msg_qbytes
3663 setting specifies the maximum number of bytes that may be written to the
3664 message queue.
3665 .TP
3666 .IR /proc/sys/kernel/ngroups_max " (since Linux 2.6.4)"
3667 This is a read-only file that displays the upper limit on the
3668 number of a process's group memberships.
3669 .TP
3670 .IR /proc/sys/kernel/ostype " and " /proc/sys/kernel/osrelease
3671 These files
3672 give substrings of
3673 .IR /proc/version .
3674 .TP
3675 .IR /proc/sys/kernel/overflowgid " and " /proc/sys/kernel/overflowuid
3676 These files duplicate the files
3677 .I /proc/sys/fs/overflowgid
3678 and
3679 .IR /proc/sys/fs/overflowuid .
3680 .TP
3681 .I /proc/sys/kernel/panic
3682 This file gives read/write access to the kernel variable
3683 .IR panic_timeout .
3684 If this is zero, the kernel will loop on a panic; if nonzero,
3685 it indicates that the kernel should autoreboot after this number
3686 of seconds.
3687 When you use the
3688 software watchdog device driver, the recommended setting is 60.
3689 .TP
3690 .IR /proc/sys/kernel/panic_on_oops " (since Linux 2.5.68)"
3691 This file controls the kernel's behavior when an oops
3692 or BUG is encountered.
3693 If this file contains 0, then the system
3694 tries to continue operation.
3695 If it contains 1, then the system
3696 delays a few seconds (to give klogd time to record the oops output)
3697 and then panics.
3698 If the
3699 .I /proc/sys/kernel/panic
3700 file is also nonzero, then the machine will be rebooted.
3701 .TP
3702 .IR /proc/sys/kernel/pid_max " (since Linux 2.5.34)"
3703 This file specifies the value at which PIDs wrap around
3704 (i.e., the value in this file is one greater than the maximum PID).
3705 PIDs greater than this value are not allocated;
3706 thus, the value in this file also acts as a system-wide limit
3707 on the total number of processes and threads.
3708 The default value for this file, 32768,
3709 results in the same range of PIDs as on earlier kernels.
3710 On 32-bit platforms, 32768 is the maximum value for
3711 .IR pid_max .
3712 On 64-bit systems,
3713 .I pid_max
3714 can be set to any value up to 2^22
3715 .RB ( PID_MAX_LIMIT ,
3716 approximately 4 million).
3717 .\" Prior to 2.6.10, pid_max could also be raised above 32768 on 32-bit
3718 .\" platforms, but this broke /proc/[pid]
3719 .\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=109513010926152&w=2
3720 .TP
3721 .IR /proc/sys/kernel/powersave-nap " (PowerPC only)"
3722 This file contains a flag.
3723 If set, Linux-PPC will use the "nap" mode of
3724 powersaving,
3725 otherwise the "doze" mode will be used.
3726 .TP
3727 .I /proc/sys/kernel/printk
3728 See
3729 .BR syslog (2).
3730 .TP
3731 .IR /proc/sys/kernel/pty " (since Linux 2.6.4)"
3732 This directory contains two files relating to the number of UNIX 98
3733 pseudoterminals (see
3734 .BR pts (4))
3735 on the system.
3736 .TP
3737 .I /proc/sys/kernel/pty/max
3738 This file defines the maximum number of pseudoterminals.
3739 .TP
3740 .I /proc/sys/kernel/pty/nr
3741 This read-only file
3742 indicates how many pseudoterminals are currently in use.
3743 .TP
3744 .I /proc/sys/kernel/random
3745 This directory
3746 contains various parameters controlling the operation of the file
3747 .IR /dev/random .
3748 See
3749 .BR random (4)
3750 for further information.
3751 .TP
3752 .IR /proc/sys/kernel/random/uuid " (since Linux 2.4)"
3753 Each read from this read-only file returns a randomly generated 128-bit UUID,
3754 as a string in the standard UUID format.
3755 .TP
3756 .I /proc/sys/kernel/real-root-dev
3757 This file is documented in the Linux kernel source file
3758 .IR Documentation/initrd.txt .
3759 .TP
3760 .IR /proc/sys/kernel/reboot-cmd " (Sparc only) "
3761 This file seems to be a way to give an argument to the SPARC
3762 ROM/Flash boot loader.
3763 Maybe to tell it what to do after
3764 rebooting?
3765 .TP
3766 .I /proc/sys/kernel/rtsig-max
3767 (Only in kernels up to and including 2.6.7; see
3768 .BR setrlimit (2))
3769 This file can be used to tune the maximum number
3770 of POSIX real-time (queued) signals that can be outstanding
3771 in the system.
3772 .TP
3773 .I /proc/sys/kernel/rtsig-nr
3774 (Only in kernels up to and including 2.6.7.)
3775 This file shows the number POSIX real-time signals currently queued.
3776 .TP
3777 .IR /proc/sys/kernel/sched_rr_timeslice_ms " (since Linux 3.9)"
3778 See
3779 .BR sched_rr_get_interval (2).
3780 .TP
3781 .IR /proc/sys/kernel/sched_rt_period_us " (Since Linux 2.6.25)"
3782 See
3783 .BR sched (7).
3784 .TP
3785 .IR /proc/sys/kernel/sched_rt_runtime_us " (Since Linux 2.6.25)"
3786 See
3787 .BR sched (7).
3788 .TP
3789 .IR /proc/sys/kernel/sem " (since Linux 2.4)"
3790 This file contains 4 numbers defining limits for System V IPC semaphores.
3791 These fields are, in order:
3792 .RS
3793 .IP SEMMSL 8
3794 The maximum semaphores per semaphore set.
3795 .IP SEMMNS 8
3796 A system-wide limit on the number of semaphores in all semaphore sets.
3797 .IP SEMOPM 8
3798 The maximum number of operations that may be specified in a
3799 .BR semop (2)
3800 call.
3801 .IP SEMMNI 8
3802 A system-wide limit on the maximum number of semaphore identifiers.
3803 .RE
3804 .TP
3805 .I /proc/sys/kernel/sg-big-buff
3806 This file
3807 shows the size of the generic SCSI device (sg) buffer.
3808 You can't tune it just yet, but you could change it at
3809 compile time by editing
3810 .I include/scsi/sg.h
3811 and changing
3812 the value of
3813 .BR SG_BIG_BUFF .
3814 However, there shouldn't be any reason to change this value.
3815 .TP
3816 .IR /proc/sys/kernel/shm_rmid_forced " (since Linux 3.1)"
3817 .\" commit b34a6b1da371ed8af1221459a18c67970f7e3d53
3818 .\" See also Documentation/sysctl/kernel.txt
3819 If this file is set to 1, all System V shared memory segments will
3820 be marked for destruction as soon as the number of attached processes
3821 falls to zero;
3822 in other words, it is no longer possible to create shared memory segments
3823 that exist independently of any attached process.
3824 .IP
3825 The effect is as though a
3826 .BR shmctl (2)
3827 .B IPC_RMID
3828 is performed on all existing segments as well as all segments
3829 created in the future (until this file is reset to 0).
3830 Note that existing segments that are attached to no process will be
3831 immediately destroyed when this file is set to 1.
3832 Setting this option will also destroy segments that were created,
3833 but never attached,
3834 upon termination of the process that created the segment with
3835 .BR shmget (2).
3836 .IP
3837 Setting this file to 1 provides a way of ensuring that
3838 all System V shared memory segments are counted against the
3839 resource usage and resource limits (see the description of
3840 .B RLIMIT_AS
3841 in
3842 .BR getrlimit (2))
3843 of at least one process.
3844 .IP
3845 Because setting this file to 1 produces behavior that is nonstandard
3846 and could also break existing applications,
3847 the default value in this file is 0.
3848 Only set this file to 1 if you have a good understanding
3849 of the semantics of the applications using
3850 System V shared memory on your system.
3851 .TP
3852 .IR /proc/sys/kernel/shmall " (since Linux 2.2)"
3853 This file
3854 contains the system-wide limit on the total number of pages of
3855 System V shared memory.
3856 .TP
3857 .IR /proc/sys/kernel/shmmax " (since Linux 2.2)"
3858 This file
3859 can be used to query and set the run-time limit
3860 on the maximum (System V IPC) shared memory segment size that can be
3861 created.
3862 Shared memory segments up to 1GB are now supported in the
3863 kernel.
3864 This value defaults to
3865 .BR SHMMAX .
3866 .TP
3867 .IR /proc/sys/kernel/shmmni " (since Linux 2.4)"
3868 This file
3869 specifies the system-wide maximum number of System V shared memory
3870 segments that can be created.
3871 .TP
3872 .I /proc/sys/kernel/sysrq
3873 This file controls the functions allowed to be invoked by the SysRq key.
3874 By default,
3875 the file contains 1 meaning that every possible SysRq request is allowed
3876 (in older kernel versions, SysRq was disabled by default,
3877 and you were required to specifically enable it at run-time,
3878 but this is not the case any more).
3879 Possible values in this file are:
3880
3881    0 - disable sysrq completely
3882    1 - enable all functions of sysrq
3883   >1 - bit mask of allowed sysrq functions, as follows:
3884           2 - enable control of console logging level
3885           4 - enable control of keyboard (SAK, unraw)
3886           8 - enable debugging dumps of processes etc.
3887          16 - enable sync command
3888          32 - enable remount read-only
3889          64 - enable signaling of processes (term, kill, oom-kill)
3890         128 - allow reboot/poweroff
3891         256 - allow nicing of all real-time tasks
3892
3893 This file is present only if the
3894 .B CONFIG_MAGIC_SYSRQ
3895 kernel configuration option is enabled.
3896 For further details see the Linux kernel source file
3897 .IR Documentation/sysrq.txt .
3898 .TP
3899 .I /proc/sys/kernel/version
3900 This file contains a string like:
3901
3902     #5 Wed Feb 25 21:49:24 MET 1998
3903
3904 The "#5" means that
3905 this is the fifth kernel built from this source base and the
3906 date behind it indicates the time the kernel was built.
3907 .TP
3908 .IR /proc/sys/kernel/threads-max " (since Linux 2.3.11)"
3909 This file specifies the system-wide limit on the number of
3910 threads (tasks) that can be created on the system.
3911 .TP
3912 .IR /proc/sys/kernel/zero-paged " (PowerPC only) "
3913 This file
3914 contains a flag.
3915 When enabled (nonzero), Linux-PPC will pre-zero pages in
3916 the idle loop, possibly speeding up get_free_pages.
3917 .TP
3918 .I /proc/sys/net
3919 This directory contains networking stuff.
3920 Explanations for some of the files under this directory can be found in
3921 .BR tcp (7)
3922 and
3923 .BR ip (7).
3924 .TP
3925 .I /proc/sys/net/core/somaxconn
3926 This file defines a ceiling value for the
3927 .I backlog
3928 argument of
3929 .BR listen (2);
3930 see the
3931 .BR listen (2)
3932 manual page for details.
3933 .TP
3934 .I /proc/sys/proc
3935 This directory may be empty.
3936 .TP
3937 .I /proc/sys/sunrpc
3938 This directory supports Sun remote procedure call for network filesystem
3939 (NFS).
3940 On some systems, it is not present.
3941 .TP
3942 .I /proc/sys/vm
3943 This directory contains files for memory management tuning, buffer and
3944 cache management.
3945 .TP
3946 .IR /proc/sys/vm/compact_memory " (since Linux 2.6.35)"
3947 When 1 is written to this file, all zones are compacted such that free
3948 memory is available in contiguous blocks where possible.
3949 The effect of this action can be seen by examining
3950 .IR /proc/buddyinfo .
3951 .IP
3952 Only present if the kernel was configured with
3953 .BR CONFIG_COMPACTION .
3954 .TP
3955 .IR /proc/sys/vm/drop_caches " (since Linux 2.6.16)"
3956 Writing to this file causes the kernel to drop clean caches, dentries, and
3957 inodes from memory, causing that memory to become free.
3958 This can be useful for memory management testing and
3959 performing reproducible filesystem benchmarks.
3960 Because writing to this file causes the benefits of caching to be lost,
3961 it can degrade overall system performance.
3962
3963 To free pagecache, use:
3964
3965     echo 1 > /proc/sys/vm/drop_caches
3966
3967 To free dentries and inodes, use:
3968
3969     echo 2 > /proc/sys/vm/drop_caches
3970
3971 To free pagecache, dentries and inodes, use:
3972
3973     echo 3 > /proc/sys/vm/drop_caches
3974
3975 Because writing to this file is a nondestructive operation and dirty objects
3976 are not freeable, the
3977 user should run
3978 .BR sync (1)
3979 first.
3980 .TP
3981 .IR /proc/sys/vm/legacy_va_layout " (since Linux 2.6.9)"
3982 .\" The following is from Documentation/filesystems/proc.txt
3983 If nonzero, this disables the new 32-bit memory-mapping layout;
3984 the kernel will use the legacy (2.4) layout for all processes.
3985 .TP
3986 .IR /proc/sys/vm/memory_failure_early_kill " (since Linux 2.6.32)"
3987 .\" The following is based on the text in Documentation/sysctl/vm.txt
3988 Control how to kill processes when an uncorrected memory error
3989 (typically a 2-bit error in a memory module)
3990 that cannot be handled by the kernel
3991 is detected in the background by hardware.
3992 In some cases (like the page still having a valid copy on disk),
3993 the kernel will handle the failure
3994 transparently without affecting any applications.
3995 But if there is no other up-to-date copy of the data,
3996 it will kill processes to prevent any data corruptions from propagating.
3997
3998 The file has one of the following values:
3999 .RS
4000 .IP 1: 4
4001 Kill all processes that have the corrupted-and-not-reloadable page mapped
4002 as soon as the corruption is detected.
4003 Note this is not supported for a few types of pages, like kernel internally
4004 allocated data or the swap cache, but works for the majority of user pages.
4005 .IP 0: 4
4006 Only unmap the corrupted page from all processes and kill only a process
4007 that tries to access it.
4008 .RE
4009 .IP
4010 The kill is performed using a
4011 .B SIGBUS
4012 signal with
4013 .I si_code
4014 set to
4015 .BR BUS_MCEERR_AO .
4016 Processes can handle this if they want to; see
4017 .BR sigaction (2)
4018 for more details.
4019
4020 This feature is active only on architectures/platforms with advanced machine
4021 check handling and depends on the hardware capabilities.
4022
4023 Applications can override the
4024 .I memory_failure_early_kill
4025 setting individually with the
4026 .BR prctl (2)
4027 .B PR_MCE_KILL
4028 operation.
4029 .IP
4030 Only present if the kernel was configured with
4031 .BR CONFIG_MEMORY_FAILURE .
4032 .TP
4033 .IR /proc/sys/vm/memory_failure_recovery " (since Linux 2.6.32)"
4034 .\" The following is based on the text in Documentation/sysctl/vm.txt
4035 Enable memory failure recovery (when supported by the platform)
4036 .RS
4037 .IP 1: 4
4038 Attempt recovery.
4039 .IP 0: 4
4040 Always panic on a memory failure.
4041 .RE
4042 .IP
4043 Only present if the kernel was configured with
4044 .BR CONFIG_MEMORY_FAILURE .
4045 .TP
4046 .IR /proc/sys/vm/oom_dump_tasks " (since Linux 2.6.25)"
4047 .\" The following is from Documentation/sysctl/vm.txt
4048 Enables a system-wide task dump (excluding kernel threads) to be
4049 produced when the kernel performs an OOM-killing.
4050 The dump includes the following information
4051 for each task (thread, process):
4052 thread ID, real user ID, thread group ID (process ID),
4053 virtual memory size, resident set size,
4054 the CPU that the task is scheduled on,
4055 oom_adj score (see the description of
4056 .IR /proc/[pid]/oom_adj ),
4057 and command name.
4058 This is helpful to determine why the OOM-killer was invoked
4059 and to identify the rogue task that caused it.
4060
4061 If this contains the value zero, this information is suppressed.
4062 On very large systems with thousands of tasks,
4063 it may not be feasible to dump the memory state information for each one.
4064 Such systems should not be forced to incur a performance penalty in
4065 OOM situations when the information may not be desired.
4066
4067 If this is set to nonzero, this information is shown whenever the
4068 OOM-killer actually kills a memory-hogging task.
4069
4070 The default value is 0.
4071 .TP
4072 .IR /proc/sys/vm/oom_kill_allocating_task " (since Linux 2.6.24)"
4073 .\" The following is from Documentation/sysctl/vm.txt
4074 This enables or disables killing the OOM-triggering task in
4075 out-of-memory situations.
4076
4077 If this is set to zero, the OOM-killer will scan through the entire
4078 tasklist and select a task based on heuristics to kill.
4079 This normally selects a rogue memory-hogging task that
4080 frees up a large amount of memory when killed.
4081
4082 If this is set to nonzero, the OOM-killer simply kills the task that
4083 triggered the out-of-memory condition.
4084 This avoids a possibly expensive tasklist scan.
4085
4086 If
4087 .I /proc/sys/vm/panic_on_oom
4088 is nonzero, it takes precedence over whatever value is used in
4089 .IR /proc/sys/vm/oom_kill_allocating_task .
4090
4091 The default value is 0.
4092 .TP
4093 .IR /proc/sys/vm/overcommit_kbytes " (since Linux 3.14)"
4094 .\" commit 49f0ce5f92321cdcf741e35f385669a421013cb7
4095 This writable file provides an alternative to
4096 .IR /proc/sys/vm/overcommit_ratio
4097 for controlling the
4098 .I CommitLimit
4099 when
4100 .IR /proc/sys/vm/overcommit_memory
4101 has the value 2.
4102 It allows the amount of memory overcommitting to be specified as
4103 an absolute value (in kB),
4104 rather than as a percentage, as is done with
4105 .IR overcommit_ratio .
4106 This allows for finer-grained control of
4107 .IR CommitLimit
4108 on systems with extremely large memory sizes.
4109
4110 Only one of
4111 .IR overcommit_kbytes
4112 or
4113 .IR overcommit_ratio
4114 can have an effect:
4115 if
4116 .IR overcommit_kbytes
4117 has a nonzero value, then it is used to calculate
4118 .IR CommitLimit ,
4119 otherwise
4120 .IR overcommit_ratio
4121 is used.
4122 Writing a value to either of these files causes the
4123 value in the other file to be set to zero.
4124 .TP
4125 .I /proc/sys/vm/overcommit_memory
4126 This file contains the kernel virtual memory accounting mode.
4127 Values are:
4128 .RS
4129 .IP
4130 0: heuristic overcommit (this is the default)
4131 .br
4132 1: always overcommit, never check
4133 .br
4134 2: always check, never overcommit
4135 .RE
4136 .IP
4137 In mode 0, calls of
4138 .BR mmap (2)
4139 with
4140 .B MAP_NORESERVE
4141 are not checked, and the default check is very weak,
4142 leading to the risk of getting a process "OOM-killed".
4143 Under Linux 2.4, any nonzero value implies mode 1.
4144
4145 In mode 2 (available since Linux 2.6), the total virtual address space
4146 that can be allocated
4147 .RI ( CommitLimit
4148 in
4149 .IR /proc/meminfo )
4150 is calculated as
4151
4152     CommitLimit = (total_RAM - total_huge_TLB) *
4153                   overcommit_ratio / 100 + total_swap
4154
4155 where:
4156 .RS 12
4157 .IP * 3
4158 .I total_RAM
4159 is the total amount of RAM on the system;
4160 .IP *
4161 .I total_huge_TLB
4162 is the amount of memory set aside for huge pages;
4163 .IP *
4164 .I overcommit_ratio
4165 is the value in
4166 .IR /proc/sys/vm/overcommit_ratio ;
4167 and
4168 .IP *
4169 .I total_swap
4170 is the amount of swap space.
4171 .RE
4172 .IP
4173 For example, on a system with 16GB of physical RAM, 16GB
4174 of swap, no space dedicated to huge pages, and an
4175 .I overcommit_ratio
4176 of 50, this formula yields a
4177 .I CommitLimit
4178 of 24GB.
4179
4180 Since Linux 3.14, if the value in
4181 .I /proc/sys/vm/overcommit_kbytes
4182 is nonzero, then
4183 .I CommitLimit
4184 is instead calculated as:
4185
4186     CommitLimit = overcommit_kbytes + total_swap
4187 .TP
4188 .IR /proc/sys/vm/overcommit_ratio " (since Linux 2.6.0)"
4189 This writable file defines a percentage by which memory
4190 can be overcommitted.
4191 The default value in the file is 50.
4192 See the description of
4193 .IR /proc/sys/vm/overcommit_memory .
4194 .TP
4195 .IR /proc/sys/vm/panic_on_oom " (since Linux 2.6.18)"
4196 .\" The following is adapted from Documentation/sysctl/vm.txt
4197 This enables or disables a kernel panic in
4198 an out-of-memory situation.
4199
4200 If this file is set to the value 0,
4201 the kernel's OOM-killer will kill some rogue process.
4202 Usually, the OOM-killer is able to kill a rogue process and the
4203 system will survive.
4204
4205 If this file is set to the value 1,
4206 then the kernel normally panics when out-of-memory happens.
4207 However, if a process limits allocations to certain nodes
4208 using memory policies
4209 .RB ( mbind (2)
4210 .BR MPOL_BIND )
4211 or cpusets
4212 .RB ( cpuset (7))
4213 and those nodes reach memory exhaustion status,
4214 one process may be killed by the OOM-killer.
4215 No panic occurs in this case:
4216 because other nodes' memory may be free,
4217 this means the system as a whole may not have reached
4218 an out-of-memory situation yet.
4219
4220 If this file is set to the value 2,
4221 the kernel always panics when an out-of-memory condition occurs.
4222
4223 The default value is 0.
4224 1 and 2 are for failover of clustering.
4225 Select either according to your policy of failover.
4226 .TP
4227 .IR /proc/sys/vm/swappiness
4228 .\" The following is from Documentation/sysctl/vm.txt
4229 The value in this file controls how aggressively the kernel will swap
4230 memory pages.
4231 Higher values increase aggressiveness, lower values
4232 decrease aggressiveness.
4233 The default value is 60.
4234 .TP
4235 .IR /proc/sysrq-trigger " (since Linux 2.4.21)"
4236 Writing a character to this file triggers the same SysRq function as
4237 typing ALT-SysRq-<character> (see the description of
4238 .IR /proc/sys/kernel/sysrq ).
4239 This file is normally writable only by
4240 .IR root .
4241 For further details see the Linux kernel source file
4242 .IR Documentation/sysrq.txt .
4243 .TP
4244 .I /proc/sysvipc
4245 Subdirectory containing the pseudo-files
4246 .IR msg ", " sem " and " shm "."
4247 These files list the System V Interprocess Communication (IPC) objects
4248 (respectively: message queues, semaphores, and shared memory)
4249 that currently exist on the system,
4250 providing similar information to that available via
4251 .BR ipcs (1).
4252 These files have headers and are formatted (one IPC object per line)
4253 for easy understanding.
4254 .BR svipc (7)
4255 provides further background on the information shown by these files.
4256 .TP
4257 .IR /proc/thread-self " (since Linux 3.17)"
4258 .\" commit 0097875bd41528922fb3bb5f348c53f17e00e2fd
4259 This directory refers to the thread accessing the
4260 .I /proc
4261 filesystem,
4262 and is identical to the
4263 .I /proc/self/task/[tid]
4264 directory named by the process thread ID
4265 .RI ( [tid] )
4266 of the same thread.
4267 .TP
4268 .IR /proc/timer_list " (since Linux 2.6.21)"
4269 .\" commit 289f480af87e45f7a6de6ba9b4c061c2e259fe98
4270 This read-only file exposes a list of all currently pending
4271 (high-resolution) timers,
4272 all clock-event sources, and their parameters in a human-readable form.
4273 .TP
4274 .IR /proc/timer_stats " (since Linux 2.6.21)"
4275 .\" commit 82f67cd9fca8c8762c15ba7ed0d5747588c1e221
4276 .\"     Date:   Fri Feb 16 01:28:13 2007 -0800
4277 .\" Text largely derived from Documentation/timers/timer_stats.txt
4278 This is a debugging facility to make timer (ab)use in a Linux
4279 system visible to kernel and user-space developers.
4280 It can be used by kernel and user-space developers to verify that
4281 their code does not make undue use of timers.
4282 The goal is to avoid unnecessary wakeups,
4283 thereby optimizing power consumption.
4284
4285 If enabled in the kernel
4286 .RB ( CONFIG_TIMER_STATS ),
4287 but not used,
4288 it has almost zero runtime overhead and a relatively small
4289 data-structure overhead.
4290 Even if collection is enabled at runtime, overhead is low:
4291 all the locking is per-CPU and lookup is hashed.
4292
4293 The
4294 .I /proc/timer_stats
4295 file is used both to control sampling facility and to read out the
4296 sampled information.
4297
4298 The timer_stats functionality is inactive on bootup.
4299 A sampling period can be started using the following command:
4300
4301     # echo 1 > /proc/timer_stats
4302
4303 The following command stops a sampling period:
4304
4305     # echo 0 > /proc/timer_stats
4306
4307 The statistics can be retrieved by:
4308
4309     $ cat /proc/timer_stats
4310
4311 While sampling is enabled, each readout from
4312 .I /proc/timer_stats
4313 will see
4314 newly updated statistics.
4315 Once sampling is disabled, the sampled information
4316 is kept until a new sample period is started.
4317 This allows multiple readouts.
4318
4319 Sample output from
4320 .IR /proc/timer_stats :
4321
4322 .nf
4323 .RS -4
4324 .RB $ " cat /proc/timer_stats"
4325 Timer Stats Version: v0.3
4326 Sample period: 1.764 s
4327 Collection: active
4328   255,     0 swapper/3        hrtimer_start_range_ns (tick_sched_timer)
4329    71,     0 swapper/1        hrtimer_start_range_ns (tick_sched_timer)
4330    58,     0 swapper/0        hrtimer_start_range_ns (tick_sched_timer)
4331     4,  1694 gnome-shell      mod_delayed_work_on (delayed_work_timer_fn)
4332    17,     7 rcu_sched        rcu_gp_kthread (process_timeout)
4333 \&...
4334     1,  4911 kworker/u16:0    mod_delayed_work_on (delayed_work_timer_fn)
4335    1D,  2522 kworker/0:0      queue_delayed_work_on (delayed_work_timer_fn)
4336 1029 total events, 583.333 events/sec
4337
4338 .fi
4339 .RE
4340 .IP
4341 The output columns are:
4342 .RS
4343 .IP * 3
4344 a count of the number of events,
4345 optionally (since Linux 2.6.23) followed by the letter \(aqD\(aq
4346 .\" commit c5c061b8f9726bc2c25e19dec227933a13d1e6b7 deferrable timers
4347 if this is a deferrable timer;
4348 .IP *
4349 the PID of the process that initialized the timer;
4350 .IP *
4351 the name of the process that initialized the timer;
4352 .IP *
4353 the function where the timer was initialized; and
4354 .IP *
4355 (in parentheses)
4356 the callback function that is associated with the timer.
4357 .RE
4358 .TP
4359 .I /proc/tty
4360 Subdirectory containing the pseudo-files and subdirectories for
4361 tty drivers and line disciplines.
4362 .TP
4363 .I /proc/uptime
4364 This file contains two numbers: the uptime of the system (seconds),
4365 and the amount of time spent in idle process (seconds).
4366 .TP
4367 .I /proc/version
4368 This string identifies the kernel version that is currently running.
4369 It includes the contents of
4370 .IR /proc/sys/kernel/ostype ,
4371 .I /proc/sys/kernel/osrelease
4372 and
4373 .IR /proc/sys/kernel/version .
4374 For example:
4375 .nf
4376 .in -2
4377 .ft CW
4378 Linux version 1.0.9 (quinlan@phaze) #1 Sat May 14 01:51:54 EDT 1994
4379 .ft
4380 .in +2
4381 .fi
4382 .\" FIXME 2.6.13 seems to have /proc/vmcore implemented; document this
4383 .\"     See Documentation/kdump/kdump.txt
4384 .\"     commit 666bfddbe8b8fd4fd44617d6c55193d5ac7edb29
4385 .\"     Needs CONFIG_VMCORE
4386 .\"
4387 .TP
4388 .IR /proc/vmstat " (since Linux 2.6)"
4389 This file displays various virtual memory statistics.
4390 .TP
4391 .IR /proc/zoneinfo " (since Linux 2.6.13)"
4392 This file display information about memory zones.
4393 This is useful for analyzing virtual memory behavior.
4394 .\" FIXME more should be said about /proc/zoneinfo
4395 .SH NOTES
4396 Many strings (i.e., the environment and command line) are in
4397 the internal format, with subfields terminated by null bytes (\(aq\\0\(aq),
4398 so you
4399 may find that things are more readable if you use \fIod \-c\fP or \fItr
4400 "\\000" "\\n"\fP to read them.
4401 Alternatively, \fIecho \`cat <file>\`\fP works well.
4402
4403 This manual page is incomplete, possibly inaccurate, and is the kind
4404 of thing that needs to be updated very often.
4405 .\" .SH ACKNOWLEDGEMENTS
4406 .\" The material on /proc/sys/fs and /proc/sys/kernel is closely based on
4407 .\" kernel source documentation files written by Rik van Riel.
4408 .SH SEE ALSO
4409 .BR cat (1),
4410 .BR dmesg (1),
4411 .BR find (1),
4412 .BR free (1),
4413 .BR ps (1),
4414 .BR tr (1),
4415 .BR uptime (1),
4416 .BR chroot (2),
4417 .BR mmap (2),
4418 .BR readlink (2),
4419 .BR syslog (2),
4420 .BR slabinfo (5),
4421 .BR hier (7),
4422 .BR namespaces (7),
4423 .BR time (7),
4424 .BR arp (8),
4425 .BR hdparm (8),
4426 .BR ifconfig (8),
4427 .BR init (1),
4428 .BR lsmod (8),
4429 .BR lspci (8),
4430 .BR mount (8),
4431 .BR netstat (8),
4432 .BR procinfo (8),
4433 .BR route (8),
4434 .BR sysctl (8)
4435
4436 The Linux kernel source files:
4437 .IR Documentation/filesystems/proc.txt
4438 .IR Documentation/sysctl/fs.txt ,
4439 .IR Documentation/sysctl/kernel.txt ,
4440 .IR Documentation/sysctl/net.txt ,
4441 and
4442 .IR Documentation/sysctl/vm.txt .
4443 .SH COLOPHON
4444 This page is part of release 3.79 of the Linux
4445 .I man-pages
4446 project.
4447 A description of the project,
4448 information about reporting bugs,
4449 and the latest version of this page,
4450 can be found at
4451 \%http://www.kernel.org/doc/man\-pages/.