]> git.proxmox.com Git - mirror_spl-debian.git/blame - man/man5/spl-module-parameters.5
New upstream version 0.7.2
[mirror_spl-debian.git] / man / man5 / spl-module-parameters.5
CommitLineData
33a20369
LG
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
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
10946b02 20\fBspl_kmem_cache_expire\fR (uint)
33a20369
LG
21.ad
22.RS 12n
10946b02
AX
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)
33a20369 40.sp
10946b02 41Default value: \fB0x02\fR
33a20369
LG
42.RE
43
ec06701b
AX
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
33a20369
LG
58.sp
59.ne 2
60.na
10946b02 61\fBspl_kmem_cache_reclaim\fR (uint)
33a20369
LG
62.ad
63.RS 12n
10946b02
AX
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.
33a20369 69.sp
10946b02 70Default value: \fB0\fR
33a20369
LG
71.RE
72
73.sp
74.ne 2
75.na
10946b02 76\fBspl_kmem_cache_obj_per_slab\fR (uint)
33a20369
LG
77.ad
78.RS 12n
10946b02
AX
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.
33a20369 84.sp
10946b02 85Default value: \fB8\fR
33a20369
LG
86.RE
87
88.sp
89.ne 2
90.na
10946b02 91\fBspl_kmem_cache_obj_per_slab_min\fR (uint)
33a20369
LG
92.ad
93.RS 12n
10946b02
AX
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.
33a20369 98.sp
10946b02 99Default value: \fB1\fR
33a20369
LG
100.RE
101
102.sp
103.ne 2
104.na
10946b02 105\fBspl_kmem_cache_max_size\fR (uint)
33a20369
LG
106.ad
107.RS 12n
10946b02
AX
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.
33a20369 112.sp
10946b02 113Default value: \fB32 (64-bit) or 4 (32-bit)\fR
33a20369
LG
114.RE
115
116.sp
117.ne 2
118.na
10946b02 119\fBspl_kmem_cache_slab_limit\fR (uint)
33a20369
LG
120.ad
121.RS 12n
10946b02
AX
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.
33a20369 130.sp
10946b02 131Default value: \fB16,384\fR
33a20369
LG
132.RE
133
134.sp
135.ne 2
136.na
10946b02 137\fBspl_kmem_cache_kmem_limit\fR (uint)
33a20369
LG
138.ad
139.RS 12n
10946b02
AX
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.
156.sh
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
33a20369
LG
163.RE
164
165.sp
166.ne 2
167.na
10946b02 168\fBspl_kmem_alloc_warn\fR (uint)
33a20369
LG
169.ad
170.RS 12n
10946b02
AX
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.
175.sp
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
185Default value: \fB32,768\fR
33a20369
LG
186.RE
187
188.sp
189.ne 2
190.na
10946b02 191\fBspl_kmem_alloc_max\fR (uint)
33a20369
LG
192.ad
193.RS 12n
10946b02
AX
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
202Default value: \fBKMALLOC_MAX_SIZE/4\fR
203.RE
204
33a20369
LG
205.sp
206.ne 2
207.na
10946b02
AX
208\fBspl_kmem_cache_magazine_size\fR (uint)
209.ad
33a20369 210.RS 12n
10946b02
AX
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
224Default value: \fB0\fR
225.RE
226
33a20369 227.sp
10946b02
AX
228.ne 2
229.na
230\fBspl_hostid\fR (ulong)
231.ad
232.RS 12n
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.
33a20369 237.sp
10946b02 238Default value: \fB0\fR
33a20369 239.RE
10946b02
AX
240
241.sp
242.ne 2
243.na
244\fBspl_hostid_path\fR (charp)
245.ad
246.RS 12n
247The expected path to locate the system hostid when specified. This value
248may be overridden for non-standard configurations.
33a20369 249.sp
10946b02 250Default value: \fB/etc/hostid\fR
9e4fb5c2
LG
251.RE
252
ec06701b
AX
253.sp
254.ne 2
255.na
256\fBspl_taskq_kick\fR (uint)
257.ad
258.RS 12n
259Kick stuck taskq to spawn threads. When writing a non-zero value to it, it will
260scan all the taskqs. If any of them have a pending task more than 5 seconds old,
261it will kick it to spawn more threads. This can be used if you find a rare
262deadlock occurs because one or more taskqs didn't spawn a thread when it should.
263.sp
264Default value: \fB0\fR
265.RE
266
9e4fb5c2
LG
267.sp
268.ne 2
269.na
270\fBspl_taskq_thread_bind\fR (int)
271.ad
272.RS 12n
10946b02
AX
273Bind taskq threads to specific CPUs. When enabled all taskq threads will
274be distributed evenly over the available CPUs. By default, this behavior
275is disabled to allow the Linux scheduler the maximum flexibility to determine
276where a thread should run.
9e4fb5c2 277.sp
10946b02 278Default value: \fB0\fR
9e4fb5c2 279.RE
f6188ddd
AX
280
281.sp
282.ne 2
283.na
284\fBspl_taskq_thread_dynamic\fR (int)
285.ad
286.RS 12n
287Allow dynamic taskqs. When enabled taskqs which set the TASKQ_DYNAMIC flag
288will by default create only a single thread. New threads will be created on
289demand up to a maximum allowed number to facilitate the completion of
290outstanding tasks. Threads which are no longer needed will be promptly
291destroyed. By default this behavior is enabled but it can be disabled to
292aid performance analysis or troubleshooting.
293.sp
294Default 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
303Allow newly created taskq threads to set a non-default scheduler priority.
304When enabled the priority specified when a taskq is created will be applied
305to all threads created by that taskq. When disabled all threads will use
306the default Linux kernel thread priority. By default, this behavior is
307enabled.
308.sp
309Default 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
318The number of items a taskq worker thread must handle without interruption
319before requesting a new worker thread be spawned. This is used to control
320how quickly taskqs ramp up the number of threads processing the queue.
321Because Linux thread creation and destruction are relatively inexpensive a
322small default value has been selected. This means that normally threads will
323be created aggressively which is desirable. Increasing this value will
324result in a slower thread creation rate which may be preferable for some
325configurations.
326.sp
327Default value: \fB4\fR
328.RE
ec06701b
AX
329
330.sp
331.ne 2
332.na
333\fBspl_max_show_tasks\fR (uint)
334.ad
335.RS 12n
336The 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
338walk the lists with lock held, reading it could cause a lock up if the list
339grow too large without limiting the output. "(truncated)" will be shown if the
340list is larger than the limit.
341.sp
342Default value: \fB512\fR
343.RE