Lines Matching refs:threadpool
103 #include <sys/threadpool.h>
107 SDT_PROBE_DEFINE1(sdt, kernel, threadpool, get,
109 SDT_PROBE_DEFINE1(sdt, kernel, threadpool, get__create,
111 SDT_PROBE_DEFINE1(sdt, kernel, threadpool, get__race,
113 SDT_PROBE_DEFINE2(sdt, kernel, threadpool, put,
114 "struct threadpool *"/*pool*/, "pri_t"/*pri*/);
115 SDT_PROBE_DEFINE2(sdt, kernel, threadpool, put__destroy,
116 "struct threadpool *"/*pool*/, "pri_t"/*pri*/);
118 SDT_PROBE_DEFINE1(sdt, kernel, threadpool, percpu__get,
120 SDT_PROBE_DEFINE1(sdt, kernel, threadpool, percpu__get__create,
122 SDT_PROBE_DEFINE1(sdt, kernel, threadpool, percpu__get__race,
124 SDT_PROBE_DEFINE2(sdt, kernel, threadpool, percpu__put,
125 "struct threadpool *"/*pool*/, "pri_t"/*pri*/);
126 SDT_PROBE_DEFINE2(sdt, kernel, threadpool, percpu__put__destroy,
127 "struct threadpool *"/*pool*/, "pri_t"/*pri*/);
129 SDT_PROBE_DEFINE2(sdt, kernel, threadpool, create,
131 SDT_PROBE_DEFINE3(sdt, kernel, threadpool, create__success,
132 "struct cpu_info *"/*ci*/, "pri_t"/*pri*/, "struct threadpool *"/*pool*/);
133 SDT_PROBE_DEFINE3(sdt, kernel, threadpool, create__failure,
135 SDT_PROBE_DEFINE1(sdt, kernel, threadpool, destroy,
136 "struct threadpool *"/*pool*/);
137 SDT_PROBE_DEFINE2(sdt, kernel, threadpool, destroy__wait,
138 "struct threadpool *"/*pool*/, "uint64_t"/*refcnt*/);
140 SDT_PROBE_DEFINE2(sdt, kernel, threadpool, schedule__job,
141 "struct threadpool *"/*pool*/, "struct threadpool_job *"/*job*/);
142 SDT_PROBE_DEFINE2(sdt, kernel, threadpool, schedule__job__running,
143 "struct threadpool *"/*pool*/, "struct threadpool_job *"/*job*/);
144 SDT_PROBE_DEFINE2(sdt, kernel, threadpool, schedule__job__dispatcher,
145 "struct threadpool *"/*pool*/, "struct threadpool_job *"/*job*/);
146 SDT_PROBE_DEFINE3(sdt, kernel, threadpool, schedule__job__thread,
147 "struct threadpool *"/*pool*/,
151 SDT_PROBE_DEFINE1(sdt, kernel, threadpool, dispatcher__start,
152 "struct threadpool *"/*pool*/);
153 SDT_PROBE_DEFINE1(sdt, kernel, threadpool, dispatcher__dying,
154 "struct threadpool *"/*pool*/);
155 SDT_PROBE_DEFINE1(sdt, kernel, threadpool, dispatcher__spawn,
156 "struct threadpool *"/*pool*/);
157 SDT_PROBE_DEFINE2(sdt, kernel, threadpool, dispatcher__race,
158 "struct threadpool *"/*pool*/,
160 SDT_PROBE_DEFINE3(sdt, kernel, threadpool, dispatcher__assign,
161 "struct threadpool *"/*pool*/,
164 SDT_PROBE_DEFINE1(sdt, kernel, threadpool, dispatcher__exit,
165 "struct threadpool *"/*pool*/);
167 SDT_PROBE_DEFINE1(sdt, kernel, threadpool, thread__start,
168 "struct threadpool *"/*pool*/);
169 SDT_PROBE_DEFINE1(sdt, kernel, threadpool, thread__dying,
170 "struct threadpool *"/*pool*/);
171 SDT_PROBE_DEFINE2(sdt, kernel, threadpool, thread__job,
172 "struct threadpool *"/*pool*/, "struct threadpool_job *"/*job*/);
173 SDT_PROBE_DEFINE1(sdt, kernel, threadpool, thread__exit,
174 "struct threadpool *"/*pool*/);
184 struct threadpool *tpt_pool;
190 struct threadpool {
202 static void threadpool_hold(struct threadpool *);
203 static void threadpool_rele(struct threadpool *);
227 struct threadpool tpu_pool;
324 "sysctl kern.threadpool subtree setup")
331 CTLTYPE_NODE, "threadpool",
332 SYSCTL_DESCR("threadpool subsystem options"),
380 threadpool_create(struct threadpool *const pool, struct cpu_info *ci,
390 SDT_PROBE2(sdt, kernel, threadpool, create, ci, pri);
421 SDT_PROBE3(sdt, kernel, threadpool, create__success, ci, pri, pool);
434 SDT_PROBE3(sdt, kernel, threadpool, create__failure, ci, pri, error);
441 threadpool_destroy(struct threadpool *pool)
445 SDT_PROBE1(sdt, kernel, threadpool, destroy, pool);
455 SDT_PROBE2(sdt, kernel, threadpool, destroy__wait,
473 threadpool_hold(struct threadpool *pool)
482 threadpool_rele(struct threadpool *pool)
494 threadpool_get(struct threadpool **poolp, pri_t pri)
501 SDT_PROBE1(sdt, kernel, threadpool, get, pri);
510 SDT_PROBE1(sdt, kernel, threadpool, get__create, pri);
524 SDT_PROBE1(sdt, kernel, threadpool, get__race, pri);
542 threadpool_put(struct threadpool *pool, pri_t pri)
550 SDT_PROBE2(sdt, kernel, threadpool, put, pool, pri);
556 SDT_PROBE2(sdt, kernel, threadpool, put__destroy, pool, pri);
579 SDT_PROBE1(sdt, kernel, threadpool, percpu__get, pri);
588 SDT_PROBE1(sdt, kernel, threadpool, percpu__get__create, pri);
600 SDT_PROBE1(sdt, kernel, threadpool, percpu__get__race,
624 SDT_PROBE2(sdt, kernel, threadpool, percpu__put, pool_percpu, pri);
630 SDT_PROBE2(sdt, kernel, threadpool, percpu__put__destroy,
642 struct threadpool *
645 struct threadpool **poolp, *pool;
654 struct threadpool *
658 struct threadpool **poolp, *pool;
682 pool_percpu->tpp_percpu = percpu_create(sizeof(struct threadpool *),
699 fail: percpu_free(pool_percpu->tpp_percpu, sizeof(struct threadpool *));
708 percpu_free(pool_percpu->tpp_percpu, sizeof(struct threadpool *));
715 struct threadpool **const poolp = vpoolp;
731 struct threadpool **const poolp = vpoolp;
741 struct threadpool **const poolp = vpoolp;
772 panic("threadpool job %p ran after destruction", job);
851 threadpool_schedule_job(struct threadpool *pool, struct threadpool_job *job)
856 SDT_PROBE2(sdt, kernel, threadpool, schedule__job, pool, job);
865 SDT_PROBE2(sdt, kernel, threadpool, schedule__job__running,
876 SDT_PROBE2(sdt, kernel, threadpool, schedule__job__dispatcher,
883 SDT_PROBE3(sdt, kernel, threadpool, schedule__job__thread,
897 threadpool_cancel_job_async(struct threadpool *pool, struct threadpool_job *job)
941 threadpool_cancel_job(struct threadpool *pool, struct threadpool_job *job)
967 struct threadpool *const pool = dispatcher->tpt_pool;
981 SDT_PROBE1(sdt, kernel, threadpool, dispatcher__start, pool);
987 SDT_PROBE1(sdt, kernel, threadpool,
998 SDT_PROBE1(sdt, kernel, threadpool, dispatcher__spawn,
1063 SDT_PROBE2(sdt, kernel, threadpool,
1075 SDT_PROBE2(sdt, kernel, threadpool,
1094 SDT_PROBE1(sdt, kernel, threadpool, dispatcher__exit, pool);
1105 struct threadpool *const pool = thread->tpt_pool;
1115 SDT_PROBE1(sdt, kernel, threadpool, thread__start, pool);
1122 SDT_PROBE1(sdt, kernel, threadpool,
1148 SDT_PROBE2(sdt, kernel, threadpool, thread__job, pool, job);
1171 SDT_PROBE1(sdt, kernel, threadpool, thread__exit, pool);