1 .\" Copyright (c) 2001 Andreas Dilger (adilger@turbolinux.com)
2 .\" and Copyright (c) 2017 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
26 .TH SLABINFO 5 2021-03-22 "" "Linux Programmer's Manual"
28 slabinfo \- kernel slab allocator statistics
34 Frequently used objects in the Linux kernel
35 (buffer heads, inodes, dentries, etc.)
39 gives statistics on these caches.
40 The following (edited) output shows an example of the
41 contents of this file:
44 $ \fBsudo cat /proc/slabinfo\fP
45 slabinfo \- version: 2.1
46 # name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> ...
47 sigqueue 100 100 160 25 1 : tunables 0 0 0 : slabdata 4 4 0
48 sighand_cache 355 405 2112 15 8 : tunables 0 0 0 : slabdata 27 27 0
49 kmalloc\-8192 96 96 8192 4 8 : tunables 0 0 0 : slabdata 24 24 0
53 The first line of output includes a version number,
54 which allows an application that is reading the file to handle changes
56 (See VERSIONS, below.)
57 The next line lists the names of the columns in the remaining lines.
59 Each of the remaining lines displays information about a specified cache.
60 Following the cache name,
61 the output shown in each line shows three components for each cache:
69 The statistics are as follows:
72 The number of objects that are currently active (i.e., in use).
75 The total number of allocated objects
76 (i.e., objects that are both in use and not in use).
79 The size of objects in this slab, in bytes.
82 The number of objects stored in each slab.
85 The number of pages allocated for each slab.
89 entries in each line show tunable parameters for the corresponding cache.
90 When using the default SLUB allocator, there are no tunables, the
92 file is not writable, and the value 0 is shown in these fields.
93 When using the older SLAB allocator,
94 the tunables for a particular cache can be set by writing
95 lines of the following form to
100 # \fBecho \(aqname limit batchcount sharedfactor\(aq > /proc/slabinfo\fP
106 is the cache name, and
111 are integers defining new values for the corresponding tunables.
114 value should be a positive value,
116 should be a positive value that is less than or equal to
120 should be nonnegative.
121 If any of the specified values is invalid,
122 the cache settings are left unchanged.
126 entries in each line contain the following fields:
129 The maximum number of objects that will be cached.
130 .\" https://lwn.net/Articles/56360/
131 .\" This is the limit on the number of free objects that can be stored
132 .\" in the per-CPU free list for this slab cache.
135 On SMP systems, this specifies the number of objects to transfer at one time
136 when refilling the available object list.
137 .\" https://lwn.net/Articles/56360/
138 .\" On SMP systems, when we refill the available object list, instead
139 .\" of doing one object at a time, we do batch-count objects at a time.
147 entries in each line contain the following fields:
150 The number of active slabs.
153 The total number of slabs.
158 Note that because of object alignment and slab cache overhead,
159 objects are not normally packed tightly into pages.
160 Pages with even one in-use object are considered in-use and cannot be
163 Kernels configured with
165 will also have additional statistics fields in each line,
166 and the first line of the file will contain the string "(statistics)".
167 The statistics field include : the high water mark of active
168 objects; the number of times objects have been allocated;
169 the number of times the cache has grown (new pages added
170 to this cache); the number of times the cache has been
171 reaped (unused pages removed from this cache); and the
172 number of times there was an error allocating new pages
175 .\" SMP systems will also have "(SMP)" in the first line of
176 .\" output, and will have two additional columns for each slab,
177 .\" reporting the slab allocation policy for the CPU-local
178 .\" cache (to reduce the need for inter-CPU synchronization
179 .\" when allocating objects from the cache).
180 .\" The first column is the per-CPU limit: the maximum number of objects that
181 .\" will be cached for each CPU.
182 .\" The second column is the
183 .\" batchcount: the maximum number of free objects in the
184 .\" global cache that will be transferred to the per-CPU cache
185 .\" if it is empty, or the number of objects to be returned
186 .\" to the global cache if the per-CPU cache is full.
188 .\" If both slab cache statistics and SMP are defined, there
189 .\" will be four additional columns, reporting the per-CPU
190 .\" cache statistics.
191 .\" The first two are the per-CPU cache
192 .\" allocation hit and miss counts: the number of times an
193 .\" object was or was not available in the per-CPU cache
195 .\" The next two are the per-CPU cache free
196 .\" hit and miss counts: the number of times a freed object
197 .\" could or could not fit within the per-CPU cache limit,
198 .\" before flushing objects to the global cache.
202 file first appeared in Linux 2.1.23.
203 The file is versioned,
204 and over time there have been a number of versions with different layouts:
207 Present throughout the Linux 2.2.x kernel series.
210 Present in the Linux 2.4.x kernel series.
211 .\" First appeared in 2.4.0-test3
214 A format that was briefly present in the Linux 2.5 development series.
215 .\" from 2.5.45 to 2.5.70
218 Present in Linux 2.6.x kernels up to and including Linux 2.6.9.
219 .\" First appeared in 2.5.71
222 The current format, which first appeared in Linux 2.6.10.
224 Only root can read and (if the kernel was configured with
230 The total amount of memory allocated to the SLAB/SLUB cache is shown in the
237 The kernel source file
238 .IR Documentation/vm/slub.txt
240 .IR tools/vm/slabinfo.c .