MAN page from openSUSE Leap 42 spl-tests-0.7.5-2.1.x86_64.rpm


Section: File Formats (5)
Updated: Oct 28, 2017


spl-module-parameters - SPL module parameters 


Description of the different parameters to the SPL module.


Module parameters

spl_kmem_cache_expire (uint)

Cache expiration is part of default Illumos cache behavior. The idea isthat objects in magazines which have not been recently accessed should bereturned to the slabs periodically. This is known as cache aging andwhen enabled objects will be typically returned after 15 seconds.

On the other hand Linux slabs are designed to never move objects back tothe slabs unless there is memory pressure. This is possible because underLinux the cache will be notified when memory is low and objects can bereleased.

By default only the Linux method is enabled. It has been shown to improveresponsiveness on low memory systems and not negatively impact the performanceof systems with more memory. This policy may be changed by setting thespl_kmem_cache_expire bit mask as follows, both policies may be enabledconcurrently.

0x01 - Aging (Illumos), 0x02 - Low memory (Linux)

Default value: 0x02

spl_kmem_cache_kmem_threads (uint)

The number of threads created for the spl_kmem_cache task queue. This taskqueue is responsible for allocating new slabs for use by the kmem caches.For the majority of systems and workloads only a small number of threads arerequired.

Default value: 4

spl_kmem_cache_reclaim (uint)

When this is set it prevents Linux from being able to rapidly reclaim all thememory held by the kmem caches. This may be useful in circumstances whereit's preferable that Linux reclaim memory from some other subsystem first.Setting this will increase the likelihood out of memory events on a memoryconstrained system.

Default value: 0

spl_kmem_cache_obj_per_slab (uint)

The preferred number of objects per slab in the cache. In general, a largervalue will increase the caches memory footprint while decreasing the timerequired to perform an allocation. Conversely, a smaller value will minimizethe footprint and improve cache reclaim time but individual allocations maytake longer.

Default value: 8

spl_kmem_cache_obj_per_slab_min (uint)

The minimum number of objects allowed per slab. Normally slabs will containspl_kmem_cache_obj_per_slab objects but for caches that contain verylarge objects it's desirable to only have a few, or even just one, object perslab.

Default value: 1

spl_kmem_cache_max_size (uint)

The maximum size of a kmem cache slab in MiB. This effectively limitsthe maximum cache object size to spl_kmem_cache_max_size /spl_kmem_cache_obj_per_slab. Caches may not be created withobject sized larger than this limit.

Default value: 32 (64-bit) or 4 (32-bit)

spl_kmem_cache_slab_limit (uint)

For small objects the Linux slab allocator should be used to make the mostefficient use of the memory. However, large objects are not supported bythe Linux slab and therefore the SPL implementation is preferred. Thisvalue is used to determine the cutoff between a small and large object.

Objects of spl_kmem_cache_slab_limit or smaller will be allocatedusing the Linux slab allocator, large objects use the SPL allocator. Acutoff of 16K was determined to be optimal for architectures using 4K pages.

Default value: 16,384

spl_kmem_cache_kmem_limit (uint)

Depending on the size of a cache object it may be backed by kmalloc()'dor vmalloc()'d memory. This is because the size of the required allocationgreatly impacts the best way to allocate the memory.

When objects are small and only a small number of memory pages need to beallocated, ideally just one, then kmalloc() is very efficient. However,when allocating multiple pages with kmalloc() it gets increasingly expensivebecause the pages must be physically contiguous.

For this reason we shift to vmalloc() for slabs of large objects whichwhich removes the need for contiguous pages. We cannot use vmalloc() inall cases because there is significant locking overhead involved. Thisfunction takes a single global lock over the entire virtual address rangewhich serializes all allocations. Using slightly different allocationfunctions for small and large objects allows us to handle a wide range ofobject sizes.

The spl_kmem_cache_kmem_limit value is used to determine this cutoffsize. One quarter the PAGE_SIZE is used as the default value becausespl_kmem_cache_obj_per_slab defaults to 16. This means that atmost we will need to allocate four contiguous pages.

Default value: PAGE_SIZE/4

spl_kmem_alloc_warn (uint)

As a general rule kmem_alloc() allocations should be small, preferablyjust a few pages since they must by physically contiguous. Therefore, arate limited warning will be printed to the console for any kmem_alloc()which exceeds a reasonable threshold.

