blob: b41e401e8e8d929f4ebf9abf79cd290abcce1d03 [file] [log] [blame]
.\" Copyright (c) 2001 Andreas Dilger (
.\" and Copyright (c) 2017 Michael Kerrisk <>
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.TH SLABINFO 5 2017-09-15 "" "Linux Programmer's Manual"
slabinfo \- kernel slab allocator statistics
.B cat /proc/slabinfo
Frequently used objects in the Linux kernel
(buffer heads, inodes, dentries, etc.)
have their own cache.
The file
.I /proc/slabinfo
gives statistics on these caches.
The following (edited) output shows an example of the
contents of this file:
.in 0
$ \fBsudo cat /proc/slabinfo\fP
slabinfo - version: 2.1
# name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> ...
sigqueue 100 100 160 25 1 : tunables 0 0 0 : slabdata 4 4 0
sighand_cache 355 405 2112 15 8 : tunables 0 0 0 : slabdata 27 27 0
kmalloc-8192 96 96 8192 4 8 : tunables 0 0 0 : slabdata 24 24 0
The first line of output includes a version number,
which allows an application that is reading the file to handle changes
in the file format.
(See VERSIONS, below.)
The next line lists the names of the columns in the remaining lines.
Each of the remaining lines displays information about a specified cache.
Following the cache name,
the output shown in each line shows three components for each cache:
.IP * 3
.IP *
.IP *
The statistics are as follows:
.I active_objs
The number of objects that are currently active (i.e., in use).
.I num_objs
The total number of allocated objects
(i.e., objects that are both in use and not in use).
.I objsize
The size of objects in this slab, in bytes.
.I objperslab
The number of objects stored in each slab.
.I pagesperslab
The number of pages allocated for each slab.
.I tunables
entries in each line show tunable parameters for the corresponding cache.
When using the default SLUB allocator, there are no tunables, the
.I /proc/slabinfo
file is not writable, and the value 0 is shown in these fields.
When using the older SLAB allocator,
the tunables for a particular cache can be set by writing
lines of the following form to
.IR /proc/slabinfo :
.in +4n
# \fBecho 'name limit batchcount sharedfactor' > /proc/slabinfo\fP
.I name
is the cache name, and
.IR limit ,
.IR batchcount ,
.IR sharedfactor
are integers defining new values for the corresponding tunables.
.I limit
value should be a positive value,
.I batchcount
should be a positive value that is less than or equal to
.IR limit ,
.I sharedfactor
should be nonnegative.
If any of the specified values is invalid,
the cache settings are left unchanged.
.I tunables
entries in each line contain the following fields:
.I limit
The maximum number of objects that will be cached.
.\" This is the limit on the number of free objects that can be stored
.\" in the per-CPU free list for this slab cache.
.I batchcount
On SMP systems, this specifies the number of objects to transfer at one time
when refilling the available object list.
.\" On SMP systems, when we refill the available object list, instead
.\" of doing one object at a time, we do batch-count objects at a time.
.I sharedfactor
[To be documented]
.I slabdata
entries in each line contain the following fields:
.I active_slabs
The number of active slabs.
.I nums_slabs
The total number of slabs.
.I sharedavail
[To be documented]
Note that because of object alignment and slab cache overhead,
objects are not normally packed tightly into pages.
Pages with even one in-use object are considered in-use and cannot be
Kernels configured with
will also have additional statistics fields in each line,
and the first line of the file will contain the string "(statistics)".
The statistics field include : the high water mark of active
objects; the number of times objects have been allocated;
the number of times the cache has grown (new pages added
to this cache); the number of times the cache has been
reaped (unused pages removed from this cache); and the
number of times there was an error allocating new pages
to this cache.
.\" SMP systems will also have "(SMP)" in the first line of
.\" output, and will have two additional columns for each slab,
.\" reporting the slab allocation policy for the CPU-local
.\" cache (to reduce the need for inter-CPU synchronization
.\" when allocating objects from the cache).
.\" The first column is the per-CPU limit: the maximum number of objects that
.\" will be cached for each CPU.
.\" The second column is the
.\" batchcount: the maximum number of free objects in the
.\" global cache that will be transferred to the per-CPU cache
.\" if it is empty, or the number of objects to be returned
.\" to the global cache if the per-CPU cache is full.
.\" If both slab cache statistics and SMP are defined, there
.\" will be four additional columns, reporting the per-CPU
.\" cache statistics.
.\" The first two are the per-CPU cache
.\" allocation hit and miss counts: the number of times an
.\" object was or was not available in the per-CPU cache
.\" for allocation.
.\" The next two are the per-CPU cache free
.\" hit and miss counts: the number of times a freed object
.\" could or could not fit within the per-CPU cache limit,
.\" before flushing objects to the global cache.
.I /proc/slabinfo
file first appeared in Linux 2.1.23.
The file is versioned,
and over time there have been a number of versions with different layouts:
Present throughout the Linux 2.2.x kernel series.
Present in the Linux 2.4.x kernel series.
.\" First appeared in 2.4.0-test3
A format that was briefly present in the Linux 2.5 development series.
.\" from 2.5.45 to 2.5.70
Present in Linux 2.6.x kernels up to and including Linux 2.6.9.
.\" First appeared in 2.5.71
The current format, which first appeared in Linux 2.6.10.
Only root can read and (if the kernel was configured with
write the
.IR /proc/slabinfo
The total amount of memory allocated to the SLAB/SLUB cache is shown in the
.I Slab
field of
.IR /proc/meminfo .
.BR slabtop (1)
The kernel source file
.IR Documentation/vm/slub.txt
.IR tools/vm/slabinfo.c .