M sys/kern/subr_taskqueue.c @@ -108,6 +108,7 @@ TQ_UNLOCK(struct taskqueue *tq) static __inline void TQ_SLEEP(struct taskqueue *tq, void *ident, const char *wmesg) { + kprintf("[ALY/DEBUG] %s@cpu#%d: tq=%p, ident=%p ...\n", __func__, mycpuid, tq, ident); ssleep(ident, &tq->tq_lock, 0, wmesg, 0); } @@ -613,10 +614,13 @@ taskqueue_thread_loop(void *arg) tqp = arg; tq = *tqp; + kprintf("[ALY/DEBUG] %s@cpu#%d: starting tq=%p ...\n", __func__, mycpuid, tq); TQ_LOCK(tq); while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) { + kprintf("[ALY/DEBUG] %s@cpu#%d: running tq=%p ...\n", __func__, mycpuid, tq); taskqueue_run(tq, 1); TQ_SLEEP(tq, tq, "tqthr"); + kprintf("[ALY/DEBUG] %s@cpu#%d: tq=%p woken up\n", __func__, mycpuid, tq); } /* rendezvous with thread that asked us to terminate */ @@ -637,6 +641,7 @@ taskqueue_thread_enqueue(void *context) /* Unlock spinlock before wakeup_one() */ TQ_UNLOCK(tq); + kprintf("[ALY/DEBUG] %s@cpu#%d: waking up tq=%p ...\n", __func__, mycpuid, tq); wakeup_one(tq); TQ_LOCK(tq); } $ sudo kldload ./if_wg.ko [ALY/DEBUG] wg_module_init@cpu#0: created tq=0xfffff80065c97db8 [ALY/DEBUG] wg_module_init@cpu#0: created tq=0xfffff80065c97e10 [ALY/DEBUG] wg_module_init@cpu#0: created tq=0xfffff80065c97e68 [ALY/DEBUG] wg_module_init@cpu#0: created tq=0xfffff80065c97ec0 [ALY/DEBUG] taskqueue_thread_loop@cpu#0: starting tq=0xfffff80065c97db8 ... [ALY/DEBUG] taskqueue_thread_loop@cpu#0: running tq=0xfffff80065c97db8 ... [ALY/DEBUG] TQ_SLEEP@cpu#0: tq=0xfffff80065c97db8, ident=0xfffff80065c97db8 ... $ ps -ax -O nwchan | grep wg_ -1 fffff80065c97db8 ?? B0 0:00.01 (wg_taskq_cpu_0) -1 fffff80065c97e10 ?? B1 0:00.00 (wg_taskq_cpu_1) -1 fffff80065c97e68 ?? B2 0:00.00 (wg_taskq_cpu_2) -1 fffff80065c97ec0 ?? B3 0:00.00 (wg_taskq_cpu_3) $ ps -ax -O wchan | grep wg_taskq -1 tqthr ?? B0 0:00.01 (wg_taskq_cpu_0) -1 tqthr ?? B1 0:00.00 (wg_taskq_cpu_1) -1 tqthr ?? B2 0:00.00 (wg_taskq_cpu_2) -1 tqthr ?? B3 0:00.00 (wg_taskq_cpu_3) $ sudo kldunload if_wg [ALY/DEBUG] TQ_SLEEP@cpu#0: tq=0xfffff80065c97db8, ident=0xfffff800463426f0 ... [ALY/DEBUG] taskqueue_thread_loop@cpu#0: tq=0xfffff80065c97db8 woken up [ALY/DEBUG] TQ_SLEEP@cpu#0: tq=0xfffff80065c97e10, ident=0xfffff800463426f8 ... [ALY/DEBUG] taskqueue_thread_loop@cpu#1: tq=0xfffff80065c97e10 woken up [ALY/DEBUG] TQ_SLEEP@cpu#0: tq=0xfffff80065c97e68, ident=0xfffff80046342700 ... [ALY/DEBUG] taskqueue_thread_loop@cpu#2: tq=0xfffff80065c97e68 woken up [ALY/DEBUG] TQ_SLEEP@cpu#0: tq=0xfffff80065c97ec0, ident=0xfffff80046342708 ... [ALY/DEBUG] taskqueue_thread_loop@cpu#3: tq=0xfffff80065c97ec0 woken up