The default warning threshold is set to eight pages but capped at 32K toaccommodate systems using large pages. This value was selected to be smallenough to ensure the largest allocations are quickly noticed and fixed.But large enough to avoid logging any warnings when a allocation size islarger than optimal but not a serious concern. Since this value is tunable,developers are encouraged to set it lower when testing so any new largishallocations are quickly caught. These warnings may be disabled by settingthe threshold to zero.

Default value: 32,768

spl_kmem_alloc_max (uint)

Large kmem_alloc() allocations will fail if they exceed KMALLOC_MAX_SIZE.Allocations which are marginally smaller than this limit may succeed butshould still be avoided due to the expense of locating a contiguous rangeof free pages. Therefore, a maximum kmem size with reasonable safelymargin of 4x is set. Kmem_alloc() allocations larger than this maximumwill quickly fail. Vmem_alloc() allocations less than or equal to thisvalue will use kmalloc(), but shift to vmalloc() when exceeding this value.

Default value: KMALLOC_MAX_SIZE/4

spl_kmem_cache_magazine_size (uint)

Cache magazines are an optimization designed to minimize the cost ofallocating memory. They do this by keeping a per-cpu cache of recentlyfreed objects, which can then be reallocated without taking a lock. Thiscan improve performance on highly contended caches. However, becauseobjects in magazines will prevent otherwise empty slabs from beingimmediately released this may not be ideal for low memory machines.

For this reason spl_kmem_cache_magazine_size can be used to set amaximum magazine size. When this value is set to 0 the magazine size willbe automatically determined based on the object size. Otherwise magazineswill be limited to 2-256 objects per magazine (i.e per cpu). Magazinesmay never be entirely disabled in this implementation.

Default value: 0

spl_hostid (ulong)

The system hostid, when set this can be used to uniquely identify a system.By default this value is set to zero which indicates the hostid is disabled.It can be explicitly enabled by placing a unique non-zero value in/etc/hostid/.

Default value: 0

spl_hostid_path (charp)

The expected path to locate the system hostid when specified. This valuemay be overridden for non-standard configurations.

Default value: /etc/hostid

spl_panic_halt (uint)

Cause a kernel panic on assertion failures. When not enabled, the thread is halted to facilitate further debugging.

Set to a non-zero value to enable.

Default value: 0

spl_taskq_kick (uint)

Kick stuck taskq to spawn threads. When writing a non-zero value to it, it willscan all the taskqs. If any of them have a pending task more than 5 seconds old,it will kick it to spawn more threads. This can be used if you find a raredeadlock occurs because one or more taskqs didn't spawn a thread when it should.

Default value: 0

spl_taskq_thread_bind (int)

Bind taskq threads to specific CPUs. When enabled all taskq threads willbe distributed evenly over the available CPUs. By default, this behavioris disabled to allow the Linux scheduler the maximum flexibility to determinewhere a thread should run.

Default value: 0

spl_taskq_thread_dynamic (int)

Allow dynamic taskqs. When enabled taskqs which set the TASKQ_DYNAMIC flagwill by default create only a single thread. New threads will be created ondemand up to a maximum allowed number to facilitate the completion ofoutstanding tasks. Threads which are no longer needed will be promptlydestroyed. By default this behavior is enabled but it can be disabled toaid performance analysis or troubleshooting.

Default value: 1

spl_taskq_thread_priority (int)

Allow newly created taskq threads to set a non-default scheduler priority.When enabled the priority specified when a taskq is created will be appliedto all threads created by that taskq. When disabled all threads will usethe default Linux kernel thread priority. By default, this behavior isenabled.

Default value: 1

spl_taskq_thread_sequential (int)

The number of items a taskq worker thread must handle without interruptionbefore requesting a new worker thread be spawned. This is used to controlhow quickly taskqs ramp up the number of threads processing the queue.Because Linux thread creation and destruction are relatively inexpensive asmall default value has been selected. This means that normally threads willbe created aggressively which is desirable. Increasing this value willresult in a slower thread creation rate which may be preferable for someconfigurations.

Default value: 4

spl_max_show_tasks (uint)

The maximum number of tasks per pending list in each taskq shown in/proc/spl/{taskq,taskq-all}. Write 0 to turn off the limit. The proc file willwalk the lists with lock held, reading it could cause a lock up if the listgrow too large without limiting the output. "(truncated)" will be shown if thelist is larger than the limit.

Default value: 512



Module parameters

This document was created byman2html,using the manual pages.