]> git.proxmox.com Git - mirror_zfs.git/blob - man/man4/spl.4
Move properties, parameters, events, and concepts around manual sections
[mirror_zfs.git] / man / man4 / spl.4
1 .\"
2 .\" The contents of this file are subject to the terms of the Common Development
3 .\" and Distribution License (the "License"). You may not use this file except
4 .\" in compliance with the License. You can obtain a copy of the license at
5 .\" usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
6 .\"
7 .\" See the License for the specific language governing permissions and
8 .\" limitations under the License. When distributing Covered Code, include this
9 .\" CDDL HEADER in each file and include the License file at
10 .\" usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this
11 .\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your
12 .\" own identifying information:
13 .\" Portions Copyright [yyyy] [name of copyright owner]
14 .\"
15 .\" Copyright 2013 Turbo Fredriksson <turbo@bayour.com>. All rights reserved.
16 .\"
17 .Dd August 24, 2020
18 .Dt SPL 4
19 .Os
20 .
21 .Sh NAME
22 .Nm spl
23 .Nd parameters of the SPL kernel module
24 .
25 .Sh DESCRIPTION
26 .Bl -tag -width Ds
27 .It Sy spl_kmem_cache_kmem_threads Ns = Ns Sy 4 Pq uint
28 The number of threads created for the spl_kmem_cache task queue.
29 This task queue is responsible for allocating new slabs
30 for use by the kmem caches.
31 For the majority of systems and workloads only a small number of threads are
32 required.
33 .
34 .It Sy spl_kmem_cache_reclaim Ns = Ns Sy 0 Pq uint
35 When this is set it prevents Linux from being able to rapidly reclaim all the
36 memory held by the kmem caches.
37 This may be useful in circumstances where it's preferable that Linux
38 reclaim memory from some other subsystem first.
39 Setting this will increase the likelihood out of memory events on a memory
40 constrained system.
41 .
42 .It Sy spl_kmem_cache_obj_per_slab Ns = Ns Sy 8 Pq uint
43 The preferred number of objects per slab in the cache.
44 In general, a larger value will increase the caches memory footprint
45 while decreasing the time required to perform an allocation.
46 Conversely, a smaller value will minimize the footprint
47 and improve cache reclaim time but individual allocations may take longer.
48 .
49 .It Sy spl_kmem_cache_max_size Ns = Ns Sy 32 Po 64-bit Pc or Sy 4 Po 32-bit Pc Pq uint
50 The maximum size of a kmem cache slab in MiB.
51 This effectively limits the maximum cache object size to
52 .Sy spl_kmem_cache_max_size Ns / Ns Sy spl_kmem_cache_obj_per_slab .
53 .Pp
54 Caches may not be created with
55 object sized larger than this limit.
56 .
57 .It Sy spl_kmem_cache_slab_limit Ns = Ns Sy 16384 Pq uint
58 For small objects the Linux slab allocator should be used to make the most
59 efficient use of the memory.
60 However, large objects are not supported by
61 the Linux slab and therefore the SPL implementation is preferred.
62 This value is used to determine the cutoff between a small and large object.
63 .Pp
64 Objects of size
65 .Sy spl_kmem_cache_slab_limit
66 or smaller will be allocated using the Linux slab allocator,
67 large objects use the SPL allocator.
68 A cutoff of 16K was determined to be optimal for architectures using 4K pages.
69 .
70 .It Sy spl_kmem_alloc_warn Ns = Ns Sy 32768 Pq uint
71 As a general rule
72 .Fn kmem_alloc
73 allocations should be small,
74 preferably just a few pages, since they must by physically contiguous.
75 Therefore, a rate limited warning will be printed to the console for any
76 .Fn kmem_alloc
77 which exceeds a reasonable threshold.
78 .Pp
79 The default warning threshold is set to eight pages but capped at 32K to
80 accommodate systems using large pages.
81 This value was selected to be small enough to ensure
82 the largest allocations are quickly noticed and fixed.
83 But large enough to avoid logging any warnings when a allocation size is
84 larger than optimal but not a serious concern.
85 Since this value is tunable, developers are encouraged to set it lower
86 when testing so any new largish allocations are quickly caught.
87 These warnings may be disabled by setting the threshold to zero.
88 .
89 .It Sy spl_kmem_alloc_max Ns = Ns Sy KMALLOC_MAX_SIZE Ns / Ns Sy 4 Pq uint
90 Large
91 .Fn kmem_alloc
92 allocations will fail if they exceed
93 .Sy KMALLOC_MAX_SIZE .
94 Allocations which are marginally smaller than this limit may succeed but
95 should still be avoided due to the expense of locating a contiguous range
96 of free pages.
97 Therefore, a maximum kmem size with reasonable safely margin of 4x is set.
98 .Fn kmem_alloc
99 allocations larger than this maximum will quickly fail.
100 .Fn vmem_alloc
101 allocations less than or equal to this value will use
102 .Fn kmalloc ,
103 but shift to
104 .Fn vmalloc
105 when exceeding this value.
106 .
107 .It Sy spl_kmem_cache_magazine_size Ns = Ns Sy 0 Pq uint
108 Cache magazines are an optimization designed to minimize the cost of
109 allocating memory.
110 They do this by keeping a per-cpu cache of recently
111 freed objects, which can then be reallocated without taking a lock.
112 This can improve performance on highly contended caches.
113 However, because objects in magazines will prevent otherwise empty slabs
114 from being immediately released this may not be ideal for low memory machines.
115 .Pp
116 For this reason,
117 .Sy spl_kmem_cache_magazine_size
118 can be used to set a maximum magazine size.
119 When this value is set to 0 the magazine size will
120 be automatically determined based on the object size.
121 Otherwise magazines will be limited to 2-256 objects per magazine (i.e per cpu).
122 Magazines may never be entirely disabled in this implementation.
123 .
124 .It Sy spl_hostid Ns = Ns Sy 0 Pq ulong
125 The system hostid, when set this can be used to uniquely identify a system.
126 By default this value is set to zero which indicates the hostid is disabled.
127 It can be explicitly enabled by placing a unique non-zero value in
128 .Pa /etc/hostid .
129 .
130 .It Sy spl_hostid_path Ns = Ns Pa /etc/hostid Pq charp
131 The expected path to locate the system hostid when specified.
132 This value may be overridden for non-standard configurations.
133 .
134 .It Sy spl_panic_halt Ns = Ns Sy 0 Pq uint
135 Cause a kernel panic on assertion failures.
136 When not enabled, the thread is halted to facilitate further debugging.
137 .Pp
138 Set to a non-zero value to enable.
139 .
140 .It Sy spl_taskq_kick Ns = Ns Sy 0 Pq uint
141 Kick stuck taskq to spawn threads.
142 When writing a non-zero value to it, it will scan all the taskqs.
143 If any of them have a pending task more than 5 seconds old,
144 it will kick it to spawn more threads.
145 This can be used if you find a rare
146 deadlock occurs because one or more taskqs didn't spawn a thread when it should.
147 .
148 .It Sy spl_taskq_thread_bind Ns = Ns Sy 0 Pq int
149 Bind taskq threads to specific CPUs.
150 When enabled all taskq threads will be distributed evenly
151 across the available CPUs.
152 By default, this behavior is disabled to allow the Linux scheduler
153 the maximum flexibility to determine where a thread should run.
154 .
155 .It Sy spl_taskq_thread_dynamic Ns = Ns Sy 1 Pq int
156 Allow dynamic taskqs.
157 When enabled taskqs which set the
158 .Sy TASKQ_DYNAMIC
159 flag will by default create only a single thread.
160 New threads will be created on demand up to a maximum allowed number
161 to facilitate the completion of outstanding tasks.
162 Threads which are no longer needed will be promptly destroyed.
163 By default this behavior is enabled but it can be disabled to
164 aid performance analysis or troubleshooting.
165 .
166 .It Sy spl_taskq_thread_priority Ns = Ns Sy 1 Pq int
167 Allow newly created taskq threads to set a non-default scheduler priority.
168 When enabled, the priority specified when a taskq is created will be applied
169 to all threads created by that taskq.
170 When disabled all threads will use the default Linux kernel thread priority.
171 By default, this behavior is enabled.
172 .
173 .It Sy spl_taskq_thread_sequential Ns = Ns Sy 4 Pq int
174 The number of items a taskq worker thread must handle without interruption
175 before requesting a new worker thread be spawned.
176 This is used to control
177 how quickly taskqs ramp up the number of threads processing the queue.
178 Because Linux thread creation and destruction are relatively inexpensive a
179 small default value has been selected.
180 This means that normally threads will be created aggressively which is desirable.
181 Increasing this value will
182 result in a slower thread creation rate which may be preferable for some
183 configurations.
184 .
185 .It Sy spl_max_show_tasks Ns = Ns Sy 512 Pq uint
186 The maximum number of tasks per pending list in each taskq shown in
187 .Pa /proc/spl/taskq{,-all} .
188 Write
189 .Sy 0
190 to turn off the limit.
191 The proc file will walk the lists with lock held,
192 reading it could cause a lock-up if the list grow too large
193 without limiting the output.
194 "(truncated)" will be shown if the list is larger than the limit.
195 .El