summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPrakash Surya <[email protected]>2011-12-06 10:04:51 -0800
committerBrian Behlendorf <[email protected]>2011-12-13 16:10:57 -0800
commit44217f7aad12225c09e5fefbbce97ac6bf2f2d16 (patch)
tree77aa3c7a82878dc94fb13da94166622c9184f914 /include
parentac1e5b6033811e15f6e471e720bf506e4e3b4a08 (diff)
Implement taskq_dispatch_prealloc() interface
This patch implements the taskq_dispatch_prealloc() interface which was introduced by the following illumos-gate commit. It allows for a preallocated taskq_ent_t to be used when dispatching items to a taskq. This eliminates a memory allocation which helps minimize lock contention in the taskq when dispatching functions. commit 5aeb94743e3be0c51e86f73096334611ae3a058e Author: Garrett D'Amore <[email protected]> Date: Wed Jul 27 07:13:44 2011 -0700 734 taskq_dispatch_prealloc() desired 943 zio_interrupt ends up calling taskq_dispatch with TQ_SLEEP Signed-off-by: Prakash Surya <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #65
Diffstat (limited to 'include')
-rw-r--r--include/sys/taskq.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/sys/taskq.h b/include/sys/taskq.h
index 4ea29cb3b..54d869afe 100644
--- a/include/sys/taskq.h
+++ b/include/sys/taskq.h
@@ -51,8 +51,11 @@ typedef struct taskq_ent {
taskqid_t tqent_id;
task_func_t *tqent_func;
void *tqent_arg;
+ uintptr_t tqent_flags;
} taskq_ent_t;
+#define TQENT_FLAG_PREALLOC 0x1
+
/*
* Flags for taskq_dispatch. TQ_SLEEP/TQ_NOSLEEP should be same as
* KM_SLEEP/KM_NOSLEEP. TQ_NOQUEUE/TQ_NOALLOC are set particularly
@@ -100,6 +103,9 @@ typedef struct taskq_thread {
extern taskq_t *system_taskq;
extern taskqid_t __taskq_dispatch(taskq_t *, task_func_t, void *, uint_t);
+extern void __taskq_dispatch_ent(taskq_t *, task_func_t, void *, uint_t, taskq_ent_t *);
+extern int __taskq_empty_ent(taskq_ent_t *);
+extern void __taskq_init_ent(taskq_ent_t *);
extern taskq_t *__taskq_create(const char *, int, pri_t, int, int, uint_t);
extern void __taskq_destroy(taskq_t *);
extern void __taskq_wait_id(taskq_t *, taskqid_t);
@@ -113,6 +119,9 @@ void spl_taskq_fini(void);
#define taskq_wait_id(tq, id) __taskq_wait_id(tq, id)
#define taskq_wait(tq) __taskq_wait(tq)
#define taskq_dispatch(tq, f, p, fl) __taskq_dispatch(tq, f, p, fl)
+#define taskq_dispatch_ent(tq, f, p, fl, t) __taskq_dispatch_ent(tq, f, p, fl, t)
+#define taskq_empty_ent(t) __taskq_empty_ent(t)
+#define taskq_init_ent(t) __taskq_init_ent(t)
#define taskq_create(n, th, p, mi, ma, fl) __taskq_create(n, th, p, mi, ma, fl)
#define taskq_create_proc(n, th, p, mi, ma, pr, fl) \
__taskq_create(n, th, p, mi, ma, fl)