]> git.proxmox.com Git - mirror_spl.git/commit - module/spl/spl-taskq.c
Taskq locking optimizations
authorNed Bass <bass6@llnl.gov>
Thu, 19 Jan 2012 18:33:19 +0000 (10:33 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 19 Jan 2012 22:42:49 +0000 (14:42 -0800)
commit3c6ed5410beb7a4f9e0c042229eb63c4c11a5fc9
tree771bf4bc28c99a21adf88de2aaa9c31c802b83ff
parent0bb43ca2823ab55a74565f6e17e2c36749cff3b9
Taskq locking optimizations

Testing has shown that tq->tq_lock can be highly contended when a
large number of small work items are dispatched.  The lock hold time
is reduced by the following changes:

1) Use exclusive threads in the work_waitq

When a single work item is dispatched we only need to wake a single
thread to service it.  The current implementation uses non-exclusive
threads so all threads are woken when the dispatcher calls wake_up().
If a large number of threads are in the queue this overhead can become
non-negligible.

2) Conditionally add/remove threads from work waitq

Taskq threads need only add themselves to the work wait queue if
there are no pending work items.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #32
module/spl/spl-taskq.c