Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/subr_gtaskqueue.c
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
#include <sys/unistd.h> | #include <sys/unistd.h> | ||||
#include <machine/stdarg.h> | #include <machine/stdarg.h> | ||||
static MALLOC_DEFINE(M_GTASKQUEUE, "gtaskqueue", "Group Task Queues"); | static MALLOC_DEFINE(M_GTASKQUEUE, "gtaskqueue", "Group Task Queues"); | ||||
static void gtaskqueue_thread_enqueue(void *); | static void gtaskqueue_thread_enqueue(void *); | ||||
static void gtaskqueue_thread_loop(void *arg); | static void gtaskqueue_thread_loop(void *arg); | ||||
TASKQGROUP_DEFINE(softirq, mp_ncpus, 1); | TASKQGROUP_DEFINE(softirq, mp_ncpus, 1); | ||||
TASKQGROUP_DEFINE(config, 1, 1); | |||||
struct gtaskqueue_busy { | struct gtaskqueue_busy { | ||||
struct gtask *tb_running; | struct gtask *tb_running; | ||||
TAILQ_ENTRY(gtaskqueue_busy) tb_link; | TAILQ_ENTRY(gtaskqueue_busy) tb_link; | ||||
}; | }; | ||||
static struct gtask * const TB_DRAIN_WAITER = (struct gtask *)0x1; | static struct gtask * const TB_DRAIN_WAITER = (struct gtask *)0x1; | ||||
▲ Show 20 Lines • Show All 593 Lines • ▼ Show 20 Lines | tqg_record_smp_started(void *arg) | ||||
tqg_smp_started = 1; | tqg_smp_started = 1; | ||||
} | } | ||||
SYSINIT(tqg_record_smp_started, SI_SUB_SMP, SI_ORDER_FOURTH, | SYSINIT(tqg_record_smp_started, SI_SUB_SMP, SI_ORDER_FOURTH, | ||||
tqg_record_smp_started, NULL); | tqg_record_smp_started, NULL); | ||||
void | void | ||||
taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *gtask, | taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *gtask, | ||||
void *uniq, int irq, char *name) | void *uniq, int irq, const char *name) | ||||
{ | { | ||||
cpuset_t mask; | cpuset_t mask; | ||||
int qid, error; | int qid, error; | ||||
gtask->gt_uniq = uniq; | gtask->gt_uniq = uniq; | ||||
snprintf(gtask->gt_name, GROUPTASK_NAMELEN, "%s", name ? name : "grouptask"); | snprintf(gtask->gt_name, GROUPTASK_NAMELEN, "%s", name ? name : "grouptask"); | ||||
gtask->gt_irq = irq; | gtask->gt_irq = irq; | ||||
gtask->gt_cpu = -1; | gtask->gt_cpu = -1; | ||||
▲ Show 20 Lines • Show All 297 Lines • ▼ Show 20 Lines | taskqgroup_create(char *name) | ||||
return (qgroup); | return (qgroup); | ||||
} | } | ||||
void | void | ||||
taskqgroup_destroy(struct taskqgroup *qgroup) | taskqgroup_destroy(struct taskqgroup *qgroup) | ||||
{ | { | ||||
} | |||||
void | |||||
taskqgroup_config_gtask_init(void *ctx, struct grouptask *gtask, gtask_fn_t *fn, | |||||
const char *name) | |||||
{ | |||||
GROUPTASK_INIT(gtask, 0, fn, ctx); | |||||
taskqgroup_attach(qgroup_config, gtask, gtask, -1, name); | |||||
} | } |