OSDN Git Service

08559182396570e5d56efe7f56e10966915532ed
[linuxjm/LDP_man-pages.git] / original / man5 / slabinfo.5
1 .\" Copyright (c) 2001 Andreas Dilger (adilger@turbolinux.com)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
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.
23 .\" %%%LICENSE_END
24 .\"
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
33 .\"
34 .TH SLABINFO 5 2007-09-30 "" "Linux Programmer's Manual"
35 .SH NAME
36 /proc/slabinfo \- kernel slab allocator statistics
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.)
42 have their own cache.
43 The file
44 .I /proc/slabinfo
45 gives statistics.
46 For example:
47 .LP
48 .in +4n
49 .nf
50 % cat /proc/slabinfo
51 slabinfo \- version: 1.1
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
65 .in
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,
74 objects are not normally packed tightly into pages.
75 Pages with even one in-use object are considered in-use and cannot be
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
86 to this cache.
87 If slab cache statistics are not enabled
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
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
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
105 cache statistics.
106 The first two are the per-CPU cache
107 allocation hit and miss counts: the number of times an
108 object was or was not available in the per-CPU cache
109 for allocation.
110 The next two are the per-CPU cache free
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
118 .in +4n
119 .nf
120 echo "\fIcache_name limit batchcount\fP" > /proc/slabinfo
121 .fi
122 .in
123 .SH FILES
124 .I <linux/slab.h>
125 .SH VERSIONS
126 .I /proc/slabinfo
127 exists since Linux 2.1.23.
128 SMP per-CPU caches exist since Linux 2.4.0-test3.
129 .SH NOTES
130 Since Linux 2.6.16 the file
131 .I /proc/slabinfo
132 is present only if the
133 .B CONFIG_SLAB
134 kernel configuration option is enabled.
135 .SH COLOPHON
136 This page is part of release 3.67 of the Linux
137 .I man-pages
138 project.
139 A description of the project,
140 information about reporting bugs,
141 and the latest version of this page,
142 can be found at
143 \%http://www.kernel.org/doc/man\-pages/.