]>
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 | .\" and scsi additions from Michael Neuffer (neuffer@mail.uni-mainz.de) |
5 | .\" and sysctl additions from Andries Brouwer (aeb@cwi.nl) | |
6 | .\" and System V IPC (as well as various other) additions from | |
c11b1abf | 7 | .\" Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da | 8 | .\" |
e4a74ca8 | 9 | .\" SPDX-License-Identifier: GPL-2.0-or-later |
fea681da MK |
10 | .\" |
11 | .\" Modified 1995-05-17 by faith@cs.unc.edu | |
12 | .\" Minor changes by aeb and Marty Leisner (leisner@sdsp.mc.xerox.com). | |
13 | .\" Modified 1996-04-13, 1996-07-22 by aeb@cwi.nl | |
14 | .\" Modified 2001-12-16 by rwhron@earthlink.net | |
15 | .\" Modified 2002-07-13 by jbelton@shaw.ca | |
16 | .\" Modified 2002-07-22, 2003-05-27, 2004-04-06, 2004-05-25 | |
c11b1abf | 17 | .\" by Michael Kerrisk <mtk.manpages@gmail.com> |
5d6d14a0 | 18 | .\" 2004-11-17, mtk -- updated notes on /proc/loadavg |
b324e17d | 19 | .\" 2004-12-01, mtk, rtsig-max and rtsig-nr went away in Linux 2.6.8 |
568105c6 MK |
20 | .\" 2004-12-14, mtk, updated 'statm', and fixed error in order of list |
21 | .\" 2005-05-12, mtk, updated 'stat' | |
6d64ca9c | 22 | .\" 2005-07-13, mtk, added /proc/sys/fs/mqueue/* |
363f747c MK |
23 | .\" 2005-09-16, mtk, Added /proc/sys/fs/suid_dumpable |
24 | .\" 2005-09-19, mtk, added /proc/zoneinfo | |
b4e9ee8f | 25 | .\" 2005-03-01, mtk, moved /proc/sys/fs/mqueue/* material to mq_overview.7. |
69119dc7 MK |
26 | .\" 2008-06-05, mtk, Added /proc/[pid]/oom_score, /proc/[pid]/oom_adj, |
27 | .\" /proc/[pid]/limits, /proc/[pid]/mountinfo, /proc/[pid]/mountstats, | |
28 | .\" and /proc/[pid]/fdinfo/*. | |
29 | .\" 2008-06-19, mtk, Documented /proc/[pid]/status. | |
cc2d5c36 | 30 | .\" 2008-07-15, mtk, added /proc/config.gz |
363f747c | 31 | .\" |
43d42cc0 | 32 | .\" FIXME cross check against Documentation/filesystems/proc.txt |
c13182ef | 33 | .\" to see what information could be imported from that file |
c533af9d | 34 | .\" into this file. |
fea681da | 35 | .\" |
a5ebdc8d | 36 | .TH proc 5 (date) "Linux man-pages (unreleased)" |
fea681da | 37 | .SH NAME |
2e1c1a57 | 38 | proc \- process information, system information, and sysctl pseudo-filesystem |
fea681da MK |
39 | .SH DESCRIPTION |
40 | The | |
31fa1fd2 | 41 | .B proc |
ac8727b6 | 42 | filesystem is a pseudo-filesystem which provides an interface to |
c13182ef MK |
43 | kernel data structures. |
44 | It is commonly mounted at | |
fea681da | 45 | .IR /proc . |
b574c52d MK |
46 | Typically, it is mounted automatically by the system, |
47 | but it can also be mounted manually using a command such as: | |
48 | .PP | |
49 | .in +4n | |
50 | .EX | |
51 | mount \-t proc proc /proc | |
52 | .EE | |
53 | .in | |
54 | .PP | |
7e174651 | 55 | Most of the files in the |
31fa1fd2 | 56 | .B proc |
7e174651 | 57 | filesystem are read-only, |
64165e01 | 58 | but some files are writable, allowing kernel variables to be changed. |
7e174651 | 59 | .\" |
fee59977 MK |
60 | .SS Mount options |
61 | The | |
31fa1fd2 | 62 | .B proc |
fee59977 MK |
63 | filesystem supports the following mount options: |
64 | .TP | |
65 | .BR hidepid "=\fIn\fP (since Linux 3.3)" | |
66 | .\" commit 0499680a42141d86417a8fbaa8c8db806bea1201 | |
67 | This option controls who can access the information in | |
1ae6b2c7 | 68 | .IR /proc/ pid |
fee59977 MK |
69 | directories. |
70 | The argument, | |
71 | .IR n , | |
72 | is one of the following values: | |
73 | .RS | |
74 | .TP 4 | |
75 | 0 | |
76 | Everybody may access all | |
1ae6b2c7 | 77 | .IR /proc/ pid |
fee59977 MK |
78 | directories. |
79 | This is the traditional behavior, | |
80 | and the default if this mount option is not specified. | |
81 | .TP | |
82 | 1 | |
83 | Users may not access files and subdirectories inside any | |
1ae6b2c7 | 84 | .IR /proc/ pid |
fee59977 | 85 | directories but their own (the |
1ae6b2c7 | 86 | .IR /proc/ pid |
fee59977 MK |
87 | directories themselves remain visible). |
88 | Sensitive files such as | |
1ae6b2c7 | 89 | .IR /proc/ pid /cmdline |
fee59977 | 90 | and |
1ae6b2c7 | 91 | .IR /proc/ pid /status |
fee59977 MK |
92 | are now protected against other users. |
93 | This makes it impossible to learn whether any user is running a | |
94 | specific program | |
95 | (so long as the program doesn't otherwise reveal itself by its behavior). | |
96 | .\" As an additional bonus, since | |
97949440 | 97 | .\" .IR /proc/[pid]/cmdline |
9d4976ce | 98 | .\" is inaccessible for other users, |
fee59977 MK |
99 | .\" poorly written programs passing sensitive information via |
100 | .\" program arguments are now protected against local eavesdroppers. | |
101 | .TP | |
102 | 2 | |
103 | As for mode 1, but in addition the | |
1ae6b2c7 | 104 | .IR /proc/ pid |
fee59977 MK |
105 | directories belonging to other users become invisible. |
106 | This means that | |
1ae6b2c7 | 107 | .IR /proc/ pid |
fee59977 MK |
108 | entries can no longer be used to discover the PIDs on the system. |
109 | This doesn't hide the fact that a process with a specific PID value exists | |
9bc87ed0 | 110 | (it can be learned by other means, for example, by "kill \-0 $PID"), |
fee59977 MK |
111 | but it hides a process's UID and GID, |
112 | which could otherwise be learned by employing | |
113 | .BR stat (2) | |
114 | on a | |
1ae6b2c7 | 115 | .IR /proc/ pid |
fee59977 MK |
116 | directory. |
117 | This greatly complicates an attacker's task of gathering | |
118 | information about running processes (e.g., discovering whether | |
119 | some daemon is running with elevated privileges, | |
120 | whether another user is running some sensitive program, | |
121 | whether other users are running any program at all, and so on). | |
122 | .RE | |
123 | .TP | |
124 | .BR gid "=\fIgid\fP (since Linux 3.3)" | |
125 | .\" commit 0499680a42141d86417a8fbaa8c8db806bea1201 | |
126 | Specifies the ID of a group whose members are authorized to | |
127 | learn process information otherwise prohibited by | |
1ae6b2c7 | 128 | .B hidepid |
95b1c1d1 | 129 | (i.e., users in this group behave as though |
fee59977 MK |
130 | .I /proc |
131 | was mounted with | |
95b1c1d1 | 132 | .IR hidepid=0 ). |
fee59977 MK |
133 | This group should be used instead of approaches such as putting |
134 | nonroot users into the | |
135 | .BR sudoers (5) | |
136 | file. | |
3c7cfa32 MK |
137 | .\" |
138 | .SS Overview | |
139 | Underneath | |
140 | .IR /proc , | |
141 | there are the following general groups of files and subdirectories: | |
142 | .TP | |
1ae6b2c7 | 143 | .IR /proc/ "pid subdirectories" |
3c7cfa32 MK |
144 | Each one of these subdirectories contains files and subdirectories |
145 | exposing information about the process with the corresponding process ID. | |
146 | .IP | |
147 | Underneath each of the | |
1ae6b2c7 | 148 | .IR /proc/ pid |
3c7cfa32 | 149 | directories, a |
7fe3b32b | 150 | .I task |
3c7cfa32 | 151 | subdirectory contains subdirectories of the form |
1ae6b2c7 | 152 | .IR task/ tid, |
3c7cfa32 MK |
153 | which contain corresponding information about each of the threads |
154 | in the process, where | |
155 | .I tid | |
156 | is the kernel thread ID of the thread. | |
01df7b70 MK |
157 | .IP |
158 | The | |
1ae6b2c7 | 159 | .IR /proc/ pid |
01df7b70 MK |
160 | subdirectories are visible when iterating through |
161 | .I /proc | |
162 | with | |
163 | .BR getdents (2) | |
164 | (and thus are visible when one uses | |
165 | .BR ls (1) | |
166 | to view the contents of | |
167 | .IR /proc ). | |
168 | .TP | |
1ae6b2c7 | 169 | .IR /proc/ "tid subdirectories" |
01df7b70 MK |
170 | Each one of these subdirectories contains files and subdirectories |
171 | exposing information about the thread with the corresponding thread ID. | |
37cd58d2 | 172 | The contents of these directories are the same as the corresponding |
1ae6b2c7 | 173 | .IR /proc/ pid /task/ tid |
37cd58d2 | 174 | directories. |
01df7b70 MK |
175 | .IP |
176 | The | |
1ae6b2c7 | 177 | .IR /proc/ tid |
01df7b70 MK |
178 | subdirectories are |
179 | .I not | |
180 | visible when iterating through | |
181 | .I /proc | |
182 | with | |
183 | .BR getdents (2) | |
184 | (and thus are | |
185 | .I not | |
186 | visible when one uses | |
187 | .BR ls (1) | |
3c7cfa32 MK |
188 | to view the contents of |
189 | .IR /proc ). | |
190 | .TP | |
191 | .I /proc/self | |
192 | When a process accesses this magic symbolic link, | |
193 | it resolves to the process's own | |
1ae6b2c7 | 194 | .IR /proc/ pid |
3c7cfa32 MK |
195 | directory. |
196 | .TP | |
184d797d | 197 | .I /proc/thread\-self |
3c7cfa32 MK |
198 | When a thread accesses this magic symbolic link, |
199 | it resolves to the process's own | |
1ae6b2c7 | 200 | .IR /proc/self/task/ tid |
3c7cfa32 MK |
201 | directory. |
202 | .TP | |
184d797d | 203 | .I /proc/[a\-z]* |
3c7cfa32 MK |
204 | Various other files and subdirectories under |
205 | .I /proc | |
206 | expose system-wide information. | |
207 | .PP | |
208 | All of the above are described in more detail below. | |
209 | .\" | |
fee59977 | 210 | .SS Files and directories |
71b36dc7 MK |
211 | The following list provides details of many of the files and directories |
212 | under the | |
743638fd MK |
213 | .I /proc |
214 | hierarchy. | |
fea681da | 215 | .TP |
1ae6b2c7 | 216 | .IR /proc/ pid |
fea681da MK |
217 | There is a numerical subdirectory for each running process; the |
218 | subdirectory is named by the process ID. | |
1e6a8e2f | 219 | Each |
1ae6b2c7 | 220 | .IR /proc/ pid |
e96ad1fd MK |
221 | subdirectory contains the pseudo-files and directories described below. |
222 | .IP | |
223 | The files inside each | |
1ae6b2c7 | 224 | .IR /proc/ pid |
e96ad1fd | 225 | directory are normally owned by the effective user and |
3bdb8ec5 MK |
226 | effective group ID of the process. |
227 | However, as a security measure, the ownership is made | |
1ae6b2c7 | 228 | .I root:root |
3bdb8ec5 | 229 | if the process's "dumpable" attribute is set to a value other than 1. |
fb49322d | 230 | .IP |
ae636827 MK |
231 | Before Linux 4.11, |
232 | .\" commit 68eb94f16227336a5773b83ecfa8290f1d6b78ce | |
1ae6b2c7 | 233 | .I root:root |
ae636827 MK |
234 | meant the "global" root user ID and group ID |
235 | (i.e., UID 0 and GID 0 in the initial user namespace). | |
236 | Since Linux 4.11, | |
237 | if the process is in a noninitial user namespace that has a | |
238 | valid mapping for user (group) ID 0 inside the namespace, then | |
239 | the user (group) ownership of the files under | |
1ae6b2c7 | 240 | .IR /proc/ pid |
ae636827 MK |
241 | is instead made the same as the root user (group) ID of the namespace. |
242 | This means that inside a container, | |
243 | things work as expected for the container "root" user. | |
244 | .IP | |
fb49322d | 245 | The process's "dumpable" attribute may change for the following reasons: |
3bdb8ec5 | 246 | .RS |
cdede5cd | 247 | .IP \[bu] 3 |
3bdb8ec5 MK |
248 | The attribute was explicitly set via the |
249 | .BR prctl (2) | |
250 | .B PR_SET_DUMPABLE | |
251 | operation. | |
cdede5cd | 252 | .IP \[bu] |
3bdb8ec5 | 253 | The attribute was reset to the value in the file |
1ae6b2c7 | 254 | .I /proc/sys/fs/suid_dumpable |
3bdb8ec5 MK |
255 | (described below), for the reasons described in |
256 | .BR prctl (2). | |
257 | .RE | |
258 | .IP | |
259 | Resetting the "dumpable" attribute to 1 reverts the ownership of the | |
1ae6b2c7 | 260 | .IR /proc/ pid /* |
eada5570 | 261 | files to the process's effective UID and GID. |
03687209 MK |
262 | Note, however, that if the effective UID or GID is subsequently modified, |
263 | then the "dumpable" attribute may be reset, as described in | |
264 | .BR prctl (2). | |
265 | Therefore, it may be desirable to reset the "dumpable" attribute | |
266 | .I after | |
267 | making any desired changes to the process's effective UID or GID. | |
69119dc7 | 268 | .\" FIXME Describe /proc/[pid]/sessionid |
b3fb99e8 | 269 | .\" commit 1e0bd7550ea9cf474b1ad4c6ff5729a507f75fdc |
b4e9ee8f | 270 | .\" CONFIG_AUDITSYSCALL |
b324e17d | 271 | .\" Added in Linux 2.6.25; read-only; only readable by real UID |
bea08fec | 272 | .\" |
69119dc7 | 273 | .\" FIXME Describe /proc/[pid]/sched |
b324e17d | 274 | .\" Added in Linux 2.6.23 |
b4e9ee8f MK |
275 | .\" CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS |
276 | .\" Displays various scheduling parameters | |
277 | .\" This file can be written, to reset stats | |
ef4f4031 | 278 | .\" The set of fields exposed by this file have changed |
b3fb99e8 MK |
279 | .\" significantly over time. |
280 | .\" commit 43ae34cb4cd650d1eb4460a8253a8e747ba052ac | |
281 | .\" | |
69119dc7 MK |
282 | .\" FIXME Describe /proc/[pid]/schedstats and |
283 | .\" /proc/[pid]/task/[tid]/schedstats | |
b324e17d | 284 | .\" Added in Linux 2.6.9 |
b4e9ee8f | 285 | .\" CONFIG_SCHEDSTATS |
fea681da | 286 | .TP |
1ae6b2c7 | 287 | .IR /proc/ pid /syscall " (since Linux 2.6.27)" |
afb7b014 MK |
288 | .\" commit ebcb67341fee34061430f3367f2e507e52ee051b |
289 | This file exposes the system call number and argument registers for the | |
290 | system call currently being executed by the process, | |
291 | followed by the values of the stack pointer and program counter registers. | |
292 | The values of all six argument registers are exposed, | |
293 | although most system calls use fewer registers. | |
2dad4c59 | 294 | .IP |
afb7b014 | 295 | If the process is blocked, but not in a system call, |
1fb61947 | 296 | then the file displays \-1 in place of the system call number, |
afb7b014 | 297 | followed by just the values of the stack pointer and program counter. |
64fcb6e1 | 298 | If process is not blocked, then the file contains just the string "running". |
2dad4c59 | 299 | .IP |
afb7b014 MK |
300 | This file is present only if the kernel was configured with |
301 | .BR CONFIG_HAVE_ARCH_TRACEHOOK . | |
2dad4c59 | 302 | .IP |
4834ae91 MK |
303 | Permission to access this file is governed by a ptrace access mode |
304 | .B PTRACE_MODE_ATTACH_FSCREDS | |
305 | check; see | |
306 | .BR ptrace (2). | |
fea681da | 307 | .TP |
1ae6b2c7 | 308 | .IR /proc/ pid /task " (since Linux 2.6.0)" |
d6bec36e | 309 | .\" Precisely: Linux 2.6.0-test6 |
afcaf646 MK |
310 | This is a directory that contains one subdirectory |
311 | for each thread in the process. | |
69119dc7 | 312 | The name of each subdirectory is the numerical thread ID |
1ae6b2c7 | 313 | .RI ( tid ) |
69119dc7 | 314 | of the thread (see |
afcaf646 | 315 | .BR gettid (2)). |
eb8567a5 | 316 | .IP |
afcaf646 MK |
317 | Within each of these subdirectories, there is a set of |
318 | files with the same names and contents as under the | |
1ae6b2c7 | 319 | .IR /proc/ pid |
afcaf646 MK |
320 | directories. |
321 | For attributes that are shared by all threads, the contents for | |
322 | each of the files under the | |
1ae6b2c7 | 323 | .IR task/ tid |
afcaf646 | 324 | subdirectories will be the same as in the corresponding |
c13182ef | 325 | file in the parent |
1ae6b2c7 | 326 | .IR /proc/ pid |
afcaf646 | 327 | directory |
c13182ef | 328 | (e.g., in a multithreaded process, all of the |
1ae6b2c7 | 329 | .IR task/ tid /cwd |
c13182ef | 330 | files will have the same value as the |
1ae6b2c7 | 331 | .IR /proc/ pid /cwd |
c13182ef | 332 | file in the parent directory, since all of the threads in a process |
afcaf646 MK |
333 | share a working directory). |
334 | For attributes that are distinct for each thread, | |
c13182ef | 335 | the corresponding files under |
1ae6b2c7 | 336 | .IR task/ tid |
afcaf646 | 337 | may have different values (e.g., various fields in each of the |
1ae6b2c7 | 338 | .IR task/ tid /status |
4a40c703 JH |
339 | files may be different for each thread), |
340 | .\" in particular: "children" :/ | |
341 | or they might not exist in | |
1ae6b2c7 | 342 | .IR /proc/ pid |
4a40c703 | 343 | at all. |
eb8567a5 | 344 | .IP |
afcaf646 MK |
345 | .\" The following was still true as at kernel 2.6.13 |
346 | In a multithreaded process, the contents of the | |
1ae6b2c7 | 347 | .IR /proc/ pid /task |
c13182ef | 348 | directory are not available if the main thread has already terminated |
afcaf646 MK |
349 | (typically by calling |
350 | .BR pthread_exit (3)). | |
4a40c703 | 351 | .TP |
1ae6b2c7 | 352 | .IR /proc/ pid /task/ tid /children " (since Linux 3.5)" |
4a40c703 JH |
353 | .\" commit 818411616baf46ceba0cff6f05af3a9b294734f7 |
354 | A space-separated list of child tasks of this task. | |
355 | Each child task is represented by its TID. | |
2dad4c59 | 356 | .IP |
4a40c703 | 357 | .\" see comments in get_children_pid() in fs/proc/array.c |
45dd5092 MK |
358 | This option is intended for use by the checkpoint-restore (CRIU) system, |
359 | and reliably provides a list of children only if all of the child processes | |
360 | are stopped or frozen. | |
361 | It does not work properly if children of the target task exit while | |
4a40c703 | 362 | the file is being read! |
45dd5092 | 363 | Exiting children may cause non-exiting children to be omitted from the list. |
4a40c703 | 364 | This makes this interface even more unreliable than classic PID-based |
45dd5092 MK |
365 | approaches if the inspected task and its children aren't frozen, |
366 | and most code should probably not use this interface. | |
2dad4c59 | 367 | .IP |
7ded2db4 MK |
368 | Until Linux 4.2, the presence of this file was governed by the |
369 | .B CONFIG_CHECKPOINT_RESTORE | |
370 | kernel configuration option. | |
371 | Since Linux 4.2, | |
372 | .\" commit 2e13ba54a2682eea24918b87ad3edf70c2cf085b | |
ae34c521 | 373 | it is governed by the |
7ded2db4 MK |
374 | .B CONFIG_PROC_CHILDREN |
375 | option. | |
afcaf646 | 376 | .TP |
1ae6b2c7 | 377 | .IR /proc/ pid /timers " (since Linux 3.10)" |
1509ca0e MK |
378 | .\" commit 5ed67f05f66c41e39880a6d61358438a25f9fee5 |
379 | .\" commit 48f6a7a511ef8823fdff39afee0320092d43a8a0 | |
380 | A list of the POSIX timers for this process. | |
93691c1e | 381 | Each timer is listed with a line that starts with the string "ID:". |
1509ca0e | 382 | For example: |
2dad4c59 | 383 | .IP |
1509ca0e | 384 | .in +4n |
37d5e699 | 385 | .EX |
1509ca0e MK |
386 | ID: 1 |
387 | signal: 60/00007fff86e452a8 | |
388 | notify: signal/pid.2634 | |
389 | ClockID: 0 | |
390 | ID: 0 | |
391 | signal: 60/00007fff86e452a8 | |
392 | notify: signal/pid.2634 | |
393 | ClockID: 1 | |
37d5e699 | 394 | .EE |
1509ca0e | 395 | .in |
2dad4c59 | 396 | .IP |
1509ca0e MK |
397 | The lines shown for each timer have the following meanings: |
398 | .RS | |
399 | .TP | |
400 | .I ID | |
401 | The ID for this timer. | |
402 | This is not the same as the timer ID returned by | |
403 | .BR timer_create (2); | |
404 | rather, it is the same kernel-internal ID that is available via the | |
405 | .I si_timerid | |
406 | field of the | |
1ae6b2c7 | 407 | .I siginfo_t |
1509ca0e MK |
408 | structure (see |
409 | .BR sigaction (2)). | |
410 | .TP | |
411 | .I signal | |
412 | This is the signal number that this timer uses to deliver notifications | |
413 | followed by a slash, and then the | |
7f1ea8fb | 414 | .I sigev_value |
1509ca0e MK |
415 | value supplied to the signal handler. |
416 | Valid only for timers that notify via a signal. | |
417 | .TP | |
418 | .I notify | |
419 | The part before the slash specifies the mechanism | |
420 | that this timer uses to deliver notifications, | |
421 | and is one of "thread", "signal", or "none". | |
422 | Immediately following the slash is either the string "tid" for timers | |
423 | with | |
424 | .B SIGEV_THREAD_ID | |
425 | notification, or "pid" for timers that notify by other mechanisms. | |
dbe6f88b MK |
426 | Following the "." is the PID of the process |
427 | (or the kernel thread ID of the thread) that will be delivered | |
1509ca0e MK |
428 | a signal if the timer delivers notifications via a signal. |
429 | .TP | |
430 | .I ClockID | |
431 | This field identifies the clock that the timer uses for measuring time. | |
432 | For most clocks, this is a number that matches one of the user-space | |
1ae6b2c7 | 433 | .B CLOCK_* |
9d54c087 | 434 | constants exposed via |
1509ca0e MK |
435 | .IR <time.h> . |
436 | .B CLOCK_PROCESS_CPUTIME_ID | |
9bc87ed0 | 437 | timers display with a value of \-6 |
1509ca0e MK |
438 | in this field. |
439 | .B CLOCK_THREAD_CPUTIME_ID | |
9bc87ed0 | 440 | timers display with a value of \-2 |
1509ca0e MK |
441 | in this field. |
442 | .RE | |
5734da6d MK |
443 | .IP |
444 | This file is available only when the kernel was configured with | |
445 | .BR CONFIG_CHECKPOINT_RESTORE . | |
1509ca0e | 446 | .TP |
1ae6b2c7 | 447 | .IR /proc/ pid /timerslack_ns " (since Linux 4.6)" |
11f60142 MK |
448 | .\" commit da8b44d5a9f8bf26da637b7336508ca534d6b319 |
449 | .\" commit 5de23d435e88996b1efe0e2cebe242074ce67c9e | |
450 | This file exposes the process's "current" timer slack value, | |
451 | expressed in nanoseconds. | |
452 | The file is writable, | |
453 | allowing the process's timer slack value to be changed. | |
454 | Writing 0 to this file resets the "current" timer slack to the | |
455 | "default" timer slack value. | |
456 | For further details, see the discussion of | |
1ae6b2c7 | 457 | .B PR_SET_TIMERSLACK |
11f60142 MK |
458 | in |
459 | .BR prctl (2). | |
2dad4c59 | 460 | .IP |
5daae264 MK |
461 | Initially, |
462 | permission to access this file was governed by a ptrace access mode | |
a62e0e01 | 463 | .B PTRACE_MODE_ATTACH_FSCREDS |
5daae264 MK |
464 | check (see |
465 | .BR ptrace (2)). | |
466 | However, this was subsequently deemed too strict a requirement | |
467 | (and had the side effect that requiring a process to have the | |
468 | .B CAP_SYS_PTRACE | |
469 | capability would also allow it to view and change any process's memory). | |
470 | Therefore, since Linux 4.9, | |
471 | .\" commit 7abbaf94049914f074306d960b0f968ffe52e59f | |
472 | only the (weaker) | |
473 | .B CAP_SYS_NICE | |
474 | capability is required to access this file. | |
11f60142 | 475 | .TP |
1ae6b2c7 | 476 | .IR /proc/ pid /wchan " (since Linux 2.6.0)" |
b1aad373 MK |
477 | The symbolic name corresponding to the location |
478 | in the kernel where the process is sleeping. | |
2dad4c59 | 479 | .IP |
82664739 MK |
480 | Permission to access this file is governed by a ptrace access mode |
481 | .B PTRACE_MODE_READ_FSCREDS | |
482 | check; see | |
483 | .BR ptrace (2). | |
b1aad373 | 484 | .TP |
1ae6b2c7 | 485 | .IR /proc/ tid |
01df7b70 MK |
486 | There is a numerical subdirectory for each running thread |
487 | that is not a thread group leader | |
488 | (i.e., a thread whose thread ID is not the same as its process ID); | |
489 | the subdirectory is named by the thread ID. | |
490 | Each one of these subdirectories contains files and subdirectories | |
491 | exposing information about the thread with the thread ID | |
492 | .IR tid . | |
493 | The contents of these directories are the same as the corresponding | |
1ae6b2c7 | 494 | .IR /proc/ pid /task/ tid |
01df7b70 MK |
495 | directories. |
496 | .IP | |
497 | The | |
1ae6b2c7 | 498 | .IR /proc/ tid |
01df7b70 MK |
499 | subdirectories are |
500 | .I not | |
501 | visible when iterating through | |
502 | .I /proc | |
503 | with | |
504 | .BR getdents (2) | |
505 | (and thus are | |
506 | .I not | |
507 | visible when one uses | |
508 | .BR ls (1) | |
509 | to view the contents of | |
510 | .IR /proc ). | |
37cd58d2 MK |
511 | However, the pathnames of these directories are visible to |
512 | (i.e., usable as arguments in) | |
513 | system calls that operate on pathnames. | |
01df7b70 | 514 | .TP |
b1aad373 MK |
515 | .I /proc/apm |
516 | Advanced power management version and battery information when | |
517 | .B CONFIG_APM | |
518 | is defined at kernel compilation time. | |
519 | .TP | |
520 | .I /proc/buddyinfo | |
521 | This file contains information which is used for diagnosing memory | |
522 | fragmentation issues. | |
523 | Each line starts with the identification of the node and the name | |
f68d8104 | 524 | of the zone which together identify a memory region. |
b1aad373 MK |
525 | This is then |
526 | followed by the count of available chunks of a certain order in | |
527 | which these zones are split. | |
528 | The size in bytes of a certain order is given by the formula: | |
2dad4c59 | 529 | .IP |
1ae6b2c7 AC |
530 | .in +4n |
531 | .EX | |
e4b01162 | 532 | (2\[ha]order)\ *\ PAGE_SIZE |
1ae6b2c7 AC |
533 | .EE |
534 | .in | |
2dad4c59 | 535 | .IP |
b1aad373 MK |
536 | The binary buddy allocator algorithm inside the kernel will split |
537 | one chunk into two chunks of a smaller order (thus with half the | |
538 | size) or combine two contiguous chunks into one larger chunk of | |
539 | a higher order (thus with double the size) to satisfy allocation | |
540 | requests and to counter memory fragmentation. | |
541 | The order matches the column number, when starting to count at zero. | |
2dad4c59 | 542 | .IP |
b5b0d21e | 543 | For example on an x86-64 system: |
e3fb1b6b | 544 | .RS -12 |
37d5e699 | 545 | .EX |
b1aad373 MK |
546 | Node 0, zone DMA 1 1 1 0 2 1 1 0 1 1 3 |
547 | Node 0, zone DMA32 65 47 4 81 52 28 13 10 5 1 404 | |
548 | Node 0, zone Normal 216 55 189 101 84 38 37 27 5 3 587 | |
37d5e699 | 549 | .EE |
e3fb1b6b | 550 | .RE |
2dad4c59 | 551 | .IP |
b1aad373 MK |
552 | In this example, there is one node containing three zones and there |
553 | are 11 different chunk sizes. | |
554 | If the page size is 4 kilobytes, then the first zone called | |
555 | .I DMA | |
556 | (on x86 the first 16 megabyte of memory) has 1 chunk of 4 kilobytes | |
557 | (order 0) available and has 3 chunks of 4 megabytes (order 10) available. | |
2dad4c59 | 558 | .IP |
b1aad373 MK |
559 | If the memory is heavily fragmented, the counters for higher |
560 | order chunks will be zero and allocation of large contiguous areas | |
561 | will fail. | |
2dad4c59 | 562 | .IP |
b1aad373 MK |
563 | Further information about the zones can be found in |
564 | .IR /proc/zoneinfo . | |
565 | .TP | |
566 | .I /proc/bus | |
7371ef9e | 567 | Contains subdirectories for installed buses. |
b1aad373 MK |
568 | .TP |
569 | .I /proc/bus/pccard | |
570 | Subdirectory for PCMCIA devices when | |
571 | .B CONFIG_PCMCIA | |
572 | is set at kernel compilation time. | |
573 | .TP | |
fea681da MK |
574 | .I /proc/bus/pccard/drivers |
575 | .TP | |
576 | .I /proc/bus/pci | |
c13182ef | 577 | Contains various bus subdirectories and pseudo-files containing |
7371ef9e | 578 | information about PCI buses, installed devices, and device |
c13182ef MK |
579 | drivers. |
580 | Some of these files are not ASCII. | |
fea681da MK |
581 | .TP |
582 | .I /proc/bus/pci/devices | |
59a40ed7 | 583 | Information about PCI devices. |
c13182ef | 584 | They may be accessed through |
fea681da MK |
585 | .BR lspci (8) |
586 | and | |
587 | .BR setpci (8). | |
588 | .TP | |
12b23dfe MK |
589 | .IR /proc/cgroups " (since Linux 2.6.24)" |
590 | See | |
591 | .BR cgroups (7). | |
592 | .TP | |
fea681da | 593 | .I /proc/cmdline |
c13182ef MK |
594 | Arguments passed to the Linux kernel at boot time. |
595 | Often done via a boot manager such as | |
59a40ed7 MK |
596 | .BR lilo (8) |
597 | or | |
598 | .BR grub (8). | |
d4cbaa91 PM |
599 | Any arguments embedded in the kernel image or initramfs via |
600 | .B CONFIG_BOOT_CONFIG | |
601 | will also be displayed. | |
f6e524c4 MK |
602 | .TP |
603 | .IR /proc/config.gz " (since Linux 2.6)" | |
604 | This file exposes the configuration options that were used | |
c3d9780d | 605 | to build the currently running kernel, |
f6e524c4 MK |
606 | in the same format as they would be shown in the |
607 | .I .config | |
608 | file that resulted when configuring the kernel (using | |
609 | .IR "make xconfig" , | |
610 | .IR "make config" , | |
611 | or similar). | |
612 | The file contents are compressed; view or search them using | |
f78ed33a MK |
613 | .BR zcat (1) |
614 | and | |
615 | .BR zgrep (1). | |
f6e524c4 | 616 | As long as no changes have been made to the following file, |
250e01ec MK |
617 | the contents of |
618 | .I /proc/config.gz | |
37d5e699 MK |
619 | are the same as those provided by: |
620 | .IP | |
f6e524c4 | 621 | .in +4n |
37d5e699 | 622 | .EX |
c3074d70 | 623 | cat /lib/modules/$(uname \-r)/build/.config |
37d5e699 | 624 | .EE |
f6e524c4 | 625 | .in |
250e01ec MK |
626 | .IP |
627 | .I /proc/config.gz | |
90878f7c | 628 | is provided only if the kernel is configured with |
250e01ec | 629 | .BR CONFIG_IKCONFIG_PROC . |
fea681da | 630 | .TP |
577c0e20 MK |
631 | .I /proc/crypto |
632 | A list of the ciphers provided by the kernel crypto API. | |
633 | For details, see the kernel | |
634 | .I "Linux Kernel Crypto API" | |
635 | documentation available under the kernel source directory | |
e94de168 ES |
636 | .I Documentation/crypto/ |
637 | .\" commit 3b72c814a8e8cd638e1ba0da4dfce501e9dff5af | |
638 | (or | |
639 | .I Documentation/DocBook | |
b324e17d | 640 | before Linux 4.10; |
e94de168 | 641 | the documentation can be built using a command such as |
1ae6b2c7 | 642 | .I make htmldocs |
e94de168 | 643 | in the root directory of the kernel source tree). |
577c0e20 | 644 | .TP |
fea681da MK |
645 | .I /proc/cpuinfo |
646 | This is a collection of CPU and system architecture dependent items, | |
647 | for each supported architecture a different list. | |
648 | Two common entries are \fIprocessor\fP which gives CPU number and | |
c13182ef MK |
649 | \fIbogomips\fP; a system constant that is calculated |
650 | during kernel initialization. | |
651 | SMP machines have information for | |
fea681da | 652 | each CPU. |
a091f002 MK |
653 | The |
654 | .BR lscpu (1) | |
655 | command gathers its information from this file. | |
fea681da MK |
656 | .TP |
657 | .I /proc/devices | |
c13182ef MK |
658 | Text listing of major numbers and device groups. |
659 | This can be used by MAKEDEV scripts for consistency with the kernel. | |
fea681da MK |
660 | .TP |
661 | .IR /proc/diskstats " (since Linux 2.5.69)" | |
662 | This file contains disk I/O statistics for each disk device. | |
66a9882e | 663 | See the Linux kernel source file |
79472471 | 664 | .I Documentation/admin\-guide/iostats.rst |
8a5fc410 | 665 | (or |
fea681da | 666 | .I Documentation/iostats.txt |
8a5fc410 | 667 | before Linux 5.3) |
fea681da MK |
668 | for further information. |
669 | .TP | |
670 | .I /proc/dma | |
c13182ef | 671 | This is a list of the registered \fIISA\fP DMA (direct memory access) |
fea681da MK |
672 | channels in use. |
673 | .TP | |
674 | .I /proc/driver | |
675 | Empty subdirectory. | |
676 | .TP | |
677 | .I /proc/execdomains | |
9b3f209a | 678 | Used to list ABI personalities before Linux 4.1; |
679 | now contains a constant string for userspace compatibility. | |
fea681da MK |
680 | .TP |
681 | .I /proc/fb | |
097585ed MK |
682 | Frame buffer information when |
683 | .B CONFIG_FB | |
684 | is defined during kernel compilation. | |
fea681da MK |
685 | .TP |
686 | .I /proc/filesystems | |
9ee4a2b6 MK |
687 | A text listing of the filesystems which are supported by the kernel, |
688 | namely filesystems which were compiled into the kernel or whose kernel | |
6387216b MK |
689 | modules are currently loaded. |
690 | (See also | |
fb477da2 | 691 | .BR filesystems (5).) |
9ee4a2b6 | 692 | If a filesystem is marked with "nodev", |
809d0164 | 693 | this means that it does not require a block device to be mounted |
9ee4a2b6 | 694 | (e.g., virtual filesystem, network filesystem). |
2dad4c59 | 695 | .IP |
809d0164 MK |
696 | Incidentally, this file may be used by |
697 | .BR mount (8) | |
9ee4a2b6 MK |
698 | when no filesystem is specified and it didn't manage to determine the |
699 | filesystem type. | |
700 | Then filesystems contained in this file are tried | |
809d0164 | 701 | (excepted those that are marked with "nodev"). |
fea681da MK |
702 | .TP |
703 | .I /proc/fs | |
df352acc | 704 | .\" FIXME Much more needs to be said about /proc/fs |
91085d85 | 705 | .\" |
df352acc MK |
706 | Contains subdirectories that in turn contain files |
707 | with information about (certain) mounted filesystems. | |
fea681da MK |
708 | .TP |
709 | .I /proc/ide | |
710 | This directory | |
59a40ed7 MK |
711 | exists on systems with the IDE bus. |
712 | There are directories for each IDE channel and attached device. | |
c13182ef | 713 | Files include: |
2dad4c59 | 714 | .IP |
a08ea57c | 715 | .in +4n |
37d5e699 | 716 | .EX |
fea681da MK |
717 | cache buffer size in KB |
718 | capacity number of sectors | |
719 | driver driver version | |
720 | geometry physical and logical geometry | |
9fdfa163 | 721 | identify in hexadecimal |
fea681da | 722 | media media type |
b957f81f | 723 | model manufacturer\[aq]s model number |
fea681da | 724 | settings drive settings |
a6a5e521 MK |
725 | smart_thresholds IDE disk management thresholds (in hex) |
726 | smart_values IDE disk management values (in hex) | |
37d5e699 | 727 | .EE |
a08ea57c | 728 | .in |
2dad4c59 | 729 | .IP |
c13182ef | 730 | The |
fea681da MK |
731 | .BR hdparm (8) |
732 | utility provides access to this information in a friendly format. | |
733 | .TP | |
734 | .I /proc/interrupts | |
23ec6ff0 MK |
735 | This is used to record the number of interrupts per CPU per IO device. |
736 | Since Linux 2.6.24, | |
9ea5bc66 | 737 | for the i386 and x86-64 architectures, at least, this also includes |
23ec6ff0 MK |
738 | interrupts internal to the system (that is, not associated with a device |
739 | as such), such as NMI (nonmaskable interrupt), LOC (local timer interrupt), | |
740 | and for SMP systems, TLB (TLB flush interrupt), RES (rescheduling | |
741 | interrupt), CAL (remote function call interrupt), and possibly others. | |
742 | Very easy to read formatting, done in ASCII. | |
fea681da MK |
743 | .TP |
744 | .I /proc/iomem | |
745 | I/O memory map in Linux 2.4. | |
746 | .TP | |
747 | .I /proc/ioports | |
c13182ef | 748 | This is a list of currently registered Input-Output port regions that |
fea681da MK |
749 | are in use. |
750 | .TP | |
751 | .IR /proc/kallsyms " (since Linux 2.5.71)" | |
752 | This holds the kernel exported symbol definitions used by the | |
753 | .BR modules (X) | |
754 | tools to dynamically link and bind loadable modules. | |
755 | In Linux 2.5.47 and earlier, a similar file with slightly different syntax | |
756 | was named | |
757 | .IR ksyms . | |
758 | .TP | |
759 | .I /proc/kcore | |
760 | This file represents the physical memory of the system and is stored | |
c13182ef MK |
761 | in the ELF core file format. |
762 | With this pseudo-file, and an unstripped | |
9a67332e MK |
763 | kernel |
764 | .RI ( /usr/src/linux/vmlinux ) | |
765 | binary, GDB can be used to | |
fea681da | 766 | examine the current state of any kernel data structures. |
2dad4c59 | 767 | .IP |
fea681da | 768 | The total length of the file is the size of physical memory (RAM) plus |
ee8655b5 | 769 | 4\ KiB. |
fea681da | 770 | .TP |
653836fb MK |
771 | .IR /proc/keys " (since Linux 2.6.10)" |
772 | See | |
773 | .BR keyrings (7). | |
774 | .TP | |
184d797d | 775 | .IR /proc/key\-users " (since Linux 2.6.10)" |
653836fb MK |
776 | See |
777 | .BR keyrings (7). | |
778 | .TP | |
fea681da MK |
779 | .I /proc/kmsg |
780 | This file can be used instead of the | |
781 | .BR syslog (2) | |
c13182ef MK |
782 | system call to read kernel messages. |
783 | A process must have superuser | |
fea681da | 784 | privileges to read this file, and only one process should read this |
c13182ef MK |
785 | file. |
786 | This file should not be read if a syslog process is running | |
fea681da MK |
787 | which uses the |
788 | .BR syslog (2) | |
789 | system call facility to log kernel messages. | |
2dad4c59 | 790 | .IP |
fea681da | 791 | Information in this file is retrieved with the |
c4517613 | 792 | .BR dmesg (1) |
fea681da MK |
793 | program. |
794 | .TP | |
55d68a94 | 795 | .IR /proc/kpagecgroup " (since Linux 4.3)" |
0e462d71 | 796 | .\" commit 80ae2fdceba8313b0433f899bdd9c6c463291a17 |
55d68a94 OE |
797 | This file contains a 64-bit inode number of |
798 | the memory cgroup each page is charged to, | |
799 | indexed by page frame number (see the discussion of | |
1ae6b2c7 | 800 | .IR /proc/ pid /pagemap ). |
55d68a94 OE |
801 | .IP |
802 | The | |
1ae6b2c7 | 803 | .I /proc/kpagecgroup |
55d68a94 OE |
804 | file is present only if the |
805 | .B CONFIG_MEMCG | |
806 | kernel configuration option is enabled. | |
807 | .TP | |
ff56ac8b MK |
808 | .IR /proc/kpagecount " (since Linux 2.6.25)" |
809 | This file contains a 64-bit count of the number of | |
810 | times each physical page frame is mapped, | |
811 | indexed by page frame number (see the discussion of | |
1ae6b2c7 | 812 | .IR /proc/ pid /pagemap ). |
ff56ac8b MK |
813 | .IP |
814 | The | |
1ae6b2c7 | 815 | .I /proc/kpagecount |
ff56ac8b MK |
816 | file is present only if the |
817 | .B CONFIG_PROC_PAGE_MONITOR | |
59d566a9 MK |
818 | kernel configuration option is enabled. |
819 | .TP | |
820 | .IR /proc/kpageflags " (since Linux 2.6.25)" | |
ef4f4031 | 821 | This file contains 64-bit masks corresponding to each physical page frame; |
59d566a9 | 822 | it is indexed by page frame number (see the discussion of |
1ae6b2c7 | 823 | .IR /proc/ pid /pagemap ). |
59d566a9 | 824 | The bits are as follows: |
30eadebd | 825 | .RS |
2dad4c59 | 826 | .IP |
30eadebd AC |
827 | .TS |
828 | r l l l. | |
829 | 0 - KPF_LOCKED | |
830 | 1 - KPF_ERROR | |
831 | 2 - KPF_REFERENCED | |
832 | 3 - KPF_UPTODATE | |
833 | 4 - KPF_DIRTY | |
834 | 5 - KPF_LRU | |
835 | 6 - KPF_ACTIVE | |
836 | 7 - KPF_SLAB | |
837 | 8 - KPF_WRITEBACK | |
838 | 9 - KPF_RECLAIM | |
839 | 10 - KPF_BUDDY | |
840 | 11 - KPF_MMAP (since Linux 2.6.31) | |
841 | 12 - KPF_ANON (since Linux 2.6.31) | |
842 | 13 - KPF_SWAPCACHE (since Linux 2.6.31) | |
843 | 14 - KPF_SWAPBACKED (since Linux 2.6.31) | |
844 | 15 - KPF_COMPOUND_HEAD (since Linux 2.6.31) | |
845 | 16 - KPF_COMPOUND_TAIL (since Linux 2.6.31) | |
846 | 17 - KPF_HUGE (since Linux 2.6.31) | |
847 | 18 - KPF_UNEVICTABLE (since Linux 2.6.31) | |
848 | 19 - KPF_HWPOISON (since Linux 2.6.31) | |
849 | 20 - KPF_NOPAGE (since Linux 2.6.31) | |
850 | 21 - KPF_KSM (since Linux 2.6.32) | |
851 | 22 - KPF_THP (since Linux 3.4) | |
852 | 23 - KPF_BALLOON (since Linux 3.18) | |
5487da4c | 853 | .\" KPF_BALLOON: commit 09316c09dde33aae14f34489d9e3d243ec0d5938 |
30eadebd | 854 | 24 - KPF_ZERO_PAGE (since Linux 4.0) |
c6f182bc | 855 | .\" KPF_ZERO_PAGE: commit 56873f43abdcd574b25105867a990f067747b2f4 |
30eadebd | 856 | 25 - KPF_IDLE (since Linux 4.3) |
c6f182bc | 857 | .\" KPF_IDLE: commit f074a8f49eb87cde95ac9d040ad5e7ea4f029738 |
33416a99 MB |
858 | 26 - KPF_PGTABLE (since Linux 4.18) |
859 | .\" KPF_PGTABLE: commit 1d40a5ea01d53251c23c7be541d3f4a656cfc537 | |
30eadebd AC |
860 | .TE |
861 | .RE | |
2dad4c59 | 862 | .IP |
59d566a9 MK |
863 | For further details on the meanings of these bits, |
864 | see the kernel source file | |
184d797d | 865 | .IR Documentation/admin\-guide/mm/pagemap.rst . |
b324e17d | 866 | Before Linux 2.6.29, |
59d566a9 MK |
867 | .\" commit ad3bdefe877afb47480418fdb05ecd42842de65e |
868 | .\" commit e07a4b9217d1e97d2f3a62b6b070efdc61212110 | |
869 | .BR KPF_WRITEBACK , | |
870 | .BR KPF_RECLAIM , | |
871 | .BR KPF_BUDDY , | |
872 | and | |
1ae6b2c7 | 873 | .B KPF_LOCKED |
59d566a9 MK |
874 | did not report correctly. |
875 | .IP | |
876 | The | |
1ae6b2c7 | 877 | .I /proc/kpageflags |
59d566a9 MK |
878 | file is present only if the |
879 | .B CONFIG_PROC_PAGE_MONITOR | |
ff56ac8b MK |
880 | kernel configuration option is enabled. |
881 | .TP | |
523869f6 | 882 | .IR /proc/ksyms " (Linux 1.1.23\[en]2.5.47)" |
fea681da MK |
883 | See |
884 | .IR /proc/kallsyms . | |
885 | .TP | |
886 | .I /proc/loadavg | |
6b05dc38 MK |
887 | The first three fields in this file are load average figures |
888 | giving the number of jobs in the run queue (state R) | |
fea681da MK |
889 | or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes. |
890 | They are the same as the load average numbers given by | |
891 | .BR uptime (1) | |
892 | and other programs. | |
6b05dc38 | 893 | The fourth field consists of two numbers separated by a slash (/). |
78fc91ec EDB |
894 | The first of these is the number of currently runnable kernel |
895 | scheduling entities (processes, threads). | |
6b05dc38 MK |
896 | The value after the slash is the number of kernel scheduling entities |
897 | that currently exist on the system. | |
898 | The fifth field is the PID of the process that was most | |
899 | recently created on the system. | |
fea681da MK |
900 | .TP |
901 | .I /proc/locks | |
902 | This file shows current file locks | |
903 | .RB ( flock "(2) and " fcntl (2)) | |
904 | and leases | |
905 | .RB ( fcntl (2)). | |
f352b560 MK |
906 | .IP |
907 | An example of the content shown in this file is the following: | |
908 | .IP | |
909 | .in +4n | |
910 | .EX | |
911 | 1: POSIX ADVISORY READ 5433 08:01:7864448 128 128 | |
912 | 2: FLOCK ADVISORY WRITE 2001 08:01:7864554 0 EOF | |
913 | 3: FLOCK ADVISORY WRITE 1568 00:2f:32388 0 EOF | |
914 | 4: POSIX ADVISORY WRITE 699 00:16:28457 0 EOF | |
915 | 5: POSIX ADVISORY WRITE 764 00:16:21448 0 0 | |
916 | 6: POSIX ADVISORY READ 3548 08:01:7867240 1 1 | |
917 | 7: POSIX ADVISORY READ 3548 08:01:7865567 1826 2335 | |
184d797d | 918 | 8: OFDLCK ADVISORY WRITE \-1 08:01:8713209 128 191 |
f352b560 MK |
919 | .EE |
920 | .in | |
921 | .IP | |
922 | The fields shown in each line are as follows: | |
923 | .RS | |
22356d97 | 924 | .IP [1] 5 |
f352b560 | 925 | The ordinal position of the lock in the list. |
22356d97 | 926 | .IP [2] |
f352b560 MK |
927 | The lock type. |
928 | Values that may appear here include: | |
929 | .RS | |
930 | .TP | |
931 | .B FLOCK | |
932 | This is a BSD file lock created using | |
933 | .BR flock (2). | |
934 | .TP | |
935 | .B OFDLCK | |
936 | This is an open file description (OFD) lock created using | |
937 | .BR fcntl (2). | |
938 | .TP | |
939 | .B POSIX | |
940 | This is a POSIX byte-range lock created using | |
941 | .BR fcntl (2). | |
942 | .RE | |
22356d97 | 943 | .IP [3] |
f352b560 MK |
944 | Among the strings that can appear here are the following: |
945 | .RS | |
946 | .TP | |
947 | .B ADVISORY | |
948 | This is an advisory lock. | |
949 | .TP | |
950 | .B MANDATORY | |
951 | This is a mandatory lock. | |
952 | .RE | |
22356d97 | 953 | .IP [4] |
f352b560 MK |
954 | The type of lock. |
955 | Values that can appear here are: | |
956 | .RS | |
957 | .TP | |
958 | .B READ | |
959 | This is a POSIX or OFD read lock, or a BSD shared lock. | |
960 | .TP | |
961 | .B WRITE | |
962 | This is a POSIX or OFD write lock, or a BSD exclusive lock. | |
963 | .RE | |
22356d97 | 964 | .IP [5] |
f352b560 MK |
965 | The PID of the process that owns the lock. |
966 | .IP | |
967 | Because OFD locks are not owned by a single process | |
968 | (since multiple processes may have file descriptors that | |
969 | refer to the same open file description), | |
970 | the value \-1 is displayed in this field for OFD locks. | |
b324e17d | 971 | (Before Linux 4.14, |
52f842a5 | 972 | .\" commit 9d5b86ac13c573795525ecac6ed2db39ab23e2a8 |
f352b560 MK |
973 | a bug meant that the PID of the process that |
974 | initially acquired the lock was displayed instead of the value \-1.) | |
22356d97 | 975 | .IP [6] |
f352b560 MK |
976 | Three colon-separated subfields that identify the major and minor device |
977 | ID of the device containing the filesystem where the locked file resides, | |
978 | followed by the inode number of the locked file. | |
22356d97 | 979 | .IP [7] |
f352b560 MK |
980 | The byte offset of the first byte of the lock. |
981 | For BSD locks, this value is always 0. | |
22356d97 | 982 | .IP [8] |
f352b560 MK |
983 | The byte offset of the last byte of the lock. |
984 | .B EOF | |
985 | in this field means that the lock extends to the end of the file. | |
986 | For BSD locks, the value shown is always | |
987 | .IR EOF . | |
988 | .RE | |
989 | .IP | |
8fb9b45a MK |
990 | Since Linux 4.9, |
991 | .\" commit d67fd44f697dff293d7cdc29af929241b669affe | |
992 | the list of locks shown in | |
993 | .I /proc/locks | |
994 | is filtered to show just the locks for the processes in the PID | |
995 | namespace (see | |
996 | .BR pid_namespaces (7)) | |
997 | for which the | |
998 | .I /proc | |
999 | filesystem was mounted. | |
1dbe854b | 1000 | (In the initial PID namespace, |
8fb9b45a MK |
1001 | there is no filtering of the records shown in this file.) |
1002 | .IP | |
9f1002a1 MK |
1003 | The |
1004 | .BR lslocks (8) | |
1005 | command provides a bit more information about each lock. | |
fea681da | 1006 | .TP |
89dd5f8a | 1007 | .IR /proc/malloc " (only up to and including Linux 2.2)" |
59a40ed7 | 1008 | .\" It looks like this only ever did something back in 1.0 days |
90878f7c | 1009 | This file is present only if |
89dd5f8a | 1010 | .B CONFIG_DEBUG_MALLOC |
097585ed | 1011 | was defined during compilation. |
fea681da MK |
1012 | .TP |
1013 | .I /proc/meminfo | |
77b802ec MK |
1014 | This file reports statistics about memory usage on the system. |
1015 | It is used by | |
fea681da MK |
1016 | .BR free (1) |
1017 | to report the amount of free and used memory (both physical and swap) | |
1018 | on the system as well as the shared memory and buffers used by the | |
1019 | kernel. | |
3ba3d5b1 MK |
1020 | Each line of the file consists of a parameter name, followed by a colon, |
1021 | the value of the parameter, and an option unit of measurement (e.g., "kB"). | |
1022 | The list below describes the parameter names and | |
1023 | the format specifier required to read the field value. | |
1024 | Except as noted below, | |
1025 | all of the fields have been present since at least Linux 2.6.0. | |
86cf87d7 | 1026 | Some fields are displayed only if the kernel was configured |
3ba3d5b1 MK |
1027 | with various options; those dependencies are noted in the list. |
1028 | .RS | |
1029 | .TP | |
1030 | .IR MemTotal " %lu" | |
449dd4e2 | 1031 | Total usable RAM (i.e., physical RAM minus a few reserved |
99e91586 | 1032 | bits and the kernel binary code). |
3ba3d5b1 MK |
1033 | .TP |
1034 | .IR MemFree " %lu" | |
7bccb7d4 DP |
1035 | The sum of |
1036 | .IR LowFree + HighFree . | |
3ba3d5b1 | 1037 | .TP |
8b4b1f68 MK |
1038 | .IR MemAvailable " %lu (since Linux 3.14)" |
1039 | An estimate of how much memory is available for starting new | |
1040 | applications, without swapping. | |
1041 | .TP | |
3ba3d5b1 | 1042 | .IR Buffers " %lu" |
99e91586 | 1043 | Relatively temporary storage for raw disk blocks that |
c7169ee5 | 1044 | shouldn't get tremendously large (20 MB or so). |
3ba3d5b1 MK |
1045 | .TP |
1046 | .IR Cached " %lu" | |
1047 | In-memory cache for files read from the disk (the page cache). | |
1048 | Doesn't include | |
1049 | .IR SwapCached . | |
1050 | .TP | |
1051 | .IR SwapCached " %lu" | |
1052 | Memory that once was swapped out, is swapped back in but | |
1053 | still also is in the swap file. | |
fa1d2749 | 1054 | (If memory pressure is high, these pages |
3ba3d5b1 | 1055 | don't need to be swapped out again because they are already |
99e91586 | 1056 | in the swap file. |
3ba3d5b1 MK |
1057 | This saves I/O.) |
1058 | .TP | |
1059 | .IR Active " %lu" | |
1060 | Memory that has been used more recently and usually not | |
1061 | reclaimed unless absolutely necessary. | |
1062 | .TP | |
1063 | .IR Inactive " %lu" | |
1064 | Memory which has been less recently used. | |
1065 | It is more eligible to be reclaimed for other purposes. | |
1066 | .TP | |
1067 | .IR Active(anon) " %lu (since Linux 2.6.28)" | |
1068 | [To be documented.] | |
1069 | .TP | |
1070 | .IR Inactive(anon) " %lu (since Linux 2.6.28)" | |
1071 | [To be documented.] | |
1072 | .TP | |
1073 | .IR Active(file) " %lu (since Linux 2.6.28)" | |
1074 | [To be documented.] | |
1075 | .TP | |
1076 | .IR Inactive(file) " %lu (since Linux 2.6.28)" | |
1077 | [To be documented.] | |
1078 | .TP | |
1079 | .IR Unevictable " %lu (since Linux 2.6.28)" | |
b324e17d | 1080 | (From Linux 2.6.28 to Linux 2.6.30, |
3ba3d5b1 MK |
1081 | \fBCONFIG_UNEVICTABLE_LRU\fP was required.) |
1082 | [To be documented.] | |
1083 | .TP | |
46fbfc07 | 1084 | .IR Mlocked " %lu (since Linux 2.6.28)" |
b324e17d | 1085 | (From Linux 2.6.28 to Linux 2.6.30, |
3ba3d5b1 MK |
1086 | \fBCONFIG_UNEVICTABLE_LRU\fP was required.) |
1087 | [To be documented.] | |
1088 | .TP | |
1089 | .IR HighTotal " %lu" | |
1090 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) | |
1091 | Total amount of highmem. | |
3f029bc9 | 1092 | Highmem is all memory above \[ti]860 MB of physical memory. |
3ba3d5b1 MK |
1093 | Highmem areas are for use by user-space programs, |
1094 | or for the page cache. | |
1095 | The kernel must use tricks to access | |
1096 | this memory, making it slower to access than lowmem. | |
1097 | .TP | |
0dbe186a | 1098 | .IR HighFree " %lu" |
3ba3d5b1 MK |
1099 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) |
1100 | Amount of free highmem. | |
1101 | .TP | |
0dbe186a | 1102 | .IR LowTotal " %lu" |
3ba3d5b1 MK |
1103 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) |
1104 | Total amount of lowmem. | |
1105 | Lowmem is memory which can be used for everything that | |
1106 | highmem can be used for, but it is also available for the | |
1107 | kernel's use for its own data structures. | |
1108 | Among many other things, | |
99e91586 | 1109 | it is where everything from |
7bccb7d4 DP |
1110 | .I Slab |
1111 | is allocated. | |
3ba3d5b1 MK |
1112 | Bad things happen when you're out of lowmem. |
1113 | .TP | |
0dbe186a | 1114 | .IR LowFree " %lu" |
3ba3d5b1 MK |
1115 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) |
1116 | Amount of free lowmem. | |
1117 | .TP | |
1118 | .IR MmapCopy " %lu (since Linux 2.6.29)" | |
99e91586 DP |
1119 | .RB ( CONFIG_MMU |
1120 | is required.) | |
3ba3d5b1 MK |
1121 | [To be documented.] |
1122 | .TP | |
1123 | .IR SwapTotal " %lu" | |
1124 | Total amount of swap space available. | |
1125 | .TP | |
1126 | .IR SwapFree " %lu" | |
c16d4f25 | 1127 | Amount of swap space that is currently unused. |
3ba3d5b1 MK |
1128 | .TP |
1129 | .IR Dirty " %lu" | |
1130 | Memory which is waiting to get written back to the disk. | |
1131 | .TP | |
1132 | .IR Writeback " %lu" | |
1133 | Memory which is actively being written back to the disk. | |
1134 | .TP | |
1135 | .IR AnonPages " %lu (since Linux 2.6.18)" | |
1136 | Non-file backed pages mapped into user-space page tables. | |
1137 | .TP | |
1138 | .IR Mapped " %lu" | |
fda70f5b MK |
1139 | Files which have been mapped into memory (with |
1140 | .BR mmap (2)), | |
1141 | such as libraries. | |
3ba3d5b1 MK |
1142 | .TP |
1143 | .IR Shmem " %lu (since Linux 2.6.32)" | |
eb775c04 MK |
1144 | Amount of memory consumed in |
1145 | .BR tmpfs (5) | |
1146 | filesystems. | |
3ba3d5b1 | 1147 | .TP |
7375eaab MK |
1148 | .IR KReclaimable " %lu (since Linux 4.20)" |
1149 | Kernel allocations that the kernel will attempt to reclaim | |
1150 | under memory pressure. | |
1151 | Includes | |
1152 | .I SReclaimable | |
1153 | (below), and other direct allocations with a shrinker. | |
1154 | .TP | |
3ba3d5b1 MK |
1155 | .IR Slab " %lu" |
1156 | In-kernel data structures cache. | |
5a5bde70 MK |
1157 | (See |
1158 | .BR slabinfo (5).) | |
3ba3d5b1 MK |
1159 | .TP |
1160 | .IR SReclaimable " %lu (since Linux 2.6.19)" | |
7bccb7d4 DP |
1161 | Part of |
1162 | .IR Slab , | |
1163 | that might be reclaimed, such as caches. | |
3ba3d5b1 MK |
1164 | .TP |
1165 | .IR SUnreclaim " %lu (since Linux 2.6.19)" | |
7bccb7d4 DP |
1166 | Part of |
1167 | .IR Slab , | |
1168 | that cannot be reclaimed on memory pressure. | |
3ba3d5b1 MK |
1169 | .TP |
1170 | .IR KernelStack " %lu (since Linux 2.6.32)" | |
1171 | Amount of memory allocated to kernel stacks. | |
1172 | .TP | |
1173 | .IR PageTables " %lu (since Linux 2.6.18)" | |
1174 | Amount of memory dedicated to the lowest level of page tables. | |
1175 | .TP | |
1176 | .IR Quicklists " %lu (since Linux 2.6.27)" | |
1177 | (\fBCONFIG_QUICKLIST\fP is required.) | |
1178 | [To be documented.] | |
1179 | .TP | |
1180 | .IR NFS_Unstable " %lu (since Linux 2.6.18)" | |
1181 | NFS pages sent to the server, but not yet committed to stable storage. | |
1182 | .TP | |
1183 | .IR Bounce " %lu (since Linux 2.6.18)" | |
1184 | Memory used for block device "bounce buffers". | |
1185 | .TP | |
1186 | .IR WritebackTmp " %lu (since Linux 2.6.26)" | |
1187 | Memory used by FUSE for temporary writeback buffers. | |
1188 | .TP | |
1189 | .IR CommitLimit " %lu (since Linux 2.6.10)" | |
cd7b6c40 MK |
1190 | This is the total amount of memory currently available to |
1191 | be allocated on the system, expressed in kilobytes. | |
90878f7c MK |
1192 | This limit is adhered to |
1193 | only if strict overcommit accounting is enabled (mode 2 in | |
cd7b6c40 MK |
1194 | .IR /proc/sys/vm/overcommit_memory ). |
1195 | The limit is calculated according to the formula described under | |
1196 | .IR /proc/sys/vm/overcommit_memory . | |
1197 | For further details, see the kernel source file | |
184d797d | 1198 | .IR Documentation/vm/overcommit\-accounting.rst . |
3ba3d5b1 MK |
1199 | .TP |
1200 | .IR Committed_AS " %lu" | |
1201 | The amount of memory presently allocated on the system. | |
1202 | The committed memory is a sum of all of the memory which | |
1203 | has been allocated by processes, even if it has not been | |
1204 | "used" by them as of yet. | |
c7169ee5 | 1205 | A process which allocates 1 GB of memory (using |
3ba3d5b1 | 1206 | .BR malloc (3) |
c7169ee5 MK |
1207 | or similar), but touches only 300 MB of that memory will show up |
1208 | as using only 300 MB of memory even if it has the address space | |
1209 | allocated for the entire 1 GB. | |
2dad4c59 | 1210 | .IP |
c7169ee5 | 1211 | This 1 GB is memory which has been "committed" to by the VM |
3ba3d5b1 | 1212 | and can be used at any time by the allocating application. |
cd7b6c40 | 1213 | With strict overcommit enabled on the system (mode 2 in |
d9e0f03d | 1214 | .IR /proc/sys/vm/overcommit_memory ), |
3ba3d5b1 MK |
1215 | allocations which would exceed the |
1216 | .I CommitLimit | |
cd7b6c40 | 1217 | will not be permitted. |
3ba3d5b1 MK |
1218 | This is useful if one needs to guarantee that processes will not |
1219 | fail due to lack of memory once that memory has been successfully allocated. | |
1220 | .TP | |
1221 | .IR VmallocTotal " %lu" | |
1222 | Total size of vmalloc memory area. | |
1223 | .TP | |
1224 | .IR VmallocUsed " %lu" | |
2fc546f9 MK |
1225 | Amount of vmalloc area which is used. |
1226 | Since Linux 4.4, | |
1227 | .\" commit a5ad88ce8c7fae7ddc72ee49a11a75aa837788e0 | |
1228 | this field is no longer calculated, and is hard coded as 0. | |
1229 | See | |
bfe9256a | 1230 | .IR /proc/vmallocinfo . |
3ba3d5b1 MK |
1231 | .TP |
1232 | .IR VmallocChunk " %lu" | |
2fc546f9 MK |
1233 | Largest contiguous block of vmalloc area which is free. |
1234 | Since Linux 4.4, | |
1235 | .\" commit a5ad88ce8c7fae7ddc72ee49a11a75aa837788e0 | |
1236 | this field is no longer calculated and is hard coded as 0. | |
1237 | See | |
bfe9256a | 1238 | .IR /proc/vmallocinfo . |
3ba3d5b1 MK |
1239 | .TP |
1240 | .IR HardwareCorrupted " %lu (since Linux 2.6.32)" | |
1241 | (\fBCONFIG_MEMORY_FAILURE\fP is required.) | |
1242 | [To be documented.] | |
1243 | .TP | |
f7bbc79d MK |
1244 | .IR LazyFree " %lu (since Linux 4.12)" |
1245 | Shows the amount of memory marked by | |
1246 | .BR madvise (2) | |
1247 | .BR MADV_FREE . | |
1248 | .TP | |
3ba3d5b1 MK |
1249 | .IR AnonHugePages " %lu (since Linux 2.6.38)" |
1250 | (\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.) | |
7fac88a9 | 1251 | Non-file backed huge pages mapped into user-space page tables. |
3ba3d5b1 | 1252 | .TP |
4ad958e1 MK |
1253 | .IR ShmemHugePages " %lu (since Linux 4.8)" |
1254 | (\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.) | |
4e07c70f MK |
1255 | Memory used by shared memory (shmem) and |
1256 | .BR tmpfs (5) | |
c7169ee5 | 1257 | allocated with huge pages. |
4ad958e1 MK |
1258 | .TP |
1259 | .IR ShmemPmdMapped " %lu (since Linux 4.8)" | |
1260 | (\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.) | |
956e74b4 | 1261 | Shared memory mapped into user space with huge pages. |
4ad958e1 | 1262 | .TP |
43179f55 MK |
1263 | .IR CmaTotal " %lu (since Linux 3.1)" |
1264 | Total CMA (Contiguous Memory Allocator) pages. | |
1265 | (\fBCONFIG_CMA\fP is required.) | |
1266 | .TP | |
1267 | .IR CmaFree " %lu (since Linux 3.1)" | |
1268 | Free CMA (Contiguous Memory Allocator) pages. | |
1269 | (\fBCONFIG_CMA\fP is required.) | |
1270 | .TP | |
3ba3d5b1 MK |
1271 | .IR HugePages_Total " %lu" |
1272 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
1273 | The size of the pool of huge pages. | |
1274 | .TP | |
1275 | .IR HugePages_Free " %lu" | |
1276 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
1277 | The number of huge pages in the pool that are not yet allocated. | |
1278 | .TP | |
1279 | .IR HugePages_Rsvd " %lu (since Linux 2.6.17)" | |
1280 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
1281 | This is the number of huge pages for | |
1282 | which a commitment to allocate from the pool has been made, | |
1283 | but no allocation has yet been made. | |
1284 | These reserved huge pages | |
1285 | guarantee that an application will be able to allocate a | |
1286 | huge page from the pool of huge pages at fault time. | |
1287 | .TP | |
aa8a6b4f | 1288 | .IR HugePages_Surp " %lu (since Linux 2.6.24)" |
3ba3d5b1 MK |
1289 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) |
1290 | This is the number of huge pages in | |
1291 | the pool above the value in | |
1292 | .IR /proc/sys/vm/nr_hugepages . | |
1293 | The maximum number of surplus huge pages is controlled by | |
1294 | .IR /proc/sys/vm/nr_overcommit_hugepages . | |
1295 | .TP | |
1296 | .IR Hugepagesize " %lu" | |
1297 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
1298 | The size of huge pages. | |
d5268de1 MK |
1299 | .TP |
1300 | .IR DirectMap4k " %lu (since Linux 2.6.27)" | |
c7169ee5 | 1301 | Number of bytes of RAM linearly mapped by kernel in 4 kB pages. |
d5268de1 MK |
1302 | (x86.) |
1303 | .TP | |
1304 | .IR DirectMap4M " %lu (since Linux 2.6.27)" | |
c7169ee5 | 1305 | Number of bytes of RAM linearly mapped by kernel in 4 MB pages. |
d5268de1 | 1306 | (x86 with |
1ae6b2c7 | 1307 | .B CONFIG_X86_64 |
d5268de1 | 1308 | or |
1ae6b2c7 | 1309 | .B CONFIG_X86_PAE |
d5268de1 MK |
1310 | enabled.) |
1311 | .TP | |
1312 | .IR DirectMap2M " %lu (since Linux 2.6.27)" | |
c7169ee5 | 1313 | Number of bytes of RAM linearly mapped by kernel in 2 MB pages. |
d5268de1 | 1314 | (x86 with neither |
1ae6b2c7 | 1315 | .B CONFIG_X86_64 |
d5268de1 | 1316 | nor |
1ae6b2c7 | 1317 | .B CONFIG_X86_PAE |
d5268de1 MK |
1318 | enabled.) |
1319 | .TP | |
1320 | .IR DirectMap1G " %lu (since Linux 2.6.27)" | |
1321 | (x86 with | |
1ae6b2c7 | 1322 | .B CONFIG_X86_64 |
d5268de1 MK |
1323 | and |
1324 | .B CONFIG_X86_DIRECT_GBPAGES | |
1325 | enabled.) | |
3ba3d5b1 | 1326 | .RE |
fea681da | 1327 | .TP |
aa341984 MK |
1328 | .I /proc/modules |
1329 | A text list of the modules that have been loaded by the system. | |
1330 | See also | |
1331 | .BR lsmod (8). | |
1332 | .TP | |
fea681da | 1333 | .I /proc/mtrr |
c13182ef | 1334 | Memory Type Range Registers. |
66a9882e | 1335 | See the Linux kernel source file |
8a5fc410 MK |
1336 | .I Documentation/x86/mtrr.rst |
1337 | (or | |
a8999e1f ES |
1338 | .I Documentation/x86/mtrr.txt |
1339 | .\" commit 7225e75144b9718cbbe1820d9c011c809d5773fd | |
8a5fc410 | 1340 | before Linux 5.2, or |
cfe70b66 | 1341 | .I Documentation/mtrr.txt |
a8999e1f | 1342 | before Linux 2.6.28) |
fea681da MK |
1343 | for details. |
1344 | .TP | |
fea681da | 1345 | .I /proc/partitions |
f042d149 MK |
1346 | Contains the major and minor numbers of each partition as well as the number |
1347 | of 1024-byte blocks and the partition name. | |
fea681da MK |
1348 | .TP |
1349 | .I /proc/pci | |
1350 | This is a listing of all PCI devices found during kernel initialization | |
1351 | and their configuration. | |
2dad4c59 | 1352 | .IP |
59a40ed7 MK |
1353 | This file has been deprecated in favor of a new |
1354 | .I /proc | |
2990d781 MK |
1355 | interface for PCI |
1356 | .RI ( /proc/bus/pci ). | |
1357 | It became optional in Linux 2.2 (available with | |
1358 | .B CONFIG_PCI_OLD_PROC | |
1359 | set at kernel compilation). | |
24b74457 | 1360 | It became once more nonoptionally enabled in Linux 2.4. |
2990d781 MK |
1361 | Next, it was deprecated in Linux 2.6 (still available with |
1362 | .B CONFIG_PCI_LEGACY_PROC | |
1363 | set), and finally removed altogether since Linux 2.6.17. | |
43d42cc0 | 1364 | .\" FIXME Document /proc/sched_debug (since Linux 2.6.23) |
69119dc7 | 1365 | .\" See also /proc/[pid]/sched |
caea7868 MK |
1366 | .TP |
1367 | .IR /proc/profile " (since Linux 2.4)" | |
1368 | This file is present only if the kernel was booted with the | |
1369 | .I profile=1 | |
1370 | command-line option. | |
1371 | It exposes kernel profiling information in a binary format for use by | |
1372 | .BR readprofile (1). | |
1373 | Writing (e.g., an empty string) to this file resets the profiling counters; | |
1374 | on some architectures, | |
1375 | writing a binary integer "profiling multiplier" of size | |
1ae6b2c7 | 1376 | .I sizeof(int) |
8a3ac89a | 1377 | sets the profiling interrupt frequency. |
fea681da MK |
1378 | .TP |
1379 | .I /proc/scsi | |
59a40ed7 MK |
1380 | A directory with the |
1381 | .I scsi | |
1382 | mid-level pseudo-file and various SCSI low-level | |
2990d781 MK |
1383 | driver directories, |
1384 | which contain a file for each SCSI host in this system, all of | |
c13182ef MK |
1385 | which give the status of some part of the SCSI IO subsystem. |
1386 | These files contain ASCII structures and are, therefore, readable with | |
2990d781 | 1387 | .BR cat (1). |
2dad4c59 | 1388 | .IP |
c13182ef | 1389 | You can also write to some of the files to reconfigure the subsystem or |
59a40ed7 | 1390 | switch certain features on or off. |
fea681da MK |
1391 | .TP |
1392 | .I /proc/scsi/scsi | |
c13182ef | 1393 | This is a listing of all SCSI devices known to the kernel. |
59a40ed7 | 1394 | The listing is similar to the one seen during bootup. |
184d797d | 1395 | scsi currently supports only the \fIadd\-single\-device\fP command which |
59a40ed7 | 1396 | allows root to add a hotplugged device to the list of known devices. |
2dad4c59 | 1397 | .IP |
59a40ed7 | 1398 | The command |
37d5e699 | 1399 | .IP |
59a40ed7 | 1400 | .in +4n |
37d5e699 | 1401 | .EX |
b957f81f | 1402 | echo \[aq]scsi add\-single\-device 1 0 5 0\[aq] > /proc/scsi/scsi |
37d5e699 | 1403 | .EE |
59a40ed7 | 1404 | .in |
37d5e699 | 1405 | .IP |
c13182ef MK |
1406 | will cause |
1407 | host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0. | |
1408 | If there | |
fea681da MK |
1409 | is already a device known on this address or the address is invalid, an |
1410 | error will be returned. | |
1411 | .TP | |
1ae6b2c7 AC |
1412 | .IR /proc/scsi/ drivername |
1413 | \fIdrivername\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740, | |
c13182ef | 1414 | aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic, |
184d797d | 1415 | scsi_debug, seagate, t128, u15\-24f, ultrastore, or wd7000. |
c13182ef | 1416 | These directories show up for all drivers that registered at least one |
59a40ed7 | 1417 | SCSI HBA. |
c13182ef | 1418 | Every directory contains one file per registered host. |
59a40ed7 | 1419 | Every host-file is named after the number the host was assigned during |
c13182ef | 1420 | initialization. |
2dad4c59 | 1421 | .IP |
c13182ef | 1422 | Reading these files will usually show driver and host configuration, |
f78ed33a | 1423 | statistics, and so on. |
2dad4c59 | 1424 | .IP |
fea681da MK |
1425 | Writing to these files allows different things on different hosts. |
1426 | For example, with the \fIlatency\fP and \fInolatency\fP commands, | |
1427 | root can switch on and off command latency measurement code in the | |
c13182ef MK |
1428 | eata_dma driver. |
1429 | With the \fIlockup\fP and \fIunlock\fP commands, | |
1430 | root can control bus lockups simulated by the scsi_debug driver. | |
fea681da MK |
1431 | .TP |
1432 | .I /proc/self | |
59a40ed7 MK |
1433 | This directory refers to the process accessing the |
1434 | .I /proc | |
9ee4a2b6 | 1435 | filesystem, |
59a40ed7 MK |
1436 | and is identical to the |
1437 | .I /proc | |
1438 | directory named by the process ID of the same process. | |
fea681da MK |
1439 | .TP |
1440 | .I /proc/slabinfo | |
c13182ef | 1441 | Information about kernel caches. |
c13182ef | 1442 | See |
fea681da MK |
1443 | .BR slabinfo (5) |
1444 | for details. | |
1445 | .TP | |
1446 | .I /proc/stat | |
c13182ef MK |
1447 | kernel/system statistics. |
1448 | Varies with architecture. | |
1449 | Common | |
fea681da MK |
1450 | entries include: |
1451 | .RS | |
1452 | .TP | |
46f6dbe8 ES |
1453 | .I cpu 10132153 290696 3084719 46828483 16683 0 25195 0 175628 0 |
1454 | .TQ | |
1455 | .I cpu0 1393280 32966 572056 13343292 6130 0 17875 0 23933 0 | |
bfbfcd18 | 1456 | The amount of time, measured in units of |
268f000b | 1457 | USER_HZ (1/100ths of a second on most architectures, use |
1ae6b2c7 | 1458 | .I sysconf(_SC_CLK_TCK) |
268f000b | 1459 | to obtain the right value), |
b81087ab | 1460 | .\" 1024 on Alpha and ia64 |
46f6dbe8 ES |
1461 | that the system ("cpu" line) or the specific CPU ("cpu\fIN\fR" line) |
1462 | spent in various states: | |
ae3b8047 MK |
1463 | .RS |
1464 | .TP | |
1465 | .I user | |
ea0841f6 | 1466 | (1) Time spent in user mode. |
ae3b8047 MK |
1467 | .TP |
1468 | .I nice | |
0633f951 | 1469 | (2) Time spent in user mode with low priority (nice). |
9f1b9726 | 1470 | .TP |
ae3b8047 | 1471 | .I system |
0633f951 | 1472 | (3) Time spent in system mode. |
ae3b8047 MK |
1473 | .TP |
1474 | .I idle | |
ea0841f6 | 1475 | (4) Time spent in the idle task. |
bea08fec | 1476 | .\" FIXME . Actually, the following info about the /proc/stat 'cpu' field |
b324e17d | 1477 | .\" does not seem to be quite right (at least in Linux 2.6.12 or Linux 3.6): |
e04a1f93 MK |
1478 | .\" the idle time in /proc/uptime does not quite match this value |
1479 | This value should be USER_HZ times the | |
4cb1deb7 MK |
1480 | second entry in the |
1481 | .I /proc/uptime | |
1482 | pseudo-file. | |
ae3b8047 MK |
1483 | .TP |
1484 | .IR iowait " (since Linux 2.5.41)" | |
ea0841f6 | 1485 | (5) Time waiting for I/O to complete. |
e0a73a31 MK |
1486 | This value is not reliable, for the following reasons: |
1487 | .\" See kernel commit 9c240d757658a3ae9968dd309e674c61f07c7f48 | |
1488 | .RS | |
cdede5cd | 1489 | .IP \[bu] 3 |
e0a73a31 MK |
1490 | The CPU will not wait for I/O to complete; |
1491 | iowait is the time that a task is waiting for I/O to complete. | |
1492 | When a CPU goes into idle state for outstanding task I/O, | |
1493 | another task will be scheduled on this CPU. | |
cdede5cd | 1494 | .IP \[bu] |
e0a73a31 MK |
1495 | On a multi-core CPU, |
1496 | the task waiting for I/O to complete is not running on any CPU, | |
1497 | so the iowait of each CPU is difficult to calculate. | |
cdede5cd | 1498 | .IP \[bu] |
e0a73a31 MK |
1499 | The value in this field may |
1500 | .I decrease | |
1501 | in certain conditions. | |
2d3fb75b | 1502 | .RE |
ae3b8047 | 1503 | .TP |
d6bec36e MK |
1504 | .IR irq " (since Linux 2.6.0)" |
1505 | .\" Precisely: Linux 2.6.0-test4 | |
ea0841f6 | 1506 | (6) Time servicing interrupts. |
ae3b8047 | 1507 | .TP |
c7169ee5 | 1508 | .IR softirq " (since Linux 2.6.0)" |
d6bec36e | 1509 | .\" Precisely: Linux 2.6.0-test4 |
ea0841f6 | 1510 | (7) Time servicing softirqs. |
ae3b8047 MK |
1511 | .TP |
1512 | .IR steal " (since Linux 2.6.11)" | |
ea0841f6 | 1513 | (8) Stolen time, which is the time spent in other operating systems when |
9de1f6cc | 1514 | running in a virtualized environment |
ae3b8047 MK |
1515 | .TP |
1516 | .IR guest " (since Linux 2.6.24)" | |
0633f951 | 1517 | (9) Time spent running a virtual CPU for guest |
afef1764 | 1518 | operating systems under the control of the Linux kernel. |
14c06953 | 1519 | .\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de |
d4fd4120 MK |
1520 | .TP |
1521 | .IR guest_nice " (since Linux 2.6.33)" | |
1522 | .\" commit ce0e7b28fb75cb003cfc8d0238613aaf1c55e797 | |
1523 | (10) Time spent running a niced guest (virtual CPU for guest | |
1524 | operating systems under the control of the Linux kernel). | |
ae3b8047 | 1525 | .RE |
fea681da MK |
1526 | .TP |
1527 | \fIpage 5741 1808\fP | |
1528 | The number of pages the system paged in and the number that were paged | |
1529 | out (from disk). | |
1530 | .TP | |
1531 | \fIswap 1 0\fP | |
1532 | The number of swap pages that have been brought in and out. | |
1533 | .TP | |
bea08fec | 1534 | .\" FIXME . The following is not the full picture for the 'intr' of |
777f5a9e | 1535 | .\" /proc/stat on 2.6: |
fea681da | 1536 | \fIintr 1462898\fP |
bfbfcd18 MK |
1537 | This line shows counts of interrupts serviced since boot time, |
1538 | for each of the possible system interrupts. | |
d63ff76e | 1539 | The first column is the total of all interrupts serviced |
d6a56978 MK |
1540 | including unnumbered architecture specific interrupts; |
1541 | each subsequent column is the total for that particular numbered interrupt. | |
d63ff76e | 1542 | Unnumbered interrupts are not shown, only summed into the total. |
fea681da MK |
1543 | .TP |
1544 | \fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP... | |
636297e9 | 1545 | (major,disk_idx):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written) |
bfbfcd18 MK |
1546 | .br |
1547 | (Linux 2.4 only) | |
fea681da MK |
1548 | .TP |
1549 | \fIctxt 115315\fP | |
1550 | The number of context switches that the system underwent. | |
1551 | .TP | |
1552 | \fIbtime 769041601\fP | |
f49c451a | 1553 | boot time, in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). |
fea681da MK |
1554 | .TP |
1555 | \fIprocesses 86031\fP | |
1556 | Number of forks since boot. | |
bfbfcd18 MK |
1557 | .TP |
1558 | \fIprocs_running 6\fP | |
1559 | Number of processes in runnable state. | |
5fab2e7c | 1560 | (Linux 2.5.45 onward.) |
bfbfcd18 MK |
1561 | .TP |
1562 | \fIprocs_blocked 2\fP | |
1563 | Number of processes blocked waiting for I/O to complete. | |
5fab2e7c | 1564 | (Linux 2.5.45 onward.) |
76f6f102 ES |
1565 | .TP |
1566 | .I softirq 229245889 94 60001584 13619 5175704 2471304 28 51212741 59130143 0 51240672 | |
1567 | .\" commit d3d64df21d3d0de675a0d3ffa7c10514f3644b30 | |
1568 | This line shows the number of softirq for all CPUs. | |
1569 | The first column is the total of all softirqs and | |
1570 | each subsequent column is the total for particular softirq. | |
d7f23d0b | 1571 | (Linux 2.6.31 onward.) |
fea681da MK |
1572 | .RE |
1573 | .TP | |
1574 | .I /proc/swaps | |
c13182ef MK |
1575 | Swap areas in use. |
1576 | See also | |
fea681da MK |
1577 | .BR swapon (8). |
1578 | .TP | |
1579 | .I /proc/sys | |
b324e17d | 1580 | This directory (present since Linux 1.3.57) contains a number of files |
fea681da | 1581 | and subdirectories corresponding to kernel variables. |
13648a9c | 1582 | These variables can be read and in some cases modified using |
9ee4a2b6 | 1583 | the \fI/proc\fP filesystem, and the (deprecated) |
fea681da | 1584 | .BR sysctl (2) |
c13182ef | 1585 | system call. |
2dad4c59 | 1586 | .IP |
b957f81f | 1587 | String values may be terminated by either \[aq]\e0\[aq] or \[aq]\en\[aq]. |
2dad4c59 | 1588 | .IP |
84ff8c1e | 1589 | Integer and long values may be written either in decimal or in |
0629df8b | 1590 | hexadecimal notation (e.g., 0x3FFF). |
e8aa7100 MK |
1591 | When writing multiple integer or long values, these may be separated |
1592 | by any of the following whitespace characters: | |
b957f81f | 1593 | \[aq]\ \[aq], \[aq]\et\[aq], or \[aq]\en\[aq]. |
e8aa7100 | 1594 | Using other separators leads to the error |
84ff8c1e | 1595 | .BR EINVAL . |
fea681da | 1596 | .TP |
6ab7c0aa | 1597 | .IR /proc/sys/abi " (since Linux 2.4.10)" |
fea681da | 1598 | This directory may contain files with application binary information. |
6ab7c0aa | 1599 | .\" On some systems, it is not present. |
66a9882e | 1600 | See the Linux kernel source file |
8a5fc410 MK |
1601 | .I Documentation/sysctl/abi.rst |
1602 | (or | |
6ab7c0aa | 1603 | .I Documentation/sysctl/abi.txt |
8a5fc410 | 1604 | before Linux 5.3) |
6ab7c0aa | 1605 | for more information. |
fea681da MK |
1606 | .TP |
1607 | .I /proc/sys/debug | |
1608 | This directory may be empty. | |
1609 | .TP | |
1610 | .I /proc/sys/dev | |
e2badfdf | 1611 | This directory contains device-specific information (e.g., |
9a67332e | 1612 | .IR dev/cdrom/info ). |
fea681da MK |
1613 | On |
1614 | some systems, it may be empty. | |
1615 | .TP | |
1616 | .I /proc/sys/fs | |
49236d3c | 1617 | This directory contains the files and subdirectories for kernel variables |
9ee4a2b6 | 1618 | related to filesystems. |
fea681da | 1619 | .TP |
b49c2acb | 1620 | .IR /proc/sys/fs/aio\-max\-nr " and " /proc/sys/fs/aio\-nr " (since Linux 2.6.4)" |
cd415e73 | 1621 | .I aio\-nr |
9f51687a MK |
1622 | is the running total of the number of events specified by |
1623 | .BR io_setup (2) | |
1624 | calls for all currently active AIO contexts. | |
1625 | If | |
cd415e73 | 1626 | .I aio\-nr |
9f51687a | 1627 | reaches |
cd415e73 | 1628 | .IR aio\-max\-nr , |
9f51687a MK |
1629 | then |
1630 | .BR io_setup (2) | |
1631 | will fail with the error | |
1632 | .BR EAGAIN . | |
1633 | Raising | |
cd415e73 | 1634 | .I aio\-max\-nr |
9f51687a MK |
1635 | does not result in the preallocation or resizing |
1636 | of any kernel data structures. | |
1637 | .TP | |
fea681da | 1638 | .I /proc/sys/fs/binfmt_misc |
c13182ef | 1639 | Documentation for files in this directory can be found |
a2923df0 | 1640 | in the Linux kernel source in the file |
1ae6b2c7 | 1641 | .I Documentation/admin\-guide/binfmt\-misc.rst |
a2923df0 | 1642 | (or in |
1ae6b2c7 | 1643 | .I Documentation/binfmt_misc.txt |
a2923df0 | 1644 | on older kernels). |
fea681da | 1645 | .TP |
184d797d | 1646 | .IR /proc/sys/fs/dentry\-state " (since Linux 2.2)" |
59a40ed7 MK |
1647 | This file contains information about the status of the |
1648 | directory cache (dcache). | |
1649 | The file contains six numbers, | |
1ae6b2c7 AC |
1650 | .IR nr_dentry , |
1651 | .IR nr_unused , | |
1652 | .I age_limit | |
1653 | (age in seconds), | |
59a40ed7 | 1654 | .I want_pages |
fea681da | 1655 | (pages requested by system) and two dummy values. |
59a40ed7 | 1656 | .RS |
cdede5cd | 1657 | .IP \[bu] 3 |
59a40ed7 MK |
1658 | .I nr_dentry |
1659 | is the number of allocated dentries (dcache entries). | |
1660 | This field is unused in Linux 2.2. | |
cdede5cd | 1661 | .IP \[bu] |
59a40ed7 MK |
1662 | .I nr_unused |
1663 | is the number of unused dentries. | |
cdede5cd | 1664 | .IP \[bu] |
59a40ed7 | 1665 | .I age_limit |
b324e17d | 1666 | .\" looks like this is unused in Linux 2.2 to Linux 2.6 |
59a40ed7 MK |
1667 | is the age in seconds after which dcache entries |
1668 | can be reclaimed when memory is short. | |
cdede5cd | 1669 | .IP \[bu] |
59a40ed7 | 1670 | .I want_pages |
b324e17d | 1671 | .\" looks like this is unused in Linux 2.2 to Linux 2.6 |
c7094399 | 1672 | is nonzero when the kernel has called shrink_dcache_pages() and the |
fea681da | 1673 | dcache isn't pruned yet. |
59a40ed7 | 1674 | .RE |
fea681da | 1675 | .TP |
184d797d | 1676 | .I /proc/sys/fs/dir\-notify\-enable |
fea681da MK |
1677 | This file can be used to disable or enable the |
1678 | .I dnotify | |
1679 | interface described in | |
1680 | .BR fcntl (2) | |
1681 | on a system-wide basis. | |
1682 | A value of 0 in this file disables the interface, | |
1683 | and a value of 1 enables it. | |
1684 | .TP | |
184d797d | 1685 | .I /proc/sys/fs/dquot\-max |
fea681da MK |
1686 | This file shows the maximum number of cached disk quota entries. |
1687 | On some (2.4) systems, it is not present. | |
1688 | If the number of free cached disk quota entries is very low and | |
1689 | you have some awesome number of simultaneous system users, | |
1690 | you might want to raise the limit. | |
1691 | .TP | |
184d797d | 1692 | .I /proc/sys/fs/dquot\-nr |
fea681da MK |
1693 | This file shows the number of allocated disk quota |
1694 | entries and the number of free disk quota entries. | |
1695 | .TP | |
24cb4a4b | 1696 | .IR /proc/sys/fs/epoll " (since Linux 2.6.28)" |
242b46af MK |
1697 | This directory contains the file |
1698 | .IR max_user_watches , | |
24cb4a4b MK |
1699 | which can be used to limit the amount of kernel memory consumed by the |
1700 | .I epoll | |
1701 | interface. | |
1702 | For further details, see | |