diff options
Diffstat (limited to 'Documentation/filesystems/proc.txt')
-rw-r--r-- | Documentation/filesystems/proc.txt | 76 |
1 files changed, 67 insertions, 9 deletions
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 2c48f945546b..1e359b62c40a 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -38,6 +38,7 @@ Table of Contents | |||
38 | 3.3 /proc/<pid>/io - Display the IO accounting fields | 38 | 3.3 /proc/<pid>/io - Display the IO accounting fields |
39 | 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings | 39 | 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings |
40 | 3.5 /proc/<pid>/mountinfo - Information about mounts | 40 | 3.5 /proc/<pid>/mountinfo - Information about mounts |
41 | 3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm | ||
41 | 42 | ||
42 | 43 | ||
43 | ------------------------------------------------------------------------------ | 44 | ------------------------------------------------------------------------------ |
@@ -163,6 +164,7 @@ read the file /proc/PID/status: | |||
163 | VmExe: 68 kB | 164 | VmExe: 68 kB |
164 | VmLib: 1412 kB | 165 | VmLib: 1412 kB |
165 | VmPTE: 20 kb | 166 | VmPTE: 20 kb |
167 | VmSwap: 0 kB | ||
166 | Threads: 1 | 168 | Threads: 1 |
167 | SigQ: 0/28578 | 169 | SigQ: 0/28578 |
168 | SigPnd: 0000000000000000 | 170 | SigPnd: 0000000000000000 |
@@ -176,7 +178,6 @@ read the file /proc/PID/status: | |||
176 | CapBnd: ffffffffffffffff | 178 | CapBnd: ffffffffffffffff |
177 | voluntary_ctxt_switches: 0 | 179 | voluntary_ctxt_switches: 0 |
178 | nonvoluntary_ctxt_switches: 1 | 180 | nonvoluntary_ctxt_switches: 1 |
179 | Stack usage: 12 kB | ||
180 | 181 | ||
181 | This shows you nearly the same information you would get if you viewed it with | 182 | This shows you nearly the same information you would get if you viewed it with |
182 | the ps command. In fact, ps uses the proc file system to obtain its | 183 | the ps command. In fact, ps uses the proc file system to obtain its |
@@ -188,7 +189,13 @@ memory usage. Its seven fields are explained in Table 1-3. The stat file | |||
188 | contains details information about the process itself. Its fields are | 189 | contains details information about the process itself. Its fields are |
189 | explained in Table 1-4. | 190 | explained in Table 1-4. |
190 | 191 | ||
191 | Table 1-2: Contents of the statm files (as of 2.6.30-rc7) | 192 | (for SMP CONFIG users) |
193 | For making accounting scalable, RSS related information are handled in | ||
194 | asynchronous manner and the vaule may not be very precise. To see a precise | ||
195 | snapshot of a moment, you can see /proc/<pid>/smaps file and scan page table. | ||
196 | It's slow but very precise. | ||
197 | |||
198 | Table 1-2: Contents of the status files (as of 2.6.30-rc7) | ||
192 | .............................................................................. | 199 | .............................................................................. |
193 | Field Content | 200 | Field Content |
194 | Name filename of the executable | 201 | Name filename of the executable |
@@ -213,6 +220,7 @@ Table 1-2: Contents of the statm files (as of 2.6.30-rc7) | |||
213 | VmExe size of text segment | 220 | VmExe size of text segment |
214 | VmLib size of shared library code | 221 | VmLib size of shared library code |
215 | VmPTE size of page table entries | 222 | VmPTE size of page table entries |
223 | VmSwap size of swap usage (the number of referred swapents) | ||
216 | Threads number of threads | 224 | Threads number of threads |
217 | SigQ number of signals queued/max. number for queue | 225 | SigQ number of signals queued/max. number for queue |
218 | SigPnd bitmap of pending signals for the thread | 226 | SigPnd bitmap of pending signals for the thread |
@@ -230,7 +238,6 @@ Table 1-2: Contents of the statm files (as of 2.6.30-rc7) | |||
230 | Mems_allowed_list Same as previous, but in "list format" | 238 | Mems_allowed_list Same as previous, but in "list format" |
231 | voluntary_ctxt_switches number of voluntary context switches | 239 | voluntary_ctxt_switches number of voluntary context switches |
232 | nonvoluntary_ctxt_switches number of non voluntary context switches | 240 | nonvoluntary_ctxt_switches number of non voluntary context switches |
233 | Stack usage: stack usage high water mark (round up to page size) | ||
234 | .............................................................................. | 241 | .............................................................................. |
235 | 242 | ||
236 | Table 1-3: Contents of the statm files (as of 2.6.8-rc3) | 243 | Table 1-3: Contents of the statm files (as of 2.6.8-rc3) |
@@ -309,7 +316,7 @@ address perms offset dev inode pathname | |||
309 | 08049000-0804a000 rw-p 00001000 03:00 8312 /opt/test | 316 | 08049000-0804a000 rw-p 00001000 03:00 8312 /opt/test |
310 | 0804a000-0806b000 rw-p 00000000 00:00 0 [heap] | 317 | 0804a000-0806b000 rw-p 00000000 00:00 0 [heap] |
311 | a7cb1000-a7cb2000 ---p 00000000 00:00 0 | 318 | a7cb1000-a7cb2000 ---p 00000000 00:00 0 |
312 | a7cb2000-a7eb2000 rw-p 00000000 00:00 0 [threadstack:001ff4b4] | 319 | a7cb2000-a7eb2000 rw-p 00000000 00:00 0 |
313 | a7eb2000-a7eb3000 ---p 00000000 00:00 0 | 320 | a7eb2000-a7eb3000 ---p 00000000 00:00 0 |
314 | a7eb3000-a7ed5000 rw-p 00000000 00:00 0 | 321 | a7eb3000-a7ed5000 rw-p 00000000 00:00 0 |
315 | a7ed5000-a8008000 r-xp 00000000 03:00 4222 /lib/libc.so.6 | 322 | a7ed5000-a8008000 r-xp 00000000 03:00 4222 /lib/libc.so.6 |
@@ -345,7 +352,6 @@ is not associated with a file: | |||
345 | [stack] = the stack of the main process | 352 | [stack] = the stack of the main process |
346 | [vdso] = the "virtual dynamic shared object", | 353 | [vdso] = the "virtual dynamic shared object", |
347 | the kernel system call handler | 354 | the kernel system call handler |
348 | [threadstack:xxxxxxxx] = the stack of the thread, xxxxxxxx is the stack size | ||
349 | 355 | ||
350 | or if empty, the mapping is anonymous. | 356 | or if empty, the mapping is anonymous. |
351 | 357 | ||
@@ -431,6 +437,7 @@ Table 1-5: Kernel info in /proc | |||
431 | modules List of loaded modules | 437 | modules List of loaded modules |
432 | mounts Mounted filesystems | 438 | mounts Mounted filesystems |
433 | net Networking info (see text) | 439 | net Networking info (see text) |
440 | pagetypeinfo Additional page allocator information (see text) (2.5) | ||
434 | partitions Table of partitions known to the system | 441 | partitions Table of partitions known to the system |
435 | pci Deprecated info of PCI bus (new way -> /proc/bus/pci/, | 442 | pci Deprecated info of PCI bus (new way -> /proc/bus/pci/, |
436 | decoupled by lspci (2.4) | 443 | decoupled by lspci (2.4) |
@@ -585,7 +592,7 @@ Node 0, zone DMA 0 4 5 4 4 3 ... | |||
585 | Node 0, zone Normal 1 0 0 1 101 8 ... | 592 | Node 0, zone Normal 1 0 0 1 101 8 ... |
586 | Node 0, zone HighMem 2 0 0 1 1 0 ... | 593 | Node 0, zone HighMem 2 0 0 1 1 0 ... |
587 | 594 | ||
588 | Memory fragmentation is a problem under some workloads, and buddyinfo is a | 595 | External fragmentation is a problem under some workloads, and buddyinfo is a |
589 | useful tool for helping diagnose these problems. Buddyinfo will give you a | 596 | useful tool for helping diagnose these problems. Buddyinfo will give you a |
590 | clue as to how big an area you can safely allocate, or why a previous | 597 | clue as to how big an area you can safely allocate, or why a previous |
591 | allocation failed. | 598 | allocation failed. |
@@ -595,6 +602,48 @@ available. In this case, there are 0 chunks of 2^0*PAGE_SIZE available in | |||
595 | ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE | 602 | ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE |
596 | available in ZONE_NORMAL, etc... | 603 | available in ZONE_NORMAL, etc... |
597 | 604 | ||
605 | More information relevant to external fragmentation can be found in | ||
606 | pagetypeinfo. | ||
607 | |||
608 | > cat /proc/pagetypeinfo | ||
609 | Page block order: 9 | ||
610 | Pages per block: 512 | ||
611 | |||
612 | Free pages count per migrate type at order 0 1 2 3 4 5 6 7 8 9 10 | ||
613 | Node 0, zone DMA, type Unmovable 0 0 0 1 1 1 1 1 1 1 0 | ||
614 | Node 0, zone DMA, type Reclaimable 0 0 0 0 0 0 0 0 0 0 0 | ||
615 | Node 0, zone DMA, type Movable 1 1 2 1 2 1 1 0 1 0 2 | ||
616 | Node 0, zone DMA, type Reserve 0 0 0 0 0 0 0 0 0 1 0 | ||
617 | Node 0, zone DMA, type Isolate 0 0 0 0 0 0 0 0 0 0 0 | ||
618 | Node 0, zone DMA32, type Unmovable 103 54 77 1 1 1 11 8 7 1 9 | ||
619 | Node 0, zone DMA32, type Reclaimable 0 0 2 1 0 0 0 0 1 0 0 | ||
620 | Node 0, zone DMA32, type Movable 169 152 113 91 77 54 39 13 6 1 452 | ||
621 | Node 0, zone DMA32, type Reserve 1 2 2 2 2 0 1 1 1 1 0 | ||
622 | Node 0, zone DMA32, type Isolate 0 0 0 0 0 0 0 0 0 0 0 | ||
623 | |||
624 | Number of blocks type Unmovable Reclaimable Movable Reserve Isolate | ||
625 | Node 0, zone DMA 2 0 5 1 0 | ||
626 | Node 0, zone DMA32 41 6 967 2 0 | ||
627 | |||
628 | Fragmentation avoidance in the kernel works by grouping pages of different | ||
629 | migrate types into the same contiguous regions of memory called page blocks. | ||
630 | A page block is typically the size of the default hugepage size e.g. 2MB on | ||
631 | X86-64. By keeping pages grouped based on their ability to move, the kernel | ||
632 | can reclaim pages within a page block to satisfy a high-order allocation. | ||
633 | |||
634 | The pagetypinfo begins with information on the size of a page block. It | ||
635 | then gives the same type of information as buddyinfo except broken down | ||
636 | by migrate-type and finishes with details on how many page blocks of each | ||
637 | type exist. | ||
638 | |||
639 | If min_free_kbytes has been tuned correctly (recommendations made by hugeadm | ||
640 | from libhugetlbfs http://sourceforge.net/projects/libhugetlbfs/), one can | ||
641 | make an estimate of the likely number of huge pages that can be allocated | ||
642 | at a given point in time. All the "Movable" blocks should be allocatable | ||
643 | unless memory has been mlock()'d. Some of the Reclaimable blocks should | ||
644 | also be allocatable although a lot of filesystem metadata may have to be | ||
645 | reclaimed to achieve this. | ||
646 | |||
598 | .............................................................................. | 647 | .............................................................................. |
599 | 648 | ||
600 | meminfo: | 649 | meminfo: |
@@ -1072,7 +1121,8 @@ second). The meanings of the columns are as follows, from left to right: | |||
1072 | - irq: servicing interrupts | 1121 | - irq: servicing interrupts |
1073 | - softirq: servicing softirqs | 1122 | - softirq: servicing softirqs |
1074 | - steal: involuntary wait | 1123 | - steal: involuntary wait |
1075 | - guest: running a guest | 1124 | - guest: running a normal guest |
1125 | - guest_nice: running a niced guest | ||
1076 | 1126 | ||
1077 | The "intr" line gives counts of interrupts serviced since boot time, for each | 1127 | The "intr" line gives counts of interrupts serviced since boot time, for each |
1078 | of the possible system interrupts. The first column is the total of all | 1128 | of the possible system interrupts. The first column is the total of all |
@@ -1088,8 +1138,8 @@ The "processes" line gives the number of processes and threads created, which | |||
1088 | includes (but is not limited to) those created by calls to the fork() and | 1138 | includes (but is not limited to) those created by calls to the fork() and |
1089 | clone() system calls. | 1139 | clone() system calls. |
1090 | 1140 | ||
1091 | The "procs_running" line gives the number of processes currently running on | 1141 | The "procs_running" line gives the total number of threads that are |
1092 | CPUs. | 1142 | running or ready to run (i.e., the total number of runnable threads). |
1093 | 1143 | ||
1094 | The "procs_blocked" line gives the number of processes currently blocked, | 1144 | The "procs_blocked" line gives the number of processes currently blocked, |
1095 | waiting for I/O to complete. | 1145 | waiting for I/O to complete. |
@@ -1408,3 +1458,11 @@ For more information on mount propagation see: | |||
1408 | 1458 | ||
1409 | Documentation/filesystems/sharedsubtree.txt | 1459 | Documentation/filesystems/sharedsubtree.txt |
1410 | 1460 | ||
1461 | |||
1462 | 3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm | ||
1463 | -------------------------------------------------------- | ||
1464 | These files provide a method to access a tasks comm value. It also allows for | ||
1465 | a task to set its own or one of its thread siblings comm value. The comm value | ||
1466 | is limited in size compared to the cmdline value, so writing anything longer | ||
1467 | then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated | ||
1468 | comm value. | ||