4 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
5 Christoph Lameter <cl@linux-foundation.org>
7 The /sys/kernel/slab directory contains a snapshot of the
8 internal state of the SLUB allocator for each cache. Certain
9 files may be modified to change the behavior of the cache (and
10 any cache it aliases, if any).
11 Users: kernel memory tuning tools
13 What: /sys/kernel/slab/cache/aliases
16 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
17 Christoph Lameter <cl@linux-foundation.org>
19 The aliases file is read-only and specifies how many caches
20 have merged into this cache.
22 What: /sys/kernel/slab/cache/align
25 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
26 Christoph Lameter <cl@linux-foundation.org>
28 The align file is read-only and specifies the cache's object
31 What: /sys/kernel/slab/cache/alloc_calls
34 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
35 Christoph Lameter <cl@linux-foundation.org>
37 The alloc_calls file is read-only and lists the kernel code
38 locations from which allocations for this cache were performed.
39 The alloc_calls file only contains information if debugging is
40 enabled for that cache (see Documentation/vm/slub.rst).
42 What: /sys/kernel/slab/cache/alloc_fastpath
45 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
46 Christoph Lameter <cl@linux-foundation.org>
48 The alloc_fastpath file shows how many objects have been
49 allocated using the fast path. It can be written to clear the
51 Available when CONFIG_SLUB_STATS is enabled.
53 What: /sys/kernel/slab/cache/alloc_from_partial
56 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
57 Christoph Lameter <cl@linux-foundation.org>
59 The alloc_from_partial file shows how many times a cpu slab has
60 been full and it has been refilled by using a slab from the list
61 of partially used slabs. It can be written to clear the current
63 Available when CONFIG_SLUB_STATS is enabled.
65 What: /sys/kernel/slab/cache/alloc_refill
68 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
69 Christoph Lameter <cl@linux-foundation.org>
71 The alloc_refill file shows how many times the per-cpu freelist
72 was empty but there were objects available as the result of
73 remote cpu frees. It can be written to clear the current count.
74 Available when CONFIG_SLUB_STATS is enabled.
76 What: /sys/kernel/slab/cache/alloc_slab
79 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
80 Christoph Lameter <cl@linux-foundation.org>
82 The alloc_slab file is shows how many times a new slab had to
83 be allocated from the page allocator. It can be written to
84 clear the current count.
85 Available when CONFIG_SLUB_STATS is enabled.
87 What: /sys/kernel/slab/cache/alloc_slowpath
90 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
91 Christoph Lameter <cl@linux-foundation.org>
93 The alloc_slowpath file shows how many objects have been
94 allocated using the slow path because of a refill or
95 allocation from a partial or new slab. It can be written to
96 clear the current count.
97 Available when CONFIG_SLUB_STATS is enabled.
99 What: /sys/kernel/slab/cache/cache_dma
101 KernelVersion: 2.6.22
102 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
103 Christoph Lameter <cl@linux-foundation.org>
105 The cache_dma file is read-only and specifies whether objects
107 Available when CONFIG_ZONE_DMA is enabled.
109 What: /sys/kernel/slab/cache/cpu_slabs
111 KernelVersion: 2.6.22
112 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
113 Christoph Lameter <cl@linux-foundation.org>
115 The cpu_slabs file is read-only and displays how many cpu slabs
116 are active and their NUMA locality.
118 What: /sys/kernel/slab/cache/cpuslab_flush
120 KernelVersion: 2.6.31
121 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
122 Christoph Lameter <cl@linux-foundation.org>
124 The file cpuslab_flush shows how many times a cache's cpu slabs
125 have been flushed as the result of destroying or shrinking a
126 cache, a cpu going offline, or as the result of forcing an
127 allocation from a certain node. It can be written to clear the
129 Available when CONFIG_SLUB_STATS is enabled.
131 What: /sys/kernel/slab/cache/ctor
133 KernelVersion: 2.6.22
134 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
135 Christoph Lameter <cl@linux-foundation.org>
137 The ctor file is read-only and specifies the cache's object
138 constructor function, which is invoked for each object when a
139 new slab is allocated.
141 What: /sys/kernel/slab/cache/deactivate_empty
143 KernelVersion: 2.6.25
144 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
145 Christoph Lameter <cl@linux-foundation.org>
147 The deactivate_empty file shows how many times an empty cpu slab
148 was deactivated. It can be written to clear the current count.
149 Available when CONFIG_SLUB_STATS is enabled.
151 What: /sys/kernel/slab/cache/deactivate_full
153 KernelVersion: 2.6.25
154 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
155 Christoph Lameter <cl@linux-foundation.org>
157 The deactivate_full file shows how many times a full cpu slab
158 was deactivated. It can be written to clear the current count.
159 Available when CONFIG_SLUB_STATS is enabled.
161 What: /sys/kernel/slab/cache/deactivate_remote_frees
163 KernelVersion: 2.6.25
164 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
165 Christoph Lameter <cl@linux-foundation.org>
167 The deactivate_remote_frees file shows how many times a cpu slab
168 has been deactivated and contained free objects that were freed
169 remotely. It can be written to clear the current count.
170 Available when CONFIG_SLUB_STATS is enabled.
172 What: /sys/kernel/slab/cache/deactivate_to_head
174 KernelVersion: 2.6.25
175 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
176 Christoph Lameter <cl@linux-foundation.org>
178 The deactivate_to_head file shows how many times a partial cpu
179 slab was deactivated and added to the head of its node's partial
180 list. It can be written to clear the current count.
181 Available when CONFIG_SLUB_STATS is enabled.
183 What: /sys/kernel/slab/cache/deactivate_to_tail
185 KernelVersion: 2.6.25
186 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
187 Christoph Lameter <cl@linux-foundation.org>
189 The deactivate_to_tail file shows how many times a partial cpu
190 slab was deactivated and added to the tail of its node's partial
191 list. It can be written to clear the current count.
192 Available when CONFIG_SLUB_STATS is enabled.
194 What: /sys/kernel/slab/cache/destroy_by_rcu
196 KernelVersion: 2.6.22
197 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
198 Christoph Lameter <cl@linux-foundation.org>
200 The destroy_by_rcu file is read-only and specifies whether
201 slabs (not objects) are freed by rcu.
203 What: /sys/kernel/slab/cache/free_add_partial
205 KernelVersion: 2.6.25
206 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
207 Christoph Lameter <cl@linux-foundation.org>
209 The free_add_partial file shows how many times an object has
210 been freed in a full slab so that it had to added to its node's
211 partial list. It can be written to clear the current count.
212 Available when CONFIG_SLUB_STATS is enabled.
214 What: /sys/kernel/slab/cache/free_calls
216 KernelVersion: 2.6.22
217 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
218 Christoph Lameter <cl@linux-foundation.org>
220 The free_calls file is read-only and lists the locations of
221 object frees if slab debugging is enabled (see
222 Documentation/vm/slub.rst).
224 What: /sys/kernel/slab/cache/free_fastpath
226 KernelVersion: 2.6.25
227 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
228 Christoph Lameter <cl@linux-foundation.org>
230 The free_fastpath file shows how many objects have been freed
231 using the fast path because it was an object from the cpu slab.
232 It can be written to clear the current count.
233 Available when CONFIG_SLUB_STATS is enabled.
235 What: /sys/kernel/slab/cache/free_frozen
237 KernelVersion: 2.6.25
238 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
239 Christoph Lameter <cl@linux-foundation.org>
241 The free_frozen file shows how many objects have been freed to
242 a frozen slab (i.e. a remote cpu slab). It can be written to
243 clear the current count.
244 Available when CONFIG_SLUB_STATS is enabled.
246 What: /sys/kernel/slab/cache/free_remove_partial
248 KernelVersion: 2.6.25
249 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
250 Christoph Lameter <cl@linux-foundation.org>
252 The free_remove_partial file shows how many times an object has
253 been freed to a now-empty slab so that it had to be removed from
254 its node's partial list. It can be written to clear the current
256 Available when CONFIG_SLUB_STATS is enabled.
258 What: /sys/kernel/slab/cache/free_slab
260 KernelVersion: 2.6.25
261 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
262 Christoph Lameter <cl@linux-foundation.org>
264 The free_slab file shows how many times an empty slab has been
265 freed back to the page allocator. It can be written to clear
267 Available when CONFIG_SLUB_STATS is enabled.
269 What: /sys/kernel/slab/cache/free_slowpath
271 KernelVersion: 2.6.25
272 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
273 Christoph Lameter <cl@linux-foundation.org>
275 The free_slowpath file shows how many objects have been freed
276 using the slow path (i.e. to a full or partial slab). It can
277 be written to clear the current count.
278 Available when CONFIG_SLUB_STATS is enabled.
280 What: /sys/kernel/slab/cache/hwcache_align
282 KernelVersion: 2.6.22
283 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
284 Christoph Lameter <cl@linux-foundation.org>
286 The hwcache_align file is read-only and specifies whether
287 objects are aligned on cachelines.
289 What: /sys/kernel/slab/cache/min_partial
291 KernelVersion: 2.6.30
292 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
293 David Rientjes <rientjes@google.com>
295 The min_partial file specifies how many empty slabs shall
296 remain on a node's partial list to avoid the overhead of
297 allocating new slabs. Such slabs may be reclaimed by utilizing
300 What: /sys/kernel/slab/cache/object_size
302 KernelVersion: 2.6.22
303 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
304 Christoph Lameter <cl@linux-foundation.org>
306 The object_size file is read-only and specifies the cache's
309 What: /sys/kernel/slab/cache/objects
311 KernelVersion: 2.6.22
312 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
313 Christoph Lameter <cl@linux-foundation.org>
315 The objects file is read-only and displays how many objects are
316 active and from which nodes they are from.
318 What: /sys/kernel/slab/cache/objects_partial
320 KernelVersion: 2.6.26
321 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
322 Christoph Lameter <cl@linux-foundation.org>
324 The objects_partial file is read-only and displays how many
325 objects are on partial slabs and from which nodes they are
328 What: /sys/kernel/slab/cache/objs_per_slab
330 KernelVersion: 2.6.22
331 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
332 Christoph Lameter <cl@linux-foundation.org>
334 The file objs_per_slab is read-only and specifies how many
335 objects may be allocated from a single slab of the order
336 specified in /sys/kernel/slab/cache/order.
338 What: /sys/kernel/slab/cache/order
340 KernelVersion: 2.6.22
341 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
342 Christoph Lameter <cl@linux-foundation.org>
344 The order file specifies the page order at which new slabs are
345 allocated. It is writable and can be changed to increase the
346 number of objects per slab. If a slab cannot be allocated
347 because of fragmentation, SLUB will retry with the minimum order
348 possible depending on its characteristics.
350 When debug_guardpage_minorder=N (N > 0) parameter is specified
351 (see Documentation/admin-guide/kernel-parameters.rst), the minimum possible
352 order is used and this sysfs entry can not be used to change
353 the order at run time.
355 What: /sys/kernel/slab/cache/order_fallback
357 KernelVersion: 2.6.26
358 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
359 Christoph Lameter <cl@linux-foundation.org>
361 The order_fallback file shows how many times an allocation of a
362 new slab has not been possible at the cache's order and instead
363 fallen back to its minimum possible order. It can be written to
364 clear the current count.
366 Available when CONFIG_SLUB_STATS is enabled.
368 What: /sys/kernel/slab/cache/partial
370 KernelVersion: 2.6.22
371 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
372 Christoph Lameter <cl@linux-foundation.org>
374 The partial file is read-only and displays how long many
375 partial slabs there are and how long each node's list is.
377 What: /sys/kernel/slab/cache/poison
379 KernelVersion: 2.6.22
380 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
381 Christoph Lameter <cl@linux-foundation.org>
383 The poison file specifies whether objects should be poisoned
384 when a new slab is allocated.
386 What: /sys/kernel/slab/cache/reclaim_account
388 KernelVersion: 2.6.22
389 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
390 Christoph Lameter <cl@linux-foundation.org>
392 The reclaim_account file specifies whether the cache's objects
393 are reclaimable (and grouped by their mobility).
395 What: /sys/kernel/slab/cache/red_zone
397 KernelVersion: 2.6.22
398 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
399 Christoph Lameter <cl@linux-foundation.org>
401 The red_zone file specifies whether the cache's objects are red
404 What: /sys/kernel/slab/cache/remote_node_defrag_ratio
406 KernelVersion: 2.6.25
407 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
408 Christoph Lameter <cl@linux-foundation.org>
410 The file remote_node_defrag_ratio specifies the percentage of
411 times SLUB will attempt to refill the cpu slab with a partial
412 slab from a remote node as opposed to allocating a new slab on
413 the local node. This reduces the amount of wasted memory over
414 the entire system but can be expensive.
416 Available when CONFIG_NUMA is enabled.
418 What: /sys/kernel/slab/cache/sanity_checks
420 KernelVersion: 2.6.22
421 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
422 Christoph Lameter <cl@linux-foundation.org>
424 The sanity_checks file specifies whether expensive checks
425 should be performed on free and, at minimum, enables double free
426 checks. Caches that enable sanity_checks cannot be merged with
429 What: /sys/kernel/slab/cache/shrink
431 KernelVersion: 2.6.22
432 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
433 Christoph Lameter <cl@linux-foundation.org>
435 The shrink file is used to reclaim unused slab cache
436 memory from a cache. Empty per-cpu or partial slabs
437 are freed and the partial list is sorted so the slabs
438 with the fewest available objects are used first.
439 It only accepts a value of "1" on write for shrinking
440 the cache. Other input values are considered invalid.
441 Shrinking slab caches might be expensive and can
442 adversely impact other running applications. So it
443 should be used with care.
445 What: /sys/kernel/slab/cache/slab_size
447 KernelVersion: 2.6.22
448 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
449 Christoph Lameter <cl@linux-foundation.org>
451 The slab_size file is read-only and specifies the object size
452 with metadata (debugging information and alignment) in bytes.
454 What: /sys/kernel/slab/cache/slabs
456 KernelVersion: 2.6.22
457 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
458 Christoph Lameter <cl@linux-foundation.org>
460 The slabs file is read-only and displays how long many slabs
461 there are (both cpu and partial) and from which nodes they are
464 What: /sys/kernel/slab/cache/store_user
466 KernelVersion: 2.6.22
467 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
468 Christoph Lameter <cl@linux-foundation.org>
470 The store_user file specifies whether the location of
471 allocation or free should be tracked for a cache.
473 What: /sys/kernel/slab/cache/total_objects
475 KernelVersion: 2.6.26
476 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
477 Christoph Lameter <cl@linux-foundation.org>
479 The total_objects file is read-only and displays how many total
480 objects a cache has and from which nodes they are from.
482 What: /sys/kernel/slab/cache/trace
484 KernelVersion: 2.6.22
485 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
486 Christoph Lameter <cl@linux-foundation.org>
488 The trace file specifies whether object allocations and frees
491 What: /sys/kernel/slab/cache/validate
493 KernelVersion: 2.6.22
494 Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
495 Christoph Lameter <cl@linux-foundation.org>
497 Writing to the validate file causes SLUB to traverse all of its
498 cache's objects and check the validity of metadata.