diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index 49cef3875cc5..904c0969e9ef 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -660,7 +660,7 @@ aac_intr(void *arg) /* It's not ok to return here because of races with the previous step */ if (reason & AAC_DB_RESPONSE_READY) /* handle completion processing */ - taskqueue_enqueue(taskqueue_swi, &sc->aac_task_complete); + taskqueue_enqueue(taskqueue_swi_giant, &sc->aac_task_complete); /* controller wants to talk to the log */ if (reason & AAC_DB_PRINTF) { diff --git a/sys/dev/amr/amr.c b/sys/dev/amr/amr.c index 6d11bec10576..bf81df399572 100644 --- a/sys/dev/amr/amr.c +++ b/sys/dev/amr/amr.c @@ -1370,7 +1370,7 @@ amr_done(struct amr_softc *sc) /* handle completion and timeouts */ #if __FreeBSD_version >= 500005 if (sc->amr_state & AMR_STATE_INTEN) - taskqueue_enqueue(taskqueue_swi, &sc->amr_task_complete); + taskqueue_enqueue(taskqueue_swi_giant, &sc->amr_task_complete); else #endif amr_complete(sc, 0); diff --git a/sys/dev/mly/mly.c b/sys/dev/mly/mly.c index 4fd18801849b..d9e18eb058d2 100644 --- a/sys/dev/mly/mly.c +++ b/sys/dev/mly/mly.c @@ -1610,7 +1610,7 @@ mly_done(struct mly_softc *sc) if (worked) { #if __FreeBSD_version >= 500005 if (sc->mly_state & MLY_STATE_INTERRUPTS_ON) - taskqueue_enqueue(taskqueue_swi, &sc->mly_task_complete); + taskqueue_enqueue(taskqueue_swi_giant, &sc->mly_task_complete); else #endif mly_complete(sc, 0); diff --git a/sys/kern/subr_taskqueue.c b/sys/kern/subr_taskqueue.c index 28fbe3873564..8cccc8d61593 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)); diff --git a/sys/modules/aac/Makefile b/sys/modules/aac/Makefile index f4f01752697e..782b1a51c195 100644 --- a/sys/modules/aac/Makefile +++ b/sys/modules/aac/Makefile @@ -12,5 +12,6 @@ SRCS+= device_if.h bus_if.h pci_if.h # To enable debug output from the driver, uncomment these two lines. #CFLAGS+= -DAAC_DEBUG=2 #SRCS+= aac_debug.c +CFLAGS+= -g .include diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c index 8fa8a08e5ce3..2221f444cd0e 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c @@ -251,7 +251,7 @@ ng_btsocket_hci_raw_node_rcvmsg(node_p node, item_p item, hook_p lasthook) error = ENOBUFS; } else { NG_BT_ITEMQ_ENQUEUE(&ng_btsocket_hci_raw_queue, item); - error = taskqueue_enqueue(taskqueue_swi, + error = taskqueue_enqueue(taskqueue_swi_giant, &ng_btsocket_hci_raw_task); } mtx_unlock(&ng_btsocket_hci_raw_queue_mtx); @@ -300,7 +300,7 @@ ng_btsocket_hci_raw_node_rcvdata(hook_p hook, item_p item) error = ENOBUFS; } else { NG_BT_ITEMQ_ENQUEUE(&ng_btsocket_hci_raw_queue, item); - error = taskqueue_enqueue(taskqueue_swi, + error = taskqueue_enqueue(taskqueue_swi_giant, &ng_btsocket_hci_raw_task); } mtx_unlock(&ng_btsocket_hci_raw_queue_mtx); diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c index dec7a3c2e62e..f4c99f78fceb 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c @@ -309,7 +309,7 @@ ng_btsocket_l2cap_node_disconnect(hook_p hook) */ if (NG_HOOK_PRIVATE(hook) != NULL) - return (taskqueue_enqueue(taskqueue_swi, + return (taskqueue_enqueue(taskqueue_swi_giant, &ng_btsocket_l2cap_rt_task)); NG_HOOK_UNREF(hook); /* Remove extra reference */ @@ -343,7 +343,7 @@ ng_btsocket_l2cap_node_rcvmsg(node_p node, item_p item, hook_p hook) } NG_BT_ITEMQ_ENQUEUE(&ng_btsocket_l2cap_queue, item); - error = taskqueue_enqueue(taskqueue_swi, + error = taskqueue_enqueue(taskqueue_swi_giant, &ng_btsocket_l2cap_queue_task); } mtx_unlock(&ng_btsocket_l2cap_queue_mtx); @@ -377,7 +377,7 @@ ng_btsocket_l2cap_node_rcvdata(hook_p hook, item_p item) NGI_SET_HOOK(item, hook); NG_BT_ITEMQ_ENQUEUE(&ng_btsocket_l2cap_queue, item); - error = taskqueue_enqueue(taskqueue_swi, + error = taskqueue_enqueue(taskqueue_swi_giant, &ng_btsocket_l2cap_queue_task); } mtx_unlock(&ng_btsocket_l2cap_queue_mtx); diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c index 3b24afd73a9f..56a53b96ec46 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c @@ -242,7 +242,7 @@ ng_btsocket_l2cap_raw_node_disconnect(hook_p hook) */ if (NG_HOOK_PRIVATE(hook) != NULL) - return (taskqueue_enqueue(taskqueue_swi, + return (taskqueue_enqueue(taskqueue_swi_giant, &ng_btsocket_l2cap_raw_rt_task)); NG_HOOK_UNREF(hook); /* Remove extra reference */ @@ -276,7 +276,7 @@ ng_btsocket_l2cap_raw_node_rcvmsg(node_p node, item_p item, hook_p hook) } NG_BT_ITEMQ_ENQUEUE(&ng_btsocket_l2cap_raw_queue, item); - error = taskqueue_enqueue(taskqueue_swi, + error = taskqueue_enqueue(taskqueue_swi_giant, &ng_btsocket_l2cap_raw_queue_task); } mtx_unlock(&ng_btsocket_l2cap_raw_queue_mtx); diff --git a/sys/sys/interrupt.h b/sys/sys/interrupt.h index 61d3ab657dd6..a48efb79851a 100644 --- a/sys/sys/interrupt.h +++ b/sys/sys/interrupt.h @@ -94,8 +94,9 @@ struct ithd { #define SWI_CAMNET 2 #define SWI_CAMBIO 3 #define SWI_VM 4 -#define SWI_TQ 5 -#define SWI_CLOCK 6 +#define SWI_TQ_GIANT 5 +#define SWI_TQ 6 +#define SWI_CLOCK 7 extern struct ithd *tty_ithd; extern struct ithd *clk_ithd; diff --git a/sys/sys/taskqueue.h b/sys/sys/taskqueue.h index 4cad2dcd54a7..953bc28c4411 100644 --- a/sys/sys/taskqueue.h +++ b/sys/sys/taskqueue.h @@ -110,6 +110,7 @@ struct __hack * This queue is serviced by a software interrupt handler. To enqueue * a task, call taskqueue_enqueue(taskqueue_swi, &task). */ +TASKQUEUE_DECLARE(swi_giant); TASKQUEUE_DECLARE(swi); #endif /* !_SYS_TASKQUEUE_H_ */