OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / original / man5 / slabinfo.5
1 .\" Copyright (c) 2001 Andreas Dilger (adilger@turbolinux.com)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .TH SLABINFO 5 2007-09-30 "" "Linux Programmer's Manual"
24 .SH NAME
25 /proc/slabinfo \- Kernel slab allocator statistics
26 .SH SYNOPSIS
27 .B cat /proc/slabinfo
28 .SH DESCRIPTION
29 Frequently used objects in the Linux kernel
30 (buffer heads, inodes, dentries, etc.)
31 have their own cache.
32 The file
33 .I /proc/slabinfo
34 gives statistics.
35 For example:
36 .LP
37 .in +4n
38 .nf
39 % cat /proc/slabinfo
40 slabinfo \- version: 1.1
41 kmem_cache            60     78    100    2    2    1
42 blkdev_requests     5120   5120     96  128  128    1
43 mnt_cache             20     40     96    1    1    1
44 inode_cache         7005  14792    480 1598 1849    1
45 dentry_cache        5469   5880    128  183  196    1
46 filp                 726    760     96   19   19    1
47 buffer_head        67131  71240     96 1776 1781    1
48 vm_area_struct      1204   1652     64   23   28    1
49 \&...
50 size-8192              1     17   8192    1   17    2
51 size-4096             41     73   4096   41   73    1
52 \&...
53 .fi
54 .in
55 .LP
56 For each slab cache, the cache name, the number of currently
57 active objects, the total number of available objects, the
58 size of each object in bytes, the number of pages with at
59 least one active object, the total number of allocated pages,
60 and the number of pages per slab are given.
61
62 Note that because of object alignment and slab cache overhead,
63 objects are not normally packed tightly into pages.
64 Pages with even one in-use object are considered in-use and cannot be
65 freed.
66
67 Kernels compiled with slab cache statistics will also have
68 "(statistics)" in the first line of output, and will have 5
69 additional columns, namely: the high water mark of active
70 objects; the number of times objects have been allocated;
71 the number of times the cache has grown (new pages added
72 to this cache); the number of times the cache has been
73 reaped (unused pages removed from this cache); and the
74 number of times there was an error allocating new pages
75 to this cache.
76 If slab cache statistics are not enabled
77 for this kernel, these columns will not be shown.
78
79 SMP systems will also have "(SMP)" in the first line of
80 output, and will have two additional columns for each slab,
81 reporting the slab allocation policy for the CPU-local
82 cache (to reduce the need for inter-CPU synchronization
83 when allocating objects from the cache).
84 The first column is the per-CPU limit: the maximum number of objects that
85 will be cached for each CPU.
86 The second column is the
87 batchcount: the maximum number of free objects in the
88 global cache that will be transferred to the per-CPU cache
89 if it is empty, or the number of objects to be returned
90 to the global cache if the per-CPU cache is full.
91
92 If both slab cache statistics and SMP are defined, there
93 will be four additional columns, reporting the per-CPU
94 cache statistics.
95 The first two are the per-CPU cache
96 allocation hit and miss counts: the number of times an
97 object was or was not available in the per-CPU cache
98 for allocation.
99 The next two are the per-CPU cache free
100 hit and miss counts: the number of times a freed object
101 could or could not fit within the per-CPU cache limit,
102 before flushing objects to the global cache.
103
104 It is possible to tune the SMP per-CPU slab cache limit
105 and batchcount via:
106
107 .in +4n
108 .nf
109 echo "\fIcache_name limit batchcount\fP" > /proc/slabinfo
110 .fi
111 .in
112 .SH FILES
113 .I <linux/slab.h>
114 .SH VERSIONS
115 .I /proc/slabinfo
116 exists since Linux 2.1.23.
117 SMP per-CPU caches exist since Linux 2.4.0-test3.
118 .SH NOTES
119 Since Linux 2.6.16 the file
120 .I /proc/slabinfo
121 is only present if the
122 .B CONFIG_SLAB
123 kernel configuration option is enabled.