hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/Documentation/vm/slub.rst
....@@ -36,9 +36,15 @@
3636
3737 slub_debug=<Debug-Options>
3838 Enable options for all slabs
39
-slub_debug=<Debug-Options>,<slab name>
40
- Enable options only for select slabs
4139
40
+slub_debug=<Debug-Options>,<slab name1>,<slab name2>,...
41
+ Enable options only for select slabs (no spaces
42
+ after a comma)
43
+
44
+Multiple blocks of options for all slabs or selected slabs can be given, with
45
+blocks of options delimited by ';'. The last of "all slabs" blocks is applied
46
+to all slabs except those that match one of the "select slabs" block. Options
47
+of the first "select slabs" blocks that matches the slab's name are applied.
4248
4349 Possible debug options are::
4450
....@@ -48,7 +54,7 @@
4854 P Poisoning (object and padding)
4955 U User tracking (free and alloc)
5056 T Trace (please only use on single slabs)
51
- A Toggle failslab filter mark for the cache
57
+ A Enable failslab filter mark for the cache
5258 O Switch debugging off for caches that would have
5359 caused higher minimum slab orders
5460 - Switch all debugging off (useful if the kernel is
....@@ -62,7 +68,12 @@
6268
6369 slub_debug=,dentry
6470
65
-to only enable debugging on the dentry cache.
71
+to only enable debugging on the dentry cache. You may use an asterisk at the
72
+end of the slab name, in order to cover all slabs with the same prefix. For
73
+example, here's how you can poison the dentry cache as well as all kmalloc
74
+slabs::
75
+
76
+ slub_debug=P,kmalloc-*,dentry
6677
6778 Red zoning and tracking may realign the slab. We can just apply sanity checks
6879 to the dentry cache with::
....@@ -77,17 +88,33 @@
7788
7889 slub_debug=O
7990
80
-In case you forgot to enable debugging on the kernel command line: It is
81
-possible to enable debugging manually when the kernel is up. Look at the
82
-contents of::
91
+You can apply different options to different list of slab names, using blocks
92
+of options. This will enable red zoning for dentry and user tracking for
93
+kmalloc. All other slabs will not get any debugging enabled::
94
+
95
+ slub_debug=Z,dentry;U,kmalloc-*
96
+
97
+You can also enable options (e.g. sanity checks and poisoning) for all caches
98
+except some that are deemed too performance critical and don't need to be
99
+debugged by specifying global debug options followed by a list of slab names
100
+with "-" as options::
101
+
102
+ slub_debug=FZ;-,zs_handle,zspage
103
+
104
+The state of each debug option for a slab can be found in the respective files
105
+under::
83106
84107 /sys/kernel/slab/<slab name>/
85108
86
-Look at the writable files. Writing 1 to them will enable the
87
-corresponding debug option. All options can be set on a slab that does
88
-not contain objects. If the slab already contains objects then sanity checks
89
-and tracing may only be enabled. The other options may cause the realignment
90
-of objects.
109
+If the file contains 1, the option is enabled, 0 means disabled. The debug
110
+options from the ``slub_debug`` parameter translate to the following files::
111
+
112
+ F sanity_checks
113
+ Z red_zone
114
+ P poison
115
+ U store_user
116
+ T trace
117
+ A failslab
91118
92119 Careful with tracing: It may spew out lots of information and never stop if
93120 used on the wrong slab.
....@@ -135,7 +162,7 @@
135162 (list_lock) where contention may occur.
136163
137164 ``slub_min_order``
138
- specifies a minim order of slabs. A similar effect like
165
+ specifies a minimum order of slabs. A similar effect like
139166 ``slub_min_objects``.
140167
141168 ``slub_max_order``
....@@ -351,7 +378,7 @@
351378 can go unnoticed. To deal with that, ``slabinfo-gnuplot.sh`` has two
352379 options to 'zoom-in'/'zoom-out':
353380
354
- a) ``-s %d,%d`` -- overwrites the default image width and heigh
381
+ a) ``-s %d,%d`` -- overwrites the default image width and height
355382 b) ``-r %d,%d`` -- specifies a range of samples to use (for example,
356383 in ``slabinfo -X >> FOO_STATS; sleep 1;`` case, using a ``-r
357384 40,60`` range will plot only samples collected between 40th and