summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_taskqueue.c
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2003-02-26 03:15:42 +0000
committerscottl <scottl@FreeBSD.org>2003-02-26 03:15:42 +0000
commit9317dd98415bf426c742032e63da549a3488b8a1 (patch)
treead64b7fff0868ef683f7e5764838fab2d311b965 /sys/kern/subr_taskqueue.c
parent9390269c86215a6c8dfb14df61c198cfe89e7fc7 (diff)
downloadFreeBSD-src-9317dd98415bf426c742032e63da549a3488b8a1.zip
FreeBSD-src-9317dd98415bf426c742032e63da549a3488b8a1.tar.gz
Introduce a new taskqueue that runs completely free of Giant, and in
turns runs its tasks free of Giant too. It is intended that as drivers become locked down, they will move out of the old, Giant-bound taskqueue and into this new one. The old taskqueue has been renamed to taskqueue_swi_giant, and the new one keeps the name taskqueue_swi.
Diffstat (limited to 'sys/kern/subr_taskqueue.c')
-rw-r--r--sys/kern/subr_taskqueue.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/sys/kern/subr_taskqueue.c b/sys/kern/subr_taskqueue.c
index 28fbe38..8cccc8d 100644
--- a/sys/kern/subr_taskqueue.c
+++ b/sys/kern/subr_taskqueue.c
@@ -41,6 +41,7 @@ static MALLOC_DEFINE(M_TASKQUEUE, "taskqueue", "Task Queues");
static STAILQ_HEAD(taskqueue_list, taskqueue) taskqueue_queues;
static void *taskqueue_ih;
+static void *taskqueue_giant_ih;
static struct mtx taskqueue_queues_mutex;
struct taskqueue {
@@ -219,6 +220,22 @@ taskqueue_swi_run(void *dummy)
taskqueue_run(taskqueue_swi);
}
+static void
+taskqueue_swi_giant_enqueue(void *context)
+{
+ swi_sched(taskqueue_giant_ih, 0);
+}
+
+static void
+taskqueue_swi_giant_run(void *dummy)
+{
+ taskqueue_run(taskqueue_swi_giant);
+}
+
TASKQUEUE_DEFINE(swi, taskqueue_swi_enqueue, 0,
- swi_add(NULL, "task queue", taskqueue_swi_run, NULL, SWI_TQ, 0,
- &taskqueue_ih));
+ swi_add(NULL, "task queue", taskqueue_swi_run, NULL, SWI_TQ,
+ INTR_MPSAFE, &taskqueue_ih));
+
+TASKQUEUE_DEFINE(swi_giant, taskqueue_swi_giant_enqueue, 0,
+ swi_add(NULL, "Giant task queue", taskqueue_swi_giant_run,
+ NULL, SWI_TQ_GIANT, 0, &taskqueue_giant_ih));
OpenPOWER on IntegriCloud