]>
Commit | Line | Data |
---|---|---|
a1eaacb1 | 1 | '\" t |
9e3fdcb6 AC |
2 | .\" Copyright (C) 1994, 1995, Daniel Quinlan <quinlan@yggdrasil.com> |
3 | .\" Copyright (C) 2002-2008, 2017, Michael Kerrisk <mtk.manpages@gmail.com> | |
fea681da MK |
4 | .\" with networking additions from Alan Cox (A.Cox@swansea.ac.uk) |
5 | .\" and scsi additions from Michael Neuffer (neuffer@mail.uni-mainz.de) | |
6 | .\" and sysctl additions from Andries Brouwer (aeb@cwi.nl) | |
7 | .\" and System V IPC (as well as various other) additions from | |
c11b1abf | 8 | .\" Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da | 9 | .\" |
e4a74ca8 | 10 | .\" SPDX-License-Identifier: GPL-2.0-or-later |
fea681da MK |
11 | .\" |
12 | .\" Modified 1995-05-17 by faith@cs.unc.edu | |
13 | .\" Minor changes by aeb and Marty Leisner (leisner@sdsp.mc.xerox.com). | |
14 | .\" Modified 1996-04-13, 1996-07-22 by aeb@cwi.nl | |
15 | .\" Modified 2001-12-16 by rwhron@earthlink.net | |
16 | .\" Modified 2002-07-13 by jbelton@shaw.ca | |
17 | .\" Modified 2002-07-22, 2003-05-27, 2004-04-06, 2004-05-25 | |
c11b1abf | 18 | .\" by Michael Kerrisk <mtk.manpages@gmail.com> |
5d6d14a0 | 19 | .\" 2004-11-17, mtk -- updated notes on /proc/loadavg |
b324e17d | 20 | .\" 2004-12-01, mtk, rtsig-max and rtsig-nr went away in Linux 2.6.8 |
568105c6 MK |
21 | .\" 2004-12-14, mtk, updated 'statm', and fixed error in order of list |
22 | .\" 2005-05-12, mtk, updated 'stat' | |
6d64ca9c | 23 | .\" 2005-07-13, mtk, added /proc/sys/fs/mqueue/* |
363f747c MK |
24 | .\" 2005-09-16, mtk, Added /proc/sys/fs/suid_dumpable |
25 | .\" 2005-09-19, mtk, added /proc/zoneinfo | |
b4e9ee8f | 26 | .\" 2005-03-01, mtk, moved /proc/sys/fs/mqueue/* material to mq_overview.7. |
69119dc7 MK |
27 | .\" 2008-06-05, mtk, Added /proc/[pid]/oom_score, /proc/[pid]/oom_adj, |
28 | .\" /proc/[pid]/limits, /proc/[pid]/mountinfo, /proc/[pid]/mountstats, | |
29 | .\" and /proc/[pid]/fdinfo/*. | |
30 | .\" 2008-06-19, mtk, Documented /proc/[pid]/status. | |
cc2d5c36 | 31 | .\" 2008-07-15, mtk, added /proc/config.gz |
363f747c | 32 | .\" |
43d42cc0 | 33 | .\" FIXME cross check against Documentation/filesystems/proc.txt |
c13182ef | 34 | .\" to see what information could be imported from that file |
c533af9d | 35 | .\" into this file. |
fea681da | 36 | .\" |
a5ebdc8d | 37 | .TH proc 5 (date) "Linux man-pages (unreleased)" |
fea681da | 38 | .SH NAME |
2e1c1a57 | 39 | proc \- process information, system information, and sysctl pseudo-filesystem |
fea681da MK |
40 | .SH DESCRIPTION |
41 | The | |
31fa1fd2 | 42 | .B proc |
ac8727b6 | 43 | filesystem is a pseudo-filesystem which provides an interface to |
c13182ef MK |
44 | kernel data structures. |
45 | It is commonly mounted at | |
fea681da | 46 | .IR /proc . |
b574c52d MK |
47 | Typically, it is mounted automatically by the system, |
48 | but it can also be mounted manually using a command such as: | |
49 | .PP | |
50 | .in +4n | |
51 | .EX | |
52 | mount \-t proc proc /proc | |
53 | .EE | |
54 | .in | |
55 | .PP | |
7e174651 | 56 | Most of the files in the |
31fa1fd2 | 57 | .B proc |
7e174651 | 58 | filesystem are read-only, |
64165e01 | 59 | but some files are writable, allowing kernel variables to be changed. |
7e174651 | 60 | .\" |
fee59977 MK |
61 | .SS Mount options |
62 | The | |
31fa1fd2 | 63 | .B proc |
fee59977 MK |
64 | filesystem supports the following mount options: |
65 | .TP | |
66 | .BR hidepid "=\fIn\fP (since Linux 3.3)" | |
67 | .\" commit 0499680a42141d86417a8fbaa8c8db806bea1201 | |
68 | This option controls who can access the information in | |
1ae6b2c7 | 69 | .IR /proc/ pid |
fee59977 MK |
70 | directories. |
71 | The argument, | |
72 | .IR n , | |
73 | is one of the following values: | |
74 | .RS | |
75 | .TP 4 | |
76 | 0 | |
77 | Everybody may access all | |
1ae6b2c7 | 78 | .IR /proc/ pid |
fee59977 MK |
79 | directories. |
80 | This is the traditional behavior, | |
81 | and the default if this mount option is not specified. | |
82 | .TP | |
83 | 1 | |
84 | Users may not access files and subdirectories inside any | |
1ae6b2c7 | 85 | .IR /proc/ pid |
fee59977 | 86 | directories but their own (the |
1ae6b2c7 | 87 | .IR /proc/ pid |
fee59977 MK |
88 | directories themselves remain visible). |
89 | Sensitive files such as | |
1ae6b2c7 | 90 | .IR /proc/ pid /cmdline |
fee59977 | 91 | and |
1ae6b2c7 | 92 | .IR /proc/ pid /status |
fee59977 MK |
93 | are now protected against other users. |
94 | This makes it impossible to learn whether any user is running a | |
95 | specific program | |
96 | (so long as the program doesn't otherwise reveal itself by its behavior). | |
97 | .\" As an additional bonus, since | |
97949440 | 98 | .\" .IR /proc/[pid]/cmdline |
9d4976ce | 99 | .\" is inaccessible for other users, |
fee59977 MK |
100 | .\" poorly written programs passing sensitive information via |
101 | .\" program arguments are now protected against local eavesdroppers. | |
102 | .TP | |
103 | 2 | |
104 | As for mode 1, but in addition the | |
1ae6b2c7 | 105 | .IR /proc/ pid |
fee59977 MK |
106 | directories belonging to other users become invisible. |
107 | This means that | |
1ae6b2c7 | 108 | .IR /proc/ pid |
fee59977 MK |
109 | entries can no longer be used to discover the PIDs on the system. |
110 | This doesn't hide the fact that a process with a specific PID value exists | |
9bc87ed0 | 111 | (it can be learned by other means, for example, by "kill \-0 $PID"), |
fee59977 MK |
112 | but it hides a process's UID and GID, |
113 | which could otherwise be learned by employing | |
114 | .BR stat (2) | |
115 | on a | |
1ae6b2c7 | 116 | .IR /proc/ pid |
fee59977 MK |
117 | directory. |
118 | This greatly complicates an attacker's task of gathering | |
119 | information about running processes (e.g., discovering whether | |
120 | some daemon is running with elevated privileges, | |
121 | whether another user is running some sensitive program, | |
122 | whether other users are running any program at all, and so on). | |
123 | .RE | |
124 | .TP | |
125 | .BR gid "=\fIgid\fP (since Linux 3.3)" | |
126 | .\" commit 0499680a42141d86417a8fbaa8c8db806bea1201 | |
127 | Specifies the ID of a group whose members are authorized to | |
128 | learn process information otherwise prohibited by | |
1ae6b2c7 | 129 | .B hidepid |
95b1c1d1 | 130 | (i.e., users in this group behave as though |
fee59977 MK |
131 | .I /proc |
132 | was mounted with | |
95b1c1d1 | 133 | .IR hidepid=0 ). |
fee59977 MK |
134 | This group should be used instead of approaches such as putting |
135 | nonroot users into the | |
136 | .BR sudoers (5) | |
137 | file. | |
3c7cfa32 MK |
138 | .\" |
139 | .SS Overview | |
140 | Underneath | |
141 | .IR /proc , | |
142 | there are the following general groups of files and subdirectories: | |
143 | .TP | |
1ae6b2c7 | 144 | .IR /proc/ "pid subdirectories" |
3c7cfa32 MK |
145 | Each one of these subdirectories contains files and subdirectories |
146 | exposing information about the process with the corresponding process ID. | |
147 | .IP | |
148 | Underneath each of the | |
1ae6b2c7 | 149 | .IR /proc/ pid |
3c7cfa32 | 150 | directories, a |
7fe3b32b | 151 | .I task |
3c7cfa32 | 152 | subdirectory contains subdirectories of the form |
1ae6b2c7 | 153 | .IR task/ tid, |
3c7cfa32 MK |
154 | which contain corresponding information about each of the threads |
155 | in the process, where | |
156 | .I tid | |
157 | is the kernel thread ID of the thread. | |
01df7b70 MK |
158 | .IP |
159 | The | |
1ae6b2c7 | 160 | .IR /proc/ pid |
01df7b70 MK |
161 | subdirectories are visible when iterating through |
162 | .I /proc | |
163 | with | |
164 | .BR getdents (2) | |
165 | (and thus are visible when one uses | |
166 | .BR ls (1) | |
167 | to view the contents of | |
168 | .IR /proc ). | |
169 | .TP | |
1ae6b2c7 | 170 | .IR /proc/ "tid subdirectories" |
01df7b70 MK |
171 | Each one of these subdirectories contains files and subdirectories |
172 | exposing information about the thread with the corresponding thread ID. | |
37cd58d2 | 173 | The contents of these directories are the same as the corresponding |
1ae6b2c7 | 174 | .IR /proc/ pid /task/ tid |
37cd58d2 | 175 | directories. |
01df7b70 MK |
176 | .IP |
177 | The | |
1ae6b2c7 | 178 | .IR /proc/ tid |
01df7b70 MK |
179 | subdirectories are |
180 | .I not | |
181 | visible when iterating through | |
182 | .I /proc | |
183 | with | |
184 | .BR getdents (2) | |
185 | (and thus are | |
186 | .I not | |
187 | visible when one uses | |
188 | .BR ls (1) | |
3c7cfa32 MK |
189 | to view the contents of |
190 | .IR /proc ). | |
191 | .TP | |
192 | .I /proc/self | |
193 | When a process accesses this magic symbolic link, | |
194 | it resolves to the process's own | |
1ae6b2c7 | 195 | .IR /proc/ pid |
3c7cfa32 MK |
196 | directory. |
197 | .TP | |
184d797d | 198 | .I /proc/thread\-self |
3c7cfa32 MK |
199 | When a thread accesses this magic symbolic link, |
200 | it resolves to the process's own | |
1ae6b2c7 | 201 | .IR /proc/self/task/ tid |
3c7cfa32 MK |
202 | directory. |
203 | .TP | |
184d797d | 204 | .I /proc/[a\-z]* |
3c7cfa32 MK |
205 | Various other files and subdirectories under |
206 | .I /proc | |
207 | expose system-wide information. | |
208 | .PP | |
209 | All of the above are described in more detail below. | |
210 | .\" | |
fee59977 | 211 | .SS Files and directories |
71b36dc7 MK |
212 | The following list provides details of many of the files and directories |
213 | under the | |
743638fd MK |
214 | .I /proc |
215 | hierarchy. | |
fea681da | 216 | .TP |
1ae6b2c7 | 217 | .IR /proc/ pid |
fea681da MK |
218 | There is a numerical subdirectory for each running process; the |
219 | subdirectory is named by the process ID. | |
1e6a8e2f | 220 | Each |
1ae6b2c7 | 221 | .IR /proc/ pid |
e96ad1fd MK |
222 | subdirectory contains the pseudo-files and directories described below. |
223 | .IP | |
224 | The files inside each | |
1ae6b2c7 | 225 | .IR /proc/ pid |
e96ad1fd | 226 | directory are normally owned by the effective user and |
3bdb8ec5 MK |
227 | effective group ID of the process. |
228 | However, as a security measure, the ownership is made | |
1ae6b2c7 | 229 | .I root:root |
3bdb8ec5 | 230 | if the process's "dumpable" attribute is set to a value other than 1. |
fb49322d | 231 | .IP |
ae636827 MK |
232 | Before Linux 4.11, |
233 | .\" commit 68eb94f16227336a5773b83ecfa8290f1d6b78ce | |
1ae6b2c7 | 234 | .I root:root |
ae636827 MK |
235 | meant the "global" root user ID and group ID |
236 | (i.e., UID 0 and GID 0 in the initial user namespace). | |
237 | Since Linux 4.11, | |
238 | if the process is in a noninitial user namespace that has a | |
239 | valid mapping for user (group) ID 0 inside the namespace, then | |
240 | the user (group) ownership of the files under | |
1ae6b2c7 | 241 | .IR /proc/ pid |
ae636827 MK |
242 | is instead made the same as the root user (group) ID of the namespace. |
243 | This means that inside a container, | |
244 | things work as expected for the container "root" user. | |
245 | .IP | |
fb49322d | 246 | The process's "dumpable" attribute may change for the following reasons: |
3bdb8ec5 | 247 | .RS |
cdede5cd | 248 | .IP \[bu] 3 |
3bdb8ec5 MK |
249 | The attribute was explicitly set via the |
250 | .BR prctl (2) | |
251 | .B PR_SET_DUMPABLE | |
252 | operation. | |
cdede5cd | 253 | .IP \[bu] |
3bdb8ec5 | 254 | The attribute was reset to the value in the file |
1ae6b2c7 | 255 | .I /proc/sys/fs/suid_dumpable |
3bdb8ec5 MK |
256 | (described below), for the reasons described in |
257 | .BR prctl (2). | |
258 | .RE | |
259 | .IP | |
260 | Resetting the "dumpable" attribute to 1 reverts the ownership of the | |
1ae6b2c7 | 261 | .IR /proc/ pid /* |
eada5570 | 262 | files to the process's effective UID and GID. |
03687209 MK |
263 | Note, however, that if the effective UID or GID is subsequently modified, |
264 | then the "dumpable" attribute may be reset, as described in | |
265 | .BR prctl (2). | |
266 | Therefore, it may be desirable to reset the "dumpable" attribute | |
267 | .I after | |
268 | making any desired changes to the process's effective UID or GID. | |
b7a42567 | 269 | .TP |
1ae6b2c7 | 270 | .IR /proc/ pid /cwd |
c13182ef | 271 | This is a symbolic link to the current working directory of the process. |
59a40ed7 MK |
272 | To find out the current working directory of process 20, |
273 | for instance, you can do this: | |
2dad4c59 | 274 | .IP |
59a40ed7 | 275 | .in +4n |
37d5e699 | 276 | .EX |
9eff2f49 | 277 | .RB "$" " cd /proc/20/cwd; pwd \-P" |
37d5e699 | 278 | .EE |
59a40ed7 | 279 | .in |
2dad4c59 | 280 | .IP |
afcaf646 | 281 | .\" The following was still true as at kernel 2.6.13 |
c13182ef MK |
282 | In a multithreaded process, the contents of this symbolic link |
283 | are not available if the main thread has already terminated | |
afcaf646 | 284 | (typically by calling |
59a40ed7 | 285 | .BR pthread_exit (3)). |
2dad4c59 | 286 | .IP |
b902fe18 MK |
287 | Permission to dereference or read |
288 | .RB ( readlink (2)) | |
289 | this symbolic link is governed by a ptrace access mode | |
290 | .B PTRACE_MODE_READ_FSCREDS | |
291 | check; see | |
292 | .BR ptrace (2). | |
fea681da | 293 | .TP |
1ae6b2c7 | 294 | .IR /proc/ pid /environ |
09651080 MK |
295 | This file contains the initial environment that was set |
296 | when the currently executing program was started via | |
297 | .BR execve (2). | |
b957f81f | 298 | The entries are separated by null bytes (\[aq]\e0\[aq]), |
b4e9ee8f | 299 | and there may be a null byte at the end. |
fea681da | 300 | Thus, to print out the environment of process 1, you would do: |
37d5e699 | 301 | .IP |
a08ea57c | 302 | .in +4n |
37d5e699 | 303 | .EX |
b957f81f | 304 | .RB "$" " cat /proc/1/environ | tr \[aq]\e000\[aq] \[aq]\en\[aq]" |
37d5e699 | 305 | .EE |
a08ea57c | 306 | .in |
2dad4c59 | 307 | .IP |
09651080 MK |
308 | If, after an |
309 | .BR execve (2), | |
310 | the process modifies its environment | |
c187d2a1 | 311 | (e.g., by calling functions such as |
387e2438 MF |
312 | .BR putenv (3) |
313 | or modifying the | |
314 | .BR environ (7) | |
315 | variable directly), | |
09651080 MK |
316 | this file will |
317 | .I not | |
318 | reflect those changes. | |
2dad4c59 | 319 | .IP |
c187d2a1 | 320 | Furthermore, a process may change the memory location that this file refers via |
387e2438 | 321 | .BR prctl (2) |
c187d2a1 | 322 | operations such as |
387e2438 | 323 | .BR PR_SET_MM_ENV_START . |
2dad4c59 | 324 | .IP |
82664739 MK |
325 | Permission to access this file is governed by a ptrace access mode |
326 | .B PTRACE_MODE_READ_FSCREDS | |
327 | check; see | |
328 | .BR ptrace (2). | |
fea681da | 329 | .TP |
1ae6b2c7 | 330 | .IR /proc/ pid /exe |
fea681da | 331 | Under Linux 2.2 and later, this file is a symbolic link |
2d7195b8 | 332 | containing the actual pathname of the executed command. |
c13182ef MK |
333 | This symbolic link can be dereferenced normally; attempting to open |
334 | it will open the executable. | |
335 | You can even type | |
1ae6b2c7 | 336 | .IR /proc/ pid /exe |
06dd061c | 337 | to run another copy of the same executable that is being run by |
1ae6b2c7 AC |
338 | process |
339 | .IR pid . | |
7e3c767a | 340 | If the pathname has been unlinked, the symbolic link will contain the |
92b8493d | 341 | string \[aq]\ (deleted)\[aq] appended to the original pathname. |
afcaf646 | 342 | .\" The following was still true as at kernel 2.6.13 |
c13182ef MK |
343 | In a multithreaded process, the contents of this symbolic link |
344 | are not available if the main thread has already terminated | |
afcaf646 MK |
345 | (typically by calling |
346 | .BR pthread_exit (3)). | |
2dad4c59 | 347 | .IP |
b902fe18 MK |
348 | Permission to dereference or read |
349 | .RB ( readlink (2)) | |
350 | this symbolic link is governed by a ptrace access mode | |
351 | .B PTRACE_MODE_READ_FSCREDS | |
352 | check; see | |
353 | .BR ptrace (2). | |
2dad4c59 | 354 | .IP |
eb9a0b2f | 355 | Under Linux 2.0 and earlier, |
1ae6b2c7 | 356 | .IR /proc/ pid /exe |
c13182ef MK |
357 | is a pointer to the binary which was executed, |
358 | and appears as a symbolic link. | |
359 | A | |
fea681da MK |
360 | .BR readlink (2) |
361 | call on this file under Linux 2.0 returns a string in the format: | |
2dad4c59 | 362 | .IP |
1ae6b2c7 AC |
363 | .in +4n |
364 | .EX | |
365 | [device]:inode | |
366 | .EE | |
367 | .in | |
2dad4c59 | 368 | .IP |
fea681da MK |
369 | For example, [0301]:1502 would be inode 1502 on device major 03 (IDE, |
370 | MFM, etc. drives) minor 01 (first partition on the first drive). | |
2dad4c59 | 371 | .IP |
fea681da | 372 | .BR find (1) |
59a40ed7 MK |
373 | with the |
374 | .I \-inum | |
375 | option can be used to locate the file. | |
fea681da | 376 | .TP |
1ae6b2c7 | 377 | .IR /proc/ pid /fd/ |
fea681da MK |
378 | This is a subdirectory containing one entry for each file which the |
379 | process has open, named by its file descriptor, and which is a | |
c13182ef | 380 | symbolic link to the actual file. |
f78ed33a | 381 | Thus, 0 is standard input, 1 standard output, 2 standard error, and so on. |
2dad4c59 | 382 | .IP |
f75715e0 MK |
383 | For file descriptors for pipes and sockets, |
384 | the entries will be symbolic links whose content is the | |
385 | file type with the inode. | |
d4529654 MF |
386 | A |
387 | .BR readlink (2) | |
388 | call on this file returns a string in the format: | |
2dad4c59 | 389 | .IP |
1ae6b2c7 AC |
390 | .in +4n |
391 | .EX | |
392 | type:[inode] | |
393 | .EE | |
394 | .in | |
2dad4c59 | 395 | .IP |
f75715e0 MK |
396 | For example, |
397 | .I socket:[2248868] | |
398 | will be a socket and its inode is 2248868. | |
399 | For sockets, that inode can be used to find more information | |
400 | in one of the files under | |
d4529654 | 401 | .IR /proc/net/ . |
2dad4c59 | 402 | .IP |
2b7a2ac5 MK |
403 | For file descriptors that have no corresponding inode |
404 | (e.g., file descriptors produced by | |
89e284a2 | 405 | .BR bpf (2), |
2b7a2ac5 MK |
406 | .BR epoll_create (2), |
407 | .BR eventfd (2), | |
408 | .BR inotify_init (2), | |
89e284a2 | 409 | .BR perf_event_open (2), |
2b7a2ac5 | 410 | .BR signalfd (2), |
89e284a2 | 411 | .BR timerfd_create (2), |
2b7a2ac5 | 412 | and |
e8675558 | 413 | .BR userfaultfd (2)), |
2b7a2ac5 | 414 | the entry will be a symbolic link with contents of the form |
2dad4c59 | 415 | .IP |
1ae6b2c7 AC |
416 | .in +4n |
417 | .EX | |
418 | .RI anon_inode: file-type | |
419 | .EE | |
420 | .in | |
2dad4c59 | 421 | .IP |
e2a5929d | 422 | In many cases (but not all), the |
2b7a2ac5 MK |
423 | .I file-type |
424 | is surrounded by square brackets. | |
2dad4c59 | 425 | .IP |
2b7a2ac5 MK |
426 | For example, an epoll file descriptor will have a symbolic link |
427 | whose content is the string | |
428 | .IR "anon_inode:[eventpoll]" . | |
2dad4c59 | 429 | .IP |
d4529654 | 430 | .\"The following was still true as at kernel 2.6.13 |
afcaf646 | 431 | In a multithreaded process, the contents of this directory |
c13182ef | 432 | are not available if the main thread has already terminated |
afcaf646 MK |
433 | (typically by calling |
434 | .BR pthread_exit (3)). | |
2dad4c59 | 435 | .IP |
20c1a631 MK |
436 | Programs that take a filename as a command-line argument, |
437 | but don't take input from standard input if no argument is supplied, | |
438 | and programs that write to a file named as a command-line argument, | |
439 | but don't send their output to standard output | |
59a40ed7 | 440 | if no argument is supplied, can nevertheless be made to use |
20c1a631 | 441 | standard input or standard output by using |
1ae6b2c7 | 442 | .IR /proc/ pid /fd |
20c1a631 | 443 | files as command-line arguments. |
59a40ed7 MK |
444 | For example, assuming that |
445 | .I \-i | |
446 | is the flag designating an input file and | |
447 | .I \-o | |
448 | is the flag designating an output file: | |
37d5e699 | 449 | .IP |
a08ea57c | 450 | .in +4n |
37d5e699 | 451 | .EX |
b43a3b30 | 452 | .RB "$" " foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ..." |
37d5e699 | 453 | .EE |
a08ea57c | 454 | .in |
2dad4c59 | 455 | .IP |
fea681da MK |
456 | and you have a working filter. |
457 | .\" The following is not true in my tests (MTK): | |
458 | .\" Note that this will not work for | |
459 | .\" programs that seek on their files, as the files in the fd directory | |
460 | .\" are not seekable. | |
2dad4c59 | 461 | .IP |
59a40ed7 MK |
462 | .I /proc/self/fd/N |
463 | is approximately the same as | |
464 | .I /dev/fd/N | |
008f1ecc | 465 | in some UNIX and UNIX-like systems. |
c13182ef | 466 | Most Linux MAKEDEV scripts symbolically link |
59a40ed7 MK |
467 | .I /dev/fd |
468 | to | |
469 | .IR /proc/self/fd , | |
470 | in fact. | |
2dad4c59 | 471 | .IP |
59a40ed7 MK |
472 | Most systems provide symbolic links |
473 | .IR /dev/stdin , | |
474 | .IR /dev/stdout , | |
475 | and | |
476 | .IR /dev/stderr , | |
477 | which respectively link to the files | |
478 | .IR 0 , | |
479 | .IR 1 , | |
480 | and | |
1ae6b2c7 | 481 | .I 2 |
59a40ed7 MK |
482 | in |
483 | .IR /proc/self/fd . | |
484 | Thus the example command above could be written as: | |
d6bd89f3 | 485 | .IP |
59a40ed7 | 486 | .in +4n |
37d5e699 | 487 | .EX |
b43a3b30 | 488 | .RB "$" " foobar \-i /dev/stdin \-o /dev/stdout ..." |
37d5e699 | 489 | .EE |
59a40ed7 | 490 | .in |
138a191e MK |
491 | .IP |
492 | Permission to dereference or read | |
493 | .RB ( readlink (2)) | |
494 | the symbolic links in this directory is governed by a ptrace access mode | |
495 | .B PTRACE_MODE_READ_FSCREDS | |
496 | check; see | |
497 | .BR ptrace (2). | |
81c8aeb6 | 498 | .IP |
15f0b7af AC |
499 | Note that for file descriptors referring to inodes |
500 | (pipes and sockets, see above), | |
81c8aeb6 LW |
501 | those inodes still have permission bits and ownership information |
502 | distinct from those of the | |
1ae6b2c7 | 503 | .IR /proc/ pid /fd |
81c8aeb6 LW |
504 | entry, |
505 | and that the owner may differ from the user and group IDs of the process. | |
506 | An unprivileged process may lack permissions to open them, as in this example: | |
507 | .IP | |
508 | .in +4n | |
509 | .EX | |
184d797d | 510 | .RB "$" " echo test | sudo \-u nobody cat" |
81c8aeb6 | 511 | test |
184d797d | 512 | .RB "$" " echo test | sudo \-u nobody cat /proc/self/fd/0" |
81c8aeb6 LW |
513 | cat: /proc/self/fd/0: Permission denied |
514 | .EE | |
515 | .in | |
516 | .IP | |
517 | File descriptor 0 refers to the pipe created by the shell | |
518 | and owned by that shell's user, which is not | |
519 | .IR nobody , | |
520 | so | |
521 | .B cat | |
15f0b7af AC |
522 | does not have permission |
523 | to create a new file descriptor to read from that inode, | |
81c8aeb6 | 524 | even though it can still read from its existing file descriptor 0. |
69ab425e | 525 | .TP |
1ae6b2c7 | 526 | .IR /proc/ pid /fdinfo/ " (since Linux 2.6.22)" |
69ab425e MK |
527 | This is a subdirectory containing one entry for each file which the |
528 | process has open, named by its file descriptor. | |
0275956d | 529 | The files in this directory are readable only by the owner of the process. |
69ab425e | 530 | The contents of each file can be read to obtain information |
0275956d MK |
531 | about the corresponding file descriptor. |
532 | The content depends on the type of file referred to by the | |
d9cb0d7d | 533 | corresponding file descriptor. |
2dad4c59 | 534 | .IP |
0275956d | 535 | For regular files and directories, we see something like: |
37d5e699 | 536 | .IP |
69ab425e | 537 | .in +4n |
37d5e699 | 538 | .EX |
69ab425e MK |
539 | .RB "$" " cat /proc/12015/fdinfo/4" |
540 | pos: 1000 | |
541 | flags: 01002002 | |
0275956d | 542 | mnt_id: 21 |
37d5e699 | 543 | .EE |
69ab425e | 544 | .in |
2dad4c59 | 545 | .IP |
9599cbb3 MK |
546 | The fields are as follows: |
547 | .RS | |
548 | .TP | |
69ab425e | 549 | .I pos |
9599cbb3 MK |
550 | This is a decimal number showing the file offset. |
551 | .TP | |
69ab425e | 552 | .I flags |
9599cbb3 | 553 | This is an octal number that displays the |
69ab425e MK |
554 | file access mode and file status flags (see |
555 | .BR open (2)). | |
d7e537ce MK |
556 | If the close-on-exec file descriptor flag is set, then |
557 | .I flags | |
558 | will also include the value | |
559 | .BR O_CLOEXEC . | |
2dad4c59 | 560 | .IP |
d7e537ce MK |
561 | Before Linux 3.1, |
562 | .\" commit 1117f72ea0217ba0cc19f05adbbd8b9a397f5ab7 | |
563 | this field incorrectly displayed the setting of | |
564 | .B O_CLOEXEC | |
565 | at the time the file was opened, | |
566 | rather than the current setting of the close-on-exec flag. | |
9599cbb3 MK |
567 | .TP |
568 | .I | |
0275956d | 569 | .I mnt_id |
9599cbb3 | 570 | This field, present since Linux 3.15, |
0275956d | 571 | .\" commit 49d063cb353265c3af701bab215ac438ca7df36d |
525a8b54 | 572 | is the ID of the mount containing this file. |
0275956d | 573 | See the description of |
1ae6b2c7 | 574 | .IR /proc/ pid /mountinfo . |
9599cbb3 MK |
575 | .RE |
576 | .IP | |
6e7622ee MK |
577 | For eventfd file descriptors (see |
578 | .BR eventfd (2)), | |
b6a7fd50 MK |
579 | we see (since Linux 3.8) |
580 | .\" commit cbac5542d48127b546a23d816380a7926eee1c25 | |
581 | the following fields: | |
2dad4c59 | 582 | .IP |
6e7622ee | 583 | .in +4n |
37d5e699 | 584 | .EX |
6e7622ee MK |
585 | pos: 0 |
586 | flags: 02 | |
587 | mnt_id: 10 | |
184d797d | 588 | eventfd\-count: 40 |
37d5e699 | 589 | .EE |
6e7622ee | 590 | .in |
2dad4c59 | 591 | .IP |
184d797d | 592 | .I eventfd\-count |
6e7622ee | 593 | is the current value of the eventfd counter, in hexadecimal. |
2dad4c59 | 594 | .IP |
58d375dd MK |
595 | For epoll file descriptors (see |
596 | .BR epoll (7)), | |
b6a7fd50 MK |
597 | we see (since Linux 3.8) |
598 | .\" commit 138d22b58696c506799f8de759804083ff9effae | |
599 | the following fields: | |
2dad4c59 | 600 | .IP |
58d375dd | 601 | .in +4n |
37d5e699 | 602 | .EX |
58d375dd MK |
603 | pos: 0 |
604 | flags: 02 | |
605 | mnt_id: 10 | |
606 | tfd: 9 events: 19 data: 74253d2500000009 | |
607 | tfd: 7 events: 19 data: 74253d2500000007 | |
37d5e699 | 608 | .EE |
58d375dd | 609 | .in |
2dad4c59 | 610 | .IP |
58d375dd MK |
611 | Each of the lines beginning |
612 | .I tfd | |
613 | describes one of the file descriptors being monitored via | |
614 | the epoll file descriptor (see | |
615 | .BR epoll_ctl (2) | |
616 | for some details). | |
617 | The | |
1ae6b2c7 | 618 | .I tfd |
58d375dd MK |
619 | field is the number of the file descriptor. |
620 | The | |
621 | .I events | |
622 | field is a hexadecimal mask of the events being monitored for this file | |
623 | descriptor. | |
624 | The | |
625 | .I data | |
626 | field is the data value associated with this file descriptor. | |
2dad4c59 | 627 | .IP |
f8a14cac MK |
628 | For signalfd file descriptors (see |
629 | .BR signalfd (2)), | |
b6a7fd50 MK |
630 | we see (since Linux 3.8) |
631 | .\" commit 138d22b58696c506799f8de759804083ff9effae | |
632 | the following fields: | |
2dad4c59 | 633 | .IP |
f8a14cac | 634 | .in +4n |
37d5e699 | 635 | .EX |
f8a14cac MK |
636 | pos: 0 |
637 | flags: 02 | |
638 | mnt_id: 10 | |
639 | sigmask: 0000000000000006 | |
37d5e699 | 640 | .EE |
f8a14cac | 641 | .in |
2dad4c59 | 642 | .IP |
f8a14cac MK |
643 | .I sigmask |
644 | is the hexadecimal mask of signals that are accepted via this | |
645 | signalfd file descriptor. | |
646 | (In this example, bits 2 and 3 are set, corresponding to the signals | |
647 | .B SIGINT | |
648 | and | |
649 | .BR SIGQUIT ; | |
650 | see | |
651 | .BR signal (7).) | |
2dad4c59 | 652 | .IP |
4e77145c MK |
653 | For inotify file descriptors (see |
654 | .BR inotify (7)), | |
655 | we see (since Linux 3.8) | |
656 | the following fields: | |
2dad4c59 | 657 | .IP |
4e77145c | 658 | .in +4n |
37d5e699 | 659 | .EX |
4e77145c MK |
660 | pos: 0 |
661 | flags: 00 | |
662 | mnt_id: 11 | |
184d797d JW |
663 | inotify wd:2 ino:7ef82a sdev:800001 mask:800afff ignored_mask:0 fhandle\-bytes:8 fhandle\-type:1 f_handle:2af87e00220ffd73 |
664 | inotify wd:1 ino:192627 sdev:800001 mask:800afff ignored_mask:0 fhandle\-bytes:8 fhandle\-type:1 f_handle:27261900802dfd73 | |
37d5e699 | 665 | .EE |
4e77145c | 666 | .in |
2dad4c59 | 667 | .IP |
4e77145c MK |
668 | Each of the lines beginning with "inotify" displays information about |
669 | one file or directory that is being monitored. | |
670 | The fields in this line are as follows: | |
671 | .RS | |
672 | .TP | |
673 | .I wd | |
674 | A watch descriptor number (in decimal). | |
675 | .TP | |
676 | .I ino | |
677 | The inode number of the target file (in hexadecimal). | |
678 | .TP | |
679 | .I sdev | |
680 | The ID of the device where the target file resides (in hexadecimal). | |
681 | .TP | |
682 | .I mask | |
683 | The mask of events being monitored for the target file (in hexadecimal). | |
684 | .RE | |
685 | .IP | |
686 | If the kernel was built with exportfs support, the path to the target | |
687 | file is exposed as a file handle, via three hexadecimal fields: | |
184d797d JW |
688 | .IR fhandle\-bytes , |
689 | .IR fhandle\-type , | |
4e77145c MK |
690 | and |
691 | .IR f_handle . | |
2dad4c59 | 692 | .IP |
e2444bcb MK |
693 | For fanotify file descriptors (see |
694 | .BR fanotify (7)), | |
695 | we see (since Linux 3.8) | |
696 | the following fields: | |
2dad4c59 | 697 | .IP |
e2444bcb | 698 | .in +4n |
37d5e699 | 699 | .EX |
e2444bcb MK |
700 | pos: 0 |
701 | flags: 02 | |
702 | mnt_id: 11 | |
184d797d JW |
703 | fanotify flags:0 event\-flags:88002 |
704 | fanotify ino:19264f sdev:800001 mflags:0 mask:1 ignored_mask:0 fhandle\-bytes:8 fhandle\-type:1 f_handle:4f261900a82dfd73 | |
37d5e699 | 705 | .EE |
e2444bcb | 706 | .in |
2dad4c59 | 707 | .IP |
e2444bcb MK |
708 | The fourth line displays information defined when the fanotify group |
709 | was created via | |
710 | .BR fanotify_init (2): | |
711 | .RS | |
712 | .TP | |
713 | .I flags | |
714 | The | |
715 | .I flags | |
716 | argument given to | |
717 | .BR fanotify_init (2) | |
718 | (expressed in hexadecimal). | |
719 | .TP | |
184d797d | 720 | .I event\-flags |
e2444bcb MK |
721 | The |
722 | .I event_f_flags | |
723 | argument given to | |
724 | .BR fanotify_init (2) | |
725 | (expressed in hexadecimal). | |
726 | .RE | |
727 | .IP | |
728 | Each additional line shown in the file contains information | |
729 | about one of the marks in the fanotify group. | |
730 | Most of these fields are as for inotify, except: | |
731 | .RS | |
732 | .TP | |
733 | .I mflags | |
734 | The flags associated with the mark | |
735 | (expressed in hexadecimal). | |
736 | .TP | |
737 | .I mask | |
738 | The events mask for this mark | |
739 | (expressed in hexadecimal). | |
740 | .TP | |
741 | .I ignored_mask | |
742 | The mask of events that are ignored for this mark | |
743 | (expressed in hexadecimal). | |
744 | .RE | |
745 | .IP | |
746 | For details on these fields, see | |
747 | .BR fanotify_mark (2). | |
340a16a6 LW |
748 | .IP |
749 | For timerfd file descriptors (see | |
750 | .BR timerfd (2)), | |
751 | we see (since Linux 3.17) | |
cd595f62 | 752 | .\" commit af9c4957cf212ad9cf0bee34c95cb11de5426e85 |
340a16a6 LW |
753 | the following fields: |
754 | .IP | |
755 | .in +4n | |
756 | .EX | |
757 | pos: 0 | |
758 | flags: 02004002 | |
759 | mnt_id: 13 | |
760 | clockid: 0 | |
761 | ticks: 0 | |
762 | settime flags: 03 | |
763 | it_value: (7695568592, 640020877) | |
764 | it_interval: (0, 0) | |
765 | .EE | |
766 | .in | |
1cdbc3a6 MK |
767 | .RS |
768 | .TP | |
340a16a6 | 769 | .I clockid |
1cdbc3a6 | 770 | This is the numeric value of the clock ID |
734ec506 MK |
771 | (corresponding to one of the |
772 | .B CLOCK_* | |
773 | constants defined via | |
a6425049 | 774 | .IR <time.h> ) |
cb5a67a4 | 775 | that is used to mark the progress of the timer (in this example, 0 is |
340a16a6 | 776 | .BR CLOCK_REALTIME ). |
1cdbc3a6 | 777 | .TP |
340a16a6 | 778 | .I ticks |
1cdbc3a6 MK |
779 | This is the number of timer expirations that have occurred, |
780 | (i.e., the value that | |
340a16a6 | 781 | .BR read (2) |
1cdbc3a6 MK |
782 | on it would return). |
783 | .TP | |
340a16a6 | 784 | .I settime flags |
1cdbc3a6 | 785 | This field lists the flags with which the timerfd was last armed (see |
340a16a6 LW |
786 | .BR timerfd_settime (2)), |
787 | in octal | |
788 | (in this example, both | |
789 | .B TFD_TIMER_ABSTIME | |
790 | and | |
791 | .B TFD_TIMER_CANCEL_ON_SET | |
792 | are set). | |
1cdbc3a6 | 793 | .TP |
340a16a6 | 794 | .I it_value |
1cdbc3a6 MK |
795 | This field contains the amount of time until the timer will next expire, |
796 | expressed in seconds and nanoseconds. | |
734ec506 MK |
797 | This is always expressed as a relative value, |
798 | regardless of whether the timer was created using the | |
799 | .B TFD_TIMER_ABSTIME | |
800 | flag. | |
1cdbc3a6 | 801 | .TP |
340a16a6 | 802 | .I it_interval |
1cdbc3a6 MK |
803 | This field contains the interval of the timer, |
804 | in seconds and nanoseconds. | |
805 | (The | |
806 | .I it_value | |
807 | and | |
808 | .I it_interval | |
809 | fields contain the values that | |
340a16a6 | 810 | .BR timerfd_gettime (2) |
1cdbc3a6 MK |
811 | on this file descriptor would return.) |
812 | .RE | |
0ca2fc4d | 813 | .TP |
1ae6b2c7 | 814 | .IR /proc/ pid /gid_map " (since Linux 3.5)" |
93401860 MK |
815 | See |
816 | .BR user_namespaces (7). | |
817 | .TP | |
b324e17d | 818 | .IR /proc/ pid /io " (since Linux 2.6.20)" |
68f11066 MK |
819 | .\" commit 7c3ab7381e79dfc7db14a67c6f4f3285664e1ec2 |
820 | This file contains I/O statistics for the process, for example: | |
37d5e699 | 821 | .IP |
0ca2fc4d | 822 | .in +4n |
37d5e699 | 823 | .EX |
0ca2fc4d PS |
824 | .RB "#" " cat /proc/3828/io" |
825 | rchar: 323934931 | |
826 | wchar: 323929600 | |
827 | syscr: 632687 | |
828 | syscw: 632675 | |
829 | read_bytes: 0 | |
830 | write_bytes: 323932160 | |
831 | cancelled_write_bytes: 0 | |
37d5e699 | 832 | .EE |
0ca2fc4d | 833 | .in |
2dad4c59 | 834 | .IP |
0ca2fc4d PS |
835 | The fields are as follows: |
836 | .RS | |
68f11066 MK |
837 | .TP |
838 | .IR rchar ": characters read" | |
0ca2fc4d PS |
839 | The number of bytes which this task has caused to be read from storage. |
840 | This is simply the sum of bytes which this process passed to | |
841 | .BR read (2) | |
68f11066 | 842 | and similar system calls. |
11256884 | 843 | It includes things such as terminal I/O and |
68f11066 MK |
844 | is unaffected by whether or not actual |
845 | physical disk I/O was required (the read might have been satisfied from | |
0ca2fc4d | 846 | pagecache). |
68f11066 MK |
847 | .TP |
848 | .IR wchar ": characters written" | |
0ca2fc4d PS |
849 | The number of bytes which this task has caused, or shall cause to be written |
850 | to disk. | |
851 | Similar caveats apply here as with | |
852 | .IR rchar . | |
68f11066 MK |
853 | .TP |
854 | .IR syscr ": read syscalls" | |
36546c38 | 855 | Attempt to count the number of read I/O operations\[em]that is, |
68f11066 | 856 | system calls such as |
0ca2fc4d PS |
857 | .BR read (2) |
858 | and | |
859 | .BR pread (2). | |
68f11066 MK |
860 | .TP |
861 | .IR syscw ": write syscalls" | |
36546c38 | 862 | Attempt to count the number of write I/O operations\[em]that is, |
68f11066 | 863 | system calls such as |
0ca2fc4d PS |
864 | .BR write (2) |
865 | and | |
866 | .BR pwrite (2). | |
68f11066 MK |
867 | .TP |
868 | .IR read_bytes ": bytes read" | |
0ca2fc4d PS |
869 | Attempt to count the number of bytes which this process really did cause to |
870 | be fetched from the storage layer. | |
871 | This is accurate for block-backed filesystems. | |
68f11066 MK |
872 | .TP |
873 | .IR write_bytes ": bytes written" | |
0ca2fc4d PS |
874 | Attempt to count the number of bytes which this process caused to be sent to |
875 | the storage layer. | |
68f11066 | 876 | .TP |
0ca2fc4d | 877 | .IR cancelled_write_bytes : |
0ca2fc4d | 878 | The big inaccuracy here is truncate. |
c7169ee5 | 879 | If a process writes 1 MB to a file and then deletes the file, |
0ca2fc4d | 880 | it will in fact perform no writeout. |
c7169ee5 | 881 | But it will have been accounted as having caused 1 MB of write. |
68f11066 | 882 | In other words: this field represents the number of bytes which this process |
0ca2fc4d | 883 | caused to not happen, by truncating pagecache. |
68f11066 | 884 | A task can cause "negative" I/O too. |
0ca2fc4d | 885 | If this task truncates some dirty pagecache, |
68f11066 MK |
886 | some I/O which another task has been accounted for |
887 | (in its | |
888 | .IR write_bytes ) | |
889 | will not be happening. | |
890 | .RE | |
0ca2fc4d PS |
891 | .IP |
892 | .IR Note : | |
68f11066 | 893 | In the current implementation, things are a bit racy on 32-bit systems: |
0ca2fc4d | 894 | if process A reads process B's |
1ae6b2c7 | 895 | .IR /proc/ pid /io |
68f11066 | 896 | while process B is updating one of these 64-bit counters, |
0ca2fc4d | 897 | process A could see an intermediate result. |
2dad4c59 | 898 | .IP |
d8e2972a MK |
899 | Permission to access this file is governed by a ptrace access mode |
900 | .B PTRACE_MODE_READ_FSCREDS | |
901 | check; see | |
902 | .BR ptrace (2). | |
f6e17121 | 903 | .TP |
1ae6b2c7 | 904 | .IR /proc/ pid /limits " (since Linux 2.6.24)" |
69ab425e MK |
905 | This file displays the soft limit, hard limit, and units of measurement |
906 | for each of the process's resource limits (see | |
907 | .BR getrlimit (2)). | |
908 | Up to and including Linux 2.6.35, | |
909 | this file is protected to allow reading only by the real UID of the process. | |
910 | Since Linux 2.6.36, | |
911 | .\" commit 3036e7b490bf7878c6dae952eec5fb87b1106589 | |
912 | this file is readable by all users on the system. | |
df2a8576 | 913 | .\" FIXME Describe /proc/[pid]/loginuid |
b324e17d | 914 | .\" Added in Linux 2.6.11; updating requires CAP_AUDIT_CONTROL |
df2a8576 | 915 | .\" CONFIG_AUDITSYSCALL |
b4f89985 | 916 | .TP |
b324e17d | 917 | .IR /proc/ pid /map_files/ " (since Linux 3.3)" |
18cdd0ac MK |
918 | .\" commit 640708a2cff7f81e246243b0073c66e6ece7e53e |
919 | This subdirectory contains entries corresponding to memory-mapped | |
b4f89985 PE |
920 | files (see |
921 | .BR mmap (2)). | |
18cdd0ac MK |
922 | Entries are named by memory region start and end |
923 | address pair (expressed as hexadecimal numbers), | |
924 | and are symbolic links to the mapped files themselves. | |
15f0b7af AC |
925 | Here is an example, |
926 | with the output wrapped and reformatted to fit on an 80-column display: | |
37d5e699 | 927 | .IP |
b4f89985 | 928 | .in +4n |
37d5e699 | 929 | .EX |
184d797d | 930 | .RB "#" " ls \-l /proc/self/map_files/" |
18cdd0ac | 931 | lr\-\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:31 |
9bc87ed0 | 932 | 3252e00000\-3252e20000 \-> /usr/lib64/ld\-2.15.so |
b4f89985 | 933 | \&... |
37d5e699 | 934 | .EE |
b4f89985 | 935 | .in |
2dad4c59 | 936 | .IP |
b4f89985 | 937 | Although these entries are present for memory regions that were |
d6a56978 | 938 | mapped with the |
1ae6b2c7 | 939 | .B MAP_FILE |
18cdd0ac | 940 | flag, the way anonymous shared memory (regions created with the |
b4f89985 PE |
941 | .B MAP_ANON | MAP_SHARED |
942 | flags) | |
943 | is implemented in Linux | |
18cdd0ac MK |
944 | means that such regions also appear on this directory. |
945 | Here is an example where the target file is the deleted | |
946 | .I /dev/zero | |
947 | one: | |
37d5e699 | 948 | .IP |
b4f89985 | 949 | .in +4n |
37d5e699 | 950 | .EX |
18cdd0ac MK |
951 | lrw\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:33 |
952 | 7fc075d2f000\-7fc075e6f000 \-> /dev/zero (deleted) | |
37d5e699 | 953 | .EE |
b4f89985 | 954 | .in |
2dad4c59 | 955 | .IP |
6a036b00 KF |
956 | Permission to access this file is governed by a ptrace access mode |
957 | .B PTRACE_MODE_READ_FSCREDS | |
958 | check; see | |
959 | .BR ptrace (2). | |
960 | .IP | |
b324e17d | 961 | Until Linux 4.3, |
84eb2279 MK |
962 | .\" commit bdb4d100afe9818aebd1d98ced575c5ef143456c |
963 | this directory appeared only if the | |
b4f89985 | 964 | .B CONFIG_CHECKPOINT_RESTORE |
6a036b00 | 965 | kernel configuration option was enabled. |
167f94b7 MK |
966 | .IP |
967 | Capabilities are required to read the contents of the symbolic links in | |
968 | this directory: before Linux 5.9, the reading process requires | |
1ae6b2c7 | 969 | .B CAP_SYS_ADMIN |
167f94b7 MK |
970 | in the initial user namespace; |
971 | since Linux 5.9, the reading process must have either | |
1ae6b2c7 | 972 | .B CAP_SYS_ADMIN |
167f94b7 | 973 | or |
1ae6b2c7 | 974 | .B CAP_CHECKPOINT_RESTORE |
2c90b4a7 | 975 | in the initial (i.e. root) user namespace. |
fea681da | 976 | .TP |
1ae6b2c7 | 977 | .IR /proc/ pid /maps |
fea681da MK |
978 | A file containing the currently mapped memory regions and their access |
979 | permissions. | |
bbf9f397 MK |
980 | See |
981 | .BR mmap (2) | |
982 | for some further information about memory mappings. | |
2dad4c59 | 983 | .IP |
aee2f0bf MK |
984 | Permission to access this file is governed by a ptrace access mode |
985 | .B PTRACE_MODE_READ_FSCREDS | |
986 | check; see | |
987 | .BR ptrace (2). | |
2dad4c59 | 988 | .IP |
dd0c3b96 | 989 | The format of the file is: |
c1a022dc | 990 | .IP |
73942082 | 991 | .in +4n |
c1a022dc | 992 | .EX |
21781757 | 993 | .I "address perms offset dev inode pathname" |
184d797d JW |
994 | 00400000\-00452000 r\-xp 00000000 08:02 173521 /usr/bin/dbus\-daemon |
995 | 00651000\-00652000 r\-\-p 00051000 08:02 173521 /usr/bin/dbus\-daemon | |
996 | 00652000\-00655000 rw\-p 00052000 08:02 173521 /usr/bin/dbus\-daemon | |
997 | 00e03000\-00e24000 rw\-p 00000000 00:00 0 [heap] | |
998 | 00e24000\-011f7000 rw\-p 00000000 00:00 0 [heap] | |
182090db | 999 | \&... |
184d797d JW |
1000 | 35b1800000\-35b1820000 r\-xp 00000000 08:02 135522 /usr/lib64/ld\-2.15.so |
1001 | 35b1a1f000\-35b1a20000 r\-\-p 0001f000 08:02 135522 /usr/lib64/ld\-2.15.so | |
1002 | 35b1a20000\-35b1a21000 rw\-p 00020000 08:02 135522 /usr/lib64/ld\-2.15.so | |
1003 | 35b1a21000\-35b1a22000 rw\-p 00000000 00:00 0 | |
1004 | 35b1c00000\-35b1dac000 r\-xp 00000000 08:02 135870 /usr/lib64/libc\-2.15.so | |
1005 | 35b1dac000\-35b1fac000 \-\-\-p 001ac000 08:02 135870 /usr/lib64/libc\-2.15.so | |
1006 | 35b1fac000\-35b1fb0000 r\-\-p 001ac000 08:02 135870 /usr/lib64/libc\-2.15.so | |
1007 | 35b1fb0000\-35b1fb2000 rw\-p 001b0000 08:02 135870 /usr/lib64/libc\-2.15.so | |
182090db | 1008 | \&... |
184d797d | 1009 | f2c6ff8c000\-7f2c7078c000 rw\-p 00000000 00:00 0 [stack:986] |
182090db | 1010 | \&... |
184d797d JW |
1011 | 7fffb2c0d000\-7fffb2c2e000 rw\-p 00000000 00:00 0 [stack] |
1012 | 7fffb2d48000\-7fffb2d49000 r\-xp 00000000 00:00 0 [vdso] | |
c1a022dc | 1013 | .EE |
21781757 | 1014 | .in |
c1a022dc | 1015 | .IP |
7d2e6d74 | 1016 | The |
3eb8c588 MK |
1017 | .I address |
1018 | field is the address space in the process that the mapping occupies. | |
1019 | The | |
1020 | .I perms | |
1021 | field is a set of permissions: | |
2dad4c59 | 1022 | .IP |
161b8eda | 1023 | .in +4n |
37d5e699 | 1024 | .EX |
fea681da MK |
1025 | r = read |
1026 | w = write | |
1027 | x = execute | |
1028 | s = shared | |
1029 | p = private (copy on write) | |
37d5e699 | 1030 | .EE |
fea681da | 1031 | .in |
2dad4c59 | 1032 | .IP |
3eb8c588 MK |
1033 | The |
1034 | .I offset | |
b844cf04 | 1035 | field is the offset into the file/whatever; |
3eb8c588 MK |
1036 | .I dev |
1037 | is the device | |
dd0c3b96 | 1038 | (major:minor); |
3eb8c588 MK |
1039 | .I inode |
1040 | is the inode on that device. | |
59a40ed7 | 1041 | 0 indicates that no inode is associated with the memory region, |
16e64bae | 1042 | as would be the case with BSS (uninitialized data). |
2dad4c59 | 1043 | .IP |
3eb8c588 MK |
1044 | The |
1045 | .I pathname | |
1046 | field will usually be the file that is backing the mapping. | |
491ea6f1 | 1047 | For ELF files, |
3eb8c588 MK |
1048 | you can easily coordinate with the |
1049 | .I offset | |
1050 | field by looking at the | |
491ea6f1 MK |
1051 | Offset field in the ELF program headers |
1052 | .RI ( "readelf\ \-l" ). | |
2dad4c59 | 1053 | .IP |
491ea6f1 | 1054 | There are additional helpful pseudo-paths: |
0019177e | 1055 | .RS |
61b0b1f4 | 1056 | .TP |
1ae6b2c7 | 1057 | .I [stack] |
16e64bae | 1058 | The initial process's (also known as the main thread's) stack. |
61b0b1f4 | 1059 | .TP |
b324e17d | 1060 | .IR [stack: tid ] " (from Linux 3.4 to Linux 4.4)" |
bca7fbb5 MK |
1061 | .\" commit b76437579d1344b612cf1851ae610c636cec7db0 (added) |
1062 | .\" commit 65376df582174ffcec9e6471bf5b0dd79ba05e4a (removed) | |
61b0b1f4 | 1063 | A thread's stack (where the |
1ae6b2c7 | 1064 | .I tid |
61b0b1f4 | 1065 | is a thread ID). |
491ea6f1 | 1066 | It corresponds to the |
1ae6b2c7 | 1067 | .IR /proc/ pid /task/ tid / |
37d32c38 | 1068 | path. |
bca7fbb5 MK |
1069 | This field was removed in Linux 4.5, since providing this information |
1070 | for a process with large numbers of threads is expensive. | |
61b0b1f4 | 1071 | .TP |
1ae6b2c7 | 1072 | .I [vdso] |
61b0b1f4 | 1073 | The virtual dynamically linked shared object. |
c56a0185 MK |
1074 | See |
1075 | .BR vdso (7). | |
61b0b1f4 | 1076 | .TP |
1ae6b2c7 | 1077 | .I [heap] |
61b0b1f4 | 1078 | The process's heap. |
b3d38b5c NG |
1079 | .TP |
1080 | .IR [anon: name ] " (since Linux 5.17)" | |
1081 | .\" Commit 9a10064f5625d5572c3626c1516e0bebc6c9fe9b | |
1082 | A named private anonymous mapping. | |
1083 | Set with | |
1084 | .BR prctl (2) | |
1085 | .BR PR_SET_VMA_ANON_NAME . | |
1086 | .TP | |
1087 | .IR [anon_shmem: name ] " (since Linux 6.2)" | |
1088 | .\" Commit d09e8ca6cb93bb4b97517a18fbbf7eccb0e9ff43 | |
1089 | A named shared anonymous mapping. | |
1090 | Set with | |
1091 | .BR prctl (2) | |
1092 | .BR PR_SET_VMA_ANON_NAME . | |
61b0b1f4 | 1093 | .in |
61b0b1f4 MK |
1094 | .RE |
1095 | .IP | |
3eb8c588 MK |
1096 | If the |
1097 | .I pathname | |
1098 | field is blank, | |
40382e5e MK |
1099 | this is an anonymous mapping as obtained via |
1100 | .BR mmap (2). | |
61b0b1f4 MK |
1101 | There is no easy way to coordinate this back to a process's source, |
1102 | short of running it through | |
491ea6f1 MK |
1103 | .BR gdb (1), |
1104 | .BR strace (1), | |
1105 | or similar. | |
2dad4c59 | 1106 | .IP |
b6547479 EK |
1107 | .I pathname |
1108 | is shown unescaped except for newline characters, which are replaced | |
d512e7b4 MK |
1109 | with an octal escape sequence. |
1110 | As a result, it is not possible to determine whether the original | |
1111 | pathname contained a newline character or the literal | |
9363af08 | 1112 | .I \e012 |
b6547479 EK |
1113 | character sequence. |
1114 | .IP | |
1115 | If the mapping is file-backed and the file has been deleted, the string | |
d512e7b4 MK |
1116 | " (deleted)" is appended to the pathname. |
1117 | Note that this is ambiguous too. | |
b6547479 | 1118 | .IP |
eb9a0b2f | 1119 | Under Linux 2.0, there is no field giving pathname. |
fea681da | 1120 | .TP |
1ae6b2c7 | 1121 | .IR /proc/ pid /mem |
fea681da MK |
1122 | This file can be used to access the pages of a process's memory through |
1123 | .BR open (2), | |
1124 | .BR read (2), | |
1125 | and | |
ccb2bb0d | 1126 | .BR lseek (2). |
2dad4c59 | 1127 | .IP |
aee2f0bf MK |
1128 | Permission to access this file is governed by a ptrace access mode |
1129 | .B PTRACE_MODE_ATTACH_FSCREDS | |
1130 | check; see | |
1131 | .BR ptrace (2). | |
b4e9ee8f | 1132 | .TP |
1ae6b2c7 | 1133 | .IR /proc/ pid /mountinfo " (since Linux 2.6.26)" |
b4e9ee8f | 1134 | .\" This info adapted from Documentation/filesystems/proc.txt |
fb4bdaa1 | 1135 | .\" commit 2d4d4864ac08caff5c204a752bd004eed4f08760 |
525a8b54 | 1136 | This file contains information about mounts |
ef5b47f6 MK |
1137 | in the process's mount namespace (see |
1138 | .BR mount_namespaces (7)). | |
fb4bdaa1 MK |
1139 | It supplies various information |
1140 | (e.g., propagation state, root of mount for bind mounts, | |
1141 | identifier for each mount and its parent) that is missing from the (older) | |
1ae6b2c7 | 1142 | .IR /proc/ pid /mounts |
fb4bdaa1 MK |
1143 | file, and fixes various other problems with that file |
1144 | (e.g., nonextensibility, | |
1145 | failure to distinguish per-mount versus per-superblock options). | |
2dad4c59 | 1146 | .IP |
fb4bdaa1 | 1147 | The file contains lines of the form: |
c1a022dc | 1148 | .IP |
c1a022dc | 1149 | .EX |
0f619d1f | 1150 | 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 \- ext3 /dev/root rw,errors=continue |
b4e9ee8f | 1151 | (1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11) |
c1a022dc | 1152 | .EE |
b4e9ee8f MK |
1153 | .IP |
1154 | The numbers in parentheses are labels for the descriptions below: | |
3bc960c2 | 1155 | .RS 7 |
b4e9ee8f MK |
1156 | .TP 5 |
1157 | (1) | |
0f619d1f | 1158 | mount ID: a unique ID for the mount (may be reused after |
b4e9ee8f MK |
1159 | .BR umount (2)). |
1160 | .TP | |
1161 | (2) | |
29270550 MK |
1162 | parent ID: the ID of the parent mount |
1163 | (or of self for the root of this mount namespace's mount tree). | |
1164 | .IP | |
8c420ed8 MK |
1165 | If a new mount is stacked on top of a previous existing mount |
1166 | (so that it hides the existing mount) at pathname P, | |
1167 | then the parent of the new mount is the previous mount at that location. | |
1168 | Thus, when looking at all the mounts stacked at a particular location, | |
1169 | the top-most mount is the one that is not the parent | |
1170 | of any other mount at the same location. | |
1171 | (Note, however, that this top-most mount will be accessible only if | |
1172 | the longest path subprefix of P that is a mount point | |
1173 | is not itself hidden by a stacked mount.) | |
1174 | .IP | |
525a8b54 | 1175 | If the parent mount lies outside the process's root directory (see |
29270550 MK |
1176 | .BR chroot (2)), |
1177 | the ID shown here won't have a corresponding record in | |
35cf1b93 | 1178 | .I mountinfo |
29270550 | 1179 | whose mount ID (field 1) matches this parent mount ID |
525a8b54 | 1180 | (because mounts that lie outside the process's root directory |
29270550 MK |
1181 | are not shown in |
1182 | .IR mountinfo ). | |
1183 | As a special case of this point, | |
525a8b54 | 1184 | the process's root mount may have a parent mount |
29270550 MK |
1185 | (for the initramfs filesystem) that lies |
1186 | .\" Miklos Szeredi, Nov 2017: The hidden one is the initramfs, I believe | |
1187 | .\" mtk: In the initial mount namespace, this hidden ID has the value 0 | |
1188 | outside the process's root directory, | |
525a8b54 | 1189 | and an entry for that mount will not appear in |
29270550 | 1190 | .IR mountinfo . |
b4e9ee8f MK |
1191 | .TP |
1192 | (3) | |
0f619d1f | 1193 | major:minor: the value of |
b4e9ee8f | 1194 | .I st_dev |
0f619d1f | 1195 | for files on this filesystem (see |
b4e9ee8f MK |
1196 | .BR stat (2)). |
1197 | .TP | |
1198 | (4) | |
0f619d1f | 1199 | root: the pathname of the directory in the filesystem |
8d857fcb | 1200 | which forms the root of this mount. |
b4e9ee8f MK |
1201 | .TP |
1202 | (5) | |
ebdc66e2 | 1203 | mount point: the pathname of the mount point relative |
0f619d1f | 1204 | to the process's root directory. |
b4e9ee8f MK |
1205 | .TP |
1206 | (6) | |
adab7ac8 MK |
1207 | mount options: per-mount options (see |
1208 | .BR mount (2)). | |
b4e9ee8f MK |
1209 | .TP |
1210 | (7) | |
0f619d1f | 1211 | optional fields: zero or more fields of the form "tag[:value]"; see below. |
b4e9ee8f MK |
1212 | .TP |
1213 | (8) | |
0f619d1f | 1214 | separator: the end of the optional fields is marked by a single hyphen. |
b4e9ee8f MK |
1215 | .TP |
1216 | (9) | |
0f619d1f | 1217 | filesystem type: the filesystem type in the form "type[.subtype]". |
b4e9ee8f MK |
1218 | .TP |
1219 | (10) | |
9ee4a2b6 | 1220 | mount source: filesystem-specific information or "none". |
b4e9ee8f MK |
1221 | .TP |
1222 | (11) | |
adab7ac8 MK |
1223 | super options: per-superblock options (see |
1224 | .BR mount (2)). | |
b4e9ee8f MK |
1225 | .RE |
1226 | .IP | |
966b5839 MK |
1227 | Currently, the possible optional fields are |
1228 | .IR shared , | |
1229 | .IR master , | |
1230 | .IR propagate_from , | |
1231 | and | |
1232 | .IR unbindable . | |
1233 | See | |
1234 | .BR mount_namespaces (7) | |
1235 | for a description of these fields. | |
0f619d1f MK |
1236 | Parsers should ignore all unrecognized optional fields. |
1237 | .IP | |
8a5fc410 MK |
1238 | For more information on mount propagation see |
1239 | .I Documentation/filesystems/sharedsubtree.rst | |
1240 | (or | |
b4e9ee8f | 1241 | .I Documentation/filesystems/sharedsubtree.txt |
8a5fc410 | 1242 | before Linux 5.8) |
66a9882e | 1243 | in the Linux kernel source tree. |
b4e9ee8f | 1244 | .TP |
1ae6b2c7 | 1245 | .IR /proc/ pid /mounts " (since Linux 2.4.19)" |
226cb3a8 | 1246 | This file lists all the filesystems currently mounted in the |
ef5b47f6 MK |
1247 | process's mount namespace (see |
1248 | .BR mount_namespaces (7)). | |
cea61382 MK |
1249 | The format of this file is documented in |
1250 | .BR fstab (5). | |
2dad4c59 | 1251 | .IP |
b324e17d | 1252 | Since Linux 2.6.15, this file is pollable: |
cea61382 | 1253 | after opening the file for reading, a change in this file |
9ee4a2b6 | 1254 | (i.e., a filesystem mount or unmount) causes |
cea61382 | 1255 | .BR select (2) |
226cb3a8 | 1256 | to mark the file descriptor as having an exceptional condition, and |
cea61382 MK |
1257 | .BR poll (2) |
1258 | and | |
1259 | .BR epoll_wait (2) | |
226cb3a8 MK |
1260 | mark the file as having a priority event |
1261 | .RB ( POLLPRI ). | |
1262 | (Before Linux 2.6.30, | |
1263 | a change in this file was indicated by the file descriptor | |
1264 | being marked as readable for | |
1265 | .BR select (2), | |
1266 | and being marked as having an error condition for | |
1267 | .BR poll (2) | |
1268 | and | |
1269 | .BR epoll_wait (2).) | |
cea61382 | 1270 | .TP |
1ae6b2c7 | 1271 | .IR /proc/ pid /mountstats " (since Linux 2.6.17)" |
783a6233 | 1272 | This file exports information (statistics, configuration information) |
525a8b54 | 1273 | about the mounts in the process's mount namespace (see |
ef5b47f6 | 1274 | .BR mount_namespaces (7)). |
b4e9ee8f | 1275 | Lines in this file have the form: |
37d5e699 MK |
1276 | .IP |
1277 | .in +4n | |
1278 | .EX | |
31572c71 MK |
1279 | device /dev/sda7 mounted on /home with fstype ext3 [stats] |
1280 | ( 1 ) ( 2 ) (3 ) ( 4 ) | |
37d5e699 MK |
1281 | .EE |
1282 | .in | |
b4e9ee8f MK |
1283 | .IP |
1284 | The fields in each line are: | |
3bc960c2 | 1285 | .RS 7 |
b4e9ee8f MK |
1286 | .TP 5 |
1287 | (1) | |
1288 | The name of the mounted device | |
1289 | (or "nodevice" if there is no corresponding device). | |
1290 | .TP | |
1291 | (2) | |
9ee4a2b6 | 1292 | The mount point within the filesystem tree. |
b4e9ee8f MK |
1293 | .TP |
1294 | (3) | |
9ee4a2b6 | 1295 | The filesystem type. |
b4e9ee8f MK |
1296 | .TP |
1297 | (4) | |
1298 | Optional statistics and configuration information. | |
9ee4a2b6 | 1299 | Currently (as at Linux 2.6.26), only NFS filesystems export |
b4e9ee8f MK |
1300 | information via this field. |
1301 | .RE | |
1302 | .IP | |
90878f7c | 1303 | This file is readable only by the owner of the process. |
b4e9ee8f | 1304 | .TP |
1ae6b2c7 | 1305 | .IR /proc/ pid /net " (since Linux 2.6.25)" |
9fb88bc8 MK |
1306 | See the description of |
1307 | .IR /proc/net . | |
1308 | .TP | |
1ae6b2c7 | 1309 | .IR /proc/ pid /ns/ " (since Linux 3.0)" |
2c4201f0 | 1310 | .\" See commit 6b4e306aa3dc94a0545eb9279475b1ab6209a31f |
b4a185e5 EB |
1311 | This is a subdirectory containing one entry for each namespace that |
1312 | supports being manipulated by | |
80e63655 | 1313 | .BR setns (2). |
cf8bfe6d MK |
1314 | For more information, see |
1315 | .BR namespaces (7). | |
b4a185e5 | 1316 | .TP |
1ae6b2c7 | 1317 | .IR /proc/ pid /numa_maps " (since Linux 2.6.14)" |
610f75cc MK |
1318 | See |
1319 | .BR numa (7). | |
7388733a | 1320 | .TP |
1ae6b2c7 | 1321 | .IR /proc/ pid /oom_adj " (since Linux 2.6.11)" |
b4e9ee8f | 1322 | This file can be used to adjust the score used to select which process |
0425de01 | 1323 | should be killed in an out-of-memory (OOM) situation. |
b4e9ee8f | 1324 | The kernel uses this value for a bit-shift operation of the process's |
1ae6b2c7 | 1325 | .I oom_score |
b4e9ee8f | 1326 | value: |
5b8dbfd4 MK |
1327 | valid values are in the range \-16 to +15, |
1328 | plus the special value \-17, | |
b4e9ee8f MK |
1329 | which disables OOM-killing altogether for this process. |
1330 | A positive score increases the likelihood of this | |
1331 | process being killed by the OOM-killer; | |
1332 | a negative score decreases the likelihood. | |
de8e9cc1 | 1333 | .IP |
b4e9ee8f MK |
1334 | The default value for this file is 0; |
1335 | a new process inherits its parent's | |
1336 | .I oom_adj | |
1337 | setting. | |
1338 | A process must be privileged | |
1339 | .RB ( CAP_SYS_RESOURCE ) | |
6c989df1 GJ |
1340 | to update this file, |
1341 | although a process can always increase its own | |
1342 | .I oom_adj | |
1343 | setting (since Linux 2.6.20). | |
f2c8b197 MK |
1344 | .IP |
1345 | Since Linux 2.6.36, use of this file is deprecated in favor of | |
4a673f16 GJ |
1346 | .IR /proc/ pid /oom_score_adj , |
1347 | and finally removed in Linux 3.7. | |
b4e9ee8f | 1348 | .TP |
1ae6b2c7 | 1349 | .IR /proc/ pid /oom_score " (since Linux 2.6.11)" |
b324e17d AC |
1350 | .\" See mm/oom_kill.c::badness() before Linux 2.6.36 sources |
1351 | .\" See mm/oom_kill.c::oom_badness() after Linux 2.6.36 | |
5753354a | 1352 | .\" commit a63d83f427fbce97a6cea0db2e64b0eb8435cd10 |
b4e9ee8f MK |
1353 | This file displays the current score that the kernel gives to |
1354 | this process for the purpose of selecting a process | |
1355 | for the OOM-killer. | |
1356 | A higher score means that the process is more likely to be | |
1357 | selected by the OOM-killer. | |
1358 | The basis for this score is the amount of memory used by the process, | |
1359 | with increases (+) or decreases (\-) for factors including: | |
b324e17d AC |
1360 | .\" See mm/oom_kill.c::badness() before Linux 2.6.36 sources |
1361 | .\" See mm/oom_kill.c::oom_badness() after Linux 2.6.36 | |
5753354a MF |
1362 | .\" commit a63d83f427fbce97a6cea0db2e64b0eb8435cd10 |
1363 | .RS | |
cdede5cd | 1364 | .IP \[bu] 3 |
9b0e3937 | 1365 | whether the process is privileged (\-). |
5753354a MF |
1366 | .\" More precisely, if it has CAP_SYS_ADMIN or (pre 2.6.36) CAP_SYS_RESOURCE |
1367 | .RE | |
1368 | .IP | |
b324e17d | 1369 | Before Linux 2.6.36 |
15f0b7af | 1370 | the following factors were also used in the calculation of oom_score: |
b4e9ee8f | 1371 | .RS |
cdede5cd | 1372 | .IP \[bu] 3 |
b4e9ee8f MK |
1373 | whether the process creates a lot of children using |
1374 | .BR fork (2) | |
1375 | (+); | |
cdede5cd | 1376 | .IP \[bu] |
b4e9ee8f MK |
1377 | whether the process has been running a long time, |
1378 | or has used a lot of CPU time (\-); | |
cdede5cd | 1379 | .IP \[bu] |
5753354a | 1380 | whether the process has a low nice value (i.e., > 0) (+); and |
cdede5cd | 1381 | .IP \[bu] |
b4e9ee8f MK |
1382 | whether the process is making direct hardware access (\-). |
1383 | .\" More precisely, if it has CAP_SYS_RAWIO | |
1384 | .RE | |
1385 | .IP | |
1386 | The | |
1387 | .I oom_score | |
f2c8b197 MK |
1388 | also reflects the adjustment specified by the |
1389 | .I oom_score_adj | |
1390 | or | |
b4e9ee8f MK |
1391 | .I oom_adj |
1392 | setting for the process. | |
f2c8b197 | 1393 | .TP |
1ae6b2c7 | 1394 | .IR /proc/ pid /oom_score_adj " (since Linux 2.6.36)" |
b324e17d | 1395 | .\" Text taken from Linux 3.7 Documentation/filesystems/proc.txt |
f2c8b197 MK |
1396 | This file can be used to adjust the badness heuristic used to select which |
1397 | process gets killed in out-of-memory conditions. | |
2dad4c59 | 1398 | .IP |
f2c8b197 MK |
1399 | The badness heuristic assigns a value to each candidate task ranging from 0 |
1400 | (never kill) to 1000 (always kill) to determine which process is targeted. | |
1401 | The units are roughly a proportion along that range of | |
1402 | allowed memory the process may allocate from, | |
1403 | based on an estimation of its current memory and swap use. | |
1404 | For example, if a task is using all allowed memory, | |
1405 | its badness score will be 1000. | |
1406 | If it is using half of its allowed memory, its score will be 500. | |
2dad4c59 | 1407 | .IP |
f2c8b197 MK |
1408 | There is an additional factor included in the badness score: root |
1409 | processes are given 3% extra memory over other tasks. | |
2dad4c59 | 1410 | .IP |
f2c8b197 | 1411 | The amount of "allowed" memory depends on the context |
0633f951 | 1412 | in which the OOM-killer was called. |
f2c8b197 MK |
1413 | If it is due to the memory assigned to the allocating task's cpuset |
1414 | being exhausted, | |
1415 | the allowed memory represents the set of mems assigned to that | |
1416 | cpuset (see | |
1417 | .BR cpuset (7)). | |
1418 | If it is due to a mempolicy's node(s) being exhausted, | |
1419 | the allowed memory represents the set of mempolicy nodes. | |
1420 | If it is due to a memory limit (or swap limit) being reached, | |
1421 | the allowed memory is that configured limit. | |
1422 | Finally, if it is due to the entire system being out of memory, the | |
1423 | allowed memory represents all allocatable resources. | |
2dad4c59 | 1424 | .IP |
f2c8b197 | 1425 | The value of |
0633f951 | 1426 | .I oom_score_adj |
f2c8b197 MK |
1427 | is added to the badness score before it |
1428 | is used to determine which task to kill. | |
1429 | Acceptable values range from \-1000 | |
1430 | (OOM_SCORE_ADJ_MIN) to +1000 (OOM_SCORE_ADJ_MAX). | |
0633f951 | 1431 | This allows user space to control the preference for OOM-killing, |
f2c8b197 | 1432 | ranging from always preferring a certain |
a45168bf | 1433 | task or completely disabling it from OOM-killing. |
f2c8b197 | 1434 | The lowest possible value, \-1000, is |
0633f951 | 1435 | equivalent to disabling OOM-killing entirely for that task, |
f2c8b197 | 1436 | since it will always report a badness score of 0. |
2dad4c59 | 1437 | .IP |
f2c8b197 MK |
1438 | Consequently, it is very simple for user space to define |
1439 | the amount of memory to consider for each task. | |
48ac01a7 | 1440 | Setting an |
f2c8b197 MK |
1441 | .I oom_score_adj |
1442 | value of +500, for example, | |
1443 | is roughly equivalent to allowing the remainder of tasks sharing the | |
1444 | same system, cpuset, mempolicy, or memory controller resources | |
1445 | to use at least 50% more memory. | |
1446 | A value of \-500, on the other hand, would be roughly | |
1447 | equivalent to discounting 50% of the task's | |
1448 | allowed memory from being considered as scoring against the task. | |
2dad4c59 | 1449 | .IP |
0633f951 | 1450 | For backward compatibility with previous kernels, |
1ae6b2c7 | 1451 | .IR /proc/ pid /oom_adj |
f2c8b197 MK |
1452 | can still be used to tune the badness score. |
1453 | Its value is | |
9f1b9726 | 1454 | scaled linearly with |
f2c8b197 | 1455 | .IR oom_score_adj . |
2dad4c59 | 1456 | .IP |
f2c8b197 | 1457 | Writing to |
1ae6b2c7 | 1458 | .IR /proc/ pid /oom_score_adj |
f2c8b197 | 1459 | or |
1ae6b2c7 | 1460 | .IR /proc/ pid /oom_adj |
f2c8b197 | 1461 | will change the other with its scaled value. |
6f752251 MK |
1462 | .IP |
1463 | The | |
1464 | .BR choom (1) | |
1465 | program provides a command-line interface for adjusting the | |
1466 | .I oom_score_adj | |
1467 | value of a running process or a newly executed command. | |
b0aa1e51 | 1468 | .TP |
1ae6b2c7 | 1469 | .IR /proc/ pid /pagemap " (since Linux 2.6.25)" |
b0aa1e51 MK |
1470 | This file shows the mapping of each of the process's virtual pages |
1471 | into physical page frames or swap area. | |
1472 | It contains one 64-bit value for each virtual page, | |
1473 | with the bits set as follows: | |
0019177e | 1474 | .RS |
b0aa1e51 MK |
1475 | .TP |
1476 | 63 | |
1477 | If set, the page is present in RAM. | |
1478 | .TP | |
1479 | 62 | |
1480 | If set, the page is in swap space | |
1481 | .TP | |
1482 | 61 (since Linux 3.5) | |
1483 | The page is a file-mapped page or a shared anonymous page. | |
1484 | .TP | |
523869f6 | 1485 | 60\[en]58 (since Linux 3.11) |
b0aa1e51 MK |
1486 | Zero |
1487 | .\" Not quite true; see commit 541c237c0923f567c9c4cabb8a81635baadc713f | |
1488 | .TP | |
76ac741f MB |
1489 | 57 (since Linux 5.14) |
1490 | If set, the page is write-protected through | |
1491 | .BR userfaultfd (2). | |
1492 | .TP | |
2e84528d | 1493 | 56 (since Linux 4.2) |
abfbcb56 MK |
1494 | .\" commit 77bb499bb60f4b79cca7d139c8041662860fcf87 |
1495 | .\" commit 83b4b0bb635eee2b8e075062e4e008d1bc110ed7 | |
2e84528d OE |
1496 | The page is exclusively mapped. |
1497 | .TP | |
b5301584 | 1498 | 55 (since Linux 3.11) |
b0aa1e51 MK |
1499 | PTE is soft-dirty |
1500 | (see the kernel source file | |
184d797d | 1501 | .IR Documentation/admin\-guide/mm/soft\-dirty.rst ). |
b0aa1e51 | 1502 | .TP |
523869f6 | 1503 | 54\[en]0 |
b0aa1e51 MK |
1504 | If the page is present in RAM (bit 63), then these bits |
1505 | provide the page frame number, which can be used to index | |
1ae6b2c7 | 1506 | .I /proc/kpageflags |
b0aa1e51 MK |
1507 | and |
1508 | .IR /proc/kpagecount . | |
1509 | If the page is present in swap (bit 62), | |
523869f6 | 1510 | then bits 4\[en]0 give the swap type, and bits 54\[en]5 encode the swap offset. |
b0aa1e51 MK |
1511 | .RE |
1512 | .IP | |
523869f6 | 1513 | Before Linux 3.11, bits 60\[en]55 were |
b0aa1e51 MK |
1514 | used to encode the base-2 log of the page size. |
1515 | .IP | |
1516 | To employ | |
1ae6b2c7 | 1517 | .IR /proc/ pid /pagemap |
b0aa1e51 | 1518 | efficiently, use |
1ae6b2c7 | 1519 | .IR /proc/ pid /maps |
b0aa1e51 MK |
1520 | to determine which areas of memory are actually mapped and seek |
1521 | to skip over unmapped regions. | |
1522 | .IP | |
1523 | The | |
1ae6b2c7 | 1524 | .IR /proc/ pid /pagemap |
b0aa1e51 MK |
1525 | file is present only if the |
1526 | .B CONFIG_PROC_PAGE_MONITOR | |
1527 | kernel configuration option is enabled. | |
2dad4c59 | 1528 | .IP |
aee2f0bf MK |
1529 | Permission to access this file is governed by a ptrace access mode |
1530 | .B PTRACE_MODE_READ_FSCREDS | |
1531 | check; see | |
1532 | .BR ptrace (2). | |
7c2905d1 | 1533 | .TP |
1ae6b2c7 | 1534 | .IR /proc/ pid /personality " (since Linux 2.6.28)" |
7c2905d1 MK |
1535 | .\" commit 478307230810d7e2a753ed220db9066dfdf88718 |
1536 | This read-only file exposes the process's execution domain, as set by | |
1537 | .BR personality (2). | |
1538 | The value is displayed in hexadecimal notation. | |
2dad4c59 | 1539 | .IP |
4834ae91 MK |
1540 | Permission to access this file is governed by a ptrace access mode |
1541 | .B PTRACE_MODE_ATTACH_FSCREDS | |
1542 | check; see | |
1543 | .BR ptrace (2). | |
fea681da | 1544 | .TP |
1ae6b2c7 | 1545 | .IR /proc/ pid /root |
008f1ecc | 1546 | UNIX and Linux support the idea of a per-process root of the |
9ee4a2b6 | 1547 | filesystem, set by the |
fea681da | 1548 | .BR chroot (2) |
c13182ef MK |
1549 | system call. |
1550 | This file is a symbolic link that points to the process's | |
14d70713 MK |
1551 | root directory, and behaves in the same way as |
1552 | .IR exe , | |
1553 | and | |
1554 | .IR fd/* . | |
2dad4c59 | 1555 | .IP |
948f0ff4 | 1556 | Note however that this file is not merely a symbolic link. |
2b312241 MF |
1557 | It provides the same view of the filesystem (including namespaces and the |
1558 | set of per-process mounts) as the process itself. | |
a77efd58 MK |
1559 | An example illustrates this point. |
1560 | In one terminal, we start a shell in new user and mount namespaces, | |
525a8b54 | 1561 | and in that shell we create some new mounts: |
2dad4c59 | 1562 | .IP |
a77efd58 | 1563 | .in +4n |
37d5e699 | 1564 | .EX |
b957f81f | 1565 | $ \fBPS1=\[aq]sh1# \[aq] unshare \-Urnm\fP |
a77efd58 MK |
1566 | sh1# \fBmount \-t tmpfs tmpfs /etc\fP # Mount empty tmpfs at /etc |
1567 | sh1# \fBmount \-\-bind /usr /dev\fP # Mount /usr at /dev | |
89f92905 | 1568 | sh1# \fBecho $$\fP |
a77efd58 | 1569 | 27123 |
37d5e699 | 1570 | .EE |
a77efd58 | 1571 | .in |
2dad4c59 | 1572 | .IP |
a77efd58 MK |
1573 | In a second terminal window, in the initial mount namespace, |
1574 | we look at the contents of the corresponding mounts in | |
1575 | the initial and new namespaces: | |
2dad4c59 | 1576 | .IP |
a77efd58 | 1577 | .in +4n |
37d5e699 | 1578 | .EX |
b957f81f | 1579 | $ \fBPS1=\[aq]sh2# \[aq] sudo sh\fP |
a77efd58 MK |
1580 | sh2# \fBls /etc | wc \-l\fP # In initial NS |
1581 | 309 | |
1582 | sh2# \fBls /proc/27123/root/etc | wc \-l\fP # /etc in other NS | |
1583 | 0 # The empty tmpfs dir | |
1584 | sh2# \fBls /dev | wc \-l\fP # In initial NS | |
1585 | 205 | |
1586 | sh2# \fBls /proc/27123/root/dev | wc \-l\fP # /dev in other NS | |
1587 | 11 # Actually bind | |
1588 | # mounted to /usr | |
1589 | sh2# \fBls /usr | wc \-l\fP # /usr in initial NS | |
1590 | 11 | |
37d5e699 | 1591 | .EE |
a77efd58 | 1592 | .in |
2dad4c59 | 1593 | .IP |
afcaf646 | 1594 | .\" The following was still true as at kernel 2.6.13 |
3ed7270e | 1595 | In a multithreaded process, the contents of the |
1ae6b2c7 | 1596 | .IR /proc/ pid /root |
3ed7270e | 1597 | symbolic link are not available if the main thread has already terminated |
afcaf646 MK |
1598 | (typically by calling |
1599 | .BR pthread_exit (3)). | |
2dad4c59 | 1600 | .IP |
b902fe18 MK |
1601 | Permission to dereference or read |
1602 | .RB ( readlink (2)) | |
1603 | this symbolic link is governed by a ptrace access mode | |
1604 | .B PTRACE_MODE_READ_FSCREDS | |
1605 | check; see | |
1606 | .BR ptrace (2). | |
8273bf01 | 1607 | .TP |
1ae6b2c7 | 1608 | .IR /proc/ pid /projid_map " (since Linux 3.7)" |
43d42cc0 | 1609 | .\" commit f76d207a66c3a53defea67e7d36c3eb1b7d6d61d |
8273bf01 MK |
1610 | See |
1611 | .BR user_namespaces (7). | |
15869389 | 1612 | .TP |
b324e17d | 1613 | .IR /proc/ pid /seccomp " (Linux 2.6.12 to Linux 2.6.22)" |
15869389 MK |
1614 | This file can be used to read and change the process's |
1615 | secure computing (seccomp) mode setting. | |
1616 | It contains the value 0 if the process is not in seccomp mode, | |
1617 | and 1 if the process is in strict seccomp mode (see | |
1618 | .BR seccomp (2)). | |
1619 | Writing 1 to this file places the process irreversibly in strict seccomp mode. | |
1620 | (Further attempts to write to the file fail with the | |
1621 | .B EPERM | |
1622 | error.) | |
2dad4c59 | 1623 | .IP |
15869389 MK |
1624 | In Linux 2.6.23, |
1625 | this file went away, to be replaced by the | |
1626 | .BR prctl (2) | |
1ae6b2c7 | 1627 | .B PR_GET_SECCOMP |
15869389 | 1628 | and |
1ae6b2c7 | 1629 | .B PR_SET_SECCOMP |
15869389 MK |
1630 | operations (and later by |
1631 | .BR seccomp (2) | |
1632 | and the | |
1633 | .I Seccomp | |
1634 | field in | |
1ae6b2c7 | 1635 | .IR /proc/ pid /status ). |
69119dc7 | 1636 | .\" FIXME Describe /proc/[pid]/sessionid |
b3fb99e8 | 1637 | .\" commit 1e0bd7550ea9cf474b1ad4c6ff5729a507f75fdc |
b4e9ee8f | 1638 | .\" CONFIG_AUDITSYSCALL |
b324e17d | 1639 | .\" Added in Linux 2.6.25; read-only; only readable by real UID |
bea08fec | 1640 | .\" |
69119dc7 | 1641 | .\" FIXME Describe /proc/[pid]/sched |
b324e17d | 1642 | .\" Added in Linux 2.6.23 |
b4e9ee8f MK |
1643 | .\" CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS |
1644 | .\" Displays various scheduling parameters | |
1645 | .\" This file can be written, to reset stats | |
ef4f4031 | 1646 | .\" The set of fields exposed by this file have changed |
b3fb99e8 MK |
1647 | .\" significantly over time. |
1648 | .\" commit 43ae34cb4cd650d1eb4460a8253a8e747ba052ac | |
1649 | .\" | |
69119dc7 MK |
1650 | .\" FIXME Describe /proc/[pid]/schedstats and |
1651 | .\" /proc/[pid]/task/[tid]/schedstats | |
b324e17d | 1652 | .\" Added in Linux 2.6.9 |
b4e9ee8f | 1653 | .\" CONFIG_SCHEDSTATS |
fea681da | 1654 | .TP |
1ae6b2c7 | 1655 | .IR /proc/ pid /setgroups " (since Linux 3.19)" |
ab28dba9 MK |
1656 | See |
1657 | .BR user_namespaces (7). | |
d520465b | 1658 | .TP |
1ae6b2c7 | 1659 | .IR /proc/ pid /smaps " (since Linux 2.6.14)" |
b07b19c4 | 1660 | This file shows memory consumption for each of the process's mappings. |
859503c3 MK |
1661 | (The |
1662 | .BR pmap (1) | |
1663 | command displays similar information, | |
1664 | in a form that may be easier for parsing.) | |
1f0add28 | 1665 | For each mapping there is a series of lines such as the following: |
37d5e699 | 1666 | .IP |
a08ea57c | 1667 | .in +4n |
37d5e699 | 1668 | .EX |
9bc87ed0 | 1669 | 00400000\-0048a000 r\-xp 00000000 fd:03 960637 /bin/bash |
95fe794d PG |
1670 | Size: 552 kB |
1671 | Rss: 460 kB | |
1672 | Pss: 100 kB | |
1673 | Shared_Clean: 452 kB | |
1674 | Shared_Dirty: 0 kB | |
1675 | Private_Clean: 8 kB | |
1676 | Private_Dirty: 0 kB | |
1677 | Referenced: 460 kB | |
1678 | Anonymous: 0 kB | |
1679 | AnonHugePages: 0 kB | |
4ad958e1 MK |
1680 | ShmemHugePages: 0 kB |
1681 | ShmemPmdMapped: 0 kB | |
95fe794d PG |
1682 | Swap: 0 kB |
1683 | KernelPageSize: 4 kB | |
1684 | MMUPageSize: 4 kB | |
1685 | Locked: 0 kB | |
2f057281 | 1686 | ProtectionKey: 0 |
eb848708 | 1687 | VmFlags: rd ex mr mw me dw |
37d5e699 | 1688 | .EE |
a08ea57c | 1689 | .in |
2d3fb75b | 1690 | .IP |
b07b19c4 MK |
1691 | The first of these lines shows the same information as is displayed |
1692 | for the mapping in | |
1ae6b2c7 | 1693 | .IR /proc/ pid /maps . |
c3d59262 | 1694 | The following lines show the size of the mapping, |
95fe794d | 1695 | the amount of the mapping that is currently resident in RAM ("Rss"), |
a5a3e91b | 1696 | the process's proportional share of this mapping ("Pss"), |
1f0add28 | 1697 | the number of clean and dirty shared pages in the mapping, |
c7ce200d | 1698 | and the number of clean and dirty private pages in the mapping. |
95fe794d | 1699 | "Referenced" indicates the amount of memory currently marked as |
1f0add28 MK |
1700 | referenced or accessed. |
1701 | "Anonymous" shows the amount of memory | |
1702 | that does not belong to any file. | |
1703 | "Swap" shows how much | |
95fe794d | 1704 | would-be-anonymous memory is also used, but out on swap. |
2dad4c59 | 1705 | .IP |
6861f8f0 MK |
1706 | The "KernelPageSize" line (available since Linux 2.6.29) |
1707 | is the page size used by the kernel to back the virtual memory area. | |
1f0add28 MK |
1708 | This matches the size used by the MMU in the majority of cases. |
1709 | However, one counter-example occurs on PPC64 kernels | |
c7169ee5 | 1710 | whereby a kernel using 64 kB as a base page size may still use 4 kB |
1f0add28 | 1711 | pages for the MMU on older processors. |
6861f8f0 MK |
1712 | To distinguish the two attributes, the "MMUPageSize" line |
1713 | (also available since Linux 2.6.29) | |
1714 | reports the page size used by the MMU. | |
2dad4c59 | 1715 | .IP |
95fe794d PG |
1716 | The "Locked" indicates whether the mapping is locked in memory |
1717 | or not. | |
2dad4c59 | 1718 | .IP |
9b780b06 MK |
1719 | The "ProtectionKey" line (available since Linux 4.9, on x86 only) |
1720 | contains the memory protection key (see | |
1721 | .BR pkeys (7)) | |
1722 | associated with the virtual memory area. | |
1723 | This entry is present only if the kernel was built with the | |
1724 | .B CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS | |
9ae9894c | 1725 | configuration option (since Linux 4.6). |
2dad4c59 | 1726 | .IP |
eb848708 MK |
1727 | The "VmFlags" line (available since Linux 3.8) |
1728 | represents the kernel flags associated with the virtual memory area, | |
1729 | encoded using the following two-letter codes: | |
30eadebd | 1730 | .RS |
2dad4c59 | 1731 | .IP |
30eadebd AC |
1732 | .TS |
1733 | l l l. | |
1734 | rd - readable | |
1735 | wr - writable | |
1736 | ex - executable | |
1737 | sh - shared | |
1738 | mr - may read | |
1739 | mw - may write | |
1740 | me - may execute | |
1741 | ms - may share | |
1742 | gd - stack segment grows down | |
1743 | pf - pure PFN range | |
1744 | dw - disabled write to the mapped file | |
1745 | lo - pages are locked in memory | |
1746 | io - memory mapped I/O area | |
1747 | sr - sequential read advise provided | |
1748 | rr - random read advise provided | |
1749 | dc - do not copy area on fork | |
1750 | de - do not expand area on remapping | |
1751 | ac - area is accountable | |
1752 | nr - swap space is not reserved for the area | |
1753 | ht - area uses huge tlb pages | |
1754 | sf - perform synchronous page faults (since Linux 4.15) | |
1755 | nl - non-linear mapping (removed in Linux 4.0) | |
1756 | ar - architecture specific flag | |
1757 | wf - wipe on fork (since Linux 4.14) | |
1758 | dd - do not include area into core dump | |
1759 | sd - soft-dirty flag (since Linux 3.13) | |
1760 | mm - mixed map area | |
1761 | hg - huge page advise flag | |
1762 | nh - no-huge page advise flag | |
1763 | mg - mergeable advise flag | |
1764 | um - userfaultfd missing pages tracking (since Linux 4.3) | |
1765 | uw - userfaultfd wprotect pages tracking (since Linux 4.3) | |
1766 | .TE | |
1767 | .RE | |
2dad4c59 | 1768 | .IP |
e618d945 | 1769 | The |
1ae6b2c7 | 1770 | .IR /proc/ pid /smaps |
e618d945 MK |
1771 | file is present only if the |
1772 | .B CONFIG_PROC_PAGE_MONITOR | |
1773 | kernel configuration option is enabled. | |
b07b19c4 | 1774 | .TP |
1ae6b2c7 | 1775 | .IR /proc/ pid /stack " (since Linux 2.6.29)" |
67aac6fb MK |
1776 | .\" 2ec220e27f5040aec1e88901c1b6ea3d135787ad |
1777 | This file provides a symbolic trace of the function calls in this | |
1778 | process's kernel stack. | |
1779 | This file is provided only if the kernel was built with the | |
1780 | .B CONFIG_STACKTRACE | |
1781 | configuration option. | |
2dad4c59 | 1782 | .IP |
4834ae91 MK |
1783 | Permission to access this file is governed by a ptrace access mode |
1784 | .B PTRACE_MODE_ATTACH_FSCREDS | |
1785 | check; see | |
1786 | .BR ptrace (2). | |
67aac6fb | 1787 | .TP |
1ae6b2c7 | 1788 | .IR /proc/ pid /stat |
c13182ef MK |
1789 | Status information about the process. |
1790 | This is used by | |
1791 | .BR ps (1). | |
082bf5b8 MK |
1792 | It is defined in the kernel source file |
1793 | .IR fs/proc/array.c "." | |
2dad4c59 | 1794 | .IP |
fea681da MK |
1795 | The fields, in order, with their proper |
1796 | .BR scanf (3) | |
b02b4b74 MK |
1797 | format specifiers, are listed below. |
1798 | Whether or not certain of these fields display valid information is governed by | |
1799 | a ptrace access mode | |
2c916a1d | 1800 | .BR PTRACE_MODE_READ_FSCREDS " | " PTRACE_MODE_NOAUDIT |
b02b4b74 MK |
1801 | check (refer to |
1802 | .BR ptrace (2)). | |
1803 | If the check denies access, then the field value is displayed as 0. | |
1804 | The affected fields are indicated with the marking [PT]. | |
fea681da | 1805 | .RS |
14948ad6 | 1806 | .TP |
62e4a418 MK |
1807 | (1) \fIpid\fP \ %d |
1808 | .br | |
1809 | The process ID. | |
fea681da | 1810 | .TP |
62e4a418 MK |
1811 | (2) \fIcomm\fP \ %s |
1812 | The filename of the executable, in parentheses. | |
b260aaec AD |
1813 | Strings longer than |
1814 | .B TASK_COMM_LEN | |
1815 | (16) characters (including the terminating null byte) are silently truncated. | |
c13182ef | 1816 | This is visible whether or not the executable is swapped out. |
fea681da | 1817 | .TP |
62e4a418 | 1818 | (3) \fIstate\fP \ %c |
31293f37 MK |
1819 | One of the following characters, indicating process state: |
1820 | .RS | |
4279e42d AC |
1821 | .TP |
1822 | R | |
31293f37 | 1823 | Running |
4279e42d AC |
1824 | .TP |
1825 | S | |
31293f37 | 1826 | Sleeping in an interruptible wait |
4279e42d AC |
1827 | .TP |
1828 | D | |
31293f37 MK |
1829 | Waiting in uninterruptible |
1830 | disk sleep | |
4279e42d AC |
1831 | .TP |
1832 | Z | |
31293f37 | 1833 | Zombie |
4279e42d AC |
1834 | .TP |
1835 | T | |
31293f37 | 1836 | Stopped (on a signal) or (before Linux 2.6.33) trace stopped |
4279e42d AC |
1837 | .TP |
1838 | t | |
31293f37 MK |
1839 | .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29 |
1840 | Tracing stop (Linux 2.6.33 onward) | |
4279e42d AC |
1841 | .TP |
1842 | W | |
31293f37 | 1843 | Paging (only before Linux 2.6.0) |
4279e42d AC |
1844 | .TP |
1845 | X | |
ef4f4031 | 1846 | Dead (from Linux 2.6.0 onward) |
4279e42d AC |
1847 | .TP |
1848 | x | |
31293f37 MK |
1849 | .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29 |
1850 | Dead (Linux 2.6.33 to | |
1851 | .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457 | |
1852 | 3.13 only) | |
4279e42d AC |
1853 | .TP |
1854 | K | |
31293f37 MK |
1855 | .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29 |
1856 | Wakekill (Linux 2.6.33 to | |
1857 | .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457 | |
1858 | 3.13 only) | |
4279e42d AC |
1859 | .TP |
1860 | W | |
31293f37 MK |
1861 | .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29 |
1862 | Waking (Linux 2.6.33 to | |
1863 | .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457 | |
1864 | 3.13 only) | |
4279e42d AC |
1865 | .TP |
1866 | P | |
31293f37 MK |
1867 | .\" commit f2530dc71cf0822f90bb63ea4600caaef33a66bb |
1868 | Parked (Linux 3.9 to | |
1869 | .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457 | |
1870 | 3.13 only) | |
4279e42d AC |
1871 | .TP |
1872 | I | |
ffdff994 BH |
1873 | .\" commit 06eb61844d841d0032a9950ce7f8e783ee49c0d0 |
1874 | Idle (Linux 4.14 onward) | |
31293f37 | 1875 | .RE |
fea681da | 1876 | .TP |
62e4a418 | 1877 | (4) \fIppid\fP \ %d |
e0fdc57c | 1878 | The PID of the parent of this process. |
fea681da | 1879 | .TP |
62e4a418 MK |
1880 | (5) \fIpgrp\fP \ %d |
1881 | The process group ID of the process. | |
fea681da | 1882 | .TP |
62e4a418 MK |
1883 | (6) \fIsession\fP \ %d |
1884 | The session ID of the process. | |
fea681da | 1885 | .TP |
62e4a418 MK |
1886 | (7) \fItty_nr\fP \ %d |
1887 | The controlling terminal of the process. | |
59a40ed7 MK |
1888 | (The minor device number is contained in the combination of bits |
1889 | 31 to 20 and 7 to 0; | |
b97deb97 | 1890 | the major device number is in bits 15 to 8.) |
fea681da | 1891 | .TP |
62e4a418 | 1892 | (8) \fItpgid\fP \ %d |
fea681da | 1893 | .\" This field and following, up to and including wchan added 0.99.1 |
62e4a418 | 1894 | The ID of the foreground process group of the controlling |
59a40ed7 | 1895 | terminal of the process. |
fea681da | 1896 | .TP |
62e4a418 MK |
1897 | (9) \fIflags\fP \ %u |
1898 | The kernel flags word of the process. | |
c13182ef | 1899 | For bit meanings, |
66a9882e | 1900 | see the PF_* defines in the Linux kernel source file |
00702acc | 1901 | .IR include/linux/sched.h . |
fea681da | 1902 | Details depend on the kernel version. |
2dad4c59 | 1903 | .IP |
62e4a418 | 1904 | The format for this field was %lu before Linux 2.6. |
fea681da | 1905 | .TP |
ee566744 | 1906 | (10) \fIminflt\fP \ %lu |
62e4a418 | 1907 | The number of minor faults the process has made which have not |
fea681da MK |
1908 | required loading a memory page from disk. |
1909 | .TP | |
62e4a418 MK |
1910 | (11) \fIcminflt\fP \ %lu |
1911 | The number of minor faults that the process's | |
fea681da MK |
1912 | waited-for children have made. |
1913 | .TP | |
62e4a418 MK |
1914 | (12) \fImajflt\fP \ %lu |
1915 | The number of major faults the process has made which have | |
fea681da MK |
1916 | required loading a memory page from disk. |
1917 | .TP | |
62e4a418 MK |
1918 | (13) \fIcmajflt\fP \ %lu |
1919 | The number of major faults that the process's | |
fea681da MK |
1920 | waited-for children have made. |
1921 | .TP | |
62e4a418 MK |
1922 | (14) \fIutime\fP \ %lu |
1923 | Amount of time that this process has been scheduled in user mode, | |
7a017e24 | 1924 | measured in clock ticks (divide by |
67914165 | 1925 | .IR sysconf(_SC_CLK_TCK) ). |
a1c9dc59 MK |
1926 | This includes guest time, \fIguest_time\fP |
1927 | (time spent running a virtual CPU, see below), | |
1928 | so that applications that are not aware of the guest time field | |
1929 | do not lose that time from their calculations. | |
fea681da | 1930 | .TP |
62e4a418 MK |
1931 | (15) \fIstime\fP \ %lu |
1932 | Amount of time that this process has been scheduled in kernel mode, | |
7a017e24 | 1933 | measured in clock ticks (divide by |
67914165 | 1934 | .IR sysconf(_SC_CLK_TCK) ). |
fea681da | 1935 | .TP |
62e4a418 MK |
1936 | (16) \fIcutime\fP \ %ld |
1937 | Amount of time that this process's | |
7a017e24 MK |
1938 | waited-for children have been scheduled in user mode, |
1939 | measured in clock ticks (divide by | |
67914165 | 1940 | .IR sysconf(_SC_CLK_TCK) ). |
c13182ef | 1941 | (See also |
fea681da | 1942 | .BR times (2).) |
a1c9dc59 MK |
1943 | This includes guest time, \fIcguest_time\fP |
1944 | (time spent running a virtual CPU, see below). | |
fea681da | 1945 | .TP |
62e4a418 MK |
1946 | (17) \fIcstime\fP \ %ld |
1947 | Amount of time that this process's | |
7a017e24 MK |
1948 | waited-for children have been scheduled in kernel mode, |
1949 | measured in clock ticks (divide by | |
67914165 | 1950 | .IR sysconf(_SC_CLK_TCK) ). |
fea681da | 1951 | .TP |
62e4a418 MK |
1952 | (18) \fIpriority\fP \ %ld |
1953 | (Explanation for Linux 2.6) | |
59a40ed7 MK |
1954 | For processes running a real-time scheduling policy |
1955 | .RI ( policy | |
1956 | below; see | |
1957 | .BR sched_setscheduler (2)), | |
1958 | this is the negated scheduling priority, minus one; | |
1959 | that is, a number in the range \-2 to \-100, | |
1960 | corresponding to real-time priorities 1 to 99. | |
1961 | For processes running under a non-real-time scheduling policy, | |
1962 | this is the raw nice value | |
1963 | .RB ( setpriority (2)) | |
1964 | as represented in the kernel. | |
1965 | The kernel stores nice values as numbers | |
1966 | in the range 0 (high) to 39 (low), | |
1967 | corresponding to the user-visible nice range of \-20 to 19. | |
2dad4c59 | 1968 | .IP |
59a40ed7 MK |
1969 | Before Linux 2.6, this was a scaled value based on |
1970 | the scheduler weighting given to this process. | |
b324e17d | 1971 | .\" And back in Linux 1.2 days things were different again. |
fea681da | 1972 | .TP |
62e4a418 MK |
1973 | (19) \fInice\fP \ %ld |
1974 | The nice value (see | |
59a40ed7 MK |
1975 | .BR setpriority (2)), |
1976 | a value in the range 19 (low priority) to \-20 (high priority). | |
b324e17d | 1977 | .\" Back in Linux 1.2 days things were different. |
fea681da MK |
1978 | .\" .TP |
1979 | .\" \fIcounter\fP %ld | |
1980 | .\" The current maximum size in jiffies of the process's next timeslice, | |
1981 | .\" or what is currently left of its current timeslice, if it is the | |
1982 | .\" currently running process. | |
1983 | .\" .TP | |
1984 | .\" \fItimeout\fP %u | |
1985 | .\" The time in jiffies of the process's next timeout. | |
0e94f77b | 1986 | .\" timeout was removed sometime around 2.1/2.2 |
aa610245 | 1987 | .TP |
62e4a418 MK |
1988 | (20) \fInum_threads\fP \ %ld |
1989 | Number of threads in this process (since Linux 2.6). | |
b324e17d | 1990 | Before Linux 2.6, this field was hard coded to 0 as a placeholder |
0e94f77b | 1991 | for an earlier removed field. |
fea681da | 1992 | .TP |
62e4a418 MK |
1993 | (21) \fIitrealvalue\fP \ %ld |
1994 | The time in jiffies before the next | |
8bd58774 MK |
1995 | .B SIGALRM |
1996 | is sent to the process due to an interval timer. | |
b324e17d | 1997 | Since Linux 2.6.17, this field is no longer maintained, |
0e94f77b | 1998 | and is hard coded as 0. |
fea681da | 1999 | .TP |
62e4a418 MK |
2000 | (22) \fIstarttime\fP \ %llu |
2001 | The time the process started after system boot. | |
b324e17d | 2002 | Before Linux 2.6, this value was expressed in jiffies. |
055024ed MK |
2003 | Since Linux 2.6, the value is expressed in clock ticks (divide by |
2004 | .IR sysconf(_SC_CLK_TCK) ). | |
2dad4c59 | 2005 | .IP |
62e4a418 | 2006 | The format for this field was %lu before Linux 2.6. |
fea681da | 2007 | .TP |
62e4a418 MK |
2008 | (23) \fIvsize\fP \ %lu |
2009 | Virtual memory size in bytes. | |
fea681da | 2010 | .TP |
62e4a418 MK |
2011 | (24) \fIrss\fP \ %ld |
2012 | Resident Set Size: number of pages the process has in real memory. | |
c13182ef | 2013 | This is just the pages which |
5fab2e7c | 2014 | count toward text, data, or stack space. |
c13182ef | 2015 | This does not include pages |
fea681da | 2016 | which have not been demand-loaded in, or which are swapped out. |
20e43cd6 | 2017 | This value is inaccurate; see |
1ae6b2c7 | 2018 | .IR /proc/ pid /statm |
20e43cd6 | 2019 | below. |
fea681da | 2020 | .TP |
62e4a418 MK |
2021 | (25) \fIrsslim\fP \ %lu |
2022 | Current soft limit in bytes on the rss of the process; | |
59a40ed7 MK |
2023 | see the description of |
2024 | .B RLIMIT_RSS | |
2025 | in | |
2b5407af | 2026 | .BR getrlimit (2). |
fea681da | 2027 | .TP |
b02b4b74 | 2028 | (26) \fIstartcode\fP \ %lu \ [PT] |
62e4a418 | 2029 | The address above which program text can run. |
fea681da | 2030 | .TP |
b02b4b74 | 2031 | (27) \fIendcode\fP \ %lu \ [PT] |
62e4a418 | 2032 | The address below which program text can run. |
fea681da | 2033 | .TP |
b02b4b74 | 2034 | (28) \fIstartstack\fP \ %lu \ [PT] |
62e4a418 | 2035 | The address of the start (i.e., bottom) of the stack. |
fea681da | 2036 | .TP |
b02b4b74 | 2037 | (29) \fIkstkesp\fP \ %lu \ [PT] |
62e4a418 | 2038 | The current value of ESP (stack pointer), as found in the |
fea681da MK |
2039 | kernel stack page for the process. |
2040 | .TP | |
b02b4b74 | 2041 | (30) \fIkstkeip\fP \ %lu \ [PT] |
62e4a418 | 2042 | The current EIP (instruction pointer). |
fea681da | 2043 | .TP |
62e4a418 MK |
2044 | (31) \fIsignal\fP \ %lu |
2045 | The bitmap of pending signals, displayed as a decimal number. | |
59a40ed7 | 2046 | Obsolete, because it does not provide information on real-time signals; use |
1ae6b2c7 | 2047 | .IR /proc/ pid /status |
59a40ed7 | 2048 | instead. |
fea681da | 2049 | .TP |
62e4a418 MK |
2050 | (32) \fIblocked\fP \ %lu |
2051 | The bitmap of blocked signals, displayed as a decimal number. | |
59a40ed7 | 2052 | Obsolete, because it does not provide information on real-time signals; use |
1ae6b2c7 | 2053 | .IR /proc/ pid /status |
59a40ed7 | 2054 | instead. |
fea681da | 2055 | .TP |
62e4a418 MK |
2056 | (33) \fIsigignore\fP \ %lu |
2057 | The bitmap of ignored signals, displayed as a decimal number. | |
59a40ed7 | 2058 | Obsolete, because it does not provide information on real-time signals; use |
1ae6b2c7 | 2059 | .IR /proc/ pid /status |
59a40ed7 | 2060 | instead. |
fea681da | 2061 | .TP |
62e4a418 MK |
2062 | (34) \fIsigcatch\fP \ %lu |
2063 | The bitmap of caught signals, displayed as a decimal number. | |
59a40ed7 | 2064 | Obsolete, because it does not provide information on real-time signals; use |
1ae6b2c7 | 2065 | .IR /proc/ pid /status |
59a40ed7 | 2066 | instead. |
fea681da | 2067 | .TP |
b02b4b74 | 2068 | (35) \fIwchan\fP \ %lu \ [PT] |
62e4a418 | 2069 | This is the "channel" in which the process is waiting. |
2054f761 MK |
2070 | It is the address of a location in the kernel where the process is sleeping. |
2071 | The corresponding symbolic name can be found in | |
1ae6b2c7 | 2072 | .IR /proc/ pid /wchan . |
fea681da | 2073 | .TP |
62e4a418 | 2074 | (36) \fInswap\fP \ %lu |
b324e17d | 2075 | .\" nswap was added in Linux 2.0 |
4d9b6984 | 2076 | Number of pages swapped (not maintained). |
fea681da | 2077 | .TP |
62e4a418 | 2078 | (37) \fIcnswap\fP \ %lu |
b324e17d | 2079 | .\" cnswap was added in Linux 2.0 |
4d9b6984 | 2080 | Cumulative \fInswap\fP for child processes (not maintained). |
fea681da | 2081 | .TP |
62e4a418 MK |
2082 | (38) \fIexit_signal\fP \ %d \ (since Linux 2.1.22) |
2083 | Signal to be sent to parent when we die. | |
fea681da | 2084 | .TP |
62e4a418 MK |
2085 | (39) \fIprocessor\fP \ %d \ (since Linux 2.2.8) |
2086 | CPU number last executed on. | |
568105c6 | 2087 | .TP |
62e4a418 MK |
2088 | (40) \fIrt_priority\fP \ %u \ (since Linux 2.5.19) |
2089 | Real-time scheduling priority, a number in the range 1 to 99 for | |
59a40ed7 MK |
2090 | processes scheduled under a real-time policy, |
2091 | or 0, for non-real-time processes (see | |
568105c6 MK |
2092 | .BR sched_setscheduler (2)). |
2093 | .TP | |
62e4a418 MK |
2094 | (41) \fIpolicy\fP \ %u \ (since Linux 2.5.19) |
2095 | Scheduling policy (see | |
568105c6 | 2096 | .BR sched_setscheduler (2)). |
cd60dedd | 2097 | Decode using the SCHED_* constants in |
59a40ed7 | 2098 | .IR linux/sched.h . |
2dad4c59 | 2099 | .IP |
62e4a418 | 2100 | The format for this field was %lu before Linux 2.6.22. |
167450d6 | 2101 | .TP |
62e4a418 MK |
2102 | (42) \fIdelayacct_blkio_ticks\fP \ %llu \ (since Linux 2.6.18) |
2103 | Aggregated block I/O delays, measured in clock ticks (centiseconds). | |
14c06953 | 2104 | .TP |
62e4a418 MK |
2105 | (43) \fIguest_time\fP \ %lu \ (since Linux 2.6.24) |
2106 | Guest time of the process (time spent running a virtual CPU | |
7a017e24 | 2107 | for a guest operating system), measured in clock ticks (divide by |
67914165 | 2108 | .IR sysconf(_SC_CLK_TCK) ). |
14c06953 | 2109 | .TP |
62e4a418 MK |
2110 | (44) \fIcguest_time\fP \ %ld \ (since Linux 2.6.24) |
2111 | Guest time of the process's children, measured in clock ticks (divide by | |
67914165 | 2112 | .IR sysconf(_SC_CLK_TCK) ). |
fea681da | 2113 | .TP |
b02b4b74 | 2114 | (45) \fIstart_data\fP \ %lu \ (since Linux 3.3) \ [PT] |
0be30a54 | 2115 | .\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff |
62e4a418 | 2116 | Address above which program initialized and |
426bc8d7 | 2117 | uninitialized (BSS) data are placed. |
12449ae3 | 2118 | .TP |
b02b4b74 | 2119 | (46) \fIend_data\fP \ %lu \ (since Linux 3.3) \ [PT] |
0be30a54 | 2120 | .\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff |
62e4a418 | 2121 | Address below which program initialized and |
426bc8d7 | 2122 | uninitialized (BSS) data are placed. |
12449ae3 | 2123 | .TP |
b02b4b74 | 2124 | (47) \fIstart_brk\fP \ %lu \ (since Linux 3.3) \ [PT] |
0be30a54 | 2125 | .\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff |
62e4a418 | 2126 | Address above which program heap can be expanded with |
426bc8d7 | 2127 | .BR brk (2). |
12449ae3 | 2128 | .TP |
b02b4b74 | 2129 | (48) \fIarg_start\fP \ %lu \ (since Linux 3.5) \ [PT] |
0be30a54 | 2130 | .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3 |
62e4a418 | 2131 | Address above which program command-line arguments |
426bc8d7 MK |
2132 | .RI ( argv ) |
2133 | are placed. | |
12449ae3 | 2134 | .TP |
b02b4b74 | 2135 | (49) \fIarg_end\fP \ %lu \ (since Linux 3.5) \ [PT] |
0be30a54 | 2136 | .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3 |
62e4a418 | 2137 | Address below program command-line arguments |
426bc8d7 MK |
2138 | .RI ( argv ) |
2139 | are placed. | |
12449ae3 | 2140 | .TP |
b02b4b74 | 2141 | (50) \fIenv_start\fP \ %lu \ (since Linux 3.5) \ [PT] |
0be30a54 | 2142 | .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3 |
62e4a418 | 2143 | Address above which program environment is placed. |
12449ae3 | 2144 | .TP |
b02b4b74 | 2145 | (51) \fIenv_end\fP \ %lu \ (since Linux 3.5) \ [PT] |
0be30a54 | 2146 | .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3 |
62e4a418 | 2147 | Address below which program environment is placed. |
12449ae3 | 2148 | .TP |
b02b4b74 | 2149 | (52) \fIexit_code\fP \ %d \ (since Linux 3.5) \ [PT] |
0be30a54 | 2150 | .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3 |
62e4a418 | 2151 | The thread's exit status in the form reported by |
426bc8d7 | 2152 | .BR waitpid (2). |
12449ae3 | 2153 | .RE |
2154 | .TP | |
1ae6b2c7 | 2155 | .IR /proc/ pid /statm |
59a40ed7 | 2156 | Provides information about memory usage, measured in pages. |
c13182ef | 2157 | The columns are: |
37d5e699 | 2158 | .IP |
a08ea57c | 2159 | .in +4n |
37d5e699 | 2160 | .EX |
cb42fb56 | 2161 | size (1) total program size |
1ae6b2c7 | 2162 | (same as VmSize in \fI/proc/\fPpid\fI/status\fP) |
cb42fb56 | 2163 | resident (2) resident set size |
1ae6b2c7 | 2164 | (inaccurate; same as VmRSS in \fI/proc/\fPpid\fI/status\fP) |
14948ad6 MK |
2165 | shared (3) number of resident shared pages |
2166 | (i.e., backed by a file) | |
20e43cd6 | 2167 | (inaccurate; same as RssFile+RssShmem in |
1ae6b2c7 | 2168 | \fI/proc/\fPpid\fI/status\fP) |
cb42fb56 | 2169 | text (4) text (code) |
59a40ed7 | 2170 | .\" (not including libs; broken, includes data segment) |
d133b9b3 | 2171 | lib (5) library (unused since Linux 2.6; always 0) |
cb42fb56 | 2172 | data (6) data + stack |
59a40ed7 | 2173 | .\" (including libs; broken, includes library text) |
d133b9b3 | 2174 | dt (7) dirty pages (unused since Linux 2.6; always 0) |
37d5e699 | 2175 | .EE |
a08ea57c | 2176 | .in |
20e43cd6 JH |
2177 | .IP |
2178 | .\" See SPLIT_RSS_COUNTING in the kernel. | |
2179 | .\" Inaccuracy is bounded by TASK_RSS_EVENTS_THRESH. | |
2180 | Some of these values are inaccurate because | |
2181 | of a kernel-internal scalability optimization. | |
2182 | If accurate values are required, use | |
1ae6b2c7 | 2183 | .IR /proc/ pid /smaps |
20e43cd6 | 2184 | or |
1ae6b2c7 | 2185 | .IR /proc/ pid /smaps_rollup |
20e43cd6 | 2186 | instead, which are much slower but provide accurate, detailed information. |
fea681da | 2187 | .TP |
1ae6b2c7 | 2188 | .IR /proc/ pid /status |
fea681da | 2189 | Provides much of the information in |
1ae6b2c7 | 2190 | .IR /proc/ pid /stat |
fea681da | 2191 | and |
1ae6b2c7 | 2192 | .IR /proc/ pid /statm |
fea681da | 2193 | in a format that's easier for humans to parse. |
16b5f7ba | 2194 | Here's an example: |
37d5e699 | 2195 | .IP |
16b5f7ba | 2196 | .in +4n |
37d5e699 | 2197 | .EX |
b43a3b30 | 2198 | .RB "$" " cat /proc/$$/status" |
16b5f7ba | 2199 | Name: bash |
a79343e9 | 2200 | Umask: 0022 |
16b5f7ba | 2201 | State: S (sleeping) |
aac0b30f | 2202 | Tgid: 17248 |
2d2dfb69 | 2203 | Ngid: 0 |
aac0b30f MK |
2204 | Pid: 17248 |
2205 | PPid: 17200 | |
16b5f7ba MK |
2206 | TracerPid: 0 |
2207 | Uid: 1000 1000 1000 1000 | |
2208 | Gid: 100 100 100 100 | |
2209 | FDSize: 256 | |
2210 | Groups: 16 33 100 | |
aac0b30f MK |
2211 | NStgid: 17248 |
2212 | NSpid: 17248 | |
2213 | NSpgid: 17248 | |
2214 | NSsid: 17200 | |
06b7cee0 MK |
2215 | VmPeak: 131168 kB |
2216 | VmSize: 131168 kB | |
2217 | VmLck: 0 kB | |
2218 | VmPin: 0 kB | |
2219 | VmHWM: 13484 kB | |
2220 | VmRSS: 13484 kB | |
e546617e MK |
2221 | RssAnon: 10264 kB |
2222 | RssFile: 3220 kB | |
2223 | RssShmem: 0 kB | |
06b7cee0 MK |
2224 | VmData: 10332 kB |
2225 | VmStk: 136 kB | |
2226 | VmExe: 992 kB | |
2227 | VmLib: 2104 kB | |
2228 | VmPTE: 76 kB | |
2229 | VmPMD: 12 kB | |
2230 | VmSwap: 0 kB | |
4084d612 | 2231 | HugetlbPages: 0 kB # 4.4 |
4641c596 | 2232 | CoreDumping: 0 # 4.15 |
16b5f7ba MK |
2233 | Threads: 1 |
2234 | SigQ: 0/3067 | |
2235 | SigPnd: 0000000000000000 | |
2236 | ShdPnd: 0000000000000000 | |
2237 | SigBlk: 0000000000010000 | |
2238 | SigIgn: 0000000000384004 | |
2239 | SigCgt: 000000004b813efb | |
2240 | CapInh: 0000000000000000 | |
2241 | CapPrm: 0000000000000000 | |
2242 | CapEff: 0000000000000000 | |
2243 | CapBnd: ffffffffffffffff | |
6112ea97 | 2244 | CapAmb: 0000000000000000 |
6c0ed873 | 2245 | NoNewPrivs: 0 |
039b6546 | 2246 | Seccomp: 0 |
d925b426 | 2247 | Seccomp_filters: 0 |
bf8fc275 | 2248 | Speculation_Store_Bypass: vulnerable |
16b5f7ba MK |
2249 | Cpus_allowed: 00000001 |
2250 | Cpus_allowed_list: 0 | |
2251 | Mems_allowed: 1 | |
2252 | Mems_allowed_list: 0 | |
2253 | voluntary_ctxt_switches: 150 | |
2254 | nonvoluntary_ctxt_switches: 545 | |
37d5e699 | 2255 | .EE |
16b5f7ba MK |
2256 | .in |
2257 | .IP | |
2258 | The fields are as follows: | |
2259 | .RS | |
bd13ace0 | 2260 | .TP |
1ae6b2c7 | 2261 | .I Name |
16b5f7ba | 2262 | Command run by this process. |
b260aaec AD |
2263 | Strings longer than |
2264 | .B TASK_COMM_LEN | |
2265 | (16) characters (including the terminating null byte) are silently truncated. | |
bd13ace0 | 2266 | .TP |
1ae6b2c7 | 2267 | .I Umask |
53473996 MK |
2268 | Process umask, expressed in octal with a leading zero; see |
2269 | .BR umask (2). | |
a79343e9 | 2270 | (Since Linux 4.7.) |
bd13ace0 | 2271 | .TP |
1ae6b2c7 | 2272 | .I State |
4175f999 MK |
2273 | Current state of the process. |
2274 | One of | |
16b5f7ba MK |
2275 | "R (running)", |
2276 | "S (sleeping)", | |
2277 | "D (disk sleep)", | |
2278 | "T (stopped)", | |
ea893369 | 2279 | "t (tracing stop)", |
16b5f7ba MK |
2280 | "Z (zombie)", |
2281 | or | |
2282 | "X (dead)". | |
bd13ace0 | 2283 | .TP |
1ae6b2c7 | 2284 | .I Tgid |
16b5f7ba | 2285 | Thread group ID (i.e., Process ID). |
bd13ace0 | 2286 | .TP |
1ae6b2c7 | 2287 | .I Ngid |
2d2dfb69 | 2288 | NUMA group ID (0 if none; since Linux 3.13). |
bd13ace0 | 2289 | .TP |
1ae6b2c7 | 2290 | .I Pid |
16b5f7ba MK |
2291 | Thread ID (see |
2292 | .BR gettid (2)). | |
bd13ace0 | 2293 | .TP |
1ae6b2c7 | 2294 | .I PPid |
a1bc91d5 | 2295 | PID of parent process. |
bd13ace0 | 2296 | .TP |
1ae6b2c7 | 2297 | .I TracerPid |
16b5f7ba | 2298 | PID of process tracing this process (0 if not being traced). |
bd13ace0 MK |
2299 | .TP |
2300 | .IR Uid ", " Gid | |
9ee4a2b6 | 2301 | Real, effective, saved set, and filesystem UIDs (GIDs). |
bd13ace0 | 2302 | .TP |
1ae6b2c7 | 2303 | .I FDSize |
16b5f7ba | 2304 | Number of file descriptor slots currently allocated. |
bd13ace0 | 2305 | .TP |
1ae6b2c7 | 2306 | .I Groups |
16b5f7ba | 2307 | Supplementary group list. |
bd13ace0 | 2308 | .TP |
1ae6b2c7 | 2309 | .I NStgid |
aac0b30f | 2310 | Thread group ID (i.e., PID) in each of the PID namespaces of which |
1ae6b2c7 | 2311 | .I pid |
aac0b30f MK |
2312 | is a member. |
2313 | The leftmost entry shows the value with respect to the PID namespace | |
0aae4092 KF |
2314 | of the process that mounted this procfs (or the root namespace |
2315 | if mounted by the kernel), | |
aac0b30f MK |
2316 | followed by the value in successively nested inner namespaces. |
2317 | .\" commit e4bc33245124db69b74a6d853ac76c2976f472d5 | |
2318 | (Since Linux 4.1.) | |
bd13ace0 | 2319 | .TP |
1ae6b2c7 | 2320 | .I NSpid |
aac0b30f | 2321 | Thread ID in each of the PID namespaces of which |
1ae6b2c7 | 2322 | .I pid |
aac0b30f MK |
2323 | is a member. |
2324 | The fields are ordered as for | |
2325 | .IR NStgid . | |
2326 | (Since Linux 4.1.) | |
bd13ace0 | 2327 | .TP |
1ae6b2c7 | 2328 | .I NSpgid |
aac0b30f | 2329 | Process group ID in each of the PID namespaces of which |
1ae6b2c7 | 2330 | .I pid |
aac0b30f MK |
2331 | is a member. |
2332 | The fields are ordered as for | |
2333 | .IR NStgid . | |
2334 | (Since Linux 4.1.) | |
bd13ace0 | 2335 | .TP |
1ae6b2c7 | 2336 | .I NSsid |
aac0b30f MK |
2337 | descendant namespace session ID hierarchy |
2338 | Session ID in each of the PID namespaces of which | |
1ae6b2c7 | 2339 | .I pid |
aac0b30f MK |
2340 | is a member. |
2341 | The fields are ordered as for | |
2342 | .IR NStgid . | |
2343 | (Since Linux 4.1.) | |
bd13ace0 | 2344 | .TP |
1ae6b2c7 | 2345 | .I VmPeak |
16b5f7ba | 2346 | Peak virtual memory size. |
bd13ace0 | 2347 | .TP |
1ae6b2c7 | 2348 | .I VmSize |
16b5f7ba | 2349 | Virtual memory size. |
bd13ace0 | 2350 | .TP |
1ae6b2c7 | 2351 | .I VmLck |
fde39195 | 2352 | Locked memory size (see |
f8bfb68e | 2353 | .BR mlock (2)). |
bd13ace0 | 2354 | .TP |
1ae6b2c7 | 2355 | .I VmPin |
15789039 TY |
2356 | Pinned memory size |
2357 | .\" commit bc3e53f682d93df677dbd5006a404722b3adfe18 | |
2358 | (since Linux 3.2). | |
2359 | These are pages that can't be moved because something needs to | |
2360 | directly access physical memory. | |
bd13ace0 | 2361 | .TP |
1ae6b2c7 | 2362 | .I VmHWM |
16b5f7ba | 2363 | Peak resident set size ("high water mark"). |
20e43cd6 | 2364 | This value is inaccurate; see |
1ae6b2c7 | 2365 | .IR /proc/ pid /statm |
20e43cd6 | 2366 | above. |
bd13ace0 | 2367 | .TP |
1ae6b2c7 | 2368 | .I VmRSS |
16b5f7ba | 2369 | Resident set size. |
e546617e MK |
2370 | Note that the value here is the sum of |
2371 | .IR RssAnon , | |
2372 | .IR RssFile , | |
2373 | and | |
2374 | .IR RssShmem . | |
20e43cd6 | 2375 | This value is inaccurate; see |
1ae6b2c7 | 2376 | .IR /proc/ pid /statm |
20e43cd6 | 2377 | above. |
bd13ace0 | 2378 | .TP |
1ae6b2c7 | 2379 | .I RssAnon |
e546617e MK |
2380 | Size of resident anonymous memory. |
2381 | .\" commit bf9683d6990589390b5178dafe8fd06808869293 | |
2382 | (since Linux 4.5). | |
20e43cd6 | 2383 | This value is inaccurate; see |
1ae6b2c7 | 2384 | .IR /proc/ pid /statm |
20e43cd6 | 2385 | above. |
bd13ace0 | 2386 | .TP |
1ae6b2c7 | 2387 | .I RssFile |
e546617e MK |
2388 | Size of resident file mappings. |
2389 | .\" commit bf9683d6990589390b5178dafe8fd06808869293 | |
2390 | (since Linux 4.5). | |
20e43cd6 | 2391 | This value is inaccurate; see |
1ae6b2c7 | 2392 | .IR /proc/ pid /statm |
20e43cd6 | 2393 | above. |
bd13ace0 | 2394 | .TP |
1ae6b2c7 | 2395 | .I RssShmem |
78230722 | 2396 | Size of resident shared memory (includes System V shared memory, |
4e07c70f MK |
2397 | mappings from |
2398 | .BR tmpfs (5), | |
2399 | and shared anonymous mappings). | |
e546617e MK |
2400 | .\" commit bf9683d6990589390b5178dafe8fd06808869293 |
2401 | (since Linux 4.5). | |
bd13ace0 MK |
2402 | .TP |
2403 | .IR VmData ", " VmStk ", " VmExe | |
16b5f7ba | 2404 | Size of data, stack, and text segments. |
20e43cd6 | 2405 | This value is inaccurate; see |
1ae6b2c7 | 2406 | .IR /proc/ pid /statm |
20e43cd6 | 2407 | above. |
bd13ace0 | 2408 | .TP |
1ae6b2c7 | 2409 | .I VmLib |
16b5f7ba | 2410 | Shared library code size. |
bd13ace0 | 2411 | .TP |
1ae6b2c7 | 2412 | .I VmPTE |
16b5f7ba | 2413 | Page table entries size (since Linux 2.6.10). |
bd13ace0 | 2414 | .TP |
1ae6b2c7 | 2415 | .I VmPMD |
e28af9cd | 2416 | .\" commit dc6c9a35b66b520cf67e05d8ca60ebecad3b0479 |
fcfac78d | 2417 | Size of second-level page tables (added in Linux 4.0; removed in Linux 4.15). |
bd13ace0 | 2418 | .TP |
1ae6b2c7 | 2419 | .I VmSwap |
1ddc1665 | 2420 | .\" commit b084d4353ff99d824d3bc5a5c2c22c70b1fba722 |
fce21149 MK |
2421 | Swapped-out virtual memory size by anonymous private pages; |
2422 | shmem swap usage is not included (since Linux 2.6.34). | |
20e43cd6 | 2423 | This value is inaccurate; see |
1ae6b2c7 | 2424 | .IR /proc/ pid /statm |
20e43cd6 | 2425 | above. |
bd13ace0 | 2426 | .TP |
1ae6b2c7 | 2427 | .I HugetlbPages |
422425ff | 2428 | Size of hugetlb memory portions |
4084d612 MK |
2429 | .\" commit 5d317b2b6536592a9b51fe65faed43d65ca9158e |
2430 | (since Linux 4.4). | |
bd13ace0 | 2431 | .TP |
1ae6b2c7 | 2432 | .I CoreDumping |
4641c596 MK |
2433 | Contains the value 1 if the process is currently dumping core, |
2434 | and 0 if it is not | |
2435 | .\" commit c643401218be0f4ab3522e0c0a63016596d6e9ca | |
2436 | (since Linux 4.15). | |
2437 | This information can be used by a monitoring process to avoid killing | |
2438 | a process that is currently dumping core, | |
2439 | which could result in a corrupted core dump file. | |
bd13ace0 | 2440 | .TP |
1ae6b2c7 | 2441 | .I Threads |
16b5f7ba | 2442 | Number of threads in process containing this thread. |
bd13ace0 | 2443 | .TP |
1ae6b2c7 | 2444 | .I SigQ |
6ee625eb MK |
2445 | This field contains two slash-separated numbers that relate to |
2446 | queued signals for the real user ID of this process. | |
2447 | The first of these is the number of currently queued | |
2448 | signals for this real user ID, and the second is the | |
2449 | resource limit on the number of queued signals for this process | |
2450 | (see the description of | |
1ae6b2c7 | 2451 | .B RLIMIT_SIGPENDING |
6ee625eb MK |
2452 | in |
2453 | .BR getrlimit (2)). | |
bd13ace0 MK |
2454 | .TP |
2455 | .IR SigPnd ", " ShdPnd | |
8bfbac5d | 2456 | Mask (expressed in hexadecimal) |
9b8887eb | 2457 | of signals pending for thread and for process as a whole (see |
16b5f7ba MK |
2458 | .BR pthreads (7) |
2459 | and | |
2460 | .BR signal (7)). | |
bd13ace0 MK |
2461 | .TP |
2462 | .IR SigBlk ", " SigIgn ", " SigCgt | |
8d839a56 | 2463 | Masks (expressed in hexadecimal) |
a4e6603a | 2464 | indicating signals being blocked, ignored, and caught (see |
16b5f7ba | 2465 | .BR signal (7)). |
bd13ace0 MK |
2466 | .TP |
2467 | .IR CapInh ", " CapPrm ", " CapEff | |
8d839a56 | 2468 | Masks (expressed in hexadecimal) |
a4e6603a | 2469 | of capabilities enabled in inheritable, permitted, and effective sets |
16b5f7ba MK |
2470 | (see |
2471 | .BR capabilities (7)). | |
bd13ace0 | 2472 | .TP |
1ae6b2c7 | 2473 | .I CapBnd |
a4e6603a | 2474 | Capability bounding set, expressed in hexadecimal |
7e07d950 | 2475 | (since Linux 2.6.26, see |
16b5f7ba | 2476 | .BR capabilities (7)). |
bd13ace0 | 2477 | .TP |
1ae6b2c7 | 2478 | .I CapAmb |
a4e6603a | 2479 | Ambient capability set, expressed in hexadecimal |
6112ea97 MK |
2480 | (since Linux 4.3, see |
2481 | .BR capabilities (7)). | |
bd13ace0 | 2482 | .TP |
1ae6b2c7 | 2483 | .I NoNewPrivs |
6c0ed873 MK |
2484 | .\" commit af884cd4a5ae62fcf5e321fecf0ec1014730353d |
2485 | Value of the | |
2486 | .I no_new_privs | |
2487 | bit | |
2488 | (since Linux 4.10, see | |
2489 | .BR prctl (2)). | |
bd13ace0 | 2490 | .TP |
1ae6b2c7 | 2491 | .I Seccomp |
039b6546 MK |
2492 | .\" commit 2f4b3bf6b2318cfaa177ec5a802f4d8d6afbd816 |
2493 | Seccomp mode of the process | |
2494 | (since Linux 3.8, see | |
2495 | .BR seccomp (2)). | |
2496 | 0 means | |
2497 | .BR SECCOMP_MODE_DISABLED ; | |
2498 | 1 means | |
2499 | .BR SECCOMP_MODE_STRICT ; | |
2500 | 2 means | |
2501 | .BR SECCOMP_MODE_FILTER . | |
2502 | This field is provided only if the kernel was built with the | |
1ae6b2c7 | 2503 | .B CONFIG_SECCOMP |
039b6546 | 2504 | kernel configuration option enabled. |
bd13ace0 | 2505 | .TP |
d925b426 SG |
2506 | .I Seccomp_filters |
2507 | .\" commit c818c03b661cd769e035e41673d5543ba2ebda64 | |
2508 | Number of seccomp filters attached to the process | |
2509 | (since Linux 5.9, see | |
2510 | .BR seccomp (2)). | |
2511 | .TP | |
1ae6b2c7 | 2512 | .I Speculation_Store_Bypass |
bf8fc275 NF |
2513 | .\" commit fae1fa0fc6cca8beee3ab8ed71d54f9a78fa3f64 |
2514 | Speculation flaw mitigation state | |
2515 | (since Linux 4.17, see | |
2516 | .BR prctl (2)). | |
bd13ace0 | 2517 | .TP |
1ae6b2c7 | 2518 | .I Cpus_allowed |
a4e6603a | 2519 | Hexadecimal mask of CPUs on which this process may run |
16b5f7ba MK |
2520 | (since Linux 2.6.24, see |
2521 | .BR cpuset (7)). | |
bd13ace0 | 2522 | .TP |
1ae6b2c7 | 2523 | .I Cpus_allowed_list |
16b5f7ba MK |
2524 | Same as previous, but in "list format" |
2525 | (since Linux 2.6.26, see | |
2526 | .BR cpuset (7)). | |
bd13ace0 | 2527 | .TP |
1ae6b2c7 | 2528 | .I Mems_allowed |
16b5f7ba MK |
2529 | Mask of memory nodes allowed to this process |
2530 | (since Linux 2.6.24, see | |
2531 | .BR cpuset (7)). | |
bd13ace0 | 2532 | .TP |
1ae6b2c7 | 2533 | .I Mems_allowed_list |
16b5f7ba MK |
2534 | Same as previous, but in "list format" |
2535 | (since Linux 2.6.26, see | |
2536 | .BR cpuset (7)). | |
bd13ace0 MK |
2537 | .TP |
2538 | .IR voluntary_ctxt_switches ", " nonvoluntary_ctxt_switches | |
16b5f7ba MK |
2539 | Number of voluntary and involuntary context switches (since Linux 2.6.23). |
2540 | .RE | |
afb7b014 | 2541 | .TP |
1ae6b2c7 | 2542 | .IR /proc/ pid /syscall " (since Linux 2.6.27)" |
afb7b014 MK |
2543 | .\" commit ebcb67341fee34061430f3367f2e507e52ee051b |
2544 | This file exposes the system call number and argument registers for the | |
2545 | system call currently being executed by the process, | |
2546 | followed by the values of the stack pointer and program counter registers. | |
2547 | The values of all six argument registers are exposed, | |
2548 | although most system calls use fewer registers. | |
2dad4c59 | 2549 | .IP |
afb7b014 | 2550 | If the process is blocked, but not in a system call, |
1fb61947 | 2551 | then the file displays \-1 in place of the system call number, |
afb7b014 | 2552 | followed by just the values of the stack pointer and program counter. |
64fcb6e1 | 2553 | If process is not blocked, then the file contains just the string "running". |
2dad4c59 | 2554 | .IP |
afb7b014 MK |
2555 | This file is present only if the kernel was configured with |
2556 | .BR CONFIG_HAVE_ARCH_TRACEHOOK . | |
2dad4c59 | 2557 | .IP |
4834ae91 MK |
2558 | Permission to access this file is governed by a ptrace access mode |
2559 | .B PTRACE_MODE_ATTACH_FSCREDS | |
2560 | check; see | |
2561 | .BR ptrace (2). | |
fea681da | 2562 | .TP |
1ae6b2c7 | 2563 | .IR /proc/ pid /task " (since Linux 2.6.0)" |
d6bec36e | 2564 | .\" Precisely: Linux 2.6.0-test6 |
afcaf646 MK |
2565 | This is a directory that contains one subdirectory |
2566 | for each thread in the process. | |
69119dc7 | 2567 | The name of each subdirectory is the numerical thread ID |
1ae6b2c7 | 2568 | .RI ( tid ) |
69119dc7 | 2569 | of the thread (see |
afcaf646 | 2570 | .BR gettid (2)). |
eb8567a5 | 2571 | .IP |
afcaf646 MK |
2572 | Within each of these subdirectories, there is a set of |
2573 | files with the same names and contents as under the | |
1ae6b2c7 | 2574 | .IR /proc/ pid |
afcaf646 MK |
2575 | directories. |
2576 | For attributes that are shared by all threads, the contents for | |
2577 | each of the files under the | |
1ae6b2c7 | 2578 | .IR task/ tid |
afcaf646 | 2579 | subdirectories will be the same as in the corresponding |
c13182ef | 2580 | file in the parent |
1ae6b2c7 | 2581 | .IR /proc/ pid |
afcaf646 | 2582 | directory |
c13182ef | 2583 | (e.g., in a multithreaded process, all of the |
1ae6b2c7 | 2584 | .IR task/ tid /cwd |
c13182ef | 2585 | files will have the same value as the |
1ae6b2c7 | 2586 | .IR /proc/ pid /cwd |
c13182ef | 2587 | file in the parent directory, since all of the threads in a process |
afcaf646 MK |
2588 | share a working directory). |
2589 | For attributes that are distinct for each thread, | |
c13182ef | 2590 | the corresponding files under |
1ae6b2c7 | 2591 | .IR task/ tid |
afcaf646 | 2592 | may have different values (e.g., various fields in each of the |
1ae6b2c7 | 2593 | .IR task/ tid /status |
4a40c703 JH |
2594 | files may be different for each thread), |
2595 | .\" in particular: "children" :/ | |
2596 | or they might not exist in | |
1ae6b2c7 | 2597 | .IR /proc/ pid |
4a40c703 | 2598 | at all. |
eb8567a5 | 2599 | .IP |
afcaf646 MK |
2600 | .\" The following was still true as at kernel 2.6.13 |
2601 | In a multithreaded process, the contents of the | |
1ae6b2c7 | 2602 | .IR /proc/ pid /task |
c13182ef | 2603 | directory are not available if the main thread has already terminated |
afcaf646 MK |
2604 | (typically by calling |
2605 | .BR pthread_exit (3)). | |
4a40c703 | 2606 | .TP |
1ae6b2c7 | 2607 | .IR /proc/ pid /task/ tid /children " (since Linux 3.5)" |
4a40c703 JH |
2608 | .\" commit 818411616baf46ceba0cff6f05af3a9b294734f7 |
2609 | A space-separated list of child tasks of this task. | |
2610 | Each child task is represented by its TID. | |
2dad4c59 | 2611 | .IP |
4a40c703 | 2612 | .\" see comments in get_children_pid() in fs/proc/array.c |
45dd5092 MK |
2613 | This option is intended for use by the checkpoint-restore (CRIU) system, |
2614 | and reliably provides a list of children only if all of the child processes | |
2615 | are stopped or frozen. | |
2616 | It does not work properly if children of the target task exit while | |
4a40c703 | 2617 | the file is being read! |
45dd5092 | 2618 | Exiting children may cause non-exiting children to be omitted from the list. |
4a40c703 | 2619 | This makes this interface even more unreliable than classic PID-based |
45dd5092 MK |
2620 | approaches if the inspected task and its children aren't frozen, |
2621 | and most code should probably not use this interface. | |
2dad4c59 | 2622 | .IP |
7ded2db4 MK |
2623 | Until Linux 4.2, the presence of this file was governed by the |
2624 | .B CONFIG_CHECKPOINT_RESTORE | |
2625 | kernel configuration option. | |
2626 | Since Linux 4.2, | |
2627 | .\" commit 2e13ba54a2682eea24918b87ad3edf70c2cf085b | |
ae34c521 | 2628 | it is governed by the |
7ded2db4 MK |
2629 | .B CONFIG_PROC_CHILDREN |
2630 | option. | |
afcaf646 | 2631 | .TP |
1ae6b2c7 | 2632 | .IR /proc/ pid /timers " (since Linux 3.10)" |
1509ca0e MK |
2633 | .\" commit 5ed67f05f66c41e39880a6d61358438a25f9fee5 |
2634 | .\" commit 48f6a7a511ef8823fdff39afee0320092d43a8a0 | |
2635 | A list of the POSIX timers for this process. | |
93691c1e | 2636 | Each timer is listed with a line that starts with the string "ID:". |
1509ca0e | 2637 | For example: |
2dad4c59 | 2638 | .IP |
1509ca0e | 2639 | .in +4n |
37d5e699 | 2640 | .EX |
1509ca0e MK |
2641 | ID: 1 |
2642 | signal: 60/00007fff86e452a8 | |
2643 | notify: signal/pid.2634 | |
2644 | ClockID: 0 | |
2645 | ID: 0 | |
2646 | signal: 60/00007fff86e452a8 | |
2647 | notify: signal/pid.2634 | |
2648 | ClockID: 1 | |
37d5e699 | 2649 | .EE |
1509ca0e | 2650 | .in |
2dad4c59 | 2651 | .IP |
1509ca0e MK |
2652 | The lines shown for each timer have the following meanings: |
2653 | .RS | |
2654 | .TP | |
2655 | .I ID | |
2656 | The ID for this timer. | |
2657 | This is not the same as the timer ID returned by | |
2658 | .BR timer_create (2); | |
2659 | rather, it is the same kernel-internal ID that is available via the | |
2660 | .I si_timerid | |
2661 | field of the | |
1ae6b2c7 | 2662 | .I siginfo_t |
1509ca0e MK |
2663 | structure (see |
2664 | .BR sigaction (2)). | |
2665 | .TP | |
2666 | .I signal | |
2667 | This is the signal number that this timer uses to deliver notifications | |
2668 | followed by a slash, and then the | |
7f1ea8fb | 2669 | .I sigev_value |
1509ca0e MK |
2670 | value supplied to the signal handler. |
2671 | Valid only for timers that notify via a signal. | |
2672 | .TP | |
2673 | .I notify | |
2674 | The part before the slash specifies the mechanism | |
2675 | that this timer uses to deliver notifications, | |
2676 | and is one of "thread", "signal", or "none". | |
2677 | Immediately following the slash is either the string "tid" for timers | |
2678 | with | |
2679 | .B SIGEV_THREAD_ID | |
2680 | notification, or "pid" for timers that notify by other mechanisms. | |
dbe6f88b MK |
2681 | Following the "." is the PID of the process |
2682 | (or the kernel thread ID of the thread) that will be delivered | |
1509ca0e MK |
2683 | a signal if the timer delivers notifications via a signal. |
2684 | .TP | |
2685 | .I ClockID | |
2686 | This field identifies the clock that the timer uses for measuring time. | |
2687 | For most clocks, this is a number that matches one of the user-space | |
1ae6b2c7 | 2688 | .B CLOCK_* |
9d54c087 | 2689 | constants exposed via |
1509ca0e MK |
2690 | .IR <time.h> . |
2691 | .B CLOCK_PROCESS_CPUTIME_ID | |
9bc87ed0 | 2692 | timers display with a value of \-6 |
1509ca0e MK |
2693 | in this field. |
2694 | .B CLOCK_THREAD_CPUTIME_ID | |
9bc87ed0 | 2695 | timers display with a value of \-2 |
1509ca0e MK |
2696 | in this field. |
2697 | .RE | |
5734da6d MK |
2698 | .IP |
2699 | This file is available only when the kernel was configured with | |
2700 | .BR CONFIG_CHECKPOINT_RESTORE . | |
1509ca0e | 2701 | .TP |
1ae6b2c7 | 2702 | .IR /proc/ pid /timerslack_ns " (since Linux 4.6)" |
11f60142 MK |
2703 | .\" commit da8b44d5a9f8bf26da637b7336508ca534d6b319 |
2704 | .\" commit 5de23d435e88996b1efe0e2cebe242074ce67c9e | |
2705 | This file exposes the process's "current" timer slack value, | |
2706 | expressed in nanoseconds. | |
2707 | The file is writable, | |
2708 | allowing the process's timer slack value to be changed. | |
2709 | Writing 0 to this file resets the "current" timer slack to the | |
2710 | "default" timer slack value. | |
2711 | For further details, see the discussion of | |
1ae6b2c7 | 2712 | .B PR_SET_TIMERSLACK |
11f60142 MK |
2713 | in |
2714 | .BR prctl (2). | |
2dad4c59 | 2715 | .IP |
5daae264 MK |
2716 | Initially, |
2717 | permission to access this file was governed by a ptrace access mode | |
a62e0e01 | 2718 | .B PTRACE_MODE_ATTACH_FSCREDS |
5daae264 MK |
2719 | check (see |
2720 | .BR ptrace (2)). | |
2721 | However, this was subsequently deemed too strict a requirement | |
2722 | (and had the side effect that requiring a process to have the | |
2723 | .B CAP_SYS_PTRACE | |
2724 | capability would also allow it to view and change any process's memory). | |
2725 | Therefore, since Linux 4.9, | |
2726 | .\" commit 7abbaf94049914f074306d960b0f968ffe52e59f | |
2727 | only the (weaker) | |
2728 | .B CAP_SYS_NICE | |
2729 | capability is required to access this file. | |
11f60142 | 2730 | .TP |
1ae6b2c7 | 2731 | .IR /proc/ pid /uid_map " (since Linux 3.5)" |
b1aad373 MK |
2732 | See |
2733 | .BR user_namespaces (7). | |
2734 | .TP | |
1ae6b2c7 | 2735 | .IR /proc/ pid /wchan " (since Linux 2.6.0)" |
b1aad373 MK |
2736 | The symbolic name corresponding to the location |
2737 | in the kernel where the process is sleeping. | |
2dad4c59 | 2738 | .IP |
82664739 MK |
2739 | Permission to access this file is governed by a ptrace access mode |
2740 | .B PTRACE_MODE_READ_FSCREDS | |
2741 | check; see | |
2742 | .BR ptrace (2). | |
b1aad373 | 2743 | .TP |
1ae6b2c7 | 2744 | .IR /proc/ tid |
01df7b70 MK |
2745 | There is a numerical subdirectory for each running thread |
2746 | that is not a thread group leader | |
2747 | (i.e., a thread whose thread ID is not the same as its process ID); | |
2748 | the subdirectory is named by the thread ID. | |
2749 | Each one of these subdirectories contains files and subdirectories | |
2750 | exposing information about the thread with the thread ID | |
2751 | .IR tid . | |
2752 | The contents of these directories are the same as the corresponding | |
1ae6b2c7 | 2753 | .IR /proc/ pid /task/ tid |
01df7b70 MK |
2754 | directories. |
2755 | .IP | |
2756 | The | |
1ae6b2c7 | 2757 | .IR /proc/ tid |
01df7b70 MK |
2758 | subdirectories are |
2759 | .I not | |
2760 | visible when iterating through | |
2761 | .I /proc | |
2762 | with | |
2763 | .BR getdents (2) | |
2764 | (and thus are | |
2765 | .I not | |
2766 | visible when one uses | |
2767 | .BR ls (1) | |
2768 | to view the contents of | |
2769 | .IR /proc ). | |
37cd58d2 MK |
2770 | However, the pathnames of these directories are visible to |
2771 | (i.e., usable as arguments in) | |
2772 | system calls that operate on pathnames. | |
01df7b70 | 2773 | .TP |
b1aad373 MK |
2774 | .I /proc/apm |
2775 | Advanced power management version and battery information when | |
2776 | .B CONFIG_APM | |
2777 | is defined at kernel compilation time. | |
2778 | .TP | |
2779 | .I /proc/buddyinfo | |
2780 | This file contains information which is used for diagnosing memory | |
2781 | fragmentation issues. | |
2782 | Each line starts with the identification of the node and the name | |
f68d8104 | 2783 | of the zone which together identify a memory region. |
b1aad373 MK |
2784 | This is then |
2785 | followed by the count of available chunks of a certain order in | |
2786 | which these zones are split. | |
2787 | The size in bytes of a certain order is given by the formula: | |
2dad4c59 | 2788 | .IP |
1ae6b2c7 AC |
2789 | .in +4n |
2790 | .EX | |
e4b01162 | 2791 | (2\[ha]order)\ *\ PAGE_SIZE |
1ae6b2c7 AC |
2792 | .EE |
2793 | .in | |
2dad4c59 | 2794 | .IP |
b1aad373 MK |
2795 | The binary buddy allocator algorithm inside the kernel will split |
2796 | one chunk into two chunks of a smaller order (thus with half the | |
2797 | size) or combine two contiguous chunks into one larger chunk of | |
2798 | a higher order (thus with double the size) to satisfy allocation | |
2799 | requests and to counter memory fragmentation. | |
2800 | The order matches the column number, when starting to count at zero. | |
2dad4c59 | 2801 | .IP |
b5b0d21e | 2802 | For example on an x86-64 system: |
e3fb1b6b | 2803 | .RS -12 |
37d5e699 | 2804 | .EX |
b1aad373 MK |
2805 | Node 0, zone DMA 1 1 1 0 2 1 1 0 1 1 3 |
2806 | Node 0, zone DMA32 65 47 4 81 52 28 13 10 5 1 404 | |
2807 | Node 0, zone Normal 216 55 189 101 84 38 37 27 5 3 587 | |
37d5e699 | 2808 | .EE |
e3fb1b6b | 2809 | .RE |
2dad4c59 | 2810 | .IP |
b1aad373 MK |
2811 | In this example, there is one node containing three zones and there |
2812 | are 11 different chunk sizes. | |
2813 | If the page size is 4 kilobytes, then the first zone called | |
2814 | .I DMA | |
2815 | (on x86 the first 16 megabyte of memory) has 1 chunk of 4 kilobytes | |
2816 | (order 0) available and has 3 chunks of 4 megabytes (order 10) available. | |
2dad4c59 | 2817 | .IP |
b1aad373 MK |
2818 | If the memory is heavily fragmented, the counters for higher |
2819 | order chunks will be zero and allocation of large contiguous areas | |
2820 | will fail. | |
2dad4c59 | 2821 | .IP |
b1aad373 MK |
2822 | Further information about the zones can be found in |
2823 | .IR /proc/zoneinfo . | |
2824 | .TP | |
2825 | .I /proc/bus | |
7371ef9e | 2826 | Contains subdirectories for installed buses. |
b1aad373 MK |
2827 | .TP |
2828 | .I /proc/bus/pccard | |
2829 | Subdirectory for PCMCIA devices when | |
2830 | .B CONFIG_PCMCIA | |
2831 | is set at kernel compilation time. | |
2832 | .TP | |
fea681da MK |
2833 | .I /proc/bus/pccard/drivers |
2834 | .TP | |
2835 | .I /proc/bus/pci | |
c13182ef | 2836 | Contains various bus subdirectories and pseudo-files containing |
7371ef9e | 2837 | information about PCI buses, installed devices, and device |
c13182ef MK |
2838 | drivers. |
2839 | Some of these files are not ASCII. | |
fea681da MK |
2840 | .TP |
2841 | .I /proc/bus/pci/devices | |
59a40ed7 | 2842 | Information about PCI devices. |
c13182ef | 2843 | They may be accessed through |
fea681da MK |
2844 | .BR lspci (8) |
2845 | and | |
2846 | .BR setpci (8). | |
2847 | .TP | |
12b23dfe MK |
2848 | .IR /proc/cgroups " (since Linux 2.6.24)" |
2849 | See | |
2850 | .BR cgroups (7). | |
2851 | .TP | |
fea681da | 2852 | .I /proc/cmdline |
c13182ef MK |
2853 | Arguments passed to the Linux kernel at boot time. |
2854 | Often done via a boot manager such as | |
59a40ed7 MK |
2855 | .BR lilo (8) |
2856 | or | |
2857 | .BR grub (8). | |
d4cbaa91 PM |
2858 | Any arguments embedded in the kernel image or initramfs via |
2859 | .B CONFIG_BOOT_CONFIG | |
2860 | will also be displayed. | |
f6e524c4 MK |
2861 | .TP |
2862 | .IR /proc/config.gz " (since Linux 2.6)" | |
2863 | This file exposes the configuration options that were used | |
c3d9780d | 2864 | to build the currently running kernel, |
f6e524c4 MK |
2865 | in the same format as they would be shown in the |
2866 | .I .config | |
2867 | file that resulted when configuring the kernel (using | |
2868 | .IR "make xconfig" , | |
2869 | .IR "make config" , | |
2870 | or similar). | |
2871 | The file contents are compressed; view or search them using | |
f78ed33a MK |
2872 | .BR zcat (1) |
2873 | and | |
2874 | .BR zgrep (1). | |
f6e524c4 | 2875 | As long as no changes have been made to the following file, |
250e01ec MK |
2876 | the contents of |
2877 | .I /proc/config.gz | |
37d5e699 MK |
2878 | are the same as those provided by: |
2879 | .IP | |
f6e524c4 | 2880 | .in +4n |
37d5e699 | 2881 | .EX |
c3074d70 | 2882 | cat /lib/modules/$(uname \-r)/build/.config |
37d5e699 | 2883 | .EE |
f6e524c4 | 2884 | .in |
250e01ec MK |
2885 | .IP |
2886 | .I /proc/config.gz | |
90878f7c | 2887 | is provided only if the kernel is configured with |
250e01ec | 2888 | .BR CONFIG_IKCONFIG_PROC . |
fea681da | 2889 | .TP |
577c0e20 MK |
2890 | .I /proc/crypto |
2891 | A list of the ciphers provided by the kernel crypto API. | |
2892 | For details, see the kernel | |
2893 | .I "Linux Kernel Crypto API" | |
2894 | documentation available under the kernel source directory | |
e94de168 ES |
2895 | .I Documentation/crypto/ |
2896 | .\" commit 3b72c814a8e8cd638e1ba0da4dfce501e9dff5af | |
2897 | (or | |
2898 | .I Documentation/DocBook | |
b324e17d | 2899 | before Linux 4.10; |
e94de168 | 2900 | the documentation can be built using a command such as |
1ae6b2c7 | 2901 | .I make htmldocs |
e94de168 | 2902 | in the root directory of the kernel source tree). |
577c0e20 | 2903 | .TP |
fea681da MK |
2904 | .I /proc/cpuinfo |
2905 | This is a collection of CPU and system architecture dependent items, | |
2906 | for each supported architecture a different list. | |
2907 | Two common entries are \fIprocessor\fP which gives CPU number and | |
c13182ef MK |
2908 | \fIbogomips\fP; a system constant that is calculated |
2909 | during kernel initialization. | |
2910 | SMP machines have information for | |
fea681da | 2911 | each CPU. |
a091f002 MK |
2912 | The |
2913 | .BR lscpu (1) | |
2914 | command gathers its information from this file. | |
fea681da MK |
2915 | .TP |
2916 | .I /proc/devices | |
c13182ef MK |
2917 | Text listing of major numbers and device groups. |
2918 | This can be used by MAKEDEV scripts for consistency with the kernel. | |
fea681da MK |
2919 | .TP |
2920 | .IR /proc/diskstats " (since Linux 2.5.69)" | |
2921 | This file contains disk I/O statistics for each disk device. | |
66a9882e | 2922 | See the Linux kernel source file |
79472471 | 2923 | .I Documentation/admin\-guide/iostats.rst |
8a5fc410 | 2924 | (or |
fea681da | 2925 | .I Documentation/iostats.txt |
8a5fc410 | 2926 | before Linux 5.3) |
fea681da MK |
2927 | for further information. |
2928 | .TP | |
2929 | .I /proc/dma | |
c13182ef | 2930 | This is a list of the registered \fIISA\fP DMA (direct memory access) |
fea681da MK |
2931 | channels in use. |
2932 | .TP | |
2933 | .I /proc/driver | |
2934 | Empty subdirectory. | |
2935 | .TP | |
2936 | .I /proc/execdomains | |
9b3f209a | 2937 | Used to list ABI personalities before Linux 4.1; |
2938 | now contains a constant string for userspace compatibility. | |
fea681da MK |
2939 | .TP |
2940 | .I /proc/fb | |
097585ed MK |
2941 | Frame buffer information when |
2942 | .B CONFIG_FB | |
2943 | is defined during kernel compilation. | |
fea681da MK |
2944 | .TP |
2945 | .I /proc/filesystems | |
9ee4a2b6 MK |
2946 | A text listing of the filesystems which are supported by the kernel, |
2947 | namely filesystems which were compiled into the kernel or whose kernel | |
6387216b MK |
2948 | modules are currently loaded. |
2949 | (See also | |
fb477da2 | 2950 | .BR filesystems (5).) |
9ee4a2b6 | 2951 | If a filesystem is marked with "nodev", |
809d0164 | 2952 | this means that it does not require a block device to be mounted |
9ee4a2b6 | 2953 | (e.g., virtual filesystem, network filesystem). |
2dad4c59 | 2954 | .IP |
809d0164 MK |
2955 | Incidentally, this file may be used by |
2956 | .BR mount (8) | |
9ee4a2b6 MK |
2957 | when no filesystem is specified and it didn't manage to determine the |
2958 | filesystem type. | |
2959 | Then filesystems contained in this file are tried | |
809d0164 | 2960 | (excepted those that are marked with "nodev"). |
fea681da MK |
2961 | .TP |
2962 | .I /proc/fs | |
df352acc | 2963 | .\" FIXME Much more needs to be said about /proc/fs |
91085d85 | 2964 | .\" |
df352acc MK |
2965 | Contains subdirectories that in turn contain files |
2966 | with information about (certain) mounted filesystems. | |
fea681da MK |
2967 | .TP |
2968 | .I /proc/ide | |
2969 | This directory | |
59a40ed7 MK |
2970 | exists on systems with the IDE bus. |
2971 | There are directories for each IDE channel and attached device. | |
c13182ef | 2972 | Files include: |
2dad4c59 | 2973 | .IP |
a08ea57c | 2974 | .in +4n |
37d5e699 | 2975 | .EX |
fea681da MK |
2976 | cache buffer size in KB |
2977 | capacity number of sectors | |
2978 | driver driver version | |
2979 | geometry physical and logical geometry | |
9fdfa163 | 2980 | identify in hexadecimal |
fea681da | 2981 | media media type |
b957f81f | 2982 | model manufacturer\[aq]s model number |
fea681da | 2983 | settings drive settings |
a6a5e521 MK |
2984 | smart_thresholds IDE disk management thresholds (in hex) |
2985 | smart_values IDE disk management values (in hex) | |
37d5e699 | 2986 | .EE |
a08ea57c | 2987 | .in |
2dad4c59 | 2988 | .IP |
c13182ef | 2989 | The |
fea681da MK |
2990 | .BR hdparm (8) |
2991 | utility provides access to this information in a friendly format. | |
2992 | .TP | |
2993 | .I /proc/interrupts | |
23ec6ff0 MK |
2994 | This is used to record the number of interrupts per CPU per IO device. |
2995 | Since Linux 2.6.24, | |
9ea5bc66 | 2996 | for the i386 and x86-64 architectures, at least, this also includes |
23ec6ff0 MK |
2997 | interrupts internal to the system (that is, not associated with a device |
2998 | as such), such as NMI (nonmaskable interrupt), LOC (local timer interrupt), | |
2999 | and for SMP systems, TLB (TLB flush interrupt), RES (rescheduling | |
3000 | interrupt), CAL (remote function call interrupt), and possibly others. | |
3001 | Very easy to read formatting, done in ASCII. | |
fea681da MK |
3002 | .TP |
3003 | .I /proc/iomem | |
3004 | I/O memory map in Linux 2.4. | |
3005 | .TP | |
3006 | .I /proc/ioports | |
c13182ef | 3007 | This is a list of currently registered Input-Output port regions that |
fea681da MK |
3008 | are in use. |
3009 | .TP | |
3010 | .IR /proc/kallsyms " (since Linux 2.5.71)" | |
3011 | This holds the kernel exported symbol definitions used by the | |
3012 | .BR modules (X) | |
3013 | tools to dynamically link and bind loadable modules. | |
3014 | In Linux 2.5.47 and earlier, a similar file with slightly different syntax | |
3015 | was named | |
3016 | .IR ksyms . | |
3017 | .TP | |
3018 | .I /proc/kcore | |
3019 | This file represents the physical memory of the system and is stored | |
c13182ef MK |
3020 | in the ELF core file format. |
3021 | With this pseudo-file, and an unstripped | |
9a67332e MK |
3022 | kernel |
3023 | .RI ( /usr/src/linux/vmlinux ) | |
3024 | binary, GDB can be used to | |
fea681da | 3025 | examine the current state of any kernel data structures. |
2dad4c59 | 3026 | .IP |
fea681da | 3027 | The total length of the file is the size of physical memory (RAM) plus |
ee8655b5 | 3028 | 4\ KiB. |
fea681da | 3029 | .TP |
653836fb MK |
3030 | .IR /proc/keys " (since Linux 2.6.10)" |
3031 | See | |
3032 | .BR keyrings (7). | |
3033 | .TP | |
184d797d | 3034 | .IR /proc/key\-users " (since Linux 2.6.10)" |
653836fb MK |
3035 | See |
3036 | .BR keyrings (7). | |
3037 | .TP | |
fea681da MK |
3038 | .I /proc/kmsg |
3039 | This file can be used instead of the | |
3040 | .BR syslog (2) | |
c13182ef MK |
3041 | system call to read kernel messages. |
3042 | A process must have superuser | |
fea681da | 3043 | privileges to read this file, and only one process should read this |
c13182ef MK |
3044 | file. |
3045 | This file should not be read if a syslog process is running | |
fea681da MK |
3046 | which uses the |
3047 | .BR syslog (2) | |
3048 | system call facility to log kernel messages. | |
2dad4c59 | 3049 | .IP |
fea681da | 3050 | Information in this file is retrieved with the |
c4517613 | 3051 | .BR dmesg (1) |
fea681da MK |
3052 | program. |
3053 | .TP | |
55d68a94 | 3054 | .IR /proc/kpagecgroup " (since Linux 4.3)" |
0e462d71 | 3055 | .\" commit 80ae2fdceba8313b0433f899bdd9c6c463291a17 |
55d68a94 OE |
3056 | This file contains a 64-bit inode number of |
3057 | the memory cgroup each page is charged to, | |
3058 | indexed by page frame number (see the discussion of | |
1ae6b2c7 | 3059 | .IR /proc/ pid /pagemap ). |
55d68a94 OE |
3060 | .IP |
3061 | The | |
1ae6b2c7 | 3062 | .I /proc/kpagecgroup |
55d68a94 OE |
3063 | file is present only if the |
3064 | .B CONFIG_MEMCG | |
3065 | kernel configuration option is enabled. | |
3066 | .TP | |
ff56ac8b MK |
3067 | .IR /proc/kpagecount " (since Linux 2.6.25)" |
3068 | This file contains a 64-bit count of the number of | |
3069 | times each physical page frame is mapped, | |
3070 | indexed by page frame number (see the discussion of | |
1ae6b2c7 | 3071 | .IR /proc/ pid /pagemap ). |
ff56ac8b MK |
3072 | .IP |
3073 | The | |
1ae6b2c7 | 3074 | .I /proc/kpagecount |
ff56ac8b MK |
3075 | file is present only if the |
3076 | .B CONFIG_PROC_PAGE_MONITOR | |
59d566a9 MK |
3077 | kernel configuration option is enabled. |
3078 | .TP | |
3079 | .IR /proc/kpageflags " (since Linux 2.6.25)" | |
ef4f4031 | 3080 | This file contains 64-bit masks corresponding to each physical page frame; |
59d566a9 | 3081 | it is indexed by page frame number (see the discussion of |
1ae6b2c7 | 3082 | .IR /proc/ pid /pagemap ). |
59d566a9 | 3083 | The bits are as follows: |
30eadebd | 3084 | .RS |
2dad4c59 | 3085 | .IP |
30eadebd AC |
3086 | .TS |
3087 | r l l l. | |
3088 | 0 - KPF_LOCKED | |
3089 | 1 - KPF_ERROR | |
3090 | 2 - KPF_REFERENCED | |
3091 | 3 - KPF_UPTODATE | |
3092 | 4 - KPF_DIRTY | |
3093 | 5 - KPF_LRU | |
3094 | 6 - KPF_ACTIVE | |
3095 | 7 - KPF_SLAB | |
3096 | 8 - KPF_WRITEBACK | |
3097 | 9 - KPF_RECLAIM | |
3098 | 10 - KPF_BUDDY | |
3099 | 11 - KPF_MMAP (since Linux 2.6.31) | |
3100 | 12 - KPF_ANON (since Linux 2.6.31) | |
3101 | 13 - KPF_SWAPCACHE (since Linux 2.6.31) | |
3102 | 14 - KPF_SWAPBACKED (since Linux 2.6.31) | |
3103 | 15 - KPF_COMPOUND_HEAD (since Linux 2.6.31) | |
3104 | 16 - KPF_COMPOUND_TAIL (since Linux 2.6.31) | |
3105 | 17 - KPF_HUGE (since Linux 2.6.31) | |
3106 | 18 - KPF_UNEVICTABLE (since Linux 2.6.31) | |
3107 | 19 - KPF_HWPOISON (since Linux 2.6.31) | |
3108 | 20 - KPF_NOPAGE (since Linux 2.6.31) | |
3109 | 21 - KPF_KSM (since Linux 2.6.32) | |
3110 | 22 - KPF_THP (since Linux 3.4) | |
3111 | 23 - KPF_BALLOON (since Linux 3.18) | |
5487da4c | 3112 | .\" KPF_BALLOON: commit 09316c09dde33aae14f34489d9e3d243ec0d5938 |
30eadebd | 3113 | 24 - KPF_ZERO_PAGE (since Linux 4.0) |
c6f182bc | 3114 | .\" KPF_ZERO_PAGE: commit 56873f43abdcd574b25105867a990f067747b2f4 |
30eadebd | 3115 | 25 - KPF_IDLE (since Linux 4.3) |
c6f182bc | 3116 | .\" KPF_IDLE: commit f074a8f49eb87cde95ac9d040ad5e7ea4f029738 |
33416a99 MB |
3117 | 26 - KPF_PGTABLE (since Linux 4.18) |
3118 | .\" KPF_PGTABLE: commit 1d40a5ea01d53251c23c7be541d3f4a656cfc537 | |
30eadebd AC |
3119 | .TE |
3120 | .RE | |
2dad4c59 | 3121 | .IP |
59d566a9 MK |
3122 | For further details on the meanings of these bits, |
3123 | see the kernel source file | |
184d797d | 3124 | .IR Documentation/admin\-guide/mm/pagemap.rst . |
b324e17d | 3125 | Before Linux 2.6.29, |
59d566a9 MK |
3126 | .\" commit ad3bdefe877afb47480418fdb05ecd42842de65e |
3127 | .\" commit e07a4b9217d1e97d2f3a62b6b070efdc61212110 | |
3128 | .BR KPF_WRITEBACK , | |
3129 | .BR KPF_RECLAIM , | |
3130 | .BR KPF_BUDDY , | |
3131 | and | |
1ae6b2c7 | 3132 | .B KPF_LOCKED |
59d566a9 MK |
3133 | did not report correctly. |
3134 | .IP | |
3135 | The | |
1ae6b2c7 | 3136 | .I /proc/kpageflags |
59d566a9 MK |
3137 | file is present only if the |
3138 | .B CONFIG_PROC_PAGE_MONITOR | |
ff56ac8b MK |
3139 | kernel configuration option is enabled. |
3140 | .TP | |
523869f6 | 3141 | .IR /proc/ksyms " (Linux 1.1.23\[en]2.5.47)" |
fea681da MK |
3142 | See |
3143 | .IR /proc/kallsyms . | |
3144 | .TP | |
3145 | .I /proc/loadavg | |
6b05dc38 MK |
3146 | The first three fields in this file are load average figures |
3147 | giving the number of jobs in the run queue (state R) | |
fea681da MK |
3148 | or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes. |
3149 | They are the same as the load average numbers given by | |
3150 | .BR uptime (1) | |
3151 | and other programs. | |
6b05dc38 | 3152 | The fourth field consists of two numbers separated by a slash (/). |
78fc91ec EDB |
3153 | The first of these is the number of currently runnable kernel |
3154 | scheduling entities (processes, threads). | |
6b05dc38 MK |
3155 | The value after the slash is the number of kernel scheduling entities |
3156 | that currently exist on the system. | |
3157 | The fifth field is the PID of the process that was most | |
3158 | recently created on the system. | |
fea681da MK |
3159 | .TP |
3160 | .I /proc/locks | |
3161 | This file shows current file locks | |
3162 | .RB ( flock "(2) and " fcntl (2)) | |
3163 | and leases | |
3164 | .RB ( fcntl (2)). | |
f352b560 MK |
3165 | .IP |
3166 | An example of the content shown in this file is the following: | |
3167 | .IP | |
3168 | .in +4n | |
3169 | .EX | |
3170 | 1: POSIX ADVISORY READ 5433 08:01:7864448 128 128 | |
3171 | 2: FLOCK ADVISORY WRITE 2001 08:01:7864554 0 EOF | |
3172 | 3: FLOCK ADVISORY WRITE 1568 00:2f:32388 0 EOF | |
3173 | 4: POSIX ADVISORY WRITE 699 00:16:28457 0 EOF | |
3174 | 5: POSIX ADVISORY WRITE 764 00:16:21448 0 0 | |
3175 | 6: POSIX ADVISORY READ 3548 08:01:7867240 1 1 | |
3176 | 7: POSIX ADVISORY READ 3548 08:01:7865567 1826 2335 | |
184d797d | 3177 | 8: OFDLCK ADVISORY WRITE \-1 08:01:8713209 128 191 |
f352b560 MK |
3178 | .EE |
3179 | .in | |
3180 | .IP | |
3181 | The fields shown in each line are as follows: | |
3182 | .RS | |
22356d97 | 3183 | .IP [1] 5 |
f352b560 | 3184 | The ordinal position of the lock in the list. |
22356d97 | 3185 | .IP [2] |
f352b560 MK |
3186 | The lock type. |
3187 | Values that may appear here include: | |
3188 | .RS | |
3189 | .TP | |
3190 | .B FLOCK | |
3191 | This is a BSD file lock created using | |
3192 | .BR flock (2). | |
3193 | .TP | |
3194 | .B OFDLCK | |
3195 | This is an open file description (OFD) lock created using | |
3196 | .BR fcntl (2). | |
3197 | .TP | |
3198 | .B POSIX | |
3199 | This is a POSIX byte-range lock created using | |
3200 | .BR fcntl (2). | |
3201 | .RE | |
22356d97 | 3202 | .IP [3] |
f352b560 MK |
3203 | Among the strings that can appear here are the following: |
3204 | .RS | |
3205 | .TP | |
3206 | .B ADVISORY | |
3207 | This is an advisory lock. | |
3208 | .TP | |
3209 | .B MANDATORY | |
3210 | This is a mandatory lock. | |
3211 | .RE | |
22356d97 | 3212 | .IP [4] |
f352b560 MK |
3213 | The type of lock. |
3214 | Values that can appear here are: | |
3215 | .RS | |
3216 | .TP | |
3217 | .B READ | |
3218 | This is a POSIX or OFD read lock, or a BSD shared lock. | |
3219 | .TP | |
3220 | .B WRITE | |
3221 | This is a POSIX or OFD write lock, or a BSD exclusive lock. | |
3222 | .RE | |
22356d97 | 3223 | .IP [5] |
f352b560 MK |
3224 | The PID of the process that owns the lock. |
3225 | .IP | |
3226 | Because OFD locks are not owned by a single process | |
3227 | (since multiple processes may have file descriptors that | |
3228 | refer to the same open file description), | |
3229 | the value \-1 is displayed in this field for OFD locks. | |
b324e17d | 3230 | (Before Linux 4.14, |
52f842a5 | 3231 | .\" commit 9d5b86ac13c573795525ecac6ed2db39ab23e2a8 |
f352b560 MK |
3232 | a bug meant that the PID of the process that |
3233 | initially acquired the lock was displayed instead of the value \-1.) | |
22356d97 | 3234 | .IP [6] |
f352b560 MK |
3235 | Three colon-separated subfields that identify the major and minor device |
3236 | ID of the device containing the filesystem where the locked file resides, | |
3237 | followed by the inode number of the locked file. | |
22356d97 | 3238 | .IP [7] |
f352b560 MK |
3239 | The byte offset of the first byte of the lock. |
3240 | For BSD locks, this value is always 0. | |
22356d97 | 3241 | .IP [8] |
f352b560 MK |
3242 | The byte offset of the last byte of the lock. |
3243 | .B EOF | |
3244 | in this field means that the lock extends to the end of the file. | |
3245 | For BSD locks, the value shown is always | |
3246 | .IR EOF . | |
3247 | .RE | |
3248 | .IP | |
8fb9b45a MK |
3249 | Since Linux 4.9, |
3250 | .\" commit d67fd44f697dff293d7cdc29af929241b669affe | |
3251 | the list of locks shown in | |
3252 | .I /proc/locks | |
3253 | is filtered to show just the locks for the processes in the PID | |
3254 | namespace (see | |
3255 | .BR pid_namespaces (7)) | |
3256 | for which the | |
3257 | .I /proc | |
3258 | filesystem was mounted. | |
1dbe854b | 3259 | (In the initial PID namespace, |
8fb9b45a MK |
3260 | there is no filtering of the records shown in this file.) |
3261 | .IP | |
9f1002a1 MK |
3262 | The |
3263 | .BR lslocks (8) | |
3264 | command provides a bit more information about each lock. | |
fea681da | 3265 | .TP |
89dd5f8a | 3266 | .IR /proc/malloc " (only up to and including Linux 2.2)" |
59a40ed7 | 3267 | .\" It looks like this only ever did something back in 1.0 days |
90878f7c | 3268 | This file is present only if |
89dd5f8a | 3269 | .B CONFIG_DEBUG_MALLOC |
097585ed | 3270 | was defined during compilation. |
fea681da MK |
3271 | .TP |
3272 | .I /proc/meminfo | |
77b802ec MK |
3273 | This file reports statistics about memory usage on the system. |
3274 | It is used by | |
fea681da MK |
3275 | .BR free (1) |
3276 | to report the amount of free and used memory (both physical and swap) | |
3277 | on the system as well as the shared memory and buffers used by the | |
3278 | kernel. | |
3ba3d5b1 MK |
3279 | Each line of the file consists of a parameter name, followed by a colon, |
3280 | the value of the parameter, and an option unit of measurement (e.g., "kB"). | |
3281 | The list below describes the parameter names and | |
3282 | the format specifier required to read the field value. | |
3283 | Except as noted below, | |
3284 | all of the fields have been present since at least Linux 2.6.0. | |
86cf87d7 | 3285 | Some fields are displayed only if the kernel was configured |
3ba3d5b1 MK |
3286 | with various options; those dependencies are noted in the list. |
3287 | .RS | |
3288 | .TP | |
3289 | .IR MemTotal " %lu" | |
449dd4e2 | 3290 | Total usable RAM (i.e., physical RAM minus a few reserved |
99e91586 | 3291 | bits and the kernel binary code). |
3ba3d5b1 MK |
3292 | .TP |
3293 | .IR MemFree " %lu" | |
7bccb7d4 DP |
3294 | The sum of |
3295 | .IR LowFree + HighFree . | |
3ba3d5b1 | 3296 | .TP |
8b4b1f68 MK |
3297 | .IR MemAvailable " %lu (since Linux 3.14)" |
3298 | An estimate of how much memory is available for starting new | |
3299 | applications, without swapping. | |
3300 | .TP | |
3ba3d5b1 | 3301 | .IR Buffers " %lu" |
99e91586 | 3302 | Relatively temporary storage for raw disk blocks that |
c7169ee5 | 3303 | shouldn't get tremendously large (20 MB or so). |
3ba3d5b1 MK |
3304 | .TP |
3305 | .IR Cached " %lu" | |
3306 | In-memory cache for files read from the disk (the page cache). | |
3307 | Doesn't include | |
3308 | .IR SwapCached . | |
3309 | .TP | |
3310 | .IR SwapCached " %lu" | |
3311 | Memory that once was swapped out, is swapped back in but | |
3312 | still also is in the swap file. | |
fa1d2749 | 3313 | (If memory pressure is high, these pages |
3ba3d5b1 | 3314 | don't need to be swapped out again because they are already |
99e91586 | 3315 | in the swap file. |
3ba3d5b1 MK |
3316 | This saves I/O.) |
3317 | .TP | |
3318 | .IR Active " %lu" | |
3319 | Memory that has been used more recently and usually not | |
3320 | reclaimed unless absolutely necessary. | |
3321 | .TP | |
3322 | .IR Inactive " %lu" | |
3323 | Memory which has been less recently used. | |
3324 | It is more eligible to be reclaimed for other purposes. | |
3325 | .TP | |
3326 | .IR Active(anon) " %lu (since Linux 2.6.28)" | |
3327 | [To be documented.] | |
3328 | .TP | |
3329 | .IR Inactive(anon) " %lu (since Linux 2.6.28)" | |
3330 | [To be documented.] | |
3331 | .TP | |
3332 | .IR Active(file) " %lu (since Linux 2.6.28)" | |
3333 | [To be documented.] | |
3334 | .TP | |
3335 | .IR Inactive(file) " %lu (since Linux 2.6.28)" | |
3336 | [To be documented.] | |
3337 | .TP | |
3338 | .IR Unevictable " %lu (since Linux 2.6.28)" | |
b324e17d | 3339 | (From Linux 2.6.28 to Linux 2.6.30, |
3ba3d5b1 MK |
3340 | \fBCONFIG_UNEVICTABLE_LRU\fP was required.) |
3341 | [To be documented.] | |
3342 | .TP | |
46fbfc07 | 3343 | .IR Mlocked " %lu (since Linux 2.6.28)" |
b324e17d | 3344 | (From Linux 2.6.28 to Linux 2.6.30, |
3ba3d5b1 MK |
3345 | \fBCONFIG_UNEVICTABLE_LRU\fP was required.) |
3346 | [To be documented.] | |
3347 | .TP | |
3348 | .IR HighTotal " %lu" | |
3349 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) | |
3350 | Total amount of highmem. | |
3f029bc9 | 3351 | Highmem is all memory above \[ti]860 MB of physical memory. |
3ba3d5b1 MK |
3352 | Highmem areas are for use by user-space programs, |
3353 | or for the page cache. | |
3354 | The kernel must use tricks to access | |
3355 | this memory, making it slower to access than lowmem. | |
3356 | .TP | |
0dbe186a | 3357 | .IR HighFree " %lu" |
3ba3d5b1 MK |
3358 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) |
3359 | Amount of free highmem. | |
3360 | .TP | |
0dbe186a | 3361 | .IR LowTotal " %lu" |
3ba3d5b1 MK |
3362 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) |
3363 | Total amount of lowmem. | |
3364 | Lowmem is memory which can be used for everything that | |
3365 | highmem can be used for, but it is also available for the | |
3366 | kernel's use for its own data structures. | |
3367 | Among many other things, | |
99e91586 | 3368 | it is where everything from |
7bccb7d4 DP |
3369 | .I Slab |
3370 | is allocated. | |
3ba3d5b1 MK |
3371 | Bad things happen when you're out of lowmem. |
3372 | .TP | |
0dbe186a | 3373 | .IR LowFree " %lu" |
3ba3d5b1 MK |
3374 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) |
3375 | Amount of free lowmem. | |
3376 | .TP | |
3377 | .IR MmapCopy " %lu (since Linux 2.6.29)" | |
99e91586 DP |
3378 | .RB ( CONFIG_MMU |
3379 | is required.) | |
3ba3d5b1 MK |
3380 | [To be documented.] |
3381 | .TP | |
3382 | .IR SwapTotal " %lu" | |
3383 | Total amount of swap space available. | |
3384 | .TP | |
3385 | .IR SwapFree " %lu" | |
c16d4f25 | 3386 | Amount of swap space that is currently unused. |
3ba3d5b1 MK |
3387 | .TP |
3388 | .IR Dirty " %lu" | |
3389 | Memory which is waiting to get written back to the disk. | |
3390 | .TP | |
3391 | .IR Writeback " %lu" | |
3392 | Memory which is actively being written back to the disk. | |
3393 | .TP | |
3394 | .IR AnonPages " %lu (since Linux 2.6.18)" | |
3395 | Non-file backed pages mapped into user-space page tables. | |
3396 | .TP | |
3397 | .IR Mapped " %lu" | |
fda70f5b MK |
3398 | Files which have been mapped into memory (with |
3399 | .BR mmap (2)), | |
3400 | such as libraries. | |
3ba3d5b1 MK |
3401 | .TP |
3402 | .IR Shmem " %lu (since Linux 2.6.32)" | |
eb775c04 MK |
3403 | Amount of memory consumed in |
3404 | .BR tmpfs (5) | |
3405 | filesystems. | |
3ba3d5b1 | 3406 | .TP |
7375eaab MK |
3407 | .IR KReclaimable " %lu (since Linux 4.20)" |
3408 | Kernel allocations that the kernel will attempt to reclaim | |
3409 | under memory pressure. | |
3410 | Includes | |
3411 | .I SReclaimable | |
3412 | (below), and other direct allocations with a shrinker. | |
3413 | .TP | |
3ba3d5b1 MK |
3414 | .IR Slab " %lu" |
3415 | In-kernel data structures cache. | |
5a5bde70 MK |
3416 | (See |
3417 | .BR slabinfo (5).) | |
3ba3d5b1 MK |
3418 | .TP |
3419 | .IR SReclaimable " %lu (since Linux 2.6.19)" | |
7bccb7d4 DP |
3420 | Part of |
3421 | .IR Slab , | |
3422 | that might be reclaimed, such as caches. | |
3ba3d5b1 MK |
3423 | .TP |
3424 | .IR SUnreclaim " %lu (since Linux 2.6.19)" | |
7bccb7d4 DP |
3425 | Part of |
3426 | .IR Slab , | |
3427 | that cannot be reclaimed on memory pressure. | |
3ba3d5b1 MK |
3428 | .TP |
3429 | .IR KernelStack " %lu (since Linux 2.6.32)" | |
3430 | Amount of memory allocated to kernel stacks. | |
3431 | .TP | |
3432 | .IR PageTables " %lu (since Linux 2.6.18)" | |
3433 | Amount of memory dedicated to the lowest level of page tables. | |
3434 | .TP | |
3435 | .IR Quicklists " %lu (since Linux 2.6.27)" | |
3436 | (\fBCONFIG_QUICKLIST\fP is required.) | |
3437 | [To be documented.] | |
3438 | .TP | |
3439 | .IR NFS_Unstable " %lu (since Linux 2.6.18)" | |
3440 | NFS pages sent to the server, but not yet committed to stable storage. | |
3441 | .TP | |
3442 | .IR Bounce " %lu (since Linux 2.6.18)" | |
3443 | Memory used for block device "bounce buffers". | |
3444 | .TP | |
3445 | .IR WritebackTmp " %lu (since Linux 2.6.26)" | |
3446 | Memory used by FUSE for temporary writeback buffers. | |
3447 | .TP | |
3448 | .IR CommitLimit " %lu (since Linux 2.6.10)" | |
cd7b6c40 MK |
3449 | This is the total amount of memory currently available to |
3450 | be allocated on the system, expressed in kilobytes. | |
90878f7c MK |
3451 | This limit is adhered to |
3452 | only if strict overcommit accounting is enabled (mode 2 in | |
cd7b6c40 MK |
3453 | .IR /proc/sys/vm/overcommit_memory ). |
3454 | The limit is calculated according to the formula described under | |
3455 | .IR /proc/sys/vm/overcommit_memory . | |
3456 | For further details, see the kernel source file | |
184d797d | 3457 | .IR Documentation/vm/overcommit\-accounting.rst . |
3ba3d5b1 MK |
3458 | .TP |
3459 | .IR Committed_AS " %lu" | |
3460 | The amount of memory presently allocated on the system. | |
3461 | The committed memory is a sum of all of the memory which | |
3462 | has been allocated by processes, even if it has not been | |
3463 | "used" by them as of yet. | |
c7169ee5 | 3464 | A process which allocates 1 GB of memory (using |
3ba3d5b1 | 3465 | .BR malloc (3) |
c7169ee5 MK |
3466 | or similar), but touches only 300 MB of that memory will show up |
3467 | as using only 300 MB of memory even if it has the address space | |
3468 | allocated for the entire 1 GB. | |
2dad4c59 | 3469 | .IP |
c7169ee5 | 3470 | This 1 GB is memory which has been "committed" to by the VM |
3ba3d5b1 | 3471 | and can be used at any time by the allocating application. |
cd7b6c40 | 3472 | With strict overcommit enabled on the system (mode 2 in |
d9e0f03d | 3473 | .IR /proc/sys/vm/overcommit_memory ), |
3ba3d5b1 MK |
3474 | allocations which would exceed the |
3475 | .I CommitLimit | |
cd7b6c40 | 3476 | will not be permitted. |
3ba3d5b1 MK |
3477 | This is useful if one needs to guarantee that processes will not |
3478 | fail due to lack of memory once that memory has been successfully allocated. | |
3479 | .TP | |
3480 | .IR VmallocTotal " %lu" | |
3481 | Total size of vmalloc memory area. | |
3482 | .TP | |
3483 | .IR VmallocUsed " %lu" | |
2fc546f9 MK |
3484 | Amount of vmalloc area which is used. |
3485 | Since Linux 4.4, | |
3486 | .\" commit a5ad88ce8c7fae7ddc72ee49a11a75aa837788e0 | |
3487 | this field is no longer calculated, and is hard coded as 0. | |
3488 | See | |
bfe9256a | 3489 | .IR /proc/vmallocinfo . |
3ba3d5b1 MK |
3490 | .TP |
3491 | .IR VmallocChunk " %lu" | |
2fc546f9 MK |
3492 | Largest contiguous block of vmalloc area which is free. |
3493 | Since Linux 4.4, | |
3494 | .\" commit a5ad88ce8c7fae7ddc72ee49a11a75aa837788e0 | |
3495 | this field is no longer calculated and is hard coded as 0. | |
3496 | See | |
bfe9256a | 3497 | .IR /proc/vmallocinfo . |
3ba3d5b1 MK |
3498 | .TP |
3499 | .IR HardwareCorrupted " %lu (since Linux 2.6.32)" | |
3500 | (\fBCONFIG_MEMORY_FAILURE\fP is required.) | |
3501 | [To be documented.] | |
3502 | .TP | |
f7bbc79d MK |
3503 | .IR LazyFree " %lu (since Linux 4.12)" |
3504 | Shows the amount of memory marked by | |
3505 | .BR madvise (2) | |
3506 | .BR MADV_FREE . | |
3507 | .TP | |
3ba3d5b1 MK |
3508 | .IR AnonHugePages " %lu (since Linux 2.6.38)" |
3509 | (\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.) | |
7fac88a9 | 3510 | Non-file backed huge pages mapped into user-space page tables. |
3ba3d5b1 | 3511 | .TP |
4ad958e1 MK |
3512 | .IR ShmemHugePages " %lu (since Linux 4.8)" |
3513 | (\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.) | |
4e07c70f MK |
3514 | Memory used by shared memory (shmem) and |
3515 | .BR tmpfs (5) | |
c7169ee5 | 3516 | allocated with huge pages. |
4ad958e1 MK |
3517 | .TP |
3518 | .IR ShmemPmdMapped " %lu (since Linux 4.8)" | |
3519 | (\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.) | |
956e74b4 | 3520 | Shared memory mapped into user space with huge pages. |
4ad958e1 | 3521 | .TP |
43179f55 MK |
3522 | .IR CmaTotal " %lu (since Linux 3.1)" |
3523 | Total CMA (Contiguous Memory Allocator) pages. | |
3524 | (\fBCONFIG_CMA\fP is required.) | |
3525 | .TP | |
3526 | .IR CmaFree " %lu (since Linux 3.1)" | |
3527 | Free CMA (Contiguous Memory Allocator) pages. | |
3528 | (\fBCONFIG_CMA\fP is required.) | |
3529 | .TP | |
3ba3d5b1 MK |
3530 | .IR HugePages_Total " %lu" |
3531 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
3532 | The size of the pool of huge pages. | |
3533 | .TP | |
3534 | .IR HugePages_Free " %lu" | |
3535 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
3536 | The number of huge pages in the pool that are not yet allocated. | |
3537 | .TP | |
3538 | .IR HugePages_Rsvd " %lu (since Linux 2.6.17)" | |
3539 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
3540 | This is the number of huge pages for | |
3541 | which a commitment to allocate from the pool has been made, | |
3542 | but no allocation has yet been made. | |
3543 | These reserved huge pages | |
3544 | guarantee that an application will be able to allocate a | |
3545 | huge page from the pool of huge pages at fault time. | |
3546 | .TP | |
aa8a6b4f | 3547 | .IR HugePages_Surp " %lu (since Linux 2.6.24)" |
3ba3d5b1 MK |
3548 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) |
3549 | This is the number of huge pages in | |
3550 | the pool above the value in | |
3551 | .IR /proc/sys/vm/nr_hugepages . | |
3552 | The maximum number of surplus huge pages is controlled by | |
3553 | .IR /proc/sys/vm/nr_overcommit_hugepages . | |
3554 | .TP | |
3555 | .IR Hugepagesize " %lu" | |
3556 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
3557 | The size of huge pages. | |
d5268de1 MK |
3558 | .TP |
3559 | .IR DirectMap4k " %lu (since Linux 2.6.27)" | |
c7169ee5 | 3560 | Number of bytes of RAM linearly mapped by kernel in 4 kB pages. |
d5268de1 MK |
3561 | (x86.) |
3562 | .TP | |
3563 | .IR DirectMap4M " %lu (since Linux 2.6.27)" | |
c7169ee5 | 3564 | Number of bytes of RAM linearly mapped by kernel in 4 MB pages. |
d5268de1 | 3565 | (x86 with |
1ae6b2c7 | 3566 | .B CONFIG_X86_64 |
d5268de1 | 3567 | or |
1ae6b2c7 | 3568 | .B CONFIG_X86_PAE |
d5268de1 MK |
3569 | enabled.) |
3570 | .TP | |
3571 | .IR DirectMap2M " %lu (since Linux 2.6.27)" | |
c7169ee5 | 3572 | Number of bytes of RAM linearly mapped by kernel in 2 MB pages. |
d5268de1 | 3573 | (x86 with neither |
1ae6b2c7 | 3574 | .B CONFIG_X86_64 |
d5268de1 | 3575 | nor |
1ae6b2c7 | 3576 | .B CONFIG_X86_PAE |
d5268de1 MK |
3577 | enabled.) |
3578 | .TP | |
3579 | .IR DirectMap1G " %lu (since Linux 2.6.27)" | |
3580 | (x86 with | |
1ae6b2c7 | 3581 | .B CONFIG_X86_64 |
d5268de1 MK |
3582 | and |
3583 | .B CONFIG_X86_DIRECT_GBPAGES | |
3584 | enabled.) | |
3ba3d5b1 | 3585 | .RE |
fea681da | 3586 | .TP |
aa341984 MK |
3587 | .I /proc/modules |
3588 | A text list of the modules that have been loaded by the system. | |
3589 | See also | |
3590 | .BR lsmod (8). | |
3591 | .TP | |
fea681da | 3592 | .I /proc/mounts |
b324e17d | 3593 | Before Linux 2.4.19, this file was a list |
9ee4a2b6 | 3594 | of all the filesystems currently mounted on the system. |
ef5b47f6 MK |
3595 | With the introduction of per-process mount namespaces in Linux 2.4.19 (see |
3596 | .BR mount_namespaces (7)), | |
3597 | this file became a link to | |
c1eea65a | 3598 | .IR /proc/self/mounts , |
525a8b54 | 3599 | which lists the mounts of the process's own mount namespace. |
fea681da | 3600 | The format of this file is documented in |
31e9a9ec | 3601 | .BR fstab (5). |
fea681da | 3602 | .TP |
fea681da | 3603 | .I /proc/mtrr |
c13182ef | 3604 | Memory Type Range Registers. |
66a9882e | 3605 | See the Linux kernel source file |
8a5fc410 MK |
3606 | .I Documentation/x86/mtrr.rst |
3607 | (or | |
a8999e1f ES |
3608 | .I Documentation/x86/mtrr.txt |
3609 | .\" commit 7225e75144b9718cbbe1820d9c011c809d5773fd | |
8a5fc410 | 3610 | before Linux 5.2, or |
cfe70b66 | 3611 | .I Documentation/mtrr.txt |
a8999e1f | 3612 | before Linux 2.6.28) |
fea681da MK |
3613 | for details. |
3614 | .TP | |
3615 | .I /proc/net | |
ccb4bcdc MK |
3616 | This directory contains various files and subdirectories containing |
3617 | information about the networking layer. | |
3618 | The files contain ASCII structures and are, | |
59a40ed7 MK |
3619 | therefore, readable with |
3620 | .BR cat (1). | |
c13182ef | 3621 | However, the standard |
fea681da MK |
3622 | .BR netstat (8) |
3623 | suite provides much cleaner access to these files. | |
2dad4c59 | 3624 | .IP |
9fb88bc8 MK |
3625 | With the advent of network namespaces, |
3626 | various information relating to the network stack is virtualized (see | |
40002795 | 3627 | .BR network_namespaces (7)). |
9fb88bc8 MK |
3628 | Thus, since Linux 2.6.25, |
3629 | .\" commit e9720acd728a46cb40daa52c99a979f7c4ff195c | |
1ae6b2c7 | 3630 | .I /proc/net |
9fb88bc8 MK |
3631 | is a symbolic link to the directory |
3632 | .IR /proc/self/net , | |
3633 | which contains the same files and directories as listed below. | |
3634 | However, these files and directories now expose information | |
3635 | for the network namespace of which the process is a member. | |
fea681da MK |
3636 | .TP |
3637 | .I /proc/net/arp | |
3638 | This holds an ASCII readable dump of the kernel ARP table used for | |
c13182ef | 3639 | address resolutions. |
01d0a447 | 3640 | It will show both dynamically learned and preprogrammed ARP entries. |
c13182ef | 3641 | The format is: |
c1a022dc | 3642 | .IP |
e3fb1b6b | 3643 | .in +4n |
c1a022dc | 3644 | .EX |
fea681da MK |
3645 | IP address HW type Flags HW address Mask Device |
3646 | 192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0 | |
3647 | 192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0 | |
c1a022dc | 3648 | .EE |
fea681da | 3649 | .in |
c1a022dc | 3650 | .IP |
6c04f928 | 3651 | Here "IP address" is the IPv4 address of the machine and the "HW type" |
c13182ef MK |
3652 | is the hardware type of the address from RFC\ 826. |
3653 | The flags are the internal | |
9a67332e MK |
3654 | flags of the ARP structure (as defined in |
3655 | .IR /usr/include/linux/if_arp.h ) | |
3656 | and | |
6c04f928 | 3657 | the "HW address" is the data link layer mapping for that IP address if |
fea681da MK |
3658 | it is known. |
3659 | .TP | |
3660 | .I /proc/net/dev | |
c13182ef MK |
3661 | The dev pseudo-file contains network device status information. |
3662 | This gives | |
3663 | the number of received and sent packets, the number of errors and | |
fea681da | 3664 | collisions |
c13182ef MK |
3665 | and other basic statistics. |
3666 | These are used by the | |
fea681da | 3667 | .BR ifconfig (8) |
c13182ef MK |
3668 | program to report device status. |
3669 | The format is: | |
c1a022dc | 3670 | .IP |
c1a022dc | 3671 | .EX |
184d797d | 3672 | Inter\-| Receive | Transmit |
fea681da MK |
3673 | face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed |
3674 | lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0 | |
3675 | eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0 | |
3676 | ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0 | |
3677 | tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0 | |
c1a022dc | 3678 | .EE |
fea681da MK |
3679 | .\" .TP |
3680 | .\" .I /proc/net/ipx | |
3681 | .\" No information. | |
3682 | .\" .TP | |
3683 | .\" .I /proc/net/ipx_route | |
3684 | .\" No information. | |
3685 | .TP | |
3686 | .I /proc/net/dev_mcast | |
3687 | Defined in | |
3688 | .IR /usr/src/linux/net/core/dev_mcast.c : | |
37d5e699 | 3689 | .IP |
161b8eda | 3690 | .in +4n |
37d5e699 | 3691 | .EX |
9fdfa163 | 3692 | indx interface_name dmi_u dmi_g dmi_address |
fea681da MK |
3693 | 2 eth0 1 0 01005e000001 |
3694 | 3 eth1 1 0 01005e000001 | |
3695 | 4 eth2 1 0 01005e000001 | |
37d5e699 | 3696 | .EE |
fea681da | 3697 | .in |
fea681da MK |
3698 | .TP |
3699 | .I /proc/net/igmp | |
c13182ef MK |
3700 | Internet Group Management Protocol. |
3701 | Defined in | |
fea681da MK |
3702 | .IR /usr/src/linux/net/core/igmp.c . |
3703 | .TP | |
3704 | .I /proc/net/rarp | |
3705 | This file uses the same format as the | |
3706 | .I arp | |
3707 | file and contains the current reverse mapping database used to provide | |
3708 | .BR rarp (8) | |
c13182ef MK |
3709 | reverse address lookup services. |
3710 | If RARP is not configured into the | |
fea681da MK |
3711 | kernel, |
3712 | this file will not be present. | |
3713 | .TP | |
3714 | .I /proc/net/raw | |
c13182ef MK |
3715 | Holds a dump of the RAW socket table. |
3716 | Much of the information is not of | |
fea681da | 3717 | use |
c13182ef | 3718 | apart from debugging. |
6c04f928 | 3719 | The "sl" value is the kernel hash slot for the |
fea681da | 3720 | socket, |
6c04f928 MK |
3721 | the "local_address" is the local address and protocol number pair. |
3722 | \&"St" is | |
c13182ef MK |
3723 | the internal status of the socket. |
3724 | The "tx_queue" and "rx_queue" are the | |
fea681da | 3725 | outgoing and incoming data queue in terms of kernel memory usage. |
94e9d9fe | 3726 | The "tr", "tm\->when", and "rexmits" fields are not used by RAW. |
fdc196f5 MK |
3727 | The "uid" |
3728 | field holds the effective UID of the creator of the socket. | |
fea681da MK |
3729 | .\" .TP |
3730 | .\" .I /proc/net/route | |
3731 | .\" No information, but looks similar to | |
3732 | .\" .BR route (8). | |
3733 | .TP | |
3734 | .I /proc/net/snmp | |
c13182ef | 3735 | This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP |
fea681da | 3736 | management |
763f0e47 | 3737 | information bases for an SNMP agent. |
fea681da MK |
3738 | .TP |
3739 | .I /proc/net/tcp | |
c13182ef MK |
3740 | Holds a dump of the TCP socket table. |
3741 | Much of the information is not | |
3742 | of use apart from debugging. | |
3743 | The "sl" value is the kernel hash slot | |
6beb1671 MK |
3744 | for the socket, the "local_address" is the local address and port number pair. |
3745 | The "rem_address" is the remote address and port number pair | |
6c04f928 MK |
3746 | (if connected). |
3747 | \&"St" is the internal status of the socket. | |
3748 | The "tx_queue" and "rx_queue" are the | |
fea681da | 3749 | outgoing and incoming data queue in terms of kernel memory usage. |
94e9d9fe | 3750 | The "tr", "tm\->when", and "rexmits" fields hold internal information of |
f33774c4 | 3751 | the kernel socket state and are useful only for debugging. |
fdc196f5 MK |
3752 | The "uid" |
3753 | field holds the effective UID of the creator of the socket. | |
fea681da MK |
3754 | .TP |
3755 | .I /proc/net/udp | |
c13182ef MK |
3756 | Holds a dump of the UDP socket table. |
3757 | Much of the information is not of | |
3758 | use apart from debugging. | |
3759 | The "sl" value is the kernel hash slot for the | |
6beb1671 MK |
3760 | socket, the "local_address" is the local address and port number pair. |
3761 | The "rem_address" is the remote address and port number pair | |
f2d607ee MK |
3762 | (if connected). |
3763 | "St" is the internal status of the socket. | |
fea681da | 3764 | The "tx_queue" and "rx_queue" are the outgoing and incoming data queue |
c13182ef | 3765 | in terms of kernel memory usage. |
94e9d9fe | 3766 | The "tr", "tm\->when", and "rexmits" fields |
c13182ef | 3767 | are not used by UDP. |
fdc196f5 MK |
3768 | The "uid" |
3769 | field holds the effective UID of the creator of the socket. | |
fea681da | 3770 | The format is: |
c1a022dc | 3771 | .IP |
c1a022dc | 3772 | .EX |
94e9d9fe | 3773 | sl local_address rem_address st tx_queue rx_queue tr rexmits tm\->when uid |
fea681da MK |
3774 | 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0 |
3775 | 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0 | |
3776 | 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 | |
c1a022dc | 3777 | .EE |
fea681da MK |
3778 | .TP |
3779 | .I /proc/net/unix | |
008f1ecc | 3780 | Lists the UNIX domain sockets present within the system and their |
c13182ef MK |
3781 | status. |
3782 | The format is: | |
c1a022dc | 3783 | .IP |
c1a022dc | 3784 | .EX |
9d30b1a6 MW |
3785 | Num RefCount Protocol Flags Type St Inode Path |
3786 | 0: 00000002 00000000 00000000 0001 03 42 | |
3787 | 1: 00000001 00000000 00010000 0001 01 1948 /dev/printer | |
c1a022dc | 3788 | .EE |
c1a022dc | 3789 | .IP |
756f55f6 MK |
3790 | The fields are as follows: |
3791 | .RS | |
3792 | .TP 10 | |
3793 | .IR Num : | |
3794 | the kernel table slot number. | |
3795 | .TP | |
3796 | .IR RefCount : | |
3797 | the number of users of the socket. | |
3798 | .TP | |
3799 | .IR Protocol : | |
3800 | currently always 0. | |
3801 | .TP | |
3802 | .IR Flags : | |
3803 | the internal kernel flags holding the status of the socket. | |
3804 | .TP | |
3805 | .IR Type : | |
a405066e MK |
3806 | the socket type. |
3807 | For | |
1ae6b2c7 | 3808 | .B SOCK_STREAM |
a405066e | 3809 | sockets, this is 0001; for |
1ae6b2c7 | 3810 | .B SOCK_DGRAM |
a405066e | 3811 | sockets, it is 0002; and for |
1ae6b2c7 | 3812 | .B SOCK_SEQPACKET |
a405066e | 3813 | sockets, it is 0005. |
756f55f6 MK |
3814 | .TP |
3815 | .IR St : | |
3816 | the internal state of the socket. | |
3817 | .TP | |
9d30b1a6 MW |
3818 | .IR Inode : |
3819 | the inode number of the socket. | |
3820 | .TP | |
756f55f6 | 3821 | .IR Path : |
590ba7e5 | 3822 | the bound pathname (if any) of the socket. |
8f8a46fb MK |
3823 | Sockets in the abstract namespace are included in the list, |
3824 | and are shown with a | |
3825 | .I Path | |
3826 | that commences with the character '@'. | |
756f55f6 | 3827 | .RE |
fea681da | 3828 | .TP |
ed8de0e4 | 3829 | .I /proc/net/netfilter/nfnetlink_queue |
6f858d5c | 3830 | This file contains information about netfilter user-space queueing, if used. |
f2d607ee MK |
3831 | Each line represents a queue. |
3832 | Queues that have not been subscribed to | |
6f858d5c | 3833 | by user space are not shown. |
37d5e699 MK |
3834 | .IP |
3835 | .in +4n | |
3836 | .EX | |
ed8de0e4 FW |
3837 | 1 4207 0 2 65535 0 0 0 1 |
3838 | (1) (2) (3)(4) (5) (6) (7) (8) | |
37d5e699 MK |
3839 | .EE |
3840 | .in | |
ed8de0e4 FW |
3841 | .IP |
3842 | The fields in each line are: | |
3843 | .RS 7 | |
3844 | .TP 5 | |
3845 | (1) | |
f2d607ee MK |
3846 | The ID of the queue. |
3847 | This matches what is specified in the | |
ed8de0e4 FW |
3848 | .B \-\-queue\-num |
3849 | or | |
3850 | .B \-\-queue\-balance | |
3851 | options to the | |
3852 | .BR iptables (8) | |
f2d607ee MK |
3853 | NFQUEUE target. |
3854 | See | |
184d797d | 3855 | .BR iptables\-extensions (8) |
ed8de0e4 FW |
3856 | for more information. |
3857 | .TP | |
3858 | (2) | |
7672e08e | 3859 | The netlink port ID subscribed to the queue. |
ed8de0e4 FW |
3860 | .TP |
3861 | (3) | |
3862 | The number of packets currently queued and waiting to be processed by | |
3863 | the application. | |
3864 | .TP | |
3865 | (4) | |
f2d607ee MK |
3866 | The copy mode of the queue. |
3867 | It is either 1 (metadata only) or 2 | |
6f858d5c | 3868 | (also copy payload data to user space). |
ed8de0e4 FW |
3869 | .TP |
3870 | (5) | |
1dea597b | 3871 | Copy range; that is, how many bytes of packet payload should be copied to |
6f858d5c | 3872 | user space at most. |
ed8de0e4 FW |
3873 | .TP |
3874 | (6) | |
f2d607ee MK |
3875 | queue dropped. |
3876 | Number of packets that had to be dropped by the kernel because | |
6f858d5c | 3877 | too many packets are already waiting for user space to send back the mandatory |
ed8de0e4 FW |
3878 | accept/drop verdicts. |
3879 | .TP | |
3880 | (7) | |
f2d607ee MK |
3881 | queue user dropped. |
3882 | Number of packets that were dropped within the netlink | |
3883 | subsystem. | |
3884 | Such drops usually happen when the corresponding socket buffer is | |
6f858d5c | 3885 | full; that is, user space is not able to read messages fast enough. |
ed8de0e4 FW |
3886 | .TP |
3887 | (8) | |
f2d607ee MK |
3888 | sequence number. |
3889 | Every queued packet is associated with a (32-bit) | |
11fd5e7c | 3890 | monotonically increasing sequence number. |
ed8de0e4 FW |
3891 | This shows the ID of the most recent packet queued. |
3892 | .RE | |
3893 | .IP | |
f33774c4 | 3894 | The last number exists only for compatibility reasons and is always 1. |
ed8de0e4 | 3895 | .TP |
fea681da | 3896 | .I /proc/partitions |
f042d149 MK |
3897 | Contains the major and minor numbers of each partition as well as the number |
3898 | of 1024-byte blocks and the partition name. | |
fea681da MK |
3899 | .TP |
3900 | .I /proc/pci | |
3901 | This is a listing of all PCI devices found during kernel initialization | |
3902 | and their configuration. | |
2dad4c59 | 3903 | .IP |
59a40ed7 MK |
3904 | This file has been deprecated in favor of a new |
3905 | .I /proc | |
2990d781 MK |
3906 | interface for PCI |
3907 | .RI ( /proc/bus/pci ). | |
3908 | It became optional in Linux 2.2 (available with | |
3909 | .B CONFIG_PCI_OLD_PROC | |
3910 | set at kernel compilation). | |
24b74457 | 3911 | It became once more nonoptionally enabled in Linux 2.4. |
2990d781 MK |
3912 | Next, it was deprecated in Linux 2.6 (still available with |
3913 | .B CONFIG_PCI_LEGACY_PROC | |
3914 | set), and finally removed altogether since Linux 2.6.17. | |
43d42cc0 | 3915 | .\" FIXME Document /proc/sched_debug (since Linux 2.6.23) |
69119dc7 | 3916 | .\" See also /proc/[pid]/sched |
caea7868 MK |
3917 | .TP |
3918 | .IR /proc/profile " (since Linux 2.4)" | |
3919 | This file is present only if the kernel was booted with the | |
3920 | .I profile=1 | |
3921 | command-line option. | |
3922 | It exposes kernel profiling information in a binary format for use by | |
3923 | .BR readprofile (1). | |
3924 | Writing (e.g., an empty string) to this file resets the profiling counters; | |
3925 | on some architectures, | |
3926 | writing a binary integer "profiling multiplier" of size | |
1ae6b2c7 | 3927 | .I sizeof(int) |
8a3ac89a | 3928 | sets the profiling interrupt frequency. |
fea681da MK |
3929 | .TP |
3930 | .I /proc/scsi | |
59a40ed7 MK |
3931 | A directory with the |
3932 | .I scsi | |
3933 | mid-level pseudo-file and various SCSI low-level | |
2990d781 MK |
3934 | driver directories, |
3935 | which contain a file for each SCSI host in this system, all of | |
c13182ef MK |
3936 | which give the status of some part of the SCSI IO subsystem. |
3937 | These files contain ASCII structures and are, therefore, readable with | |
2990d781 | 3938 | .BR cat (1). |
2dad4c59 | 3939 | .IP |
c13182ef | 3940 | You can also write to some of the files to reconfigure the subsystem or |
59a40ed7 | 3941 | switch certain features on or off. |
fea681da MK |
3942 | .TP |
3943 | .I /proc/scsi/scsi | |
c13182ef | 3944 | This is a listing of all SCSI devices known to the kernel. |
59a40ed7 | 3945 | The listing is similar to the one seen during bootup. |
184d797d | 3946 | scsi currently supports only the \fIadd\-single\-device\fP command which |
59a40ed7 | 3947 | allows root to add a hotplugged device to the list of known devices. |
2dad4c59 | 3948 | .IP |
59a40ed7 | 3949 | The command |
37d5e699 | 3950 | .IP |
59a40ed7 | 3951 | .in +4n |
37d5e699 | 3952 | .EX |
b957f81f | 3953 | echo \[aq]scsi add\-single\-device 1 0 5 0\[aq] > /proc/scsi/scsi |
37d5e699 | 3954 | .EE |
59a40ed7 | 3955 | .in |
37d5e699 | 3956 | .IP |
c13182ef MK |
3957 | will cause |
3958 | host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0. | |
3959 | If there | |
fea681da MK |
3960 | is already a device known on this address or the address is invalid, an |
3961 | error will be returned. | |
3962 | .TP | |
1ae6b2c7 AC |
3963 | .IR /proc/scsi/ drivername |
3964 | \fIdrivername\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740, | |
c13182ef | 3965 | aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic, |
184d797d | 3966 | scsi_debug, seagate, t128, u15\-24f, ultrastore, or wd7000. |
c13182ef | 3967 | These directories show up for all drivers that registered at least one |
59a40ed7 | 3968 | SCSI HBA. |
c13182ef | 3969 | Every directory contains one file per registered host. |
59a40ed7 | 3970 | Every host-file is named after the number the host was assigned during |
c13182ef | 3971 | initialization. |
2dad4c59 | 3972 | .IP |
c13182ef | 3973 | Reading these files will usually show driver and host configuration, |
f78ed33a | 3974 | statistics, and so on. |
2dad4c59 | 3975 | .IP |
fea681da MK |
3976 | Writing to these files allows different things on different hosts. |
3977 | For example, with the \fIlatency\fP and \fInolatency\fP commands, | |
3978 | root can switch on and off command latency measurement code in the | |
c13182ef MK |
3979 | eata_dma driver. |
3980 | With the \fIlockup\fP and \fIunlock\fP commands, | |
3981 | root can control bus lockups simulated by the scsi_debug driver. | |
fea681da MK |
3982 | .TP |
3983 | .I /proc/self | |
59a40ed7 MK |
3984 | This directory refers to the process accessing the |
3985 | .I /proc | |
9ee4a2b6 | 3986 | filesystem, |
59a40ed7 MK |
3987 | and is identical to the |
3988 | .I /proc | |
3989 | directory named by the process ID of the same process. | |
fea681da MK |
3990 | .TP |
3991 | .I /proc/slabinfo | |
c13182ef | 3992 | Information about kernel caches. |
c13182ef | 3993 | See |
fea681da MK |
3994 | .BR slabinfo (5) |
3995 | for details. | |
3996 | .TP | |
3997 | .I /proc/stat | |
c13182ef MK |
3998 | kernel/system statistics. |
3999 | Varies with architecture. | |
4000 | Common | |
fea681da MK |
4001 | entries include: |
4002 | .RS | |
4003 | .TP | |
46f6dbe8 ES |
4004 | .I cpu 10132153 290696 3084719 46828483 16683 0 25195 0 175628 0 |
4005 | .TQ | |
4006 | .I cpu0 1393280 32966 572056 13343292 6130 0 17875 0 23933 0 | |
bfbfcd18 | 4007 | The amount of time, measured in units of |
268f000b | 4008 | USER_HZ (1/100ths of a second on most architectures, use |
1ae6b2c7 | 4009 | .I sysconf(_SC_CLK_TCK) |
268f000b | 4010 | to obtain the right value), |
b81087ab | 4011 | .\" 1024 on Alpha and ia64 |
46f6dbe8 ES |
4012 | that the system ("cpu" line) or the specific CPU ("cpu\fIN\fR" line) |
4013 | spent in various states: | |
ae3b8047 MK |
4014 | .RS |
4015 | .TP | |
4016 | .I user | |
ea0841f6 | 4017 | (1) Time spent in user mode. |
ae3b8047 MK |
4018 | .TP |
4019 | .I nice | |
0633f951 | 4020 | (2) Time spent in user mode with low priority (nice). |
9f1b9726 | 4021 | .TP |
ae3b8047 | 4022 | .I system |
0633f951 | 4023 | (3) Time spent in system mode. |
ae3b8047 MK |
4024 | .TP |
4025 | .I idle | |
ea0841f6 | 4026 | (4) Time spent in the idle task. |
bea08fec | 4027 | .\" FIXME . Actually, the following info about the /proc/stat 'cpu' field |
b324e17d | 4028 | .\" does not seem to be quite right (at least in Linux 2.6.12 or Linux 3.6): |
e04a1f93 MK |
4029 | .\" the idle time in /proc/uptime does not quite match this value |
4030 | This value should be USER_HZ times the | |
4cb1deb7 MK |
4031 | second entry in the |
4032 | .I /proc/uptime | |
4033 | pseudo-file. | |
ae3b8047 MK |
4034 | .TP |
4035 | .IR iowait " (since Linux 2.5.41)" | |
ea0841f6 | 4036 | (5) Time waiting for I/O to complete. |
e0a73a31 MK |
4037 | This value is not reliable, for the following reasons: |
4038 | .\" See kernel commit 9c240d757658a3ae9968dd309e674c61f07c7f48 | |
4039 | .RS | |
cdede5cd | 4040 | .IP \[bu] 3 |
e0a73a31 MK |
4041 | The CPU will not wait for I/O to complete; |
4042 | iowait is the time that a task is waiting for I/O to complete. | |
4043 | When a CPU goes into idle state for outstanding task I/O, | |
4044 | another task will be scheduled on this CPU. | |
cdede5cd | 4045 | .IP \[bu] |
e0a73a31 MK |
4046 | On a multi-core CPU, |
4047 | the task waiting for I/O to complete is not running on any CPU, | |
4048 | so the iowait of each CPU is difficult to calculate. | |
cdede5cd | 4049 | .IP \[bu] |
e0a73a31 MK |
4050 | The value in this field may |
4051 | .I decrease | |
4052 | in certain conditions. | |
2d3fb75b | 4053 | .RE |
ae3b8047 | 4054 | .TP |
d6bec36e MK |
4055 | .IR irq " (since Linux 2.6.0)" |
4056 | .\" Precisely: Linux 2.6.0-test4 | |
ea0841f6 | 4057 | (6) Time servicing interrupts. |
ae3b8047 | 4058 | .TP |
c7169ee5 | 4059 | .IR softirq " (since Linux 2.6.0)" |
d6bec36e | 4060 | .\" Precisely: Linux 2.6.0-test4 |
ea0841f6 | 4061 | (7) Time servicing softirqs. |
ae3b8047 MK |
4062 | .TP |
4063 | .IR steal " (since Linux 2.6.11)" | |
ea0841f6 | 4064 | (8) Stolen time, which is the time spent in other operating systems when |
9de1f6cc | 4065 | running in a virtualized environment |
ae3b8047 MK |
4066 | .TP |
4067 | .IR guest " (since Linux 2.6.24)" | |
0633f951 | 4068 | (9) Time spent running a virtual CPU for guest |
afef1764 | 4069 | operating systems under the control of the Linux kernel. |
14c06953 | 4070 | .\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de |
d4fd4120 MK |
4071 | .TP |
4072 | .IR guest_nice " (since Linux 2.6.33)" | |
4073 | .\" commit ce0e7b28fb75cb003cfc8d0238613aaf1c55e797 | |
4074 | (10) Time spent running a niced guest (virtual CPU for guest | |
4075 | operating systems under the control of the Linux kernel). | |
ae3b8047 | 4076 | .RE |
fea681da MK |
4077 | .TP |
4078 | \fIpage 5741 1808\fP | |
4079 | The number of pages the system paged in and the number that were paged | |
4080 | out (from disk). | |
4081 | .TP | |
4082 | \fIswap 1 0\fP | |
4083 | The number of swap pages that have been brought in and out. | |
4084 | .TP | |
bea08fec | 4085 | .\" FIXME . The following is not the full picture for the 'intr' of |
777f5a9e | 4086 | .\" /proc/stat on 2.6: |
fea681da | 4087 | \fIintr 1462898\fP |
bfbfcd18 MK |
4088 | This line shows counts of interrupts serviced since boot time, |
4089 | for each of the possible system interrupts. | |
d63ff76e | 4090 | The first column is the total of all interrupts serviced |
d6a56978 MK |
4091 | including unnumbered architecture specific interrupts; |
4092 | each subsequent column is the total for that particular numbered interrupt. | |
d63ff76e | 4093 | Unnumbered interrupts are not shown, only summed into the total. |
fea681da MK |
4094 | .TP |
4095 | \fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP... | |
636297e9 | 4096 | (major,disk_idx):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written) |
bfbfcd18 MK |
4097 | .br |
4098 | (Linux 2.4 only) | |
fea681da MK |
4099 | .TP |
4100 | \fIctxt 115315\fP | |
4101 | The number of context switches that the system underwent. | |
4102 | .TP | |
4103 | \fIbtime 769041601\fP | |
f49c451a | 4104 | boot time, in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). |
fea681da MK |
4105 | .TP |
4106 | \fIprocesses 86031\fP | |
4107 | Number of forks since boot. | |
bfbfcd18 MK |
4108 | .TP |
4109 | \fIprocs_running 6\fP | |
4110 | Number of processes in runnable state. | |
5fab2e7c | 4111 | (Linux 2.5.45 onward.) |
bfbfcd18 MK |
4112 | .TP |
4113 | \fIprocs_blocked 2\fP | |
4114 | Number of processes blocked waiting for I/O to complete. | |
5fab2e7c | 4115 | (Linux 2.5.45 onward.) |
76f6f102 ES |
4116 | .TP |
4117 | .I softirq 229245889 94 60001584 13619 5175704 2471304 28 51212741 59130143 0 51240672 | |
4118 | .\" commit d3d64df21d3d0de675a0d3ffa7c10514f3644b30 | |
4119 | This line shows the number of softirq for all CPUs. | |
4120 | The first column is the total of all softirqs and | |
4121 | each subsequent column is the total for particular softirq. | |
d7f23d0b | 4122 | (Linux 2.6.31 onward.) |
fea681da MK |
4123 | .RE |
4124 | .TP | |
4125 | .I /proc/swaps | |
c13182ef MK |
4126 | Swap areas in use. |
4127 | See also | |
fea681da MK |
4128 | .BR swapon (8). |
4129 | .TP | |
4130 | .I /proc/sys | |
b324e17d | 4131 | This directory (present since Linux 1.3.57) contains a number of files |
fea681da | 4132 | and subdirectories corresponding to kernel variables. |
13648a9c | 4133 | These variables can be read and in some cases modified using |
9ee4a2b6 | 4134 | the \fI/proc\fP filesystem, and the (deprecated) |
fea681da | 4135 | .BR sysctl (2) |
c13182ef | 4136 | system call. |
2dad4c59 | 4137 | .IP |
b957f81f | 4138 | String values may be terminated by either \[aq]\e0\[aq] or \[aq]\en\[aq]. |
2dad4c59 | 4139 | .IP |
84ff8c1e | 4140 | Integer and long values may be written either in decimal or in |
0629df8b | 4141 | hexadecimal notation (e.g., 0x3FFF). |
e8aa7100 MK |
4142 | When writing multiple integer or long values, these may be separated |
4143 | by any of the following whitespace characters: | |
b957f81f | 4144 | \[aq]\ \[aq], \[aq]\et\[aq], or \[aq]\en\[aq]. |
e8aa7100 | 4145 | Using other separators leads to the error |
84ff8c1e | 4146 | .BR EINVAL . |
fea681da | 4147 | .TP |
6ab7c0aa | 4148 | .IR /proc/sys/abi " (since Linux 2.4.10)" |
fea681da | 4149 | This directory may contain files with application binary information. |
6ab7c0aa | 4150 | .\" On some systems, it is not present. |
66a9882e | 4151 | See the Linux kernel source file |
8a5fc410 MK |
4152 | .I Documentation/sysctl/abi.rst |
4153 | (or | |
6ab7c0aa | 4154 | .I Documentation/sysctl/abi.txt |
8a5fc410 | 4155 | before Linux 5.3) |
6ab7c0aa | 4156 | for more information. |
fea681da MK |
4157 | .TP |
4158 | .I /proc/sys/debug | |
4159 | This directory may be empty. | |
4160 | .TP | |
4161 | .I /proc/sys/dev | |
e2badfdf | 4162 | This directory contains device-specific information (e.g., |
9a67332e | 4163 | .IR dev/cdrom/info ). |
fea681da MK |
4164 | On |
4165 | some systems, it may be empty. | |
4166 | .TP | |
4167 | .I /proc/sys/fs | |
49236d3c | 4168 | This directory contains the files and subdirectories for kernel variables |
9ee4a2b6 | 4169 | related to filesystems. |
fea681da | 4170 | .TP |
b49c2acb | 4171 | .IR /proc/sys/fs/aio\-max\-nr " and " /proc/sys/fs/aio\-nr " (since Linux 2.6.4)" |
cd415e73 | 4172 | .I aio\-nr |
9f51687a MK |
4173 | is the running total of the number of events specified by |
4174 | .BR io_setup (2) | |
4175 | calls for all currently active AIO contexts. | |
4176 | If | |
cd415e73 | 4177 | .I aio\-nr |
9f51687a | 4178 | reaches |
cd415e73 | 4179 | .IR aio\-max\-nr , |
9f51687a MK |
4180 | then |
4181 | .BR io_setup (2) | |
4182 | will fail with the error | |
4183 | .BR EAGAIN . | |
4184 | Raising | |
cd415e73 | 4185 | .I aio\-max\-nr |
9f51687a MK |
4186 | does not result in the preallocation or resizing |
4187 | of any kernel data structures. | |
4188 | .TP | |
fea681da | 4189 | .I /proc/sys/fs/binfmt_misc |
c13182ef | 4190 | Documentation for files in this directory can be found |
a2923df0 | 4191 | in the Linux kernel source in the file |
1ae6b2c7 | 4192 | .I Documentation/admin\-guide/binfmt\-misc.rst |
a2923df0 | 4193 | (or in |
1ae6b2c7 | 4194 | .I Documentation/binfmt_misc.txt |
a2923df0 | 4195 | on older kernels). |
fea681da | 4196 | .TP |
184d797d | 4197 | .IR /proc/sys/fs/dentry\-state " (since Linux 2.2)" |
59a40ed7 MK |
4198 | This file contains information about the status of the |
4199 | directory cache (dcache). | |
4200 | The file contains six numbers, | |
1ae6b2c7 AC |
4201 | .IR nr_dentry , |
4202 | .IR nr_unused , | |
4203 | .I age_limit | |
4204 | (age in seconds), | |
59a40ed7 | 4205 | .I want_pages |
fea681da | 4206 | (pages requested by system) and two dummy values. |
59a40ed7 | 4207 | .RS |
cdede5cd | 4208 | .IP \[bu] 3 |
59a40ed7 MK |
4209 | .I nr_dentry |
4210 | is the number of allocated dentries (dcache entries). | |
4211 | This field is unused in Linux 2.2. | |
cdede5cd | 4212 | .IP \[bu] |
59a40ed7 MK |
4213 | .I nr_unused |
4214 | is the number of unused dentries. | |
cdede5cd | 4215 | .IP \[bu] |
59a40ed7 | 4216 | .I age_limit |
b324e17d | 4217 | .\" looks like this is unused in Linux 2.2 to Linux 2.6 |
59a40ed7 MK |
4218 | is the age in seconds after which dcache entries |
4219 | can be reclaimed when memory is short. | |
cdede5cd | 4220 | .IP \[bu] |
59a40ed7 | 4221 | .I want_pages |
b324e17d | 4222 | .\" looks like this is unused in Linux 2.2 to Linux 2.6 |
c7094399 | 4223 | is nonzero when the kernel has called shrink_dcache_pages() and the |
fea681da | 4224 | dcache isn't pruned yet. |
59a40ed7 | 4225 | .RE |
fea681da | 4226 | .TP |
184d797d | 4227 | .I /proc/sys/fs/dir\-notify\-enable |
fea681da MK |
4228 | This file can be used to disable or enable the |
4229 | .I dnotify | |
4230 | interface described in | |
4231 | .BR fcntl (2) | |
4232 | on a system-wide basis. | |
4233 | A value of 0 in this file disables the interface, | |
4234 | and a value of 1 enables it. | |
4235 | .TP | |
184d797d | 4236 | .I /proc/sys/fs/dquot\-max |
fea681da MK |
4237 | This file shows the maximum number of cached disk quota entries. |
4238 | On some (2.4) systems, it is not present. | |
4239 | If the number of free cached disk quota entries is very low and | |
4240 | you have some awesome number of simultaneous system users, | |
4241 | you might want to raise the limit. | |
4242 | .TP | |
184d797d | 4243 | .I /proc/sys/fs/dquot\-nr |
fea681da MK |
4244 | This file shows the number of allocated disk quota |
4245 | entries and the number of free disk quota entries. | |
4246 | .TP | |
24cb4a4b | 4247 | .IR /proc/sys/fs/epoll " (since Linux 2.6.28)" |
242b46af MK |
4248 | This directory contains the file |
4249 | .IR max_user_watches , | |
24cb4a4b MK |
4250 | which can be used to limit the amount of kernel memory consumed by the |
4251 | .I epoll | |
4252 | interface. | |
4253 | For further details, see | |