]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright (C) 1994, 1995 by Daniel Quinlan (quinlan@yggdrasil.com) |
b4e9ee8f | 2 | .\" and Copyright (C) 2002-2008 Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da MK |
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 | |
c11b1abf | 7 | .\" Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da | 8 | .\" |
1dd72f9c | 9 | .\" %%%LICENSE_START(GPLv2+_DOC_FULL) |
fea681da MK |
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 | |
c715f741 MK |
26 | .\" License along with this manual; if not, see |
27 | .\" <http://www.gnu.org/licenses/>. | |
6a8d8745 | 28 | .\" %%%LICENSE_END |
fea681da MK |
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 | |
c11b1abf | 36 | .\" by Michael Kerrisk <mtk.manpages@gmail.com> |
5d6d14a0 MK |
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 | |
568105c6 MK |
39 | .\" 2004-12-14, mtk, updated 'statm', and fixed error in order of list |
40 | .\" 2005-05-12, mtk, updated 'stat' | |
6d64ca9c | 41 | .\" 2005-07-13, mtk, added /proc/sys/fs/mqueue/* |
363f747c MK |
42 | .\" 2005-09-16, mtk, Added /proc/sys/fs/suid_dumpable |
43 | .\" 2005-09-19, mtk, added /proc/zoneinfo | |
b4e9ee8f | 44 | .\" 2005-03-01, mtk, moved /proc/sys/fs/mqueue/* material to mq_overview.7. |
69119dc7 MK |
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. | |
cc2d5c36 | 49 | .\" 2008-07-15, mtk, added /proc/config.gz |
363f747c | 50 | .\" |
bea08fec | 51 | .\" FIXME . cross check against Documentation/filesystems/proc.txt |
c13182ef | 52 | .\" to see what information could be imported from that file |
c533af9d | 53 | .\" into this file. |
fea681da | 54 | .\" |
8392a3b3 | 55 | .TH PROC 5 2015-01-22 "Linux" "Linux Programmer's Manual" |
fea681da | 56 | .SH NAME |
9ee4a2b6 | 57 | proc \- process information pseudo-filesystem |
fea681da MK |
58 | .SH DESCRIPTION |
59 | The | |
60 | .I proc | |
ac8727b6 | 61 | filesystem is a pseudo-filesystem which provides an interface to |
c13182ef MK |
62 | kernel data structures. |
63 | It is commonly mounted at | |
fea681da | 64 | .IR /proc . |
c13182ef | 65 | Most of it is read-only, but some files allow kernel variables to be |
fea681da MK |
66 | changed. |
67 | .LP | |
ac8727b6 | 68 | The following list describes many of the files and directories under the |
743638fd MK |
69 | .I /proc |
70 | hierarchy. | |
fea681da MK |
71 | .PD 1 |
72 | .TP | |
69119dc7 | 73 | .I /proc/[pid] |
fea681da MK |
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. | |
69119dc7 | 78 | .\" FIXME Describe /proc/[pid]/attr and |
b3fb99e8 MK |
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 | |
b4e9ee8f | 97 | .\" |
fea681da | 98 | .TP |
69119dc7 | 99 | .IR /proc/[pid]/auxv " (since 2.6.0-test7)" |
857f1942 | 100 | This contains the contents of the ELF interpreter information passed |
c13182ef | 101 | to the process at exec time. |
857f1942 | 102 | The format is one \fIunsigned long\fP ID |
c13182ef | 103 | plus one \fIunsigned long\fP value for each entry. |
857f1942 | 104 | The last entry contains two zeros. |
4c69c692 MK |
105 | See also |
106 | .BR getauxval (3). | |
b5d204d0 | 107 | .TP |
8d708d6b | 108 | .IR /proc/[pid]/cgroup " (since Linux 2.6.24)" |
b5d204d0 MK |
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 | |
90878f7c | 130 | This file is present only if the |
b5d204d0 MK |
131 | .B CONFIG_CGROUPS |
132 | kernel configuration option is enabled. | |
76e0451c MK |
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) | |
b4e9ee8f | 138 | .\" |
b4e9ee8f | 139 | .\" "Clears page referenced bits shown in smaps output" |
76e0451c MK |
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. | |
322d49fb | 167 | One first inspects the values in the "Referenced" fields |
76e0451c MK |
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, | |
322d49fb | 174 | once again inspects the values in the "Referenced" fields |
76e0451c MK |
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. | |
857f1942 | 203 | .TP |
69119dc7 | 204 | .I /proc/[pid]/cmdline |
6975c16e | 205 | This read-only file holds the complete command line for the process, |
b447cd58 MK |
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: | |
75b94dc3 | 209 | that is, a read on this file will return 0 characters. |
b447cd58 | 210 | The command-line arguments appear in this file as a set of |
6596d270 MK |
211 | strings separated by null bytes (\(aq\\0\(aq), |
212 | with a further null byte after the last string. | |
32d7ef00 MK |
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 | ||
ef4f4031 | 236 | This file provides a superset of the |
32d7ef00 MK |
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. | |
fea681da | 244 | .TP |
7e07d950 | 245 | .IR /proc/[pid]/coredump_filter " (since Linux 2.6.23)" |
b4e9ee8f MK |
246 | See |
247 | .BR core (5). | |
5c411b17 | 248 | .TP |
7e07d950 MK |
249 | .IR /proc/[pid]/cpuset " (since Linux 2.6.12)" |
250 | .\" and/proc/[pid]/task/[tid]/cpuset | |
5c411b17 MK |
251 | See |
252 | .BR cpuset (7). | |
b4e9ee8f | 253 | .TP |
69119dc7 | 254 | .I /proc/[pid]/cwd |
c13182ef | 255 | This is a symbolic link to the current working directory of the process. |
59a40ed7 MK |
256 | To find out the current working directory of process 20, |
257 | for instance, you can do this: | |
fea681da | 258 | |
59a40ed7 | 259 | .in +4n |
fea681da | 260 | .nf |
b43a3b30 | 261 | .RB "$" " cd /proc/20/cwd; /bin/pwd" |
fea681da | 262 | .fi |
59a40ed7 | 263 | .in |
fea681da | 264 | |
c13182ef MK |
265 | Note that the |
266 | .I pwd | |
e7b489f0 | 267 | command is often a shell built-in, and might |
c13182ef | 268 | not work properly. |
743638fd MK |
269 | In |
270 | .BR bash (1), | |
271 | you may use | |
272 | .IR "pwd\ \-P" . | |
afcaf646 MK |
273 | |
274 | .\" The following was still true as at kernel 2.6.13 | |
c13182ef MK |
275 | In a multithreaded process, the contents of this symbolic link |
276 | are not available if the main thread has already terminated | |
afcaf646 | 277 | (typically by calling |
59a40ed7 | 278 | .BR pthread_exit (3)). |
fea681da | 279 | .TP |
69119dc7 | 280 | .I /proc/[pid]/environ |
fea681da | 281 | This file contains the environment for the process. |
f81fb444 | 282 | The entries are separated by null bytes (\(aq\\0\(aq), |
b4e9ee8f | 283 | and there may be a null byte at the end. |
fea681da | 284 | Thus, to print out the environment of process 1, you would do: |
a08ea57c | 285 | .in +4n |
fea681da | 286 | .nf |
a08ea57c | 287 | |
fea681da | 288 | .ft CW |
13912780 | 289 | .RB "$" " strings /proc/1/environ" |
fea681da MK |
290 | .fi |
291 | .ft P | |
a08ea57c | 292 | .in |
fea681da | 293 | .TP |
69119dc7 | 294 | .I /proc/[pid]/exe |
fea681da | 295 | Under Linux 2.2 and later, this file is a symbolic link |
2d7195b8 | 296 | containing the actual pathname of the executed command. |
c13182ef MK |
297 | This symbolic link can be dereferenced normally; attempting to open |
298 | it will open the executable. | |
299 | You can even type | |
69119dc7 | 300 | .I /proc/[pid]/exe |
c13182ef | 301 | to run another copy of the same executable as is being run by |
69119dc7 | 302 | process [pid]. |
afcaf646 | 303 | .\" The following was still true as at kernel 2.6.13 |
c13182ef MK |
304 | In a multithreaded process, the contents of this symbolic link |
305 | are not available if the main thread has already terminated | |
afcaf646 MK |
306 | (typically by calling |
307 | .BR pthread_exit (3)). | |
fea681da | 308 | |
eb9a0b2f | 309 | Under Linux 2.0 and earlier, |
69119dc7 | 310 | .I /proc/[pid]/exe |
c13182ef MK |
311 | is a pointer to the binary which was executed, |
312 | and appears as a symbolic link. | |
313 | A | |
fea681da MK |
314 | .BR readlink (2) |
315 | call on this file under Linux 2.0 returns a string in the format: | |
316 | ||
59a40ed7 | 317 | [device]:inode |
fea681da MK |
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) | |
59a40ed7 MK |
323 | with the |
324 | .I \-inum | |
325 | option can be used to locate the file. | |
fea681da | 326 | .TP |
d4529654 | 327 | .I /proc/[pid]/fd/ |
fea681da MK |
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 | |
c13182ef | 330 | symbolic link to the actual file. |
f78ed33a | 331 | Thus, 0 is standard input, 1 standard output, 2 standard error, and so on. |
fea681da | 332 | |
f75715e0 MK |
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. | |
d4529654 MF |
336 | A |
337 | .BR readlink (2) | |
338 | call on this file returns a string in the format: | |
f75715e0 | 339 | |
d4529654 | 340 | type:[inode] |
f75715e0 MK |
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 | |
d4529654 MF |
347 | .IR /proc/net/ . |
348 | ||
2b7a2ac5 MK |
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 | ||
d4529654 | 369 | .\"The following was still true as at kernel 2.6.13 |
afcaf646 | 370 | In a multithreaded process, the contents of this directory |
c13182ef | 371 | are not available if the main thread has already terminated |
afcaf646 MK |
372 | (typically by calling |
373 | .BR pthread_exit (3)). | |
374 | ||
59a40ed7 MK |
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 | |
69119dc7 | 381 | .IR /proc/[pid]/fd . |
59a40ed7 MK |
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: | |
a08ea57c | 387 | .in +4n |
fea681da MK |
388 | .nf |
389 | ||
b43a3b30 | 390 | .RB "$" " foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ..." |
fea681da | 391 | .fi |
a08ea57c MK |
392 | .in |
393 | ||
fea681da MK |
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 | ||
59a40ed7 MK |
400 | .I /proc/self/fd/N |
401 | is approximately the same as | |
402 | .I /dev/fd/N | |
008f1ecc | 403 | in some UNIX and UNIX-like systems. |
c13182ef | 404 | Most Linux MAKEDEV scripts symbolically link |
59a40ed7 MK |
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 | ||
b43a3b30 | 426 | .RB "$" " foobar \-i /dev/stdin \-o /dev/stdout ..." |
59a40ed7 MK |
427 | .fi |
428 | .in | |
69ab425e MK |
429 | .\" FIXME Describe /proc/[pid]/loginuid |
430 | .\" Added in 2.6.11; updating requires CAP_AUDIT_CONTROL | |
431 | .\" CONFIG_AUDITSYSCALL | |
432 | .TP | |
7e07d950 | 433 | .IR /proc/[pid]/fdinfo/ " (since Linux 2.6.22)" |
69ab425e MK |
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. | |
43a8bfc6 MK |
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 | .\" | |
fa1d49a6 | 467 | .\" Basically, the /proc/PID/fdinfo/ entry for an inotify FD |
43a8bfc6 MK |
468 | .\" includes the file handles for all watched FDs |
469 | .\" | |
0ca2fc4d PS |
470 | .TP |
471 | .IR /proc/[pid]/io " (since kernel 2.6.20)" | |
68f11066 MK |
472 | .\" commit 7c3ab7381e79dfc7db14a67c6f4f3285664e1ec2 |
473 | This file contains I/O statistics for the process, for example: | |
0ca2fc4d PS |
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 | |
68f11066 MK |
490 | .TP |
491 | .IR rchar ": characters read" | |
0ca2fc4d PS |
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) | |
68f11066 | 495 | and similar system calls. |
11256884 | 496 | It includes things such as terminal I/O and |
68f11066 MK |
497 | is unaffected by whether or not actual |
498 | physical disk I/O was required (the read might have been satisfied from | |
0ca2fc4d | 499 | pagecache). |
68f11066 MK |
500 | .TP |
501 | .IR wchar ": characters written" | |
0ca2fc4d PS |
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 . | |
68f11066 MK |
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 | |
0ca2fc4d PS |
510 | .BR read (2) |
511 | and | |
512 | .BR pread (2). | |
68f11066 MK |
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 | |
0ca2fc4d PS |
517 | .BR write (2) |
518 | and | |
519 | .BR pwrite (2). | |
68f11066 MK |
520 | .TP |
521 | .IR read_bytes ": bytes read" | |
0ca2fc4d PS |
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. | |
68f11066 MK |
525 | .TP |
526 | .IR write_bytes ": bytes written" | |
0ca2fc4d PS |
527 | Attempt to count the number of bytes which this process caused to be sent to |
528 | the storage layer. | |
68f11066 | 529 | .TP |
0ca2fc4d | 530 | .IR cancelled_write_bytes : |
0ca2fc4d PS |
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. | |
68f11066 | 535 | In other words: this field represents the number of bytes which this process |
0ca2fc4d | 536 | caused to not happen, by truncating pagecache. |
68f11066 | 537 | A task can cause "negative" I/O too. |
0ca2fc4d | 538 | If this task truncates some dirty pagecache, |
68f11066 MK |
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 | |
0ca2fc4d PS |
544 | .IP |
545 | .IR Note : | |
68f11066 | 546 | In the current implementation, things are a bit racy on 32-bit systems: |
0ca2fc4d PS |
547 | if process A reads process B's |
548 | .I /proc/[pid]/io | |
68f11066 | 549 | while process B is updating one of these 64-bit counters, |
0ca2fc4d | 550 | process A could see an intermediate result. |
f6e17121 | 551 | .TP |
ccdc8958 | 552 | .IR /proc/[pid]/gid_map " (since Linux 3.5)" |
149eeb7b MK |
553 | See the description of |
554 | .IR /proc/[pid]/uid_map . | |
f6e17121 | 555 | |
69ab425e | 556 | .TP |
7e07d950 | 557 | .IR /proc/[pid]/limits " (since Linux 2.6.24)" |
69ab425e MK |
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. | |
b4f89985 PE |
566 | .TP |
567 | .IR /proc/[pid]/map_files/ " (since kernel 3.3) | |
18cdd0ac MK |
568 | .\" commit 640708a2cff7f81e246243b0073c66e6ece7e53e |
569 | This subdirectory contains entries corresponding to memory-mapped | |
b4f89985 PE |
570 | files (see |
571 | .BR mmap (2)). | |
18cdd0ac MK |
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: | |
b4f89985 PE |
576 | .in +4n |
577 | .nf | |
578 | ||
f2aa4dcc | 579 | .RB "#" " ls -l /proc/self/map_files/" |
18cdd0ac MK |
580 | lr\-\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:31 |
581 | 3252e00000\-3252e20000 \-> /usr/lib64/ld-2.15.so | |
b4f89985 PE |
582 | \&... |
583 | .fi | |
584 | .in | |
585 | ||
586 | Although these entries are present for memory regions that were | |
d6a56978 | 587 | mapped with the |
b4f89985 | 588 | .BR MAP_FILE |
18cdd0ac | 589 | flag, the way anonymous shared memory (regions created with the |
b4f89985 PE |
590 | .B MAP_ANON | MAP_SHARED |
591 | flags) | |
592 | is implemented in Linux | |
18cdd0ac MK |
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: | |
b4f89985 PE |
597 | .in +4n |
598 | .nf | |
599 | ||
600 | .RB | |
18cdd0ac MK |
601 | lrw\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:33 |
602 | 7fc075d2f000\-7fc075e6f000 \-> /dev/zero (deleted) | |
b4f89985 PE |
603 | .fi |
604 | .in | |
605 | ||
606 | This directory appears only if the | |
607 | .B CONFIG_CHECKPOINT_RESTORE | |
608 | kernel configuration option is enabled. | |
f2aa4dcc MK |
609 | Privilege |
610 | .RB ( CAP_SYS_ADMIN ) | |
611 | .\" FIXME | |
612 | .\" This may change. See the mail thread | |
613 | .\" [RFC][PATCH v2] procfs: Always expose /proc/<pid>/map_files/ and make it readable | |
614 | .\" from Jan 2015 | |
615 | is required to view the contents of this directory. | |
fea681da | 616 | .TP |
69119dc7 | 617 | .I /proc/[pid]/maps |
fea681da MK |
618 | A file containing the currently mapped memory regions and their access |
619 | permissions. | |
bbf9f397 MK |
620 | See |
621 | .BR mmap (2) | |
622 | for some further information about memory mappings. | |
fea681da | 623 | |
dd0c3b96 | 624 | The format of the file is: |
fea681da | 625 | |
21781757 | 626 | .in -7n |
fea681da MK |
627 | .nf |
628 | .ft CW | |
fea681da | 629 | .ft |
21781757 MK |
630 | .I "address perms offset dev inode pathname" |
631 | 00400000-00452000 r-xp 00000000 08:02 173521 /usr/bin/dbus-daemon | |
632 | 00651000-00652000 r--p 00051000 08:02 173521 /usr/bin/dbus-daemon | |
633 | 00652000-00655000 rw-p 00052000 08:02 173521 /usr/bin/dbus-daemon | |
634 | 00e03000-00e24000 rw-p 00000000 00:00 0 [heap] | |
635 | 00e24000-011f7000 rw-p 00000000 00:00 0 [heap] | |
182090db | 636 | \&... |
21781757 MK |
637 | 35b1800000-35b1820000 r-xp 00000000 08:02 135522 /usr/lib64/ld-2.15.so |
638 | 35b1a1f000-35b1a20000 r--p 0001f000 08:02 135522 /usr/lib64/ld-2.15.so | |
639 | 35b1a20000-35b1a21000 rw-p 00020000 08:02 135522 /usr/lib64/ld-2.15.so | |
7d2e6d74 | 640 | 35b1a21000-35b1a22000 rw-p 00000000 00:00 0 |
21781757 MK |
641 | 35b1c00000-35b1dac000 r-xp 00000000 08:02 135870 /usr/lib64/libc-2.15.so |
642 | 35b1dac000-35b1fac000 ---p 001ac000 08:02 135870 /usr/lib64/libc-2.15.so | |
643 | 35b1fac000-35b1fb0000 r--p 001ac000 08:02 135870 /usr/lib64/libc-2.15.so | |
644 | 35b1fb0000-35b1fb2000 rw-p 001b0000 08:02 135870 /usr/lib64/libc-2.15.so | |
182090db | 645 | \&... |
21781757 | 646 | f2c6ff8c000-7f2c7078c000 rw-p 00000000 00:00 0 [stack:986] |
182090db | 647 | \&... |
21781757 MK |
648 | 7fffb2c0d000-7fffb2c2e000 rw-p 00000000 00:00 0 [stack] |
649 | 7fffb2d48000-7fffb2d49000 r-xp 00000000 00:00 0 [vdso] | |
fea681da | 650 | .fi |
21781757 | 651 | .in |
fea681da | 652 | |
7d2e6d74 | 653 | The |
3eb8c588 MK |
654 | .I address |
655 | field is the address space in the process that the mapping occupies. | |
656 | The | |
657 | .I perms | |
658 | field is a set of permissions: | |
fea681da MK |
659 | |
660 | .nf | |
661 | .in +5 | |
662 | r = read | |
663 | w = write | |
664 | x = execute | |
665 | s = shared | |
666 | p = private (copy on write) | |
667 | .fi | |
668 | .in | |
669 | ||
3eb8c588 MK |
670 | The |
671 | .I offset | |
b844cf04 | 672 | field is the offset into the file/whatever; |
3eb8c588 MK |
673 | .I dev |
674 | is the device | |
dd0c3b96 | 675 | (major:minor); |
3eb8c588 MK |
676 | .I inode |
677 | is the inode on that device. | |
59a40ed7 | 678 | 0 indicates that no inode is associated with the memory region, |
16e64bae | 679 | as would be the case with BSS (uninitialized data). |
fea681da | 680 | |
3eb8c588 MK |
681 | The |
682 | .I pathname | |
683 | field will usually be the file that is backing the mapping. | |
491ea6f1 | 684 | For ELF files, |
3eb8c588 MK |
685 | you can easily coordinate with the |
686 | .I offset | |
687 | field by looking at the | |
491ea6f1 MK |
688 | Offset field in the ELF program headers |
689 | .RI ( "readelf\ \-l" ). | |
37d32c38 | 690 | |
491ea6f1 | 691 | There are additional helpful pseudo-paths: |
61b0b1f4 MK |
692 | .RS 12 |
693 | .TP | |
694 | .IR [stack] | |
16e64bae | 695 | The initial process's (also known as the main thread's) stack. |
61b0b1f4 | 696 | .TP |
3eb8c588 | 697 | .IR [stack:<tid>] " (since Linux 3.4)" |
a60894c5 | 698 | .\" commit b76437579d1344b612cf1851ae610c636cec7db0 |
61b0b1f4 | 699 | A thread's stack (where the |
3eb8c588 | 700 | .IR <tid> |
61b0b1f4 | 701 | is a thread ID). |
491ea6f1 | 702 | It corresponds to the |
3eb8c588 | 703 | .IR /proc/[pid]/task/[tid]/ |
37d32c38 | 704 | path. |
61b0b1f4 | 705 | .TP |
7d2e6d74 | 706 | .IR [vdso] |
61b0b1f4 MK |
707 | The virtual dynamically linked shared object. |
708 | .TP | |
7d2e6d74 | 709 | .IR [heap] |
61b0b1f4 MK |
710 | The process's heap. |
711 | .in | |
61b0b1f4 MK |
712 | .RE |
713 | .IP | |
3eb8c588 MK |
714 | If the |
715 | .I pathname | |
716 | field is blank, | |
491ea6f1 | 717 | this is an anonymous mapping as obtained via the |
37d32c38 | 718 | .BR mmap (2) |
491ea6f1 | 719 | function. |
61b0b1f4 MK |
720 | There is no easy way to coordinate this back to a process's source, |
721 | short of running it through | |
491ea6f1 MK |
722 | .BR gdb (1), |
723 | .BR strace (1), | |
724 | or similar. | |
37d32c38 | 725 | |
eb9a0b2f | 726 | Under Linux 2.0, there is no field giving pathname. |
fea681da | 727 | .TP |
69119dc7 | 728 | .I /proc/[pid]/mem |
fea681da MK |
729 | This file can be used to access the pages of a process's memory through |
730 | .BR open (2), | |
731 | .BR read (2), | |
732 | and | |
ccb2bb0d | 733 | .BR lseek (2). |
b4e9ee8f | 734 | .TP |
69119dc7 | 735 | .IR /proc/[pid]/mountinfo " (since Linux 2.6.26)" |
b4e9ee8f MK |
736 | .\" This info adapted from Documentation/filesystems/proc.txt |
737 | This file contains information about mount points. | |
738 | It contains lines of the form: | |
739 | .nf | |
740 | .ft CW | |
b4e9ee8f MK |
741 | |
742 | 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue | |
743 | (1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11) | |
b4e9ee8f MK |
744 | .ft |
745 | .fi | |
746 | .IP | |
747 | The numbers in parentheses are labels for the descriptions below: | |
3bc960c2 | 748 | .RS 7 |
b4e9ee8f MK |
749 | .TP 5 |
750 | (1) | |
751 | mount ID: unique identifier of the mount (may be reused after | |
752 | .BR umount (2)). | |
753 | .TP | |
754 | (2) | |
755 | parent ID: ID of parent mount (or of self for the top of the mount tree). | |
756 | .TP | |
757 | (3) | |
758 | major:minor: value of | |
759 | .I st_dev | |
9ee4a2b6 | 760 | for files on filesystem (see |
b4e9ee8f MK |
761 | .BR stat (2)). |
762 | .TP | |
763 | (4) | |
9ee4a2b6 | 764 | root: root of the mount within the filesystem. |
b4e9ee8f MK |
765 | .TP |
766 | (5) | |
767 | mount point: mount point relative to the process's root. | |
768 | .TP | |
769 | (6) | |
770 | mount options: per-mount options. | |
771 | .TP | |
772 | (7) | |
773 | optional fields: zero or more fields of the form "tag[:value]". | |
774 | .TP | |
775 | (8) | |
776 | separator: marks the end of the optional fields. | |
777 | .TP | |
778 | (9) | |
9ee4a2b6 | 779 | filesystem type: name of filesystem in the form "type[.subtype]". |
b4e9ee8f MK |
780 | .TP |
781 | (10) | |
9ee4a2b6 | 782 | mount source: filesystem-specific information or "none". |
b4e9ee8f MK |
783 | .TP |
784 | (11) | |
68d86eac | 785 | super options: per-superblock options. |
b4e9ee8f MK |
786 | .RE |
787 | .IP | |
788 | Parsers should ignore all unrecognized optional fields. | |
789 | Currently the possible optional fields are: | |
790 | .RS 12 | |
791 | .TP 18 | |
792 | shared:X | |
793 | mount is shared in peer group X | |
794 | .TP | |
795 | master:X | |
796 | mount is slave to peer group X | |
797 | .TP | |
798 | propagate_from:X | |
799 | mount is slave and receives propagation from peer group X (*) | |
800 | .TP | |
801 | unbindable | |
802 | mount is unbindable | |
803 | .RE | |
804 | .IP | |
805 | (*) X is the closest dominant peer group under the process's root. | |
806 | If X is the immediate master of the mount, | |
807 | or if there is no dominant peer group under the same root, | |
808 | then only the "master:X" field is present | |
809 | and not the "propagate_from:X" field. | |
810 | ||
811 | For more information on mount propagation see: | |
812 | .I Documentation/filesystems/sharedsubtree.txt | |
66a9882e | 813 | in the Linux kernel source tree. |
b4e9ee8f | 814 | .TP |
cea61382 | 815 | .IR /proc/[pid]/mounts " (since Linux 2.4.19)" |
9ee4a2b6 | 816 | This is a list of all the filesystems currently mounted in the |
732e54dd | 817 | process's mount namespace. |
cea61382 MK |
818 | The format of this file is documented in |
819 | .BR fstab (5). | |
820 | Since kernel version 2.6.15, this file is pollable: | |
821 | after opening the file for reading, a change in this file | |
9ee4a2b6 | 822 | (i.e., a filesystem mount or unmount) causes |
cea61382 MK |
823 | .BR select (2) |
824 | to mark the file descriptor as readable, and | |
825 | .BR poll (2) | |
826 | and | |
827 | .BR epoll_wait (2) | |
828 | mark the file as having an error condition. | |
357002ec MK |
829 | See |
830 | .BR namespaces (7) | |
831 | for more information. | |
cea61382 | 832 | .TP |
69119dc7 | 833 | .IR /proc/[pid]/mountstats " (since Linux 2.6.17)" |
783a6233 | 834 | This file exports information (statistics, configuration information) |
0bafc692 | 835 | about the mount points in the process's mount namespace. |
b4e9ee8f MK |
836 | Lines in this file have the form: |
837 | .nf | |
838 | ||
839 | device /dev/sda7 mounted on /home with fstype ext3 [statistics] | |
840 | ( 1 ) ( 2 ) (3 ) (4) | |
841 | .fi | |
842 | .IP | |
843 | The fields in each line are: | |
3bc960c2 | 844 | .RS 7 |
b4e9ee8f MK |
845 | .TP 5 |
846 | (1) | |
847 | The name of the mounted device | |
848 | (or "nodevice" if there is no corresponding device). | |
849 | .TP | |
850 | (2) | |
9ee4a2b6 | 851 | The mount point within the filesystem tree. |
b4e9ee8f MK |
852 | .TP |
853 | (3) | |
9ee4a2b6 | 854 | The filesystem type. |
b4e9ee8f MK |
855 | .TP |
856 | (4) | |
857 | Optional statistics and configuration information. | |
9ee4a2b6 | 858 | Currently (as at Linux 2.6.26), only NFS filesystems export |
b4e9ee8f MK |
859 | information via this field. |
860 | .RE | |
861 | .IP | |
90878f7c | 862 | This file is readable only by the owner of the process. |
4716a1dd MK |
863 | |
864 | See | |
865 | .BR namespaces (7) | |
866 | for more information. | |
b4e9ee8f | 867 | .TP |
b4a185e5 | 868 | .IR /proc/[pid]/ns/ " (since Linux 3.0)" |
2c4201f0 | 869 | .\" See commit 6b4e306aa3dc94a0545eb9279475b1ab6209a31f |
b4a185e5 EB |
870 | This is a subdirectory containing one entry for each namespace that |
871 | supports being manipulated by | |
80e63655 | 872 | .BR setns (2). |
cf8bfe6d MK |
873 | For more information, see |
874 | .BR namespaces (7). | |
ec1dd85d | 875 | |
b4a185e5 | 876 | .TP |
69119dc7 | 877 | .IR /proc/[pid]/numa_maps " (since Linux 2.6.14)" |
610f75cc MK |
878 | See |
879 | .BR numa (7). | |
7388733a | 880 | .TP |
69119dc7 | 881 | .IR /proc/[pid]/oom_adj " (since Linux 2.6.11)" |
b4e9ee8f | 882 | This file can be used to adjust the score used to select which process |
0425de01 | 883 | should be killed in an out-of-memory (OOM) situation. |
b4e9ee8f MK |
884 | The kernel uses this value for a bit-shift operation of the process's |
885 | .IR oom_score | |
886 | value: | |
5b8dbfd4 MK |
887 | valid values are in the range \-16 to +15, |
888 | plus the special value \-17, | |
b4e9ee8f MK |
889 | which disables OOM-killing altogether for this process. |
890 | A positive score increases the likelihood of this | |
891 | process being killed by the OOM-killer; | |
892 | a negative score decreases the likelihood. | |
de8e9cc1 | 893 | .IP |
b4e9ee8f MK |
894 | The default value for this file is 0; |
895 | a new process inherits its parent's | |
896 | .I oom_adj | |
897 | setting. | |
898 | A process must be privileged | |
899 | .RB ( CAP_SYS_RESOURCE ) | |
900 | to update this file. | |
f2c8b197 MK |
901 | .IP |
902 | Since Linux 2.6.36, use of this file is deprecated in favor of | |
903 | .IR /proc/[pid]/oom_score_adj . | |
b4e9ee8f | 904 | .TP |
69119dc7 | 905 | .IR /proc/[pid]/oom_score " (since Linux 2.6.11)" |
b4e9ee8f MK |
906 | .\" See mm/oom_kill.c::badness() in the 2.6.25 sources |
907 | This file displays the current score that the kernel gives to | |
908 | this process for the purpose of selecting a process | |
909 | for the OOM-killer. | |
910 | A higher score means that the process is more likely to be | |
911 | selected by the OOM-killer. | |
912 | The basis for this score is the amount of memory used by the process, | |
913 | with increases (+) or decreases (\-) for factors including: | |
914 | .\" See mm/oom_kill.c::badness() in the 2.6.25 sources | |
915 | .RS | |
916 | .IP * 2 | |
917 | whether the process creates a lot of children using | |
918 | .BR fork (2) | |
919 | (+); | |
920 | .IP * | |
921 | whether the process has been running a long time, | |
922 | or has used a lot of CPU time (\-); | |
923 | .IP * | |
924 | whether the process has a low nice value (i.e., > 0) (+); | |
925 | .IP * | |
926 | whether the process is privileged (\-); and | |
927 | .\" More precisely, if it has CAP_SYS_ADMIN or CAP_SYS_RESOURCE | |
928 | .IP * | |
929 | whether the process is making direct hardware access (\-). | |
930 | .\" More precisely, if it has CAP_SYS_RAWIO | |
931 | .RE | |
932 | .IP | |
933 | The | |
934 | .I oom_score | |
f2c8b197 MK |
935 | also reflects the adjustment specified by the |
936 | .I oom_score_adj | |
937 | or | |
b4e9ee8f MK |
938 | .I oom_adj |
939 | setting for the process. | |
f2c8b197 MK |
940 | .TP |
941 | .IR /proc/[pid]/oom_score_adj " (since Linux 2.6.36)" | |
942 | .\" Text taken from 3.7 Documentation/filesystems/proc.txt | |
943 | This file can be used to adjust the badness heuristic used to select which | |
944 | process gets killed in out-of-memory conditions. | |
945 | ||
946 | The badness heuristic assigns a value to each candidate task ranging from 0 | |
947 | (never kill) to 1000 (always kill) to determine which process is targeted. | |
948 | The units are roughly a proportion along that range of | |
949 | allowed memory the process may allocate from, | |
950 | based on an estimation of its current memory and swap use. | |
951 | For example, if a task is using all allowed memory, | |
952 | its badness score will be 1000. | |
953 | If it is using half of its allowed memory, its score will be 500. | |
954 | ||
955 | There is an additional factor included in the badness score: root | |
956 | processes are given 3% extra memory over other tasks. | |
957 | ||
958 | The amount of "allowed" memory depends on the context | |
0633f951 | 959 | in which the OOM-killer was called. |
f2c8b197 MK |
960 | If it is due to the memory assigned to the allocating task's cpuset |
961 | being exhausted, | |
962 | the allowed memory represents the set of mems assigned to that | |
963 | cpuset (see | |
964 | .BR cpuset (7)). | |
965 | If it is due to a mempolicy's node(s) being exhausted, | |
966 | the allowed memory represents the set of mempolicy nodes. | |
967 | If it is due to a memory limit (or swap limit) being reached, | |
968 | the allowed memory is that configured limit. | |
969 | Finally, if it is due to the entire system being out of memory, the | |
970 | allowed memory represents all allocatable resources. | |
971 | ||
972 | The value of | |
0633f951 | 973 | .I oom_score_adj |
f2c8b197 MK |
974 | is added to the badness score before it |
975 | is used to determine which task to kill. | |
976 | Acceptable values range from \-1000 | |
977 | (OOM_SCORE_ADJ_MIN) to +1000 (OOM_SCORE_ADJ_MAX). | |
0633f951 | 978 | This allows user space to control the preference for OOM-killing, |
f2c8b197 | 979 | ranging from always preferring a certain |
f082ada4 | 980 | task or completely disabling it from OOM killing. |
f2c8b197 | 981 | The lowest possible value, \-1000, is |
0633f951 | 982 | equivalent to disabling OOM-killing entirely for that task, |
f2c8b197 MK |
983 | since it will always report a badness score of 0. |
984 | ||
985 | Consequently, it is very simple for user space to define | |
986 | the amount of memory to consider for each task. | |
987 | Setting a | |
988 | .I oom_score_adj | |
989 | value of +500, for example, | |
990 | is roughly equivalent to allowing the remainder of tasks sharing the | |
991 | same system, cpuset, mempolicy, or memory controller resources | |
992 | to use at least 50% more memory. | |
993 | A value of \-500, on the other hand, would be roughly | |
994 | equivalent to discounting 50% of the task's | |
995 | allowed memory from being considered as scoring against the task. | |
996 | ||
0633f951 | 997 | For backward compatibility with previous kernels, |
f2c8b197 MK |
998 | .I /proc/[pid]/oom_adj |
999 | can still be used to tune the badness score. | |
1000 | Its value is | |
9f1b9726 | 1001 | scaled linearly with |
f2c8b197 MK |
1002 | .IR oom_score_adj . |
1003 | ||
1004 | Writing to | |
1005 | .IR /proc/[pid]/oom_score_adj | |
1006 | or | |
1007 | .IR /proc/[pid]/oom_adj | |
1008 | will change the other with its scaled value. | |
b0aa1e51 MK |
1009 | .TP |
1010 | .IR /proc/[pid]/pagemap " (since Linux 2.6.25)" | |
1011 | This file shows the mapping of each of the process's virtual pages | |
1012 | into physical page frames or swap area. | |
1013 | It contains one 64-bit value for each virtual page, | |
1014 | with the bits set as follows: | |
1015 | .RS 12 | |
1016 | .TP | |
1017 | 63 | |
1018 | If set, the page is present in RAM. | |
1019 | .TP | |
1020 | 62 | |
1021 | If set, the page is in swap space | |
1022 | .TP | |
1023 | 61 (since Linux 3.5) | |
1024 | The page is a file-mapped page or a shared anonymous page. | |
1025 | .TP | |
1026 | 60-56 (since Linux 3.11) | |
1027 | Zero | |
1028 | .\" Not quite true; see commit 541c237c0923f567c9c4cabb8a81635baadc713f | |
1029 | .TP | |
1030 | 55 (Since Linux 3.11) | |
1031 | PTE is soft-dirty | |
1032 | (see the kernel source file | |
1033 | .IR Documentation/vm/soft-dirty.txt ). | |
1034 | .TP | |
1035 | 54-0 | |
1036 | If the page is present in RAM (bit 63), then these bits | |
1037 | provide the page frame number, which can be used to index | |
1038 | .IR /proc/kpageflags | |
1039 | and | |
1040 | .IR /proc/kpagecount . | |
1041 | If the page is present in swap (bit 62), | |
1042 | then bits 4-0 give the swap type, and bits 54-5 encode the swap offset. | |
1043 | .RE | |
1044 | .IP | |
1045 | Before Linux 3.11, bits 60-55 were | |
1046 | used to encode the base-2 log of the page size. | |
1047 | .IP | |
1048 | To employ | |
1049 | .IR /proc/[pid]/pagemap | |
1050 | efficiently, use | |
1051 | .IR /proc/[pid]/maps | |
1052 | to determine which areas of memory are actually mapped and seek | |
1053 | to skip over unmapped regions. | |
1054 | .IP | |
1055 | The | |
1056 | .IR /proc/[pid]/pagemap | |
1057 | file is present only if the | |
1058 | .B CONFIG_PROC_PAGE_MONITOR | |
1059 | kernel configuration option is enabled. | |
7c2905d1 MK |
1060 | .TP |
1061 | .IR /proc/[pid]/personality " (since Linux 2.6.28)" | |
1062 | .\" commit 478307230810d7e2a753ed220db9066dfdf88718 | |
1063 | This read-only file exposes the process's execution domain, as set by | |
1064 | .BR personality (2). | |
1065 | The value is displayed in hexadecimal notation. | |
fea681da | 1066 | .TP |
69119dc7 | 1067 | .I /proc/[pid]/root |
008f1ecc | 1068 | UNIX and Linux support the idea of a per-process root of the |
9ee4a2b6 | 1069 | filesystem, set by the |
fea681da | 1070 | .BR chroot (2) |
c13182ef MK |
1071 | system call. |
1072 | This file is a symbolic link that points to the process's | |
14d70713 MK |
1073 | root directory, and behaves in the same way as |
1074 | .IR exe , | |
1075 | and | |
1076 | .IR fd/* . | |
afcaf646 MK |
1077 | |
1078 | .\" The following was still true as at kernel 2.6.13 | |
c13182ef MK |
1079 | In a multithreaded process, the contents of this symbolic link |
1080 | are not available if the main thread has already terminated | |
afcaf646 MK |
1081 | (typically by calling |
1082 | .BR pthread_exit (3)). | |
f34f0182 MK |
1083 | .\" FIXME Describe /proc/[pid]/projid_map |
1084 | .\" Added in 3.7, commit f76d207a66c3a53defea67e7d36c3eb1b7d6d61d | |
69119dc7 | 1085 | .\" FIXME Describe /proc/[pid]/seccomp |
6aefb6df | 1086 | .\" Added in 2.6.12 |
bea08fec | 1087 | .\" |
69119dc7 | 1088 | .\" FIXME Describe /proc/[pid]/sessionid |
b4e9ee8f | 1089 | .\" Added in 2.6.25; read-only; only readable by real UID |
b3fb99e8 | 1090 | .\" commit 1e0bd7550ea9cf474b1ad4c6ff5729a507f75fdc |
b4e9ee8f | 1091 | .\" CONFIG_AUDITSYSCALL |
bea08fec | 1092 | .\" |
69119dc7 | 1093 | .\" FIXME Describe /proc/[pid]/sched |
b4e9ee8f MK |
1094 | .\" Added in 2.6.23 |
1095 | .\" CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS | |
1096 | .\" Displays various scheduling parameters | |
1097 | .\" This file can be written, to reset stats | |
ef4f4031 | 1098 | .\" The set of fields exposed by this file have changed |
b3fb99e8 MK |
1099 | .\" significantly over time. |
1100 | .\" commit 43ae34cb4cd650d1eb4460a8253a8e747ba052ac | |
1101 | .\" | |
69119dc7 MK |
1102 | .\" FIXME Describe /proc/[pid]/schedstats and |
1103 | .\" /proc/[pid]/task/[tid]/schedstats | |
b4e9ee8f MK |
1104 | .\" Added in 2.6.9 |
1105 | .\" CONFIG_SCHEDSTATS | |
fea681da | 1106 | .TP |
69119dc7 | 1107 | .IR /proc/[pid]/smaps " (since Linux 2.6.14)" |
b07b19c4 | 1108 | This file shows memory consumption for each of the process's mappings. |
859503c3 MK |
1109 | (The |
1110 | .BR pmap (1) | |
1111 | command displays similar information, | |
1112 | in a form that may be easier for parsing.) | |
1f0add28 | 1113 | For each mapping there is a series of lines such as the following: |
a08ea57c | 1114 | .in +4n |
b07b19c4 MK |
1115 | .nf |
1116 | ||
1f0add28 | 1117 | 00400000-0048a000 r-xp 00000000 fd:03 960637 /bin/bash |
95fe794d PG |
1118 | Size: 552 kB |
1119 | Rss: 460 kB | |
1120 | Pss: 100 kB | |
1121 | Shared_Clean: 452 kB | |
1122 | Shared_Dirty: 0 kB | |
1123 | Private_Clean: 8 kB | |
1124 | Private_Dirty: 0 kB | |
1125 | Referenced: 460 kB | |
1126 | Anonymous: 0 kB | |
1127 | AnonHugePages: 0 kB | |
1128 | Swap: 0 kB | |
1129 | KernelPageSize: 4 kB | |
1130 | MMUPageSize: 4 kB | |
1131 | Locked: 0 kB | |
b07b19c4 MK |
1132 | |
1133 | .fi | |
a08ea57c | 1134 | .in |
b07b19c4 MK |
1135 | The first of these lines shows the same information as is displayed |
1136 | for the mapping in | |
69119dc7 | 1137 | .IR /proc/[pid]/maps . |
b07b19c4 | 1138 | The remaining lines show the size of the mapping, |
95fe794d PG |
1139 | the amount of the mapping that is currently resident in RAM ("Rss"), |
1140 | the process' proportional share of this mapping ("Pss"), | |
1f0add28 | 1141 | the number of clean and dirty shared pages in the mapping, |
c7ce200d | 1142 | and the number of clean and dirty private pages in the mapping. |
95fe794d | 1143 | "Referenced" indicates the amount of memory currently marked as |
1f0add28 MK |
1144 | referenced or accessed. |
1145 | "Anonymous" shows the amount of memory | |
1146 | that does not belong to any file. | |
1147 | "Swap" shows how much | |
95fe794d PG |
1148 | would-be-anonymous memory is also used, but out on swap. |
1149 | ||
d6a56978 | 1150 | The "KernelPageSize" entry is the page size used by the kernel to back a VMA. |
1f0add28 MK |
1151 | This matches the size used by the MMU in the majority of cases. |
1152 | However, one counter-example occurs on PPC64 kernels | |
1153 | whereby a kernel using 64K as a base page size may still use 4K | |
1154 | pages for the MMU on older processors. | |
1155 | To distinguish, this | |
1156 | patch reports "MMUPageSize" as the page size used by the MMU. | |
95fe794d PG |
1157 | |
1158 | The "Locked" indicates whether the mapping is locked in memory | |
1159 | or not. | |
1160 | ||
1161 | "VmFlags" field represents the kernel flags associated with | |
1f0add28 MK |
1162 | the particular virtual memory area in two letter encoded manner. |
1163 | The codes are the following: | |
1164 | ||
95fe794d | 1165 | rd - readable |
1f0add28 | 1166 | wr - writable |
95fe794d PG |
1167 | ex - executable |
1168 | sh - shared | |
1169 | mr - may read | |
1170 | mw - may write | |
1171 | me - may execute | |
1172 | ms - may share | |
723e333c | 1173 | gd - stack segment grows down |
95fe794d PG |
1174 | pf - pure PFN range |
1175 | dw - disabled write to the mapped file | |
1176 | lo - pages are locked in memory | |
1177 | io - memory mapped I/O area | |
1178 | sr - sequential read advise provided | |
1179 | rr - random read advise provided | |
1180 | dc - do not copy area on fork | |
1181 | de - do not expand area on remapping | |
1182 | ac - area is accountable | |
1183 | nr - swap space is not reserved for the area | |
1184 | ht - area uses huge tlb pages | |
1185 | nl - non-linear mapping | |
1186 | ar - architecture specific flag | |
1187 | dd - do not include area into core dump | |
1188 | sd - soft-dirty flag | |
1189 | mm - mixed map area | |
1190 | hg - huge page advise flag | |
1191 | nh - no-huge page advise flag | |
b5408a0f | 1192 | mg - mergeable advise flag |
b07b19c4 | 1193 | |
e618d945 MK |
1194 | The |
1195 | .IR /proc/[pid]/smaps | |
1196 | file is present only if the | |
1197 | .B CONFIG_PROC_PAGE_MONITOR | |
1198 | kernel configuration option is enabled. | |
b07b19c4 | 1199 | .TP |
67aac6fb MK |
1200 | .IR /proc/[pid]/stack " (since Linux 2.6.29)" |
1201 | .\" 2ec220e27f5040aec1e88901c1b6ea3d135787ad | |
1202 | This file provides a symbolic trace of the function calls in this | |
1203 | process's kernel stack. | |
1204 | This file is provided only if the kernel was built with the | |
1205 | .B CONFIG_STACKTRACE | |
1206 | configuration option. | |
1207 | .TP | |
69119dc7 | 1208 | .I /proc/[pid]/stat |
c13182ef MK |
1209 | Status information about the process. |
1210 | This is used by | |
1211 | .BR ps (1). | |
082bf5b8 MK |
1212 | It is defined in the kernel source file |
1213 | .IR fs/proc/array.c "." | |
fea681da MK |
1214 | |
1215 | The fields, in order, with their proper | |
1216 | .BR scanf (3) | |
1217 | format specifiers, are: | |
1218 | .RS | |
62e4a418 MK |
1219 | .TP 10 |
1220 | (1) \fIpid\fP \ %d | |
1221 | .br | |
1222 | The process ID. | |
fea681da | 1223 | .TP |
62e4a418 MK |
1224 | (2) \fIcomm\fP \ %s |
1225 | The filename of the executable, in parentheses. | |
c13182ef | 1226 | This is visible whether or not the executable is swapped out. |
fea681da | 1227 | .TP |
62e4a418 | 1228 | (3) \fIstate\fP \ %c |
31293f37 MK |
1229 | One of the following characters, indicating process state: |
1230 | .RS | |
1231 | .IP R 3 | |
1232 | Running | |
1233 | .IP S | |
1234 | Sleeping in an interruptible wait | |
1235 | .IP D | |
1236 | Waiting in uninterruptible | |
1237 | disk sleep | |
1238 | .IP Z | |
1239 | Zombie | |
1240 | .IP T | |
1241 | Stopped (on a signal) or (before Linux 2.6.33) trace stopped | |
1242 | .IP t | |
1243 | .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29 | |
1244 | Tracing stop (Linux 2.6.33 onward) | |
1245 | .IP W | |
1246 | Paging (only before Linux 2.6.0) | |
1247 | .IP X | |
ef4f4031 | 1248 | Dead (from Linux 2.6.0 onward) |
31293f37 MK |
1249 | .IP x |
1250 | .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29 | |
1251 | Dead (Linux 2.6.33 to | |
1252 | .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457 | |
1253 | 3.13 only) | |
1254 | .IP K | |
1255 | .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29 | |
1256 | Wakekill (Linux 2.6.33 to | |
1257 | .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457 | |
1258 | 3.13 only) | |
1259 | .IP W | |
1260 | .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29 | |
1261 | Waking (Linux 2.6.33 to | |
1262 | .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457 | |
1263 | 3.13 only) | |
1264 | .IP P | |
1265 | .\" commit f2530dc71cf0822f90bb63ea4600caaef33a66bb | |
1266 | Parked (Linux 3.9 to | |
1267 | .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457 | |
1268 | 3.13 only) | |
1269 | .RE | |
fea681da | 1270 | .TP |
62e4a418 | 1271 | (4) \fIppid\fP \ %d |
e0fdc57c | 1272 | The PID of the parent of this process. |
fea681da | 1273 | .TP |
62e4a418 MK |
1274 | (5) \fIpgrp\fP \ %d |
1275 | The process group ID of the process. | |
fea681da | 1276 | .TP |
62e4a418 MK |
1277 | (6) \fIsession\fP \ %d |
1278 | The session ID of the process. | |
fea681da | 1279 | .TP |
62e4a418 MK |
1280 | (7) \fItty_nr\fP \ %d |
1281 | The controlling terminal of the process. | |
59a40ed7 MK |
1282 | (The minor device number is contained in the combination of bits |
1283 | 31 to 20 and 7 to 0; | |
b97deb97 | 1284 | the major device number is in bits 15 to 8.) |
fea681da | 1285 | .TP |
62e4a418 | 1286 | (8) \fItpgid\fP \ %d |
fea681da | 1287 | .\" This field and following, up to and including wchan added 0.99.1 |
62e4a418 | 1288 | The ID of the foreground process group of the controlling |
59a40ed7 | 1289 | terminal of the process. |
fea681da | 1290 | .TP |
62e4a418 MK |
1291 | (9) \fIflags\fP \ %u |
1292 | The kernel flags word of the process. | |
c13182ef | 1293 | For bit meanings, |
66a9882e | 1294 | see the PF_* defines in the Linux kernel source file |
00702acc | 1295 | .IR include/linux/sched.h . |
fea681da | 1296 | Details depend on the kernel version. |
62e4a418 MK |
1297 | |
1298 | The format for this field was %lu before Linux 2.6. | |
fea681da | 1299 | .TP |
ee566744 | 1300 | (10) \fIminflt\fP \ %lu |
62e4a418 | 1301 | The number of minor faults the process has made which have not |
fea681da MK |
1302 | required loading a memory page from disk. |
1303 | .TP | |
62e4a418 MK |
1304 | (11) \fIcminflt\fP \ %lu |
1305 | The number of minor faults that the process's | |
fea681da MK |
1306 | waited-for children have made. |
1307 | .TP | |
62e4a418 MK |
1308 | (12) \fImajflt\fP \ %lu |
1309 | The number of major faults the process has made which have | |
fea681da MK |
1310 | required loading a memory page from disk. |
1311 | .TP | |
62e4a418 MK |
1312 | (13) \fIcmajflt\fP \ %lu |
1313 | The number of major faults that the process's | |
fea681da MK |
1314 | waited-for children have made. |
1315 | .TP | |
62e4a418 MK |
1316 | (14) \fIutime\fP \ %lu |
1317 | Amount of time that this process has been scheduled in user mode, | |
7a017e24 | 1318 | measured in clock ticks (divide by |
67914165 | 1319 | .IR sysconf(_SC_CLK_TCK) ). |
a1c9dc59 MK |
1320 | This includes guest time, \fIguest_time\fP |
1321 | (time spent running a virtual CPU, see below), | |
1322 | so that applications that are not aware of the guest time field | |
1323 | do not lose that time from their calculations. | |
fea681da | 1324 | .TP |
62e4a418 MK |
1325 | (15) \fIstime\fP \ %lu |
1326 | Amount of time that this process has been scheduled in kernel mode, | |
7a017e24 | 1327 | measured in clock ticks (divide by |
67914165 | 1328 | .IR sysconf(_SC_CLK_TCK) ). |
fea681da | 1329 | .TP |
62e4a418 MK |
1330 | (16) \fIcutime\fP \ %ld |
1331 | Amount of time that this process's | |
7a017e24 MK |
1332 | waited-for children have been scheduled in user mode, |
1333 | measured in clock ticks (divide by | |
67914165 | 1334 | .IR sysconf(_SC_CLK_TCK) ). |
c13182ef | 1335 | (See also |
fea681da | 1336 | .BR times (2).) |
a1c9dc59 MK |
1337 | This includes guest time, \fIcguest_time\fP |
1338 | (time spent running a virtual CPU, see below). | |
fea681da | 1339 | .TP |
62e4a418 MK |
1340 | (17) \fIcstime\fP \ %ld |
1341 | Amount of time that this process's | |
7a017e24 MK |
1342 | waited-for children have been scheduled in kernel mode, |
1343 | measured in clock ticks (divide by | |
67914165 | 1344 | .IR sysconf(_SC_CLK_TCK) ). |
fea681da | 1345 | .TP |
62e4a418 MK |
1346 | (18) \fIpriority\fP \ %ld |
1347 | (Explanation for Linux 2.6) | |
59a40ed7 MK |
1348 | For processes running a real-time scheduling policy |
1349 | .RI ( policy | |
1350 | below; see | |
1351 | .BR sched_setscheduler (2)), | |
1352 | this is the negated scheduling priority, minus one; | |
1353 | that is, a number in the range \-2 to \-100, | |
1354 | corresponding to real-time priorities 1 to 99. | |
1355 | For processes running under a non-real-time scheduling policy, | |
1356 | this is the raw nice value | |
1357 | .RB ( setpriority (2)) | |
1358 | as represented in the kernel. | |
1359 | The kernel stores nice values as numbers | |
1360 | in the range 0 (high) to 39 (low), | |
1361 | corresponding to the user-visible nice range of \-20 to 19. | |
1362 | ||
1363 | Before Linux 2.6, this was a scaled value based on | |
1364 | the scheduler weighting given to this process. | |
1365 | .\" And back in kernel 1.2 days things were different again. | |
fea681da | 1366 | .TP |
62e4a418 MK |
1367 | (19) \fInice\fP \ %ld |
1368 | The nice value (see | |
59a40ed7 MK |
1369 | .BR setpriority (2)), |
1370 | a value in the range 19 (low priority) to \-20 (high priority). | |
1371 | .\" Back in kernel 1.2 days things were different. | |
fea681da MK |
1372 | .\" .TP |
1373 | .\" \fIcounter\fP %ld | |
1374 | .\" The current maximum size in jiffies of the process's next timeslice, | |
1375 | .\" or what is currently left of its current timeslice, if it is the | |
1376 | .\" currently running process. | |
1377 | .\" .TP | |
1378 | .\" \fItimeout\fP %u | |
1379 | .\" The time in jiffies of the process's next timeout. | |
0e94f77b | 1380 | .\" timeout was removed sometime around 2.1/2.2 |
aa610245 | 1381 | .TP |
62e4a418 MK |
1382 | (20) \fInum_threads\fP \ %ld |
1383 | Number of threads in this process (since Linux 2.6). | |
bb83d1b9 | 1384 | Before kernel 2.6, this field was hard coded to 0 as a placeholder |
0e94f77b | 1385 | for an earlier removed field. |
fea681da | 1386 | .TP |
62e4a418 MK |
1387 | (21) \fIitrealvalue\fP \ %ld |
1388 | The time in jiffies before the next | |
8bd58774 MK |
1389 | .B SIGALRM |
1390 | is sent to the process due to an interval timer. | |
0e94f77b MK |
1391 | Since kernel 2.6.17, this field is no longer maintained, |
1392 | and is hard coded as 0. | |
fea681da | 1393 | .TP |
62e4a418 MK |
1394 | (22) \fIstarttime\fP \ %llu |
1395 | The time the process started after system boot. | |
055024ed MK |
1396 | In kernels before Linux 2.6, this value was expressed in jiffies. |
1397 | Since Linux 2.6, the value is expressed in clock ticks (divide by | |
1398 | .IR sysconf(_SC_CLK_TCK) ). | |
62e4a418 MK |
1399 | |
1400 | The format for this field was %lu before Linux 2.6. | |
fea681da | 1401 | .TP |
62e4a418 MK |
1402 | (23) \fIvsize\fP \ %lu |
1403 | Virtual memory size in bytes. | |
fea681da | 1404 | .TP |
62e4a418 MK |
1405 | (24) \fIrss\fP \ %ld |
1406 | Resident Set Size: number of pages the process has in real memory. | |
c13182ef | 1407 | This is just the pages which |
5fab2e7c | 1408 | count toward text, data, or stack space. |
c13182ef | 1409 | This does not include pages |
fea681da MK |
1410 | which have not been demand-loaded in, or which are swapped out. |
1411 | .TP | |
62e4a418 MK |
1412 | (25) \fIrsslim\fP \ %lu |
1413 | Current soft limit in bytes on the rss of the process; | |
59a40ed7 MK |
1414 | see the description of |
1415 | .B RLIMIT_RSS | |
1416 | in | |
2b5407af | 1417 | .BR getrlimit (2). |
fea681da | 1418 | .TP |
62e4a418 MK |
1419 | (26) \fIstartcode\fP \ %lu |
1420 | The address above which program text can run. | |
fea681da | 1421 | .TP |
62e4a418 MK |
1422 | (27) \fIendcode\fP \ %lu |
1423 | The address below which program text can run. | |
fea681da | 1424 | .TP |
62e4a418 MK |
1425 | (28) \fIstartstack\fP \ %lu |
1426 | The address of the start (i.e., bottom) of the stack. | |
fea681da | 1427 | .TP |
62e4a418 MK |
1428 | (29) \fIkstkesp\fP \ %lu |
1429 | The current value of ESP (stack pointer), as found in the | |
fea681da MK |
1430 | kernel stack page for the process. |
1431 | .TP | |
62e4a418 MK |
1432 | (30) \fIkstkeip\fP \ %lu |
1433 | The current EIP (instruction pointer). | |
fea681da | 1434 | .TP |
62e4a418 MK |
1435 | (31) \fIsignal\fP \ %lu |
1436 | The bitmap of pending signals, displayed as a decimal number. | |
59a40ed7 | 1437 | Obsolete, because it does not provide information on real-time signals; use |
69119dc7 | 1438 | .I /proc/[pid]/status |
59a40ed7 | 1439 | instead. |
fea681da | 1440 | .TP |
62e4a418 MK |
1441 | (32) \fIblocked\fP \ %lu |
1442 | The bitmap of blocked signals, displayed as a decimal number. | |
59a40ed7 | 1443 | Obsolete, because it does not provide information on real-time signals; use |
69119dc7 | 1444 | .I /proc/[pid]/status |
59a40ed7 | 1445 | instead. |
fea681da | 1446 | .TP |
62e4a418 MK |
1447 | (33) \fIsigignore\fP \ %lu |
1448 | The bitmap of ignored signals, displayed as a decimal number. | |
59a40ed7 | 1449 | Obsolete, because it does not provide information on real-time signals; use |
69119dc7 | 1450 | .I /proc/[pid]/status |
59a40ed7 | 1451 | instead. |
fea681da | 1452 | .TP |
62e4a418 MK |
1453 | (34) \fIsigcatch\fP \ %lu |
1454 | The bitmap of caught signals, displayed as a decimal number. | |
59a40ed7 | 1455 | Obsolete, because it does not provide information on real-time signals; use |
69119dc7 | 1456 | .I /proc/[pid]/status |
59a40ed7 | 1457 | instead. |
fea681da | 1458 | .TP |
62e4a418 MK |
1459 | (35) \fIwchan\fP \ %lu |
1460 | This is the "channel" in which the process is waiting. | |
2054f761 MK |
1461 | It is the address of a location in the kernel where the process is sleeping. |
1462 | The corresponding symbolic name can be found in | |
1463 | .IR /proc/[pid]/wchan . | |
fea681da | 1464 | .TP |
62e4a418 | 1465 | (36) \fInswap\fP \ %lu |
0633f951 | 1466 | .\" nswap was added in 2.0 |
4d9b6984 | 1467 | Number of pages swapped (not maintained). |
fea681da | 1468 | .TP |
62e4a418 | 1469 | (37) \fIcnswap\fP \ %lu |
0633f951 | 1470 | .\" cnswap was added in 2.0 |
4d9b6984 | 1471 | Cumulative \fInswap\fP for child processes (not maintained). |
fea681da | 1472 | .TP |
62e4a418 MK |
1473 | (38) \fIexit_signal\fP \ %d \ (since Linux 2.1.22) |
1474 | Signal to be sent to parent when we die. | |
fea681da | 1475 | .TP |
62e4a418 MK |
1476 | (39) \fIprocessor\fP \ %d \ (since Linux 2.2.8) |
1477 | CPU number last executed on. | |
568105c6 | 1478 | .TP |
62e4a418 MK |
1479 | (40) \fIrt_priority\fP \ %u \ (since Linux 2.5.19) |
1480 | Real-time scheduling priority, a number in the range 1 to 99 for | |
59a40ed7 MK |
1481 | processes scheduled under a real-time policy, |
1482 | or 0, for non-real-time processes (see | |
568105c6 MK |
1483 | .BR sched_setscheduler (2)). |
1484 | .TP | |
62e4a418 MK |
1485 | (41) \fIpolicy\fP \ %u \ (since Linux 2.5.19) |
1486 | Scheduling policy (see | |
568105c6 | 1487 | .BR sched_setscheduler (2)). |
cd60dedd | 1488 | Decode using the SCHED_* constants in |
59a40ed7 | 1489 | .IR linux/sched.h . |
62e4a418 MK |
1490 | |
1491 | The format for this field was %lu before Linux 2.6.22. | |
167450d6 | 1492 | .TP |
62e4a418 MK |
1493 | (42) \fIdelayacct_blkio_ticks\fP \ %llu \ (since Linux 2.6.18) |
1494 | Aggregated block I/O delays, measured in clock ticks (centiseconds). | |
14c06953 | 1495 | .TP |
62e4a418 MK |
1496 | (43) \fIguest_time\fP \ %lu \ (since Linux 2.6.24) |
1497 | Guest time of the process (time spent running a virtual CPU | |
7a017e24 | 1498 | for a guest operating system), measured in clock ticks (divide by |
67914165 | 1499 | .IR sysconf(_SC_CLK_TCK) ). |
14c06953 | 1500 | .TP |
62e4a418 MK |
1501 | (44) \fIcguest_time\fP \ %ld \ (since Linux 2.6.24) |
1502 | Guest time of the process's children, measured in clock ticks (divide by | |
67914165 | 1503 | .IR sysconf(_SC_CLK_TCK) ). |
fea681da | 1504 | .TP |
62e4a418 | 1505 | (45) \fIstart_data\fP \ %lu \ (since Linux 3.3) |
0be30a54 | 1506 | .\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff |
62e4a418 | 1507 | Address above which program initialized and |
426bc8d7 | 1508 | uninitialized (BSS) data are placed. |
12449ae3 | 1509 | .TP |
62e4a418 | 1510 | (46) \fIend_data\fP \ %lu \ (since Linux 3.3) |
0be30a54 | 1511 | .\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff |
62e4a418 | 1512 | Address below which program initialized and |
426bc8d7 | 1513 | uninitialized (BSS) data are placed. |
12449ae3 | 1514 | .TP |
62e4a418 | 1515 | (47) \fIstart_brk\fP \ %lu \ (since Linux 3.3) |
0be30a54 | 1516 | .\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff |
62e4a418 | 1517 | Address above which program heap can be expanded with |
426bc8d7 | 1518 | .BR brk (2). |
12449ae3 | 1519 | .TP |
62e4a418 | 1520 | (48) \fIarg_start\fP \ %lu \ (since Linux 3.5) |
0be30a54 | 1521 | .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3 |
62e4a418 | 1522 | Address above which program command-line arguments |
426bc8d7 MK |
1523 | .RI ( argv ) |
1524 | are placed. | |
12449ae3 | 1525 | .TP |
62e4a418 | 1526 | (49) \fIarg_end\fP \ %lu \ (since Linux 3.5) |
0be30a54 | 1527 | .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3 |
62e4a418 | 1528 | Address below program command-line arguments |
426bc8d7 MK |
1529 | .RI ( argv ) |
1530 | are placed. | |
12449ae3 | 1531 | .TP |
62e4a418 | 1532 | (50) \fIenv_start\fP \ %lu \ (since Linux 3.5) |
0be30a54 | 1533 | .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3 |
62e4a418 | 1534 | Address above which program environment is placed. |
12449ae3 | 1535 | .TP |
62e4a418 | 1536 | (51) \fIenv_end\fP \ %lu \ (since Linux 3.5) |
0be30a54 | 1537 | .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3 |
62e4a418 | 1538 | Address below which program environment is placed. |
12449ae3 | 1539 | .TP |
62e4a418 | 1540 | (52) \fIexit_code\fP \ %d \ (since Linux 3.5) |
0be30a54 | 1541 | .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3 |
62e4a418 | 1542 | The thread's exit status in the form reported by |
426bc8d7 | 1543 | .BR waitpid (2). |
12449ae3 | 1544 | .RE |
1545 | .TP | |
69119dc7 | 1546 | .I /proc/[pid]/statm |
59a40ed7 | 1547 | Provides information about memory usage, measured in pages. |
c13182ef | 1548 | The columns are: |
a08ea57c MK |
1549 | .in +4n |
1550 | .nf | |
1551 | ||
cb42fb56 | 1552 | size (1) total program size |
69119dc7 | 1553 | (same as VmSize in \fI/proc/[pid]/status\fP) |
cb42fb56 | 1554 | resident (2) resident set size |
69119dc7 | 1555 | (same as VmRSS in \fI/proc/[pid]/status\fP) |
cb42fb56 MK |
1556 | share (3) shared pages (i.e., backed by a file) |
1557 | text (4) text (code) | |
59a40ed7 | 1558 | .\" (not including libs; broken, includes data segment) |
cb42fb56 MK |
1559 | lib (5) library (unused in Linux 2.6) |
1560 | data (6) data + stack | |
59a40ed7 | 1561 | .\" (including libs; broken, includes library text) |
cb42fb56 | 1562 | dt (7) dirty pages (unused in Linux 2.6) |
a08ea57c MK |
1563 | .fi |
1564 | .in | |
fea681da | 1565 | .TP |
69119dc7 | 1566 | .I /proc/[pid]/status |
fea681da | 1567 | Provides much of the information in |
69119dc7 | 1568 | .I /proc/[pid]/stat |
fea681da | 1569 | and |
69119dc7 | 1570 | .I /proc/[pid]/statm |
fea681da | 1571 | in a format that's easier for humans to parse. |
16b5f7ba MK |
1572 | Here's an example: |
1573 | .in +4n | |
1574 | .nf | |
1575 | ||
b43a3b30 | 1576 | .RB "$" " cat /proc/$$/status" |
16b5f7ba MK |
1577 | Name: bash |
1578 | State: S (sleeping) | |
1579 | Tgid: 3515 | |
1580 | Pid: 3515 | |
1581 | PPid: 3452 | |
1582 | TracerPid: 0 | |
1583 | Uid: 1000 1000 1000 1000 | |
1584 | Gid: 100 100 100 100 | |
1585 | FDSize: 256 | |
1586 | Groups: 16 33 100 | |
1587 | VmPeak: 9136 kB | |
1588 | VmSize: 7896 kB | |
1589 | VmLck: 0 kB | |
1590 | VmHWM: 7572 kB | |
1591 | VmRSS: 6316 kB | |
1592 | VmData: 5224 kB | |
1593 | VmStk: 88 kB | |
1594 | VmExe: 572 kB | |
1595 | VmLib: 1708 kB | |
1596 | VmPTE: 20 kB | |
49f6dda7 | 1597 | VmSwap: 0 kB |
16b5f7ba MK |
1598 | Threads: 1 |
1599 | SigQ: 0/3067 | |
1600 | SigPnd: 0000000000000000 | |
1601 | ShdPnd: 0000000000000000 | |
1602 | SigBlk: 0000000000010000 | |
1603 | SigIgn: 0000000000384004 | |
1604 | SigCgt: 000000004b813efb | |
1605 | CapInh: 0000000000000000 | |
1606 | CapPrm: 0000000000000000 | |
1607 | CapEff: 0000000000000000 | |
1608 | CapBnd: ffffffffffffffff | |
039b6546 | 1609 | Seccomp: 0 |
16b5f7ba MK |
1610 | Cpus_allowed: 00000001 |
1611 | Cpus_allowed_list: 0 | |
1612 | Mems_allowed: 1 | |
1613 | Mems_allowed_list: 0 | |
1614 | voluntary_ctxt_switches: 150 | |
1615 | nonvoluntary_ctxt_switches: 545 | |
1616 | .fi | |
1617 | .in | |
1618 | .IP | |
1619 | The fields are as follows: | |
1620 | .RS | |
1621 | .IP * 2 | |
1622 | .IR Name : | |
1623 | Command run by this process. | |
1624 | .IP * | |
1625 | .IR State : | |
4175f999 MK |
1626 | Current state of the process. |
1627 | One of | |
16b5f7ba MK |
1628 | "R (running)", |
1629 | "S (sleeping)", | |
1630 | "D (disk sleep)", | |
1631 | "T (stopped)", | |
1632 | "T (tracing stop)", | |
1633 | "Z (zombie)", | |
1634 | or | |
1635 | "X (dead)". | |
1636 | .IP * | |
1637 | .IR Tgid : | |
1638 | Thread group ID (i.e., Process ID). | |
1639 | .IP * | |
1640 | .IR Pid : | |
1641 | Thread ID (see | |
1642 | .BR gettid (2)). | |
1643 | .IP * | |
a1bc91d5 MK |
1644 | .IR PPid : |
1645 | PID of parent process. | |
1646 | .IP * | |
16b5f7ba MK |
1647 | .IR TracerPid : |
1648 | PID of process tracing this process (0 if not being traced). | |
1649 | .IP * | |
1650 | .IR Uid ", " Gid : | |
9ee4a2b6 | 1651 | Real, effective, saved set, and filesystem UIDs (GIDs). |
16b5f7ba MK |
1652 | .IP * |
1653 | .IR FDSize : | |
1654 | Number of file descriptor slots currently allocated. | |
1655 | .IP * | |
1656 | .IR Groups : | |
1657 | Supplementary group list. | |
1658 | .IP * | |
1659 | .IR VmPeak : | |
1660 | Peak virtual memory size. | |
1661 | .IP * | |
1662 | .IR VmSize : | |
1663 | Virtual memory size. | |
1664 | .IP * | |
1665 | .IR VmLck : | |
fde39195 MK |
1666 | Locked memory size (see |
1667 | .BR mlock (3)). | |
16b5f7ba MK |
1668 | .IP * |
1669 | .IR VmHWM : | |
1670 | Peak resident set size ("high water mark"). | |
1671 | .IP * | |
1672 | .IR VmRSS : | |
1673 | Resident set size. | |
1674 | .IP * | |
1675 | .IR VmData ", " VmStk ", " VmExe : | |
1676 | Size of data, stack, and text segments. | |
1677 | .IP * | |
1678 | .IR VmLib : | |
1679 | Shared library code size. | |
1680 | .IP * | |
1681 | .IR VmPTE : | |
1682 | Page table entries size (since Linux 2.6.10). | |
1683 | .IP * | |
ac4b0eb3 | 1684 | .IR VmSwap : |
1ddc1665 | 1685 | .\" commit b084d4353ff99d824d3bc5a5c2c22c70b1fba722 |
ac4b0eb3 | 1686 | Swapped-out virtual memory size (since Linux 2.6.34). |
49f6dda7 | 1687 | .IP * |
16b5f7ba MK |
1688 | .IR Threads : |
1689 | Number of threads in process containing this thread. | |
1690 | .IP * | |
6ee625eb MK |
1691 | .IR SigQ : |
1692 | This field contains two slash-separated numbers that relate to | |
1693 | queued signals for the real user ID of this process. | |
1694 | The first of these is the number of currently queued | |
1695 | signals for this real user ID, and the second is the | |
1696 | resource limit on the number of queued signals for this process | |
1697 | (see the description of | |
1698 | .BR RLIMIT_SIGPENDING | |
1699 | in | |
1700 | .BR getrlimit (2)). | |
1701 | .IP * | |
16b5f7ba MK |
1702 | .IR SigPnd ", " ShdPnd : |
1703 | Number of signals pending for thread and for process as a whole (see | |
1704 | .BR pthreads (7) | |
1705 | and | |
1706 | .BR signal (7)). | |
1707 | .IP * | |
1708 | .IR SigBlk ", " SigIgn ", " SigCgt : | |
1709 | Masks indicating signals being blocked, ignored, and caught (see | |
1710 | .BR signal (7)). | |
1711 | .IP * | |
1712 | .IR CapInh ", " CapPrm ", " CapEff : | |
1713 | Masks of capabilities enabled in inheritable, permitted, and effective sets | |
1714 | (see | |
1715 | .BR capabilities (7)). | |
1716 | .IP * | |
1717 | .IR CapBnd : | |
1718 | Capability Bounding set | |
7e07d950 | 1719 | (since Linux 2.6.26, see |
16b5f7ba MK |
1720 | .BR capabilities (7)). |
1721 | .IP * | |
039b6546 MK |
1722 | .IR Seccomp : |
1723 | .\" commit 2f4b3bf6b2318cfaa177ec5a802f4d8d6afbd816 | |
1724 | Seccomp mode of the process | |
1725 | (since Linux 3.8, see | |
1726 | .BR seccomp (2)). | |
1727 | 0 means | |
1728 | .BR SECCOMP_MODE_DISABLED ; | |
1729 | 1 means | |
1730 | .BR SECCOMP_MODE_STRICT ; | |
1731 | 2 means | |
1732 | .BR SECCOMP_MODE_FILTER . | |
1733 | This field is provided only if the kernel was built with the | |
1734 | .BR CONFIG_SECCOMP | |
1735 | kernel configuration option enabled. | |
1736 | .IP * | |
16b5f7ba MK |
1737 | .IR Cpus_allowed : |
1738 | Mask of CPUs on which this process may run | |
1739 | (since Linux 2.6.24, see | |
1740 | .BR cpuset (7)). | |
1741 | .IP * | |
1742 | .IR Cpus_allowed_list : | |
1743 | Same as previous, but in "list format" | |
1744 | (since Linux 2.6.26, see | |
1745 | .BR cpuset (7)). | |
1746 | .IP * | |
1747 | .IR Mems_allowed : | |
1748 | Mask of memory nodes allowed to this process | |
1749 | (since Linux 2.6.24, see | |
1750 | .BR cpuset (7)). | |
1751 | .IP * | |
1752 | .IR Mems_allowed_list : | |
1753 | Same as previous, but in "list format" | |
1754 | (since Linux 2.6.26, see | |
1755 | .BR cpuset (7)). | |
1756 | .IP * | |
7c82878a | 1757 | .IR voluntary_ctxt_switches ", " nonvoluntary_ctxt_switches : |
16b5f7ba MK |
1758 | Number of voluntary and involuntary context switches (since Linux 2.6.23). |
1759 | .RE | |
afb7b014 MK |
1760 | .TP |
1761 | .IR /proc/[pid]/syscall " (since Linux 2.6.27)" | |
1762 | .\" commit ebcb67341fee34061430f3367f2e507e52ee051b | |
1763 | This file exposes the system call number and argument registers for the | |
1764 | system call currently being executed by the process, | |
1765 | followed by the values of the stack pointer and program counter registers. | |
1766 | The values of all six argument registers are exposed, | |
1767 | although most system calls use fewer registers. | |
1768 | ||
1769 | If the process is blocked, but not in a system call, | |
1fb61947 | 1770 | then the file displays \-1 in place of the system call number, |
afb7b014 MK |
1771 | followed by just the values of the stack pointer and program counter. |
1772 | If process is not blocked, then file contains just the string "running". | |
1773 | ||
1774 | This file is present only if the kernel was configured with | |
1775 | .BR CONFIG_HAVE_ARCH_TRACEHOOK . | |
fea681da | 1776 | .TP |
69119dc7 | 1777 | .IR /proc/[pid]/task " (since Linux 2.6.0-test6)" |
afcaf646 MK |
1778 | This is a directory that contains one subdirectory |
1779 | for each thread in the process. | |
69119dc7 MK |
1780 | The name of each subdirectory is the numerical thread ID |
1781 | .RI ( [tid] ) | |
1782 | of the thread (see | |
afcaf646 MK |
1783 | .BR gettid (2)). |
1784 | Within each of these subdirectories, there is a set of | |
1785 | files with the same names and contents as under the | |
69119dc7 | 1786 | .I /proc/[pid] |
afcaf646 MK |
1787 | directories. |
1788 | For attributes that are shared by all threads, the contents for | |
1789 | each of the files under the | |
69119dc7 | 1790 | .I task/[tid] |
afcaf646 | 1791 | subdirectories will be the same as in the corresponding |
c13182ef | 1792 | file in the parent |
69119dc7 | 1793 | .I /proc/[pid] |
afcaf646 | 1794 | directory |
c13182ef | 1795 | (e.g., in a multithreaded process, all of the |
69119dc7 | 1796 | .I task/[tid]/cwd |
c13182ef | 1797 | files will have the same value as the |
69119dc7 | 1798 | .I /proc/[pid]/cwd |
c13182ef | 1799 | file in the parent directory, since all of the threads in a process |
afcaf646 MK |
1800 | share a working directory). |
1801 | For attributes that are distinct for each thread, | |
c13182ef | 1802 | the corresponding files under |
69119dc7 | 1803 | .I task/[tid] |
afcaf646 | 1804 | may have different values (e.g., various fields in each of the |
69119dc7 | 1805 | .I task/[tid]/status |
afcaf646 MK |
1806 | files may be different for each thread). |
1807 | ||
1808 | .\" The following was still true as at kernel 2.6.13 | |
1809 | In a multithreaded process, the contents of the | |
69119dc7 | 1810 | .I /proc/[pid]/task |
c13182ef | 1811 | directory are not available if the main thread has already terminated |
afcaf646 MK |
1812 | (typically by calling |
1813 | .BR pthread_exit (3)). | |
1814 | .TP | |
ccdc8958 | 1815 | .IR /proc/[pid]/uid_map ", " /proc/[pid]/gid_map " (since Linux 3.5)" |
149eeb7b MK |
1816 | .\" commit 22d917d80e842829d0ca0a561967d728eb1d6303 |
1817 | These files expose the mappings for user and group IDs | |
1818 | inside the user namespace for the process | |
1819 | .IR pid . | |
1820 | The description here explains the details for | |
1821 | .IR uid_map ; | |
1822 | .IR gid_map | |
1823 | is exactly the same, | |
1824 | but each instance of "user ID" is replaced by "group ID". | |
1825 | ||
1826 | The | |
1827 | .I uid_map | |
1828 | file exposes the mapping of user IDs from the user namespace | |
1829 | of the process | |
f6e17121 EB |
1830 | .IR pid |
1831 | to the user namespace of the process that opened | |
6b1eaf53 MK |
1832 | .IR uid_map |
1833 | (but see a qualification to this point below). | |
1834 | In other words, processes that are in different user namespaces | |
23be33af MK |
1835 | will potentially see different values when reading from a particular |
1836 | .I uid_map | |
1837 | file, depending on the user ID mappings for the user namespaces | |
6b1eaf53 | 1838 | of the reading processes. |
23be33af | 1839 | |
f6e17121 | 1840 | |
149eeb7b | 1841 | Each line in the file specifies a 1-to-1 mapping of a range of contiguous |
6b1eaf53 MK |
1842 | between two user namespaces. |
1843 | The specification in each line takes the form of | |
1844 | three numbers delimited by white space. | |
f5d401dd | 1845 | The first two numbers specify the starting user ID in |
6b1eaf53 MK |
1846 | each user namespace. |
1847 | The third number specifies the length of the mapped range. | |
1848 | In detail, the fields are interpreted as follows: | |
149eeb7b MK |
1849 | .RS |
1850 | .IP (1) 4 | |
1851 | The start of the range of user IDs in | |
1852 | the user namespace of the process | |
1853 | .IR pid . | |
1854 | .IP (2) | |
6b1eaf53 MK |
1855 | The start of the range of user |
1856 | IDs to which the user IDs specified by field one map. | |
1857 | How field two is interpreted depends on whether the process that opened | |
1858 | .I uid_map | |
1859 | and the process | |
1860 | .IR pid | |
1861 | are in the same user namespace, as follows: | |
1862 | .RS | |
1863 | .IP a) 3 | |
1864 | If the two processes are in different user namespaces: | |
1865 | field two is the start of a range of | |
1866 | user IDs in the user namespace of the process that opened | |
149eeb7b | 1867 | .IR uid_map . |
6b1eaf53 MK |
1868 | .IP b) |
1869 | If the two processes are in the same user namespace: | |
1870 | field two is the start of the range of | |
1871 | user IDs in the parent user namespace of the process | |
1872 | .IR pid . | |
1873 | (The "parent user namespace" | |
1874 | is the user namespace of the process that created a user namespace | |
1875 | via a call to | |
1876 | .BR unshare (2) | |
1877 | or | |
1878 | .BR clone (2) | |
f5d401dd | 1879 | with the |
6b1eaf53 MK |
1880 | .BR CLONE_NEWUSER |
1881 | flag.) | |
1882 | This case enables the opener of | |
1883 | .I uid_map | |
1884 | (the common case here is opening | |
1885 | .IR /proc/self/uid_map ) | |
1886 | to see the mapping of user IDs into the user namespace of the process | |
1887 | that created this user namespace. | |
1888 | .RE | |
149eeb7b MK |
1889 | .IP (3) |
1890 | The length of the range of user IDs that is mapped between the two | |
f6e17121 | 1891 | user namespaces. |
149eeb7b MK |
1892 | .RE |
1893 | .IP | |
a2f479de MK |
1894 | After the creation of a new user namespace, the |
1895 | .I uid_map | |
1896 | file may be written to exactly once to specify | |
149eeb7b MK |
1897 | the mapping of user IDs in the new user namespace. |
1898 | (An attempt to write more than once to the file fails with the error | |
1899 | .BR EPERM .) | |
8b69f9c7 MK |
1900 | .IP |
1901 | The lines written to | |
1902 | .IR uid_map | |
1903 | must conform to the following rules: | |
1904 | .RS | |
1905 | .IP * 3 | |
1906 | The three fields must be valid numbers, | |
1907 | and the last field must be greater than 0. | |
1908 | .IP * | |
1909 | Lines are terminated by newline characters. | |
1910 | .IP * | |
d0ebf398 | 1911 | There is an (arbitrary) limit on the number of lines in the file. |
a2f479de | 1912 | As at Linux 3.8, the limit is five lines. |
8b69f9c7 | 1913 | .IP * |
8b69f9c7 MK |
1914 | The range of user IDs specified in each line cannot overlap with the ranges |
1915 | in any other lines. | |
f5d401dd | 1916 | In the current implementation (Linux 3.8), this requirement is |
98ea4173 MK |
1917 | satisfied by a simplistic implementation that imposes the further |
1918 | requirement that | |
1919 | the values in both field 1 and field 2 of successive lines must be | |
1920 | in ascending numerical order. | |
8b69f9c7 MK |
1921 | .RE |
1922 | .IP | |
1923 | Writes that violate the above rules fail with the error | |
1924 | .BR EINVAL . | |
3d33f6ce | 1925 | |
6b1eaf53 | 1926 | In order for a process to write to the |
3d33f6ce MK |
1927 | .I /proc/[pid]/uid_map |
1928 | .RI ( /proc/[pid]/gid_map ) | |
6b1eaf53 MK |
1929 | file, the following requirements must be met: |
1930 | .RS | |
1931 | .IP * 3 | |
1932 | The process must have the | |
3d33f6ce MK |
1933 | .BR CAP_SETUID |
1934 | .RB ( CAP_SETGID ) | |
1935 | capability in the user namespace of the process | |
1936 | .IR pid . | |
6b1eaf53 MK |
1937 | .IP * |
1938 | The process must have the | |
1939 | .BR CAP_SETUID | |
1940 | .RB ( CAP_SETGID ) | |
1941 | capability in the parent user namespace. | |
1942 | .IP * | |
1943 | The process must be in either the user namespace of the process | |
1944 | .I pid | |
1945 | or inside the parent user namespace of the process | |
1946 | .IR pid . | |
1947 | .RE | |
b81acb15 MK |
1948 | For further details, see |
1949 | .BR namespaces (7). | |
f6e17121 | 1950 | .TP |
2054f761 MK |
1951 | .IR /proc/[pid]/wchan " (since Linux 2.6.0)" |
1952 | The symbolic name corresponding to the location | |
1953 | in the kernel where the process is sleeping. | |
1954 | .TP | |
fea681da | 1955 | .I /proc/apm |
097585ed MK |
1956 | Advanced power management version and battery information when |
1957 | .B CONFIG_APM | |
1958 | is defined at kernel compilation time. | |
fea681da | 1959 | .TP |
eb7097c2 EDB |
1960 | .I /proc/buddyinfo |
1961 | This file contains information which is used for diagnosing memory | |
1962 | fragmentation issues. | |
1963 | Each line starts with the identification of the node and the name | |
b96ddae0 MK |
1964 | of the zone which together identify a memory region |
1965 | This is then | |
eb7097c2 EDB |
1966 | followed by the count of available chunks of a certain order in |
1967 | which these zones are split. | |
b96ddae0 MK |
1968 | The size in bytes of a certain order is given by the formual: |
1969 | ||
1970 | (2^order)\ *\ PAGE_SIZE | |
1971 | ||
eb7097c2 EDB |
1972 | The binary buddy allocator algorithm inside the kernel will split |
1973 | one chunk into two chunks of a smaller order (thus with half the | |
1974 | size) or combine two contiguous chunks into one larger chunk of | |
1975 | a higher order (thus with double the size) to satisfy allocation | |
1976 | requests and to counter memory fragmentation. | |
1977 | The order matches the column number, when starting to count at zero. | |
1978 | ||
1979 | For example on a x86_64 system: | |
b96ddae0 MK |
1980 | |
1981 | .in -12n | |
eb7097c2 | 1982 | .nf |
b96ddae0 MK |
1983 | Node 0, zone DMA 1 1 1 0 2 1 1 0 1 1 3 |
1984 | Node 0, zone DMA32 65 47 4 81 52 28 13 10 5 1 404 | |
1985 | Node 0, zone Normal 216 55 189 101 84 38 37 27 5 3 587 | |
eb7097c2 EDB |
1986 | .fi |
1987 | .in | |
1988 | ||
b96ddae0 | 1989 | In this example, there is one node containing three zones and there |
eb7097c2 | 1990 | are 11 different chunk sizes. |
73ba31a9 | 1991 | If the page size is 4 kilobytes, then the first zone called |
eb7097c2 | 1992 | .I DMA |
b96ddae0 MK |
1993 | (on x86 the first 16 megabyte of memory) has 1 chunk of 4 kilobytes |
1994 | (order 0) available and has 3 chunks of 4 megabytes (order 10) available. | |
eb7097c2 | 1995 | |
73ba31a9 | 1996 | If the memory is heavily fragmented, the counters for higher |
eb7097c2 EDB |
1997 | order chunks will be zero and allocation of large contiguous areas |
1998 | will fail. | |
1999 | ||
2000 | Further information about the zones can be found in | |
2001 | .IR /proc/zoneinfo . | |
2002 | .TP | |
fea681da MK |
2003 | .I /proc/bus |
2004 | Contains subdirectories for installed busses. | |
2005 | .TP | |
2006 | .I /proc/bus/pccard | |
59a40ed7 | 2007 | Subdirectory for PCMCIA devices when |
097585ed MK |
2008 | .B CONFIG_PCMCIA |
2009 | is set at kernel compilation time. | |
fea681da | 2010 | .TP |
1509ca0e MK |
2011 | .IR /proc/[pid]/timers " (since Linux 3.10)" |
2012 | .\" commit 5ed67f05f66c41e39880a6d61358438a25f9fee5 | |
2013 | .\" commit 48f6a7a511ef8823fdff39afee0320092d43a8a0 | |
2014 | A list of the POSIX timers for this process. | |
9d54c087 | 2015 | Each timer is listed with a line that started with the string "ID:". |
1509ca0e MK |
2016 | For example: |
2017 | ||
2018 | .in +4n | |
2019 | .nf | |
2020 | ID: 1 | |
2021 | signal: 60/00007fff86e452a8 | |
2022 | notify: signal/pid.2634 | |
2023 | ClockID: 0 | |
2024 | ID: 0 | |
2025 | signal: 60/00007fff86e452a8 | |
2026 | notify: signal/pid.2634 | |
2027 | ClockID: 1 | |
2028 | .fi | |
2029 | .in | |
2030 | ||
2031 | The lines shown for each timer have the following meanings: | |
2032 | .RS | |
2033 | .TP | |
2034 | .I ID | |
2035 | The ID for this timer. | |
2036 | This is not the same as the timer ID returned by | |
2037 | .BR timer_create (2); | |
2038 | rather, it is the same kernel-internal ID that is available via the | |
2039 | .I si_timerid | |
2040 | field of the | |
2041 | .IR siginfo_t | |
2042 | structure (see | |
2043 | .BR sigaction (2)). | |
2044 | .TP | |
2045 | .I signal | |
2046 | This is the signal number that this timer uses to deliver notifications | |
2047 | followed by a slash, and then the | |
2048 | .I sigev_value.sival_ptr | |
2049 | value supplied to the signal handler. | |
2050 | Valid only for timers that notify via a signal. | |
2051 | .TP | |
2052 | .I notify | |
2053 | The part before the slash specifies the mechanism | |
2054 | that this timer uses to deliver notifications, | |
2055 | and is one of "thread", "signal", or "none". | |
2056 | Immediately following the slash is either the string "tid" for timers | |
2057 | with | |
2058 | .B SIGEV_THREAD_ID | |
2059 | notification, or "pid" for timers that notify by other mechanisms. | |
2060 | Following the "." is the PID of the process that will be delivered | |
2061 | a signal if the timer delivers notifications via a signal. | |
2062 | .TP | |
2063 | .I ClockID | |
2064 | This field identifies the clock that the timer uses for measuring time. | |
2065 | For most clocks, this is a number that matches one of the user-space | |
2066 | .BR CLOCK_* | |
9d54c087 | 2067 | constants exposed via |
1509ca0e MK |
2068 | .IR <time.h> . |
2069 | .B CLOCK_PROCESS_CPUTIME_ID | |
2070 | timers display with a value of -6 | |
2071 | in this field. | |
2072 | .B CLOCK_THREAD_CPUTIME_ID | |
2073 | timers display with a value of -2 | |
2074 | in this field. | |
2075 | .RE | |
2076 | .TP | |
fea681da MK |
2077 | .I /proc/bus/pccard/drivers |
2078 | .TP | |
2079 | .I /proc/bus/pci | |
c13182ef | 2080 | Contains various bus subdirectories and pseudo-files containing |
59a40ed7 | 2081 | information about PCI busses, installed devices, and device |
c13182ef MK |
2082 | drivers. |
2083 | Some of these files are not ASCII. | |
fea681da MK |
2084 | .TP |
2085 | .I /proc/bus/pci/devices | |
59a40ed7 | 2086 | Information about PCI devices. |
c13182ef | 2087 | They may be accessed through |
fea681da MK |
2088 | .BR lspci (8) |
2089 | and | |
2090 | .BR setpci (8). | |
2091 | .TP | |
2092 | .I /proc/cmdline | |
c13182ef MK |
2093 | Arguments passed to the Linux kernel at boot time. |
2094 | Often done via a boot manager such as | |
59a40ed7 MK |
2095 | .BR lilo (8) |
2096 | or | |
2097 | .BR grub (8). | |
f6e524c4 MK |
2098 | .TP |
2099 | .IR /proc/config.gz " (since Linux 2.6)" | |
2100 | This file exposes the configuration options that were used | |
c3d9780d | 2101 | to build the currently running kernel, |
f6e524c4 MK |
2102 | in the same format as they would be shown in the |
2103 | .I .config | |
2104 | file that resulted when configuring the kernel (using | |
2105 | .IR "make xconfig" , | |
2106 | .IR "make config" , | |
2107 | or similar). | |
2108 | The file contents are compressed; view or search them using | |
f78ed33a MK |
2109 | .BR zcat (1) |
2110 | and | |
2111 | .BR zgrep (1). | |
f6e524c4 | 2112 | As long as no changes have been made to the following file, |
250e01ec MK |
2113 | the contents of |
2114 | .I /proc/config.gz | |
2115 | are the same as those provided by : | |
f6e524c4 MK |
2116 | .in +4n |
2117 | .nf | |
2118 | ||
c3074d70 | 2119 | cat /lib/modules/$(uname \-r)/build/.config |
f6e524c4 MK |
2120 | .fi |
2121 | .in | |
250e01ec MK |
2122 | .IP |
2123 | .I /proc/config.gz | |
90878f7c | 2124 | is provided only if the kernel is configured with |
250e01ec | 2125 | .BR CONFIG_IKCONFIG_PROC . |
fea681da MK |
2126 | .TP |
2127 | .I /proc/cpuinfo | |
2128 | This is a collection of CPU and system architecture dependent items, | |
2129 | for each supported architecture a different list. | |
2130 | Two common entries are \fIprocessor\fP which gives CPU number and | |
c13182ef MK |
2131 | \fIbogomips\fP; a system constant that is calculated |
2132 | during kernel initialization. | |
2133 | SMP machines have information for | |
fea681da | 2134 | each CPU. |
a091f002 MK |
2135 | The |
2136 | .BR lscpu (1) | |
2137 | command gathers its information from this file. | |
fea681da MK |
2138 | .TP |
2139 | .I /proc/devices | |
c13182ef MK |
2140 | Text listing of major numbers and device groups. |
2141 | This can be used by MAKEDEV scripts for consistency with the kernel. | |
fea681da MK |
2142 | .TP |
2143 | .IR /proc/diskstats " (since Linux 2.5.69)" | |
2144 | This file contains disk I/O statistics for each disk device. | |
66a9882e | 2145 | See the Linux kernel source file |
fea681da MK |
2146 | .I Documentation/iostats.txt |
2147 | for further information. | |
2148 | .TP | |
2149 | .I /proc/dma | |
c13182ef | 2150 | This is a list of the registered \fIISA\fP DMA (direct memory access) |
fea681da MK |
2151 | channels in use. |
2152 | .TP | |
2153 | .I /proc/driver | |
2154 | Empty subdirectory. | |
2155 | .TP | |
2156 | .I /proc/execdomains | |
2157 | List of the execution domains (ABI personalities). | |
2158 | .TP | |
2159 | .I /proc/fb | |
097585ed MK |
2160 | Frame buffer information when |
2161 | .B CONFIG_FB | |
2162 | is defined during kernel compilation. | |
fea681da MK |
2163 | .TP |
2164 | .I /proc/filesystems | |
9ee4a2b6 MK |
2165 | A text listing of the filesystems which are supported by the kernel, |
2166 | namely filesystems which were compiled into the kernel or whose kernel | |
6387216b MK |
2167 | modules are currently loaded. |
2168 | (See also | |
fb477da2 | 2169 | .BR filesystems (5).) |
9ee4a2b6 | 2170 | If a filesystem is marked with "nodev", |
809d0164 | 2171 | this means that it does not require a block device to be mounted |
9ee4a2b6 | 2172 | (e.g., virtual filesystem, network filesystem). |
809d0164 MK |
2173 | |
2174 | Incidentally, this file may be used by | |
2175 | .BR mount (8) | |
9ee4a2b6 MK |
2176 | when no filesystem is specified and it didn't manage to determine the |
2177 | filesystem type. | |
2178 | Then filesystems contained in this file are tried | |
809d0164 | 2179 | (excepted those that are marked with "nodev"). |
fea681da MK |
2180 | .TP |
2181 | .I /proc/fs | |
df352acc | 2182 | .\" FIXME Much more needs to be said about /proc/fs |
91085d85 | 2183 | .\" |
df352acc MK |
2184 | Contains subdirectories that in turn contain files |
2185 | with information about (certain) mounted filesystems. | |
fea681da MK |
2186 | .TP |
2187 | .I /proc/ide | |
2188 | This directory | |
59a40ed7 MK |
2189 | exists on systems with the IDE bus. |
2190 | There are directories for each IDE channel and attached device. | |
c13182ef | 2191 | Files include: |
fea681da | 2192 | |
a08ea57c | 2193 | .in +4n |
fea681da MK |
2194 | .nf |
2195 | cache buffer size in KB | |
2196 | capacity number of sectors | |
2197 | driver driver version | |
2198 | geometry physical and logical geometry | |
9fdfa163 | 2199 | identify in hexadecimal |
fea681da MK |
2200 | media media type |
2201 | model manufacturer's model number | |
2202 | settings drive settings | |
9fdfa163 MK |
2203 | smart_thresholds in hexadecimal |
2204 | smart_values in hexadecimal | |
fea681da | 2205 | .fi |
a08ea57c | 2206 | .in |
fea681da | 2207 | |
c13182ef | 2208 | The |
fea681da MK |
2209 | .BR hdparm (8) |
2210 | utility provides access to this information in a friendly format. | |
2211 | .TP | |
2212 | .I /proc/interrupts | |
23ec6ff0 MK |
2213 | This is used to record the number of interrupts per CPU per IO device. |
2214 | Since Linux 2.6.24, | |
2215 | for the i386 and x86_64 architectures, at least, this also includes | |
2216 | interrupts internal to the system (that is, not associated with a device | |
2217 | as such), such as NMI (nonmaskable interrupt), LOC (local timer interrupt), | |
2218 | and for SMP systems, TLB (TLB flush interrupt), RES (rescheduling | |
2219 | interrupt), CAL (remote function call interrupt), and possibly others. | |
2220 | Very easy to read formatting, done in ASCII. | |
fea681da MK |
2221 | .TP |
2222 | .I /proc/iomem | |
2223 | I/O memory map in Linux 2.4. | |
2224 | .TP | |
2225 | .I /proc/ioports | |
c13182ef | 2226 | This is a list of currently registered Input-Output port regions that |
fea681da MK |
2227 | are in use. |
2228 | .TP | |
2229 | .IR /proc/kallsyms " (since Linux 2.5.71)" | |
2230 | This holds the kernel exported symbol definitions used by the | |
2231 | .BR modules (X) | |
2232 | tools to dynamically link and bind loadable modules. | |
2233 | In Linux 2.5.47 and earlier, a similar file with slightly different syntax | |
2234 | was named | |
2235 | .IR ksyms . | |
2236 | .TP | |
2237 | .I /proc/kcore | |
2238 | This file represents the physical memory of the system and is stored | |
c13182ef MK |
2239 | in the ELF core file format. |
2240 | With this pseudo-file, and an unstripped | |
9a67332e MK |
2241 | kernel |
2242 | .RI ( /usr/src/linux/vmlinux ) | |
2243 | binary, GDB can be used to | |
fea681da MK |
2244 | examine the current state of any kernel data structures. |
2245 | ||
2246 | The total length of the file is the size of physical memory (RAM) plus | |
2247 | 4KB. | |
2248 | .TP | |
2249 | .I /proc/kmsg | |
2250 | This file can be used instead of the | |
2251 | .BR syslog (2) | |
c13182ef MK |
2252 | system call to read kernel messages. |
2253 | A process must have superuser | |
fea681da | 2254 | privileges to read this file, and only one process should read this |
c13182ef MK |
2255 | file. |
2256 | This file should not be read if a syslog process is running | |
fea681da MK |
2257 | which uses the |
2258 | .BR syslog (2) | |
2259 | system call facility to log kernel messages. | |
2260 | ||
2261 | Information in this file is retrieved with the | |
c4517613 | 2262 | .BR dmesg (1) |
fea681da MK |
2263 | program. |
2264 | .TP | |
ff56ac8b MK |
2265 | .IR /proc/kpagecount " (since Linux 2.6.25)" |
2266 | This file contains a 64-bit count of the number of | |
2267 | times each physical page frame is mapped, | |
2268 | indexed by page frame number (see the discussion of | |
2269 | .IR /proc/[pid]/pagemap ). | |
2270 | .IP | |
2271 | The | |
2272 | .IR /proc/kpagecount | |
2273 | file is present only if the | |
2274 | .B CONFIG_PROC_PAGE_MONITOR | |
59d566a9 MK |
2275 | kernel configuration option is enabled. |
2276 | .TP | |
2277 | .IR /proc/kpageflags " (since Linux 2.6.25)" | |
ef4f4031 | 2278 | This file contains 64-bit masks corresponding to each physical page frame; |
59d566a9 MK |
2279 | it is indexed by page frame number (see the discussion of |
2280 | .IR /proc/[pid]/pagemap ). | |
2281 | The bits are as follows: | |
2282 | ||
2283 | 0 - KPF_LOCKED | |
2284 | 1 - KPF_ERROR | |
2285 | 2 - KPF_REFERENCED | |
2286 | 3 - KPF_UPTODATE | |
2287 | 4 - KPF_DIRTY | |
2288 | 5 - KPF_LRU | |
2289 | 6 - KPF_ACTIVE | |
2290 | 7 - KPF_SLAB | |
2291 | 8 - KPF_WRITEBACK | |
2292 | 9 - KPF_RECLAIM | |
2293 | 10 - KPF_BUDDY | |
2294 | 11 - KPF_MMAP (since Linux 2.6.31) | |
2295 | 12 - KPF_ANON (since Linux 2.6.31) | |
2296 | 13 - KPF_SWAPCACHE (since Linux 2.6.31) | |
2297 | 14 - KPF_SWAPBACKED (since Linux 2.6.31) | |
2298 | 15 - KPF_COMPOUND_HEAD (since Linux 2.6.31) | |
2299 | 16 - KPF_COMPOUND_TAIL (since Linux 2.6.31) | |
2300 | 16 - KPF_HUGE (since Linux 2.6.31) | |
2301 | 18 - KPF_UNEVICTABLE (since Linux 2.6.31) | |
2302 | 19 - KPF_HWPOISON (since Linux 2.6.31) | |
2303 | 20 - KPF_NOPAGE (since Linux 2.6.31) | |
2304 | 21 - KPF_KSM (since Linux 2.6.32) | |
2305 | 22 - KPF_THP (since Linux 3.4) | |
2306 | ||
2307 | For further details on the meanings of these bits, | |
2308 | see the kernel source file | |
2309 | .IR Documentation/vm/pagemap.txt . | |
2310 | Before kernel 2.6.29, | |
2311 | .\" commit ad3bdefe877afb47480418fdb05ecd42842de65e | |
2312 | .\" commit e07a4b9217d1e97d2f3a62b6b070efdc61212110 | |
2313 | .BR KPF_WRITEBACK , | |
2314 | .BR KPF_RECLAIM , | |
2315 | .BR KPF_BUDDY , | |
2316 | and | |
2317 | .BR KPF_LOCKED | |
2318 | did not report correctly. | |
2319 | .IP | |
2320 | The | |
2321 | .IR /proc/kpageflags | |
2322 | file is present only if the | |
2323 | .B CONFIG_PROC_PAGE_MONITOR | |
ff56ac8b MK |
2324 | kernel configuration option is enabled. |
2325 | .TP | |
fea681da MK |
2326 | .IR /proc/ksyms " (Linux 1.1.23-2.5.47)" |
2327 | See | |
2328 | .IR /proc/kallsyms . | |
2329 | .TP | |
2330 | .I /proc/loadavg | |
6b05dc38 MK |
2331 | The first three fields in this file are load average figures |
2332 | giving the number of jobs in the run queue (state R) | |
fea681da MK |
2333 | or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes. |
2334 | They are the same as the load average numbers given by | |
2335 | .BR uptime (1) | |
2336 | and other programs. | |
6b05dc38 | 2337 | The fourth field consists of two numbers separated by a slash (/). |
78fc91ec EDB |
2338 | The first of these is the number of currently runnable kernel |
2339 | scheduling entities (processes, threads). | |
6b05dc38 MK |
2340 | The value after the slash is the number of kernel scheduling entities |
2341 | that currently exist on the system. | |
2342 | The fifth field is the PID of the process that was most | |
2343 | recently created on the system. | |
fea681da MK |
2344 | .TP |
2345 | .I /proc/locks | |
2346 | This file shows current file locks | |
2347 | .RB ( flock "(2) and " fcntl (2)) | |
2348 | and leases | |
2349 | .RB ( fcntl (2)). | |
2350 | .TP | |
89dd5f8a | 2351 | .IR /proc/malloc " (only up to and including Linux 2.2)" |
59a40ed7 | 2352 | .\" It looks like this only ever did something back in 1.0 days |
90878f7c | 2353 | This file is present only if |
89dd5f8a | 2354 | .B CONFIG_DEBUG_MALLOC |
097585ed | 2355 | was defined during compilation. |
fea681da MK |
2356 | .TP |
2357 | .I /proc/meminfo | |
77b802ec MK |
2358 | This file reports statistics about memory usage on the system. |
2359 | It is used by | |
fea681da MK |
2360 | .BR free (1) |
2361 | to report the amount of free and used memory (both physical and swap) | |
2362 | on the system as well as the shared memory and buffers used by the | |
2363 | kernel. | |
3ba3d5b1 MK |
2364 | Each line of the file consists of a parameter name, followed by a colon, |
2365 | the value of the parameter, and an option unit of measurement (e.g., "kB"). | |
2366 | The list below describes the parameter names and | |
2367 | the format specifier required to read the field value. | |
2368 | Except as noted below, | |
2369 | all of the fields have been present since at least Linux 2.6.0. | |
86cf87d7 | 2370 | Some fields are displayed only if the kernel was configured |
3ba3d5b1 MK |
2371 | with various options; those dependencies are noted in the list. |
2372 | .RS | |
2373 | .TP | |
2374 | .IR MemTotal " %lu" | |
449dd4e2 | 2375 | Total usable RAM (i.e., physical RAM minus a few reserved |
99e91586 | 2376 | bits and the kernel binary code). |
3ba3d5b1 MK |
2377 | .TP |
2378 | .IR MemFree " %lu" | |
7bccb7d4 DP |
2379 | The sum of |
2380 | .IR LowFree + HighFree . | |
3ba3d5b1 MK |
2381 | .TP |
2382 | .IR Buffers " %lu" | |
99e91586 | 2383 | Relatively temporary storage for raw disk blocks that |
3ba3d5b1 MK |
2384 | shouldn't get tremendously large (20MB or so). |
2385 | .TP | |
2386 | .IR Cached " %lu" | |
2387 | In-memory cache for files read from the disk (the page cache). | |
2388 | Doesn't include | |
2389 | .IR SwapCached . | |
2390 | .TP | |
2391 | .IR SwapCached " %lu" | |
2392 | Memory that once was swapped out, is swapped back in but | |
2393 | still also is in the swap file. | |
fa1d2749 | 2394 | (If memory pressure is high, these pages |
3ba3d5b1 | 2395 | don't need to be swapped out again because they are already |
99e91586 | 2396 | in the swap file. |
3ba3d5b1 MK |
2397 | This saves I/O.) |
2398 | .TP | |
2399 | .IR Active " %lu" | |
2400 | Memory that has been used more recently and usually not | |
2401 | reclaimed unless absolutely necessary. | |
2402 | .TP | |
2403 | .IR Inactive " %lu" | |
2404 | Memory which has been less recently used. | |
2405 | It is more eligible to be reclaimed for other purposes. | |
2406 | .TP | |
2407 | .IR Active(anon) " %lu (since Linux 2.6.28)" | |
2408 | [To be documented.] | |
2409 | .TP | |
2410 | .IR Inactive(anon) " %lu (since Linux 2.6.28)" | |
2411 | [To be documented.] | |
2412 | .TP | |
2413 | .IR Active(file) " %lu (since Linux 2.6.28)" | |
2414 | [To be documented.] | |
2415 | .TP | |
2416 | .IR Inactive(file) " %lu (since Linux 2.6.28)" | |
2417 | [To be documented.] | |
2418 | .TP | |
2419 | .IR Unevictable " %lu (since Linux 2.6.28)" | |
2420 | (From Linux 2.6.28 to 2.6.30, | |
2421 | \fBCONFIG_UNEVICTABLE_LRU\fP was required.) | |
2422 | [To be documented.] | |
2423 | .TP | |
46fbfc07 | 2424 | .IR Mlocked " %lu (since Linux 2.6.28)" |
3ba3d5b1 MK |
2425 | (From Linux 2.6.28 to 2.6.30, |
2426 | \fBCONFIG_UNEVICTABLE_LRU\fP was required.) | |
2427 | [To be documented.] | |
2428 | .TP | |
2429 | .IR HighTotal " %lu" | |
2430 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) | |
2431 | Total amount of highmem. | |
99e91586 | 2432 | Highmem is all memory above ~860MB of physical memory. |
3ba3d5b1 MK |
2433 | Highmem areas are for use by user-space programs, |
2434 | or for the page cache. | |
2435 | The kernel must use tricks to access | |
2436 | this memory, making it slower to access than lowmem. | |
2437 | .TP | |
2438 | .IR HighFree " %lu | |
2439 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) | |
2440 | Amount of free highmem. | |
2441 | .TP | |
2442 | .IR LowTotal " %lu | |
2443 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) | |
2444 | Total amount of lowmem. | |
2445 | Lowmem is memory which can be used for everything that | |
2446 | highmem can be used for, but it is also available for the | |
2447 | kernel's use for its own data structures. | |
2448 | Among many other things, | |
99e91586 | 2449 | it is where everything from |
7bccb7d4 DP |
2450 | .I Slab |
2451 | is allocated. | |
3ba3d5b1 MK |
2452 | Bad things happen when you're out of lowmem. |
2453 | .TP | |
2454 | .IR LowFree " %lu | |
2455 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) | |
2456 | Amount of free lowmem. | |
2457 | .TP | |
2458 | .IR MmapCopy " %lu (since Linux 2.6.29)" | |
99e91586 DP |
2459 | .RB ( CONFIG_MMU |
2460 | is required.) | |
3ba3d5b1 MK |
2461 | [To be documented.] |
2462 | .TP | |
2463 | .IR SwapTotal " %lu" | |
2464 | Total amount of swap space available. | |
2465 | .TP | |
2466 | .IR SwapFree " %lu" | |
c16d4f25 | 2467 | Amount of swap space that is currently unused. |
3ba3d5b1 MK |
2468 | .TP |
2469 | .IR Dirty " %lu" | |
2470 | Memory which is waiting to get written back to the disk. | |
2471 | .TP | |
2472 | .IR Writeback " %lu" | |
2473 | Memory which is actively being written back to the disk. | |
2474 | .TP | |
2475 | .IR AnonPages " %lu (since Linux 2.6.18)" | |
2476 | Non-file backed pages mapped into user-space page tables. | |
2477 | .TP | |
2478 | .IR Mapped " %lu" | |
fda70f5b MK |
2479 | Files which have been mapped into memory (with |
2480 | .BR mmap (2)), | |
2481 | such as libraries. | |
3ba3d5b1 MK |
2482 | .TP |
2483 | .IR Shmem " %lu (since Linux 2.6.32)" | |
2484 | [To be documented.] | |
2485 | .TP | |
2486 | .IR Slab " %lu" | |
2487 | In-kernel data structures cache. | |
2488 | .TP | |
2489 | .IR SReclaimable " %lu (since Linux 2.6.19)" | |
7bccb7d4 DP |
2490 | Part of |
2491 | .IR Slab , | |
2492 | that might be reclaimed, such as caches. | |
3ba3d5b1 MK |
2493 | .TP |
2494 | .IR SUnreclaim " %lu (since Linux 2.6.19)" | |
7bccb7d4 DP |
2495 | Part of |
2496 | .IR Slab , | |
2497 | that cannot be reclaimed on memory pressure. | |
3ba3d5b1 MK |
2498 | .TP |
2499 | .IR KernelStack " %lu (since Linux 2.6.32)" | |
2500 | Amount of memory allocated to kernel stacks. | |
2501 | .TP | |
2502 | .IR PageTables " %lu (since Linux 2.6.18)" | |
2503 | Amount of memory dedicated to the lowest level of page tables. | |
2504 | .TP | |
2505 | .IR Quicklists " %lu (since Linux 2.6.27)" | |
2506 | (\fBCONFIG_QUICKLIST\fP is required.) | |
2507 | [To be documented.] | |
2508 | .TP | |
2509 | .IR NFS_Unstable " %lu (since Linux 2.6.18)" | |
2510 | NFS pages sent to the server, but not yet committed to stable storage. | |
2511 | .TP | |
2512 | .IR Bounce " %lu (since Linux 2.6.18)" | |
2513 | Memory used for block device "bounce buffers". | |
2514 | .TP | |
2515 | .IR WritebackTmp " %lu (since Linux 2.6.26)" | |
2516 | Memory used by FUSE for temporary writeback buffers. | |
2517 | .TP | |
2518 | .IR CommitLimit " %lu (since Linux 2.6.10)" | |
cd7b6c40 MK |
2519 | This is the total amount of memory currently available to |
2520 | be allocated on the system, expressed in kilobytes. | |
90878f7c MK |
2521 | This limit is adhered to |
2522 | only if strict overcommit accounting is enabled (mode 2 in | |
cd7b6c40 MK |
2523 | .IR /proc/sys/vm/overcommit_memory ). |
2524 | The limit is calculated according to the formula described under | |
2525 | .IR /proc/sys/vm/overcommit_memory . | |
2526 | For further details, see the kernel source file | |
3ba3d5b1 MK |
2527 | .IR Documentation/vm/overcommit-accounting . |
2528 | .TP | |
2529 | .IR Committed_AS " %lu" | |
2530 | The amount of memory presently allocated on the system. | |
2531 | The committed memory is a sum of all of the memory which | |
2532 | has been allocated by processes, even if it has not been | |
2533 | "used" by them as of yet. | |
2534 | A process which allocates 1GB of memory (using | |
2535 | .BR malloc (3) | |
33a0ccb2 | 2536 | or similar), but touches only 300MB of that memory will show up |
90878f7c | 2537 | as using only 300MB of memory even if it has the address space |
3ba3d5b1 | 2538 | allocated for the entire 1GB. |
cd7b6c40 | 2539 | |
3ba3d5b1 MK |
2540 | This 1GB is memory which has been "committed" to by the VM |
2541 | and can be used at any time by the allocating application. | |
cd7b6c40 MK |
2542 | With strict overcommit enabled on the system (mode 2 in |
2543 | IR /proc/sys/vm/overcommit_memory ), | |
3ba3d5b1 MK |
2544 | allocations which would exceed the |
2545 | .I CommitLimit | |
cd7b6c40 | 2546 | will not be permitted. |
3ba3d5b1 MK |
2547 | This is useful if one needs to guarantee that processes will not |
2548 | fail due to lack of memory once that memory has been successfully allocated. | |
2549 | .TP | |
2550 | .IR VmallocTotal " %lu" | |
2551 | Total size of vmalloc memory area. | |
2552 | .TP | |
2553 | .IR VmallocUsed " %lu" | |
2554 | Amount of vmalloc area which is used. | |
2555 | .TP | |
2556 | .IR VmallocChunk " %lu" | |
2557 | Largest contiguous block of vmalloc area which is free. | |
2558 | .TP | |
2559 | .IR HardwareCorrupted " %lu (since Linux 2.6.32)" | |
2560 | (\fBCONFIG_MEMORY_FAILURE\fP is required.) | |
2561 | [To be documented.] | |
2562 | .TP | |
2563 | .IR AnonHugePages " %lu (since Linux 2.6.38)" | |
2564 | (\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.) | |
7fac88a9 | 2565 | Non-file backed huge pages mapped into user-space page tables. |
3ba3d5b1 MK |
2566 | .TP |
2567 | .IR HugePages_Total " %lu" | |
2568 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
2569 | The size of the pool of huge pages. | |
2570 | .TP | |
2571 | .IR HugePages_Free " %lu" | |
2572 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
2573 | The number of huge pages in the pool that are not yet allocated. | |
2574 | .TP | |
2575 | .IR HugePages_Rsvd " %lu (since Linux 2.6.17)" | |
2576 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
2577 | This is the number of huge pages for | |
2578 | which a commitment to allocate from the pool has been made, | |
2579 | but no allocation has yet been made. | |
2580 | These reserved huge pages | |
2581 | guarantee that an application will be able to allocate a | |
2582 | huge page from the pool of huge pages at fault time. | |
2583 | .TP | |
aa8a6b4f | 2584 | .IR HugePages_Surp " %lu (since Linux 2.6.24)" |
3ba3d5b1 MK |
2585 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) |
2586 | This is the number of huge pages in | |
2587 | the pool above the value in | |
2588 | .IR /proc/sys/vm/nr_hugepages . | |
2589 | The maximum number of surplus huge pages is controlled by | |
2590 | .IR /proc/sys/vm/nr_overcommit_hugepages . | |
2591 | .TP | |
2592 | .IR Hugepagesize " %lu" | |
2593 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
2594 | The size of huge pages. | |
2595 | .RE | |
fea681da | 2596 | .TP |
aa341984 MK |
2597 | .I /proc/modules |
2598 | A text list of the modules that have been loaded by the system. | |
2599 | See also | |
2600 | .BR lsmod (8). | |
2601 | .TP | |
fea681da | 2602 | .I /proc/mounts |
c1eea65a | 2603 | Before kernel 2.4.19, this file was a list |
9ee4a2b6 | 2604 | of all the filesystems currently mounted on the system. |
732e54dd | 2605 | With the introduction of per-process mount namespaces in |
c1eea65a MK |
2606 | Linux 2.4.19, this file became a link to |
2607 | .IR /proc/self/mounts , | |
732e54dd | 2608 | which lists the mount points of the process's own mount namespace. |
fea681da | 2609 | The format of this file is documented in |
31e9a9ec | 2610 | .BR fstab (5). |
fea681da | 2611 | .TP |
fea681da | 2612 | .I /proc/mtrr |
c13182ef | 2613 | Memory Type Range Registers. |
66a9882e | 2614 | See the Linux kernel source file |
cfe70b66 | 2615 | .I Documentation/mtrr.txt |
fea681da MK |
2616 | for details. |
2617 | .TP | |
2618 | .I /proc/net | |
2619 | various net pseudo-files, all of which give the status of some part of | |
c13182ef MK |
2620 | the networking layer. |
2621 | These files contain ASCII structures and are, | |
59a40ed7 MK |
2622 | therefore, readable with |
2623 | .BR cat (1). | |
c13182ef | 2624 | However, the standard |
fea681da MK |
2625 | .BR netstat (8) |
2626 | suite provides much cleaner access to these files. | |
2627 | .TP | |
2628 | .I /proc/net/arp | |
2629 | This holds an ASCII readable dump of the kernel ARP table used for | |
c13182ef | 2630 | address resolutions. |
01d0a447 | 2631 | It will show both dynamically learned and preprogrammed ARP entries. |
c13182ef | 2632 | The format is: |
fea681da MK |
2633 | |
2634 | .nf | |
2635 | .ft CW | |
2636 | .in 8n | |
2637 | IP address HW type Flags HW address Mask Device | |
2638 | 192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0 | |
2639 | 192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0 | |
2640 | .ft | |
2641 | .fi | |
2642 | .in | |
2643 | ||
6c04f928 | 2644 | Here "IP address" is the IPv4 address of the machine and the "HW type" |
c13182ef MK |
2645 | is the hardware type of the address from RFC\ 826. |
2646 | The flags are the internal | |
9a67332e MK |
2647 | flags of the ARP structure (as defined in |
2648 | .IR /usr/include/linux/if_arp.h ) | |
2649 | and | |
6c04f928 | 2650 | the "HW address" is the data link layer mapping for that IP address if |
fea681da MK |
2651 | it is known. |
2652 | .TP | |
2653 | .I /proc/net/dev | |
c13182ef MK |
2654 | The dev pseudo-file contains network device status information. |
2655 | This gives | |
2656 | the number of received and sent packets, the number of errors and | |
fea681da | 2657 | collisions |
c13182ef MK |
2658 | and other basic statistics. |
2659 | These are used by the | |
fea681da | 2660 | .BR ifconfig (8) |
c13182ef MK |
2661 | program to report device status. |
2662 | The format is: | |
fea681da MK |
2663 | |
2664 | .nf | |
2665 | .ft CW | |
2666 | .in 1n | |
2667 | Inter-| Receive | Transmit | |
2668 | face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed | |
2669 | lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0 | |
2670 | eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0 | |
2671 | ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0 | |
2672 | tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0 | |
2673 | .in | |
2674 | .ft | |
2675 | .fi | |
2676 | .\" .TP | |
2677 | .\" .I /proc/net/ipx | |
2678 | .\" No information. | |
2679 | .\" .TP | |
2680 | .\" .I /proc/net/ipx_route | |
2681 | .\" No information. | |
2682 | .TP | |
2683 | .I /proc/net/dev_mcast | |
2684 | Defined in | |
2685 | .IR /usr/src/linux/net/core/dev_mcast.c : | |
2686 | .nf | |
2687 | .in +5 | |
9fdfa163 | 2688 | indx interface_name dmi_u dmi_g dmi_address |
fea681da MK |
2689 | 2 eth0 1 0 01005e000001 |
2690 | 3 eth1 1 0 01005e000001 | |
2691 | 4 eth2 1 0 01005e000001 | |
2692 | .in | |
2693 | .fi | |
2694 | .TP | |
2695 | .I /proc/net/igmp | |
c13182ef MK |
2696 | Internet Group Management Protocol. |
2697 | Defined in | |
fea681da MK |
2698 | .IR /usr/src/linux/net/core/igmp.c . |
2699 | .TP | |
2700 | .I /proc/net/rarp | |
2701 | This file uses the same format as the | |
2702 | .I arp | |
2703 | file and contains the current reverse mapping database used to provide | |
2704 | .BR rarp (8) | |
c13182ef MK |
2705 | reverse address lookup services. |
2706 | If RARP is not configured into the | |
fea681da MK |
2707 | kernel, |
2708 | this file will not be present. | |
2709 | .TP | |
2710 | .I /proc/net/raw | |
c13182ef MK |
2711 | Holds a dump of the RAW socket table. |
2712 | Much of the information is not of | |
fea681da | 2713 | use |
c13182ef | 2714 | apart from debugging. |
6c04f928 | 2715 | The "sl" value is the kernel hash slot for the |
fea681da | 2716 | socket, |
6c04f928 MK |
2717 | the "local_address" is the local address and protocol number pair. |
2718 | \&"St" is | |
c13182ef MK |
2719 | the internal status of the socket. |
2720 | The "tx_queue" and "rx_queue" are the | |
fea681da | 2721 | outgoing and incoming data queue in terms of kernel memory usage. |
94e9d9fe | 2722 | The "tr", "tm\->when", and "rexmits" fields are not used by RAW. |
fdc196f5 MK |
2723 | The "uid" |
2724 | field holds the effective UID of the creator of the socket. | |
fea681da MK |
2725 | .\" .TP |
2726 | .\" .I /proc/net/route | |
2727 | .\" No information, but looks similar to | |
2728 | .\" .BR route (8). | |
2729 | .TP | |
2730 | .I /proc/net/snmp | |
c13182ef | 2731 | This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP |
fea681da | 2732 | management |
763f0e47 | 2733 | information bases for an SNMP agent. |
fea681da MK |
2734 | .TP |
2735 | .I /proc/net/tcp | |
c13182ef MK |
2736 | Holds a dump of the TCP socket table. |
2737 | Much of the information is not | |
2738 | of use apart from debugging. | |
2739 | The "sl" value is the kernel hash slot | |
6beb1671 MK |
2740 | for the socket, the "local_address" is the local address and port number pair. |
2741 | The "rem_address" is the remote address and port number pair | |
6c04f928 MK |
2742 | (if connected). |
2743 | \&"St" is the internal status of the socket. | |
2744 | The "tx_queue" and "rx_queue" are the | |
fea681da | 2745 | outgoing and incoming data queue in terms of kernel memory usage. |
94e9d9fe | 2746 | The "tr", "tm\->when", and "rexmits" fields hold internal information of |
f33774c4 | 2747 | the kernel socket state and are useful only for debugging. |
fdc196f5 MK |
2748 | The "uid" |
2749 | field holds the effective UID of the creator of the socket. | |
fea681da MK |
2750 | .TP |
2751 | .I /proc/net/udp | |
c13182ef MK |
2752 | Holds a dump of the UDP socket table. |
2753 | Much of the information is not of | |
2754 | use apart from debugging. | |
2755 | The "sl" value is the kernel hash slot for the | |
6beb1671 MK |
2756 | socket, the "local_address" is the local address and port number pair. |
2757 | The "rem_address" is the remote address and port number pair | |
fea681da MK |
2758 | (if connected). "St" is the internal status of the socket. |
2759 | The "tx_queue" and "rx_queue" are the outgoing and incoming data queue | |
c13182ef | 2760 | in terms of kernel memory usage. |
94e9d9fe | 2761 | The "tr", "tm\->when", and "rexmits" fields |
c13182ef | 2762 | are not used by UDP. |
fdc196f5 MK |
2763 | The "uid" |
2764 | field holds the effective UID of the creator of the socket. | |
fea681da MK |
2765 | The format is: |
2766 | ||
2767 | .nf | |
2768 | .ft CW | |
2769 | .in 1n | |
94e9d9fe | 2770 | sl local_address rem_address st tx_queue rx_queue tr rexmits tm\->when uid |
fea681da MK |
2771 | 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0 |
2772 | 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0 | |
2773 | 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 | |
2774 | .in | |
2775 | .ft | |
2776 | .fi | |
2777 | .TP | |
2778 | .I /proc/net/unix | |
008f1ecc | 2779 | Lists the UNIX domain sockets present within the system and their |
c13182ef MK |
2780 | status. |
2781 | The format is: | |
fea681da MK |
2782 | .nf |
2783 | .sp .5 | |
2784 | .ft CW | |
2785 | Num RefCount Protocol Flags Type St Path | |
2786 | 0: 00000002 00000000 00000000 0001 03 | |
2787 | 1: 00000001 00000000 00010000 0001 01 /dev/printer | |
2788 | .ft | |
2789 | .sp .5 | |
2790 | .fi | |
2791 | ||
6c04f928 MK |
2792 | Here "Num" is the kernel table slot number, "RefCount" is the number |
2793 | of users of the socket, "Protocol" is currently always 0, "Flags" | |
fea681da | 2794 | represent the internal kernel flags holding the status of the |
c13182ef | 2795 | socket. |
008f1ecc | 2796 | Currently, type is always "1" (UNIX domain datagram sockets are |
6c04f928 MK |
2797 | not yet supported in the kernel). |
2798 | \&"St" is the internal state of the | |
fea681da MK |
2799 | socket and Path is the bound path (if any) of the socket. |
2800 | .TP | |
ed8de0e4 FW |
2801 | .I /proc/net/netfilter/nfnetlink_queue |
2802 | This file contains information about netfilter userspace queueing, if used. | |
2803 | Each line represents a queue. Queues that have not been subscribed to | |
2804 | by userspace are not shown. | |
2805 | .nf | |
2806 | ||
2807 | 1 4207 0 2 65535 0 0 0 1 | |
2808 | (1) (2) (3)(4) (5) (6) (7) (8) | |
2809 | .fi | |
2810 | .IP | |
2811 | The fields in each line are: | |
2812 | .RS 7 | |
2813 | .TP 5 | |
2814 | (1) | |
2815 | The ID of the queue. This matches what is specified in the | |
2816 | .B \-\-queue\-num | |
2817 | or | |
2818 | .B \-\-queue\-balance | |
2819 | options to the | |
2820 | .BR iptables (8) | |
2821 | NFQUEUE target. See | |
2822 | .BR iptables-extensions (8) | |
2823 | for more information. | |
2824 | .TP | |
2825 | (2) | |
2826 | The netlink port id subscribed to the queue. | |
2827 | .TP | |
2828 | (3) | |
2829 | The number of packets currently queued and waiting to be processed by | |
2830 | the application. | |
2831 | .TP | |
2832 | (4) | |
2833 | The copy mode of the queue. It is either 1 (metadata only) or 2 | |
2834 | (also copy payload data to userspace). | |
2835 | .TP | |
2836 | (5) | |
2837 | Copy range, i.e. how many bytes of packet payload should be copied to | |
2838 | userspace at most. | |
2839 | .TP | |
2840 | (6) | |
2841 | queue dropped. Number of packets that had to be dropped by the kernel because | |
2842 | too many packets are already waiting for userspace to send back the mandatory | |
2843 | accept/drop verdicts. | |
2844 | .TP | |
2845 | (7) | |
2846 | queue user dropped. Number of packets that were dropped within the netlink | |
2847 | subsystem. Such drops usually happen when the corresponding socket buffer is | |
2848 | full, i.e. userspace is not able to read messages fast enough. | |
2849 | .TP | |
2850 | (8) | |
2851 | sequence number. Every queued packet is associated with a (32-bit) | |
2852 | monotonically-increasing sequence number. | |
2853 | This shows the ID of the most recent packet queued. | |
2854 | .RE | |
2855 | .IP | |
f33774c4 | 2856 | The last number exists only for compatibility reasons and is always 1. |
ed8de0e4 | 2857 | .TP |
fea681da | 2858 | .I /proc/partitions |
f042d149 MK |
2859 | Contains the major and minor numbers of each partition as well as the number |
2860 | of 1024-byte blocks and the partition name. | |
fea681da MK |
2861 | .TP |
2862 | .I /proc/pci | |
2863 | This is a listing of all PCI devices found during kernel initialization | |
2864 | and their configuration. | |
2990d781 | 2865 | |
59a40ed7 MK |
2866 | This file has been deprecated in favor of a new |
2867 | .I /proc | |
2990d781 MK |
2868 | interface for PCI |
2869 | .RI ( /proc/bus/pci ). | |
2870 | It became optional in Linux 2.2 (available with | |
2871 | .B CONFIG_PCI_OLD_PROC | |
2872 | set at kernel compilation). | |
24b74457 | 2873 | It became once more nonoptionally enabled in Linux 2.4. |
2990d781 MK |
2874 | Next, it was deprecated in Linux 2.6 (still available with |
2875 | .B CONFIG_PCI_LEGACY_PROC | |
2876 | set), and finally removed altogether since Linux 2.6.17. | |
bea08fec MK |
2877 | .\" FIXME Document /proc/sched_debug |
2878 | .\" | |
b4e9ee8f MK |
2879 | .\" .TP |
2880 | .\" .IR /proc/sched_debug " (since Linux 2.6.23)" | |
69119dc7 | 2881 | .\" See also /proc/[pid]/sched |
caea7868 MK |
2882 | .TP |
2883 | .IR /proc/profile " (since Linux 2.4)" | |
2884 | This file is present only if the kernel was booted with the | |
2885 | .I profile=1 | |
2886 | command-line option. | |
2887 | It exposes kernel profiling information in a binary format for use by | |
2888 | .BR readprofile (1). | |
2889 | Writing (e.g., an empty string) to this file resets the profiling counters; | |
2890 | on some architectures, | |
2891 | writing a binary integer "profiling multiplier" of size | |
2892 | .IR sizeof(int) | |
8a3ac89a | 2893 | sets the profiling interrupt frequency. |
fea681da MK |
2894 | .TP |
2895 | .I /proc/scsi | |
59a40ed7 MK |
2896 | A directory with the |
2897 | .I scsi | |
2898 | mid-level pseudo-file and various SCSI low-level | |
2990d781 MK |
2899 | driver directories, |
2900 | which contain a file for each SCSI host in this system, all of | |
c13182ef MK |
2901 | which give the status of some part of the SCSI IO subsystem. |
2902 | These files contain ASCII structures and are, therefore, readable with | |
2990d781 | 2903 | .BR cat (1). |
fea681da | 2904 | |
c13182ef | 2905 | You can also write to some of the files to reconfigure the subsystem or |
59a40ed7 | 2906 | switch certain features on or off. |
fea681da MK |
2907 | .TP |
2908 | .I /proc/scsi/scsi | |
c13182ef | 2909 | This is a listing of all SCSI devices known to the kernel. |
59a40ed7 | 2910 | The listing is similar to the one seen during bootup. |
c13182ef | 2911 | scsi currently supports only the \fIadd-single-device\fP command which |
59a40ed7 MK |
2912 | allows root to add a hotplugged device to the list of known devices. |
2913 | ||
2914 | The command | |
2915 | .in +4n | |
2916 | .nf | |
2917 | ||
2918 | echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi | |
fea681da | 2919 | |
59a40ed7 MK |
2920 | .fi |
2921 | .in | |
c13182ef MK |
2922 | will cause |
2923 | host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0. | |
2924 | If there | |
fea681da MK |
2925 | is already a device known on this address or the address is invalid, an |
2926 | error will be returned. | |
2927 | .TP | |
2928 | .I /proc/scsi/[drivername] | |
c13182ef MK |
2929 | \fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740, |
2930 | aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic, | |
2931 | scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000. | |
2932 | These directories show up for all drivers that registered at least one | |
59a40ed7 | 2933 | SCSI HBA. |
c13182ef | 2934 | Every directory contains one file per registered host. |
59a40ed7 | 2935 | Every host-file is named after the number the host was assigned during |
c13182ef | 2936 | initialization. |
fea681da | 2937 | |
c13182ef | 2938 | Reading these files will usually show driver and host configuration, |
f78ed33a | 2939 | statistics, and so on. |
fea681da MK |
2940 | |
2941 | Writing to these files allows different things on different hosts. | |
2942 | For example, with the \fIlatency\fP and \fInolatency\fP commands, | |
2943 | root can switch on and off command latency measurement code in the | |
c13182ef MK |
2944 | eata_dma driver. |
2945 | With the \fIlockup\fP and \fIunlock\fP commands, | |
2946 | root can control bus lockups simulated by the scsi_debug driver. | |
fea681da MK |
2947 | .TP |
2948 | .I /proc/self | |
59a40ed7 MK |
2949 | This directory refers to the process accessing the |
2950 | .I /proc | |
9ee4a2b6 | 2951 | filesystem, |
59a40ed7 MK |
2952 | and is identical to the |
2953 | .I /proc | |
2954 | directory named by the process ID of the same process. | |
fea681da MK |
2955 | .TP |
2956 | .I /proc/slabinfo | |
c13182ef | 2957 | Information about kernel caches. |
90878f7c | 2958 | Since Linux 2.6.16 this file is present only if the |
821643a8 MK |
2959 | .B CONFIG_SLAB |
2960 | kernel configuration option is enabled. | |
350038ff | 2961 | The columns in |
38f76cd2 | 2962 | .I /proc/slabinfo |
350038ff | 2963 | are: |
a08ea57c | 2964 | .in +4n |
fea681da | 2965 | .nf |
a08ea57c | 2966 | |
fea681da MK |
2967 | cache-name |
2968 | num-active-objs | |
2969 | total-objs | |
2970 | object-size | |
2971 | num-active-slabs | |
2972 | total-slabs | |
2973 | num-pages-per-slab | |
2974 | .fi | |
a08ea57c MK |
2975 | .in |
2976 | ||
c13182ef | 2977 | See |
fea681da MK |
2978 | .BR slabinfo (5) |
2979 | for details. | |
2980 | .TP | |
2981 | .I /proc/stat | |
c13182ef MK |
2982 | kernel/system statistics. |
2983 | Varies with architecture. | |
2984 | Common | |
fea681da MK |
2985 | entries include: |
2986 | .RS | |
2987 | .TP | |
2988 | \fIcpu 3357 0 4313 1362393\fP | |
bfbfcd18 | 2989 | The amount of time, measured in units of |
268f000b MK |
2990 | USER_HZ (1/100ths of a second on most architectures, use |
2991 | .IR sysconf(_SC_CLK_TCK) | |
2992 | to obtain the right value), | |
b81087ab | 2993 | .\" 1024 on Alpha and ia64 |
ae3b8047 MK |
2994 | that the system spent in various states: |
2995 | .RS | |
2996 | .TP | |
2997 | .I user | |
ea0841f6 | 2998 | (1) Time spent in user mode. |
ae3b8047 MK |
2999 | .TP |
3000 | .I nice | |
0633f951 | 3001 | (2) Time spent in user mode with low priority (nice). |
9f1b9726 | 3002 | .TP |
ae3b8047 | 3003 | .I system |
0633f951 | 3004 | (3) Time spent in system mode. |
ae3b8047 MK |
3005 | .TP |
3006 | .I idle | |
ea0841f6 | 3007 | (4) Time spent in the idle task. |
bea08fec | 3008 | .\" FIXME . Actually, the following info about the /proc/stat 'cpu' field |
e04a1f93 MK |
3009 | .\" does not seem to be quite right (at least in 2.6.12 or 3.6): |
3010 | .\" the idle time in /proc/uptime does not quite match this value | |
3011 | This value should be USER_HZ times the | |
4cb1deb7 MK |
3012 | second entry in the |
3013 | .I /proc/uptime | |
3014 | pseudo-file. | |
ae3b8047 MK |
3015 | .TP |
3016 | .IR iowait " (since Linux 2.5.41)" | |
ea0841f6 | 3017 | (5) Time waiting for I/O to complete. |
ae3b8047 MK |
3018 | .TP |
3019 | .IR irq " (since Linux 2.6.0-test4)" | |
ea0841f6 | 3020 | (6) Time servicing interrupts. |
ae3b8047 | 3021 | .TP |
0633f951 | 3022 | .IR softirq " (since Linux 2.6.0-test4)" |
ea0841f6 | 3023 | (7) Time servicing softirqs. |
ae3b8047 MK |
3024 | .TP |
3025 | .IR steal " (since Linux 2.6.11)" | |
ea0841f6 | 3026 | (8) Stolen time, which is the time spent in other operating systems when |
9de1f6cc | 3027 | running in a virtualized environment |
ae3b8047 MK |
3028 | .TP |
3029 | .IR guest " (since Linux 2.6.24)" | |
0633f951 | 3030 | (9) Time spent running a virtual CPU for guest |
afef1764 | 3031 | operating systems under the control of the Linux kernel. |
14c06953 | 3032 | .\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de |
d4fd4120 MK |
3033 | .TP |
3034 | .IR guest_nice " (since Linux 2.6.33)" | |
3035 | .\" commit ce0e7b28fb75cb003cfc8d0238613aaf1c55e797 | |
3036 | (10) Time spent running a niced guest (virtual CPU for guest | |
3037 | operating systems under the control of the Linux kernel). | |
ae3b8047 | 3038 | .RE |
fea681da MK |
3039 | .TP |
3040 | \fIpage 5741 1808\fP | |
3041 | The number of pages the system paged in and the number that were paged | |
3042 | out (from disk). | |
3043 | .TP | |
3044 | \fIswap 1 0\fP | |
3045 | The number of swap pages that have been brought in and out. | |
3046 | .TP | |
bea08fec | 3047 | .\" FIXME . The following is not the full picture for the 'intr' of |
777f5a9e | 3048 | .\" /proc/stat on 2.6: |
fea681da | 3049 | \fIintr 1462898\fP |
bfbfcd18 MK |
3050 | This line shows counts of interrupts serviced since boot time, |
3051 | for each of the possible system interrupts. | |
d63ff76e | 3052 | The first column is the total of all interrupts serviced |
d6a56978 MK |
3053 | including unnumbered architecture specific interrupts; |
3054 | each subsequent column is the total for that particular numbered interrupt. | |
d63ff76e | 3055 | Unnumbered interrupts are not shown, only summed into the total. |
fea681da MK |
3056 | .TP |
3057 | \fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP... | |
636297e9 | 3058 | (major,disk_idx):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written) |
bfbfcd18 MK |
3059 | .br |
3060 | (Linux 2.4 only) | |
fea681da MK |
3061 | .TP |
3062 | \fIctxt 115315\fP | |
3063 | The number of context switches that the system underwent. | |
3064 | .TP | |
3065 | \fIbtime 769041601\fP | |
f49c451a | 3066 | boot time, in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). |
fea681da MK |
3067 | .TP |
3068 | \fIprocesses 86031\fP | |
3069 | Number of forks since boot. | |
bfbfcd18 MK |
3070 | .TP |
3071 | \fIprocs_running 6\fP | |
3072 | Number of processes in runnable state. | |
5fab2e7c | 3073 | (Linux 2.5.45 onward.) |
bfbfcd18 MK |
3074 | .TP |
3075 | \fIprocs_blocked 2\fP | |
3076 | Number of processes blocked waiting for I/O to complete. | |
5fab2e7c | 3077 | (Linux 2.5.45 onward.) |
fea681da MK |
3078 | .RE |
3079 | .TP | |
3080 | .I /proc/swaps | |
c13182ef MK |
3081 | Swap areas in use. |
3082 | See also | |
fea681da MK |
3083 | .BR swapon (8). |
3084 | .TP | |
3085 | .I /proc/sys | |
3086 | This directory (present since 1.3.57) contains a number of files | |
3087 | and subdirectories corresponding to kernel variables. | |
3088 | These variables can be read and sometimes modified using | |
9ee4a2b6 | 3089 | the \fI/proc\fP filesystem, and the (deprecated) |
fea681da | 3090 | .BR sysctl (2) |
c13182ef | 3091 | system call. |
fea681da | 3092 | .TP |
6ab7c0aa | 3093 | .IR /proc/sys/abi " (since Linux 2.4.10)" |
fea681da | 3094 | This directory may contain files with application binary information. |
6ab7c0aa | 3095 | .\" On some systems, it is not present. |
66a9882e | 3096 | See the Linux kernel source file |
6ab7c0aa MK |
3097 | .I Documentation/sysctl/abi.txt |
3098 | for more information. | |
fea681da MK |
3099 | .TP |
3100 | .I /proc/sys/debug | |
3101 | This directory may be empty. | |
3102 | .TP | |
3103 | .I /proc/sys/dev | |
e2badfdf | 3104 | This directory contains device-specific information (e.g., |
9a67332e | 3105 | .IR dev/cdrom/info ). |
fea681da MK |
3106 | On |
3107 | some systems, it may be empty. | |
3108 | .TP | |
3109 | .I /proc/sys/fs | |
49236d3c | 3110 | This directory contains the files and subdirectories for kernel variables |
9ee4a2b6 | 3111 | related to filesystems. |
fea681da MK |
3112 | .TP |
3113 | .I /proc/sys/fs/binfmt_misc | |
c13182ef | 3114 | Documentation for files in this directory can be found |
66a9882e | 3115 | in the Linux kernel sources in |
fea681da MK |
3116 | .IR Documentation/binfmt_misc.txt . |
3117 | .TP | |
59a40ed7 MK |
3118 | .IR /proc/sys/fs/dentry-state " (since Linux 2.2)" |
3119 | This file contains information about the status of the | |
3120 | directory cache (dcache). | |
3121 | The file contains six numbers, | |
c13182ef | 3122 | .IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), " |
59a40ed7 | 3123 | .I want_pages |
fea681da | 3124 | (pages requested by system) and two dummy values. |
59a40ed7 MK |
3125 | .RS |
3126 | .IP * 2 | |
3127 | .I nr_dentry | |
3128 | is the number of allocated dentries (dcache entries). | |
3129 | This field is unused in Linux 2.2. | |
3130 | .IP * | |
3131 | .I nr_unused | |
3132 | is the number of unused dentries. | |
3133 | .IP * | |
3134 | .I age_limit | |
3135 | .\" looks like this is unused in kernels 2.2 to 2.6 | |
3136 | is the age in seconds after which dcache entries | |
3137 | can be reclaimed when memory is short. | |
3138 | .IP * | |
3139 | .I want_pages | |
3140 | .\" looks like this is unused in kernels 2.2 to 2.6 | |
c7094399 | 3141 | is nonzero when the kernel has called shrink_dcache_pages() and the |
fea681da | 3142 | dcache isn't pruned yet. |
59a40ed7 | 3143 | .RE |
fea681da MK |
3144 | .TP |
3145 | .I /proc/sys/fs/dir-notify-enable | |
3146 | This file can be used to disable or enable the | |
3147 | .I dnotify | |
3148 | interface described in | |
3149 | .BR fcntl (2) | |
3150 | on a system-wide basis. | |
3151 | A value of 0 in this file disables the interface, | |
3152 | and a value of 1 enables it. | |
3153 | .TP | |
3154 | .I /proc/sys/fs/dquot-max | |
3155 | This file shows the maximum number of cached disk quota entries. | |
3156 | On some (2.4) systems, it is not present. | |
3157 | If the number of free cached disk quota entries is very low and | |
3158 | you have some awesome number of simultaneous system users, | |
3159 | you might want to raise the limit. | |
3160 | .TP | |
3161 | .I /proc/sys/fs/dquot-nr | |
3162 | This file shows the number of allocated disk quota | |
3163 | entries and the number of free disk quota entries. | |
3164 | .TP | |
24cb4a4b | 3165 | .IR /proc/sys/fs/epoll " (since Linux 2.6.28)" |
242b46af MK |
3166 | This directory contains the file |
3167 | .IR max_user_watches , | |
24cb4a4b MK |
3168 | which can be used to limit the amount of kernel memory consumed by the |
3169 | .I epoll | |
3170 | interface. | |
3171 | For further details, see | |