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