]> git.proxmox.com Git - mirror_spl.git/blob - man/man5/spl-module-parameters.5
97241fd53780e858a7bf408e8457efb90e6d9a63
[mirror_spl.git] / man / man5 / spl-module-parameters.5
1 '\" te
2 .\"
3 .\" Copyright 2013 Turbo Fredriksson <turbo@bayour.com>. All rights reserved.
4 .\"
5 .TH SPL-MODULE-PARAMETERS 5 "Nov 18, 2013"
6 .SH NAME
7 spl\-module\-parameters \- SPL module parameters
8 .SH DESCRIPTION
9 .sp
10 .LP
11 Description of the different parameters to the SPL module.
12
13 .SS "Module parameters"
14 .sp
15 .LP
16
17 .sp
18 .ne 2
19 .na
20 \fBspl_kmem_cache_expire\fR (uint)
21 .ad
22 .RS 12n
23 Cache expiration is part of default Illumos cache behavior. The idea is
24 that objects in magazines which have not been recently accessed should be
25 returned to the slabs periodically. This is known as cache aging and
26 when enabled objects will be typically returned after 15 seconds.
27 .sp
28 On the other hand Linux slabs are designed to never move objects back to
29 the slabs unless there is memory pressure. This is possible because under
30 Linux the cache will be notified when memory is low and objects can be
31 released.
32 .sp
33 By default only the Linux method is enabled. It has been shown to improve
34 responsiveness on low memory systems and not negatively impact the performance
35 of systems with more memory. This policy may be changed by setting the
36 \fBspl_kmem_cache_expire\fR bit mask as follows, both policies may be enabled
37 concurrently.
38 .sp
39 0x01 - Aging (Illumos), 0x02 - Low memory (Linux)
40 .sp
41 Default value: \fB0x02\fR
42 .RE
43
44 .sp
45 .ne 2
46 .na
47 \fBspl_kmem_cache_kmem_threads\fR (uint)
48 .ad
49 .RS 12n
50 The number of threads created for the spl_kmem_cache task queue. This task
51 queue is responsible for allocating new slabs for use by the kmem caches.
52 For the majority of systems and workloads only a small number of threads are
53 required.
54 .sp
55 Default value: \fB4\fR
56 .RE
57
58 .sp
59 .ne 2
60 .na
61 \fBspl_kmem_cache_reclaim\fR (uint)
62 .ad
63 .RS 12n
64 When this is set it prevents Linux from being able to rapidly reclaim all the
65 memory held by the kmem caches. This may be useful in circumstances where
66 it's preferable that Linux reclaim memory from some other subsystem first.
67 Setting this will increase the likelihood out of memory events on a memory
68 constrained system.
69 .sp
70 Default value: \fB0\fR
71 .RE
72
73 .sp
74 .ne 2
75 .na
76 \fBspl_kmem_cache_obj_per_slab\fR (uint)
77 .ad
78 .RS 12n
79 The preferred number of objects per slab in the cache. In general, a larger
80 value will increase the caches memory footprint while decreasing the time
81 required to perform an allocation. Conversely, a smaller value will minimize
82 the footprint and improve cache reclaim time but individual allocations may
83 take longer.
84 .sp
85 Default value: \fB8\fR
86 .RE
87
88 .sp
89 .ne 2
90 .na
91 \fBspl_kmem_cache_obj_per_slab_min\fR (uint)
92 .ad
93 .RS 12n
94 The minimum number of objects allowed per slab. Normally slabs will contain
95 \fBspl_kmem_cache_obj_per_slab\fR objects but for caches that contain very
96 large objects it's desirable to only have a few, or even just one, object per
97 slab.
98 .sp
99 Default value: \fB1\fR
100 .RE
101
102 .sp
103 .ne 2
104 .na
105 \fBspl_kmem_cache_max_size\fR (uint)
106 .ad
107 .RS 12n
108 The maximum size of a kmem cache slab in MiB. This effectively limits
109 the maximum cache object size to \fBspl_kmem_cache_max_size\fR /
110 \fBspl_kmem_cache_obj_per_slab\fR. Caches may not be created with
111 object sized larger than this limit.
112 .sp
113 Default value: \fB32 (64-bit) or 4 (32-bit)\fR
114 .RE
115
116 .sp
117 .ne 2
118 .na
119 \fBspl_kmem_cache_slab_limit\fR (uint)
120 .ad
121 .RS 12n
122 For small objects the Linux slab allocator should be used to make the most
123 efficient use of the memory. However, large objects are not supported by
124 the Linux slab and therefore the SPL implementation is preferred. This
125 value is used to determine the cutoff between a small and large object.
126 .sp
127 Objects of \fBspl_kmem_cache_slab_limit\fR or smaller will be allocated
128 using the Linux slab allocator, large objects use the SPL allocator. A
129 cutoff of 16K was determined to be optimal for architectures using 4K pages.
130 .sp
131 Default value: \fB16,384\fR
132 .RE
133
134 .sp
135 .ne 2
136 .na
137 \fBspl_kmem_cache_kmem_limit\fR (uint)
138 .ad
139 .RS 12n
140 Depending on the size of a cache object it may be backed by kmalloc()'d
141 or vmalloc()'d memory. This is because the size of the required allocation
142 greatly impacts the best way to allocate the memory.
143 .sp
144 When objects are small and only a small number of memory pages need to be
145 allocated, ideally just one, then kmalloc() is very efficient. However,
146 when allocating multiple pages with kmalloc() it gets increasingly expensive
147 because the pages must be physically contiguous.
148 .sp
149 For this reason we shift to vmalloc() for slabs of large objects which
150 which removes the need for contiguous pages. We cannot use vmalloc() in
151 all cases because there is significant locking overhead involved. This
152 function takes a single global lock over the entire virtual address range
153 which serializes all allocations. Using slightly different allocation
154 functions for small and large objects allows us to handle a wide range of
155 object sizes.
156 .sh
157 The \fBspl_kmem_cache_kmem_limit\fR value is used to determine this cutoff
158 size. One quarter the PAGE_SIZE is used as the default value because
159 \fBspl_kmem_cache_obj_per_slab\fR defaults to 16. This means that at
160 most we will need to allocate four contiguous pages.
161 .sp
162 Default value: \fBPAGE_SIZE/4\fR
163 .RE
164
165 .sp
166 .ne 2
167 .na
168 \fBspl_kmem_alloc_warn\fR (uint)
169 .ad
170 .RS 12n
171 As a general rule kmem_alloc() allocations should be small, preferably
172 just a few pages since they must by physically contiguous. Therefore, a
173 rate limited warning will be printed to the console for any kmem_alloc()
174 which exceeds a reasonable threshold.
175 .sp
176 The default warning threshold is set to eight pages but capped at 32K to
177 accommodate systems using large pages. This value was selected to be small
178 enough to ensure the largest allocations are quickly noticed and fixed.
179 But large enough to avoid logging any warnings when a allocation size is
180 larger than optimal but not a serious concern. Since this value is tunable,
181 developers are encouraged to set it lower when testing so any new largish
182 allocations are quickly caught. These warnings may be disabled by setting
183 the threshold to zero.
184 .sp
185 Default value: \fB32,768\fR
186 .RE
187
188 .sp
189 .ne 2
190 .na
191 \fBspl_kmem_alloc_max\fR (uint)
192 .ad
193 .RS 12n
194 Large kmem_alloc() allocations will fail if they exceed KMALLOC_MAX_SIZE.
195 Allocations which are marginally smaller than this limit may succeed but
196 should still be avoided due to the expense of locating a contiguous range
197 of free pages. Therefore, a maximum kmem size with reasonable safely
198 margin of 4x is set. Kmem_alloc() allocations larger than this maximum
199 will quickly fail. Vmem_alloc() allocations less than or equal to this
200 value will use kmalloc(), but shift to vmalloc() when exceeding this value.
201 .sp
202 Default value: \fBKMALLOC_MAX_SIZE/4\fR
203 .RE
204
205 .sp
206 .ne 2
207 .na
208 \fBspl_kmem_cache_magazine_size\fR (uint)
209 .ad
210 .RS 12n
211 Cache magazines are an optimization designed to minimize the cost of
212 allocating memory. They do this by keeping a per-cpu cache of recently
213 freed objects, which can then be reallocated without taking a lock. This
214 can improve performance on highly contended caches. However, because
215 objects in magazines will prevent otherwise empty slabs from being
216 immediately released this may not be ideal for low memory machines.
217 .sp
218 For this reason \fBspl_kmem_cache_magazine_size\fR can be used to set a
219 maximum magazine size. When this value is set to 0 the magazine size will
220 be automatically determined based on the object size. Otherwise magazines
221 will be limited to 2-256 objects per magazine (i.e per cpu). Magazines
222 may never be entirely disabled in this implementation.
223 .sp
224 Default value: \fB0\fR
225 .RE
226
227 .sp
228 .ne 2
229 .na
230 \fBspl_hostid\fR (ulong)
231 .ad
232 .RS 12n
233 The system hostid, when set this can be used to uniquely identify a system.
234 By default this value is set to zero which indicates the hostid is disabled.
235 It can be explicitly enabled by placing a unique non-zero value in
236 \fB/etc/hostid/\fR.
237 .sp
238 Default value: \fB0\fR
239 .RE
240
241 .sp
242 .ne 2
243 .na
244 \fBspl_hostid_path\fR (charp)
245 .ad
246 .RS 12n
247 The expected path to locate the system hostid when specified. This value
248 may be overridden for non-standard configurations.
249 .sp
250 Default value: \fB/etc/hostid\fR
251 .RE
252
253 .sp
254 .ne 2
255 .na
256 \fBspl_taskq_kick\fR (uint)
257 .ad
258 .RS 12n
259 Kick stuck taskq to spawn threads. When writing a non-zero value to it, it will
260 scan all the taskqs. If any of them have a pending task more than 5 seconds old,
261 it will kick it to spawn more threads. This can be used if you find a rare
262 deadlock occurs because one or more taskqs didn't spawn a thread when it should.
263 .sp
264 Default value: \fB0\fR
265 .RE
266
267 .sp
268 .ne 2
269 .na
270 \fBspl_taskq_thread_bind\fR (int)
271 .ad
272 .RS 12n
273 Bind taskq threads to specific CPUs. When enabled all taskq threads will
274 be distributed evenly over the available CPUs. By default, this behavior
275 is disabled to allow the Linux scheduler the maximum flexibility to determine
276 where a thread should run.
277 .sp
278 Default value: \fB0\fR
279 .RE
280
281 .sp
282 .ne 2
283 .na
284 \fBspl_taskq_thread_dynamic\fR (int)
285 .ad
286 .RS 12n
287 Allow dynamic taskqs. When enabled taskqs which set the TASKQ_DYNAMIC flag
288 will by default create only a single thread. New threads will be created on
289 demand up to a maximum allowed number to facilitate the completion of
290 outstanding tasks. Threads which are no longer needed will be promptly
291 destroyed. By default this behavior is enabled but it can be disabled to
292 aid performance analysis or troubleshooting.
293 .sp
294 Default value: \fB1\fR
295 .RE
296
297 .sp
298 .ne 2
299 .na
300 \fBspl_taskq_thread_priority\fR (int)
301 .ad
302 .RS 12n
303 Allow newly created taskq threads to set a non-default scheduler priority.
304 When enabled the priority specified when a taskq is created will be applied
305 to all threads created by that taskq. When disabled all threads will use
306 the default Linux kernel thread priority. By default, this behavior is
307 enabled.
308 .sp
309 Default value: \fB1\fR
310 .RE
311
312 .sp
313 .ne 2
314 .na
315 \fBspl_taskq_thread_sequential\fR (int)
316 .ad
317 .RS 12n
318 The number of items a taskq worker thread must handle without interruption
319 before requesting a new worker thread be spawned. This is used to control
320 how quickly taskqs ramp up the number of threads processing the queue.
321 Because Linux thread creation and destruction are relatively inexpensive a
322 small default value has been selected. This means that normally threads will
323 be created aggressively which is desirable. Increasing this value will
324 result in a slower thread creation rate which may be preferable for some
325 configurations.
326 .sp
327 Default value: \fB4\fR
328 .RE
329
330 .sp
331 .ne 2
332 .na
333 \fBspl_max_show_tasks\fR (uint)
334 .ad
335 .RS 12n
336 The maximum number of tasks per pending list in each taskq shown in
337 /proc/spl/{taskq,taskq-all}. Write 0 to turn off the limit. The proc file will
338 walk the lists with lock held, reading it could cause a lock up if the list
339 grow too large without limiting the output. "(truncated)" will be shown if the
340 list is larger than the limit.
341 .sp
342 Default value: \fB512\fR
343 .RE