Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/openzfs/module/os/linux/spl/spl-taskq.c
Show First 20 Lines • Show All 268 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
static taskqid_t | static taskqid_t | ||||
taskq_lowest_id(taskq_t *tq) | taskq_lowest_id(taskq_t *tq) | ||||
{ | { | ||||
taskqid_t lowest_id = tq->tq_next_id; | taskqid_t lowest_id = tq->tq_next_id; | ||||
taskq_ent_t *t; | taskq_ent_t *t; | ||||
taskq_thread_t *tqt; | taskq_thread_t *tqt; | ||||
ASSERT(tq); | |||||
if (!list_empty(&tq->tq_pend_list)) { | if (!list_empty(&tq->tq_pend_list)) { | ||||
t = list_entry(tq->tq_pend_list.next, taskq_ent_t, tqent_list); | t = list_entry(tq->tq_pend_list.next, taskq_ent_t, tqent_list); | ||||
lowest_id = MIN(lowest_id, t->tqent_id); | lowest_id = MIN(lowest_id, t->tqent_id); | ||||
} | } | ||||
if (!list_empty(&tq->tq_prio_list)) { | if (!list_empty(&tq->tq_prio_list)) { | ||||
t = list_entry(tq->tq_prio_list.next, taskq_ent_t, tqent_list); | t = list_entry(tq->tq_prio_list.next, taskq_ent_t, tqent_list); | ||||
lowest_id = MIN(lowest_id, t->tqent_id); | lowest_id = MIN(lowest_id, t->tqent_id); | ||||
▲ Show 20 Lines • Show All 703 Lines • ▼ Show 20 Lines | taskq_thread(void *args) | ||||
__set_current_state(TASK_RUNNING); | __set_current_state(TASK_RUNNING); | ||||
tq->tq_nthreads--; | tq->tq_nthreads--; | ||||
list_del_init(&tqt->tqt_thread_list); | list_del_init(&tqt->tqt_thread_list); | ||||
error: | error: | ||||
kmem_free(tqt, sizeof (taskq_thread_t)); | kmem_free(tqt, sizeof (taskq_thread_t)); | ||||
spin_unlock_irqrestore(&tq->tq_lock, flags); | spin_unlock_irqrestore(&tq->tq_lock, flags); | ||||
tsd_set(taskq_tsd, NULL); | tsd_set(taskq_tsd, NULL); | ||||
thread_exit(); | |||||
return (0); | return (0); | ||||
} | } | ||||
static taskq_thread_t * | static taskq_thread_t * | ||||
taskq_thread_create(taskq_t *tq) | taskq_thread_create(taskq_t *tq) | ||||
{ | { | ||||
static int last_used_cpu = 0; | static int last_used_cpu = 0; | ||||
▲ Show 20 Lines • Show All 424 Lines • Show Last 20 Lines |