]> git.proxmox.com Git - mirror_spl.git/commit
Add TASKQ_DYNAMIC feature
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 8 Jun 2015 21:36:27 +0000 (14:36 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 24 Jun 2015 22:14:18 +0000 (15:14 -0700)
commitf7a973d99b5e272f4a6223b8fb7db4fc6d363b41
tree551121411cae17bf6d2c158ca5bd87d0d6347f75
parent5acb2307b2edc55335996bf0ff78f6bdca24a98d
Add TASKQ_DYNAMIC feature

Setting the TASKQ_DYNAMIC flag will create a taskq with dynamic
semantics.  Initially only a single worker thread will be created
to service tasks dispatched to the queue.  As additional threads
are needed they will be dynamically spawned up to the max number
specified by 'nthreads'.  When the threads are no longer needed,
because the taskq is empty, they will automatically terminate.

Due to the low cost of creating and destroying threads under Linux
by default new threads and spawned and terminated aggressively.
There are two modules options which can be tuned to adjust this
behavior if needed.

* spl_taskq_thread_sequential - The number of sequential tasks,
without interruption, which needed to be handled by a worker
thread before a new worker thread is spawned.  Default 4.

* spl_taskq_thread_dynamic - Provides the ability to completely
disable the use of dynamic taskqs on the system.  This is provided
for the purposes of debugging and troubleshooting.  Default 1
(enabled).

This behavior is fundamentally consistent with the dynamic taskq
implementation found in both illumos and FreeBSD.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Closes #458
include/sys/taskq.h
man/man5/spl-module-parameters.5
module/spl/spl-taskq.c
module/splat/splat-taskq.c