diff options
author | Chunwei Chen <[email protected]> | 2015-12-02 14:52:46 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-01-20 13:07:45 -0800 |
commit | 16522ac29023d94bc29e97761b01b252117cbbfe (patch) | |
tree | c05042fbea285fe0c73640afd915b3a3d69c8476 /include | |
parent | de77e245902cc5bb6c22591d54e31c7647ff912f (diff) |
Use tsd to store tq for taskq_member
To prevent taskq_member holding tq_lock and doing linear search, thus causing
contention. We store the taskq pointer to which the thread belongs in tsd.
This way taskq_member will not need to touch tq_lock, and tsd has per slot
spinlock. So the contention should be reduced greatly.
Signed-off-by: Chunwei Chen <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #500
Closes #504
Closes #505
Diffstat (limited to 'include')
-rw-r--r-- | include/sys/taskq.h | 2 | ||||
-rw-r--r-- | include/sys/tsd.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/include/sys/taskq.h b/include/sys/taskq.h index 544dbb2bb..e7661f7ce 100644 --- a/include/sys/taskq.h +++ b/include/sys/taskq.h @@ -140,7 +140,7 @@ extern void taskq_wait_id(taskq_t *, taskqid_t); extern void taskq_wait_outstanding(taskq_t *, taskqid_t); extern void taskq_wait(taskq_t *); extern int taskq_cancel_id(taskq_t *, taskqid_t); -extern int taskq_member(taskq_t *, void *); +extern int taskq_member(taskq_t *, kthread_t *); #define taskq_create_proc(name, nthreads, pri, min, max, proc, flags) \ taskq_create(name, nthreads, pri, min, max, flags) diff --git a/include/sys/tsd.h b/include/sys/tsd.h index ebc55b09b..1894a8232 100644 --- a/include/sys/tsd.h +++ b/include/sys/tsd.h @@ -35,6 +35,7 @@ typedef void (*dtor_func_t)(void *); extern int tsd_set(uint_t, void *); extern void *tsd_get(uint_t); +extern void *tsd_get_by_thread(uint_t, kthread_t *); extern void tsd_create(uint_t *, dtor_func_t); extern void tsd_destroy(uint_t *); extern void tsd_exit(void); |