]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) 2001 Andreas Dilger (adilger@turbolinux.com) |
2 | .\" | |
3 | .\" Permission is granted to make and distribute verbatim copies of this | |
4 | .\" manual provided the copyright notice and this permission notice are | |
5 | .\" preserved on all copies. | |
6 | .\" | |
7 | .\" Permission is granted to copy and distribute modified versions of this | |
8 | .\" manual under the conditions for verbatim copying, provided that the | |
9 | .\" entire resulting derived work is distributed under the terms of a | |
10 | .\" permission notice identical to this one. | |
11 | .\" | |
12 | .\" Since the Linux kernel and libraries are constantly changing, this | |
13 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
14 | .\" responsibility for errors or omissions, or for damages resulting from | |
15 | .\" the use of the information contained herein. The author(s) may not | |
16 | .\" have taken the same level of care in the production of this manual, | |
17 | .\" which is licensed free of charge, as they might when working | |
18 | .\" professionally. | |
19 | .\" | |
20 | .\" Formatted or processed versions of this manual, if unaccompanied by | |
21 | .\" the source, must acknowledge the copyright and authors of this work. | |
22 | .\" | |
23 | .TH SLABINFO 5 2001-06-19 "" "Linux manual" | |
24 | .SH NAME | |
25 | /proc/slabinfo \- Kernel slab allocator statistics | |
26 | .SH SYNOPSIS | |
27 | .B cat /proc/slabinfo | |
28 | .SH DESCRIPTION | |
29 | Frequently used objects in the Linux kernel | |
30 | (buffer heads, inodes, dentries, etc.) | |
31 | have their own cache. The file | |
32 | .I /proc/slabinfo | |
33 | gives statistics. For example: | |
34 | .LP | |
35 | .RS | |
36 | .nf | |
37 | % cat /proc/slabinfo | |
2bc2f479 | 38 | slabinfo \- version: 1.1 |
fea681da MK |
39 | kmem_cache 60 78 100 2 2 1 |
40 | blkdev_requests 5120 5120 96 128 128 1 | |
41 | mnt_cache 20 40 96 1 1 1 | |
42 | inode_cache 7005 14792 480 1598 1849 1 | |
43 | dentry_cache 5469 5880 128 183 196 1 | |
44 | filp 726 760 96 19 19 1 | |
45 | buffer_head 67131 71240 96 1776 1781 1 | |
46 | vm_area_struct 1204 1652 64 23 28 1 | |
47 | \&... | |
48 | size-8192 1 17 8192 1 17 2 | |
49 | size-4096 41 73 4096 41 73 1 | |
50 | \&... | |
51 | .fi | |
52 | .RE | |
53 | .LP | |
54 | For each slab cache, the cache name, the number of currently | |
55 | active objects, the total number of available objects, the | |
56 | size of each object in bytes, the number of pages with at | |
57 | least one active object, the total number of allocated pages, | |
58 | and the number of pages per slab are given. | |
59 | ||
60 | Note that because of object alignment and slab cache overhead, | |
61 | objects are not normally packed tightly into pages. Pages with | |
62 | even one in-use object are considered in-use and cannot be | |
63 | freed. | |
64 | ||
65 | Kernels compiled with slab cache statistics will also have | |
66 | "(statistics)" in the first line of output, and will have 5 | |
67 | additional columns, namely: the high water mark of active | |
68 | objects; the number of times objects have been allocated; | |
69 | the number of times the cache has grown (new pages added | |
70 | to this cache); the number of times the cache has been | |
71 | reaped (unused pages removed from this cache); and the | |
72 | number of times there was an error allocating new pages | |
73 | to this cache. If slab cache statistics are not enabled | |
74 | for this kernel, these columns will not be shown. | |
75 | ||
76 | SMP systems will also have "(SMP)" in the first line of | |
77 | output, and will have two additional columns for each slab, | |
78 | reporting the slab allocation policy for the CPU-local | |
79 | cache (to reduce the need for inter-CPU synchronization | |
80 | when allocating objects from the cache). The first column | |
81 | is the per-CPU limit: the maximum number of objects that | |
82 | will be cached for each CPU. The second column is the | |
83 | batchcount: the maximum number of free objects in the | |
84 | global cache that will be transferred to the per-CPU cache | |
85 | if it is empty, or the number of objects to be returned | |
86 | to the global cache if the per-CPU cache is full. | |
87 | ||
88 | If both slab cache statistics and SMP are defined, there | |
89 | will be four additional columns, reporting the per-CPU | |
90 | cache statistics. The first two are the per-CPU cache | |
91 | allocation hit and miss counts: the number of times an | |
92 | object was or was not available in the per-CPU cache | |
93 | for allocation. The next two are the per-CPU cache free | |
94 | hit and miss counts: the number of times a freed object | |
95 | could or could not fit within the per-CPU cache limit, | |
96 | before flushing objects to the global cache. | |
97 | ||
98 | It is possible to tune the SMP per-CPU slab cache limit | |
99 | and batchcount via: | |
100 | ||
101 | .nf | |
102 | echo "\fIcache_name limit batchcount\fP" > /proc/slabinfo | |
103 | .fi | |
fea681da MK |
104 | .SH AVAILABILITY |
105 | .I /proc/slabinfo | |
106 | exists since Linux 2.1.23. | |
107 | SMP per-CPU caches exist since Linux 2.4.0-test3. | |
fea681da MK |
108 | .SH FILES |
109 | .I <linux/slab.h> |