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