1 .\" Copyright (c) 2001 Andreas Dilger (adilger@turbolinux.com)
2 .\" and Copyright (c) 2017 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .TH SLABINFO 5 2021-03-22 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
8 slabinfo \- kernel slab allocator statistics
14 Frequently used objects in the Linux kernel
15 (buffer heads, inodes, dentries, etc.)
19 gives statistics on these caches.
20 The following (edited) output shows an example of the
21 contents of this file:
24 $ \fBsudo cat /proc/slabinfo\fP
25 slabinfo \- version: 2.1
26 # name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> ...
27 sigqueue 100 100 160 25 1 : tunables 0 0 0 : slabdata 4 4 0
28 sighand_cache 355 405 2112 15 8 : tunables 0 0 0 : slabdata 27 27 0
29 kmalloc\-8192 96 96 8192 4 8 : tunables 0 0 0 : slabdata 24 24 0
33 The first line of output includes a version number,
34 which allows an application that is reading the file to handle changes
36 (See VERSIONS, below.)
37 The next line lists the names of the columns in the remaining lines.
39 Each of the remaining lines displays information about a specified cache.
40 Following the cache name,
41 the output shown in each line shows three components for each cache:
49 The statistics are as follows:
52 The number of objects that are currently active (i.e., in use).
55 The total number of allocated objects
56 (i.e., objects that are both in use and not in use).
59 The size of objects in this slab, in bytes.
62 The number of objects stored in each slab.
65 The number of pages allocated for each slab.
69 entries in each line show tunable parameters for the corresponding cache.
70 When using the default SLUB allocator, there are no tunables, the
72 file is not writable, and the value 0 is shown in these fields.
73 When using the older SLAB allocator,
74 the tunables for a particular cache can be set by writing
75 lines of the following form to
80 # \fBecho \(aqname limit batchcount sharedfactor\(aq > /proc/slabinfo\fP
86 is the cache name, and
91 are integers defining new values for the corresponding tunables.
94 value should be a positive value,
96 should be a positive value that is less than or equal to
100 should be nonnegative.
101 If any of the specified values is invalid,
102 the cache settings are left unchanged.
106 entries in each line contain the following fields:
109 The maximum number of objects that will be cached.
110 .\" https://lwn.net/Articles/56360/
111 .\" This is the limit on the number of free objects that can be stored
112 .\" in the per-CPU free list for this slab cache.
115 On SMP systems, this specifies the number of objects to transfer at one time
116 when refilling the available object list.
117 .\" https://lwn.net/Articles/56360/
118 .\" On SMP systems, when we refill the available object list, instead
119 .\" of doing one object at a time, we do batch-count objects at a time.
127 entries in each line contain the following fields:
130 The number of active slabs.
133 The total number of slabs.
138 Note that because of object alignment and slab cache overhead,
139 objects are not normally packed tightly into pages.
140 Pages with even one in-use object are considered in-use and cannot be
143 Kernels configured with
145 will also have additional statistics fields in each line,
146 and the first line of the file will contain the string "(statistics)".
147 The statistics field include : the high water mark of active
148 objects; the number of times objects have been allocated;
149 the number of times the cache has grown (new pages added
150 to this cache); the number of times the cache has been
151 reaped (unused pages removed from this cache); and the
152 number of times there was an error allocating new pages
155 .\" SMP systems will also have "(SMP)" in the first line of
156 .\" output, and will have two additional columns for each slab,
157 .\" reporting the slab allocation policy for the CPU-local
158 .\" cache (to reduce the need for inter-CPU synchronization
159 .\" when allocating objects from the cache).
160 .\" The first column is the per-CPU limit: the maximum number of objects that
161 .\" will be cached for each CPU.
162 .\" The second column is the
163 .\" batchcount: the maximum number of free objects in the
164 .\" global cache that will be transferred to the per-CPU cache
165 .\" if it is empty, or the number of objects to be returned
166 .\" to the global cache if the per-CPU cache is full.
168 .\" If both slab cache statistics and SMP are defined, there
169 .\" will be four additional columns, reporting the per-CPU
170 .\" cache statistics.
171 .\" The first two are the per-CPU cache
172 .\" allocation hit and miss counts: the number of times an
173 .\" object was or was not available in the per-CPU cache
175 .\" The next two are the per-CPU cache free
176 .\" hit and miss counts: the number of times a freed object
177 .\" could or could not fit within the per-CPU cache limit,
178 .\" before flushing objects to the global cache.
182 file first appeared in Linux 2.1.23.
183 The file is versioned,
184 and over time there have been a number of versions with different layouts:
187 Present throughout the Linux 2.2.x kernel series.
190 Present in the Linux 2.4.x kernel series.
191 .\" First appeared in 2.4.0-test3
194 A format that was briefly present in the Linux 2.5 development series.
195 .\" from 2.5.45 to 2.5.70
198 Present in Linux 2.6.x kernels up to and including Linux 2.6.9.
199 .\" First appeared in 2.5.71
202 The current format, which first appeared in Linux 2.6.10.
204 Only root can read and (if the kernel was configured with
210 The total amount of memory allocated to the SLAB/SLUB cache is shown in the
217 The kernel source file
218 .I Documentation/vm/slub.txt
220 .IR tools/vm/slabinfo.c .