1SLABINFO(5) Linux Programmer's Manual SLABINFO(5)
2
3
4
6 /proc/slabinfo - Kernel slab allocator statistics
7
9 cat /proc/slabinfo
10
12 Frequently used objects in the Linux kernel (buffer heads, inodes, den‐
13 tries, etc.) have their own cache. The file /proc/slabinfo gives sta‐
14 tistics. For example:
15
16 % cat /proc/slabinfo
17 slabinfo - version: 1.1
18 kmem_cache 60 78 100 2 2 1
19 blkdev_requests 5120 5120 96 128 128 1
20 mnt_cache 20 40 96 1 1 1
21 inode_cache 7005 14792 480 1598 1849 1
22 dentry_cache 5469 5880 128 183 196 1
23 filp 726 760 96 19 19 1
24 buffer_head 67131 71240 96 1776 1781 1
25 vm_area_struct 1204 1652 64 23 28 1
26 ...
27 size-8192 1 17 8192 1 17 2
28 size-4096 41 73 4096 41 73 1
29 ...
30
31 For each slab cache, the cache name, the number of currently active
32 objects, the total number of available objects, the size of each object
33 in bytes, the number of pages with at least one active object, the
34 total number of allocated pages, and the number of pages per slab are
35 given.
36
37 Note that because of object alignment and slab cache overhead, objects
38 are not normally packed tightly into pages. Pages with even one in-use
39 object are considered in-use and cannot be freed.
40
41 Kernels compiled with slab cache statistics will also have "(statis‐
42 tics)" in the first line of output, and will have 5 additional columns,
43 namely: the high water mark of active objects; the number of times
44 objects have been allocated; the number of times the cache has grown
45 (new pages added to this cache); the number of times the cache has been
46 reaped (unused pages removed from this cache); and the number of times
47 there was an error allocating new pages to this cache. If slab cache
48 statistics are not enabled for this kernel, these columns will not be
49 shown.
50
51 SMP systems will also have "(SMP)" in the first line of output, and
52 will have two additional columns for each slab, reporting the slab
53 allocation policy for the CPU-local cache (to reduce the need for
54 inter-CPU synchronization when allocating objects from the cache). The
55 first column is the per-CPU limit: the maximum number of objects that
56 will be cached for each CPU. The second column is the batchcount: the
57 maximum number of free objects in the global cache that will be trans‐
58 ferred to the per-CPU cache if it is empty, or the number of objects to
59 be returned to the global cache if the per-CPU cache is full.
60
61 If both slab cache statistics and SMP are defined, there will be four
62 additional columns, reporting the per-CPU cache statistics. The first
63 two are the per-CPU cache allocation hit and miss counts: the number of
64 times an object was or was not available in the per-CPU cache for allo‐
65 cation. The next two are the per-CPU cache free hit and miss counts:
66 the number of times a freed object could or could not fit within the
67 per-CPU cache limit, before flushing objects to the global cache.
68
69 It is possible to tune the SMP per-CPU slab cache limit and batchcount
70 via:
71
72 echo "cache_name limit batchcount" > /proc/slabinfo
73
75 <linux/slab.h>
76
78 /proc/slabinfo exists since Linux 2.1.23. SMP per-CPU caches exist
79 since Linux 2.4.0-test3.
80
82 Since Linux 2.6.16 the file /proc/slabinfo is only present if the CON‐
83 FIG_SLAB kernel configuration option is enabled.
84
86 This page is part of release 3.25 of the Linux man-pages project. A
87 description of the project, and information about reporting bugs, can
88 be found at http://www.kernel.org/doc/man-pages/.
89
90
91
92 2007-09-30 SLABINFO(5)