NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/60728 (workqueue panic in wg)



Synopsis: workqueue panic in wg

State-Changed-From-To: open->feedback
State-Changed-By: riastradh%NetBSD.org@localhost
State-Changed-When: Tue, 15 Sep 2026 17:01:42 +0000
State-Changed-Why:
1. Do you have a crash dump?

2. Is this reproducible?

3. Do you have any local patches?

4. Have you run a memory test on this machine?


The workqueue_enqueue calls are serialized by wgp_intr_lock,
conditional on wgp_tasks != 0, and wgp_tasks transitions to zero only
after the workqueue function begins to run:

   2811 	mutex_enter(wgp->wgp_intr_lock);
   2812 	WG_DLOG("tasks=%d, task=%d\n", wgp->wgp_tasks, task);
   2813 	if (wgp->wgp_tasks == 0)
   2814 		/*
   2815 		 * XXX If the current CPU is already loaded -- e.g., if
   2816 		 * there's already a bunch of handshakes queued up --
   2817 		 * consider tossing this over to another CPU to
   2818 		 * distribute the load.
   2819 		 */
   2820 		workqueue_enqueue(wg_wq, &wgp->wgp_work, NULL);
   2821 	wgp->wgp_tasks |= task;
   2822 	mutex_exit(wgp->wgp_intr_lock);
...
   3713 static void
   3714 wg_peer_work(struct work *wk, void *cookie)
   3715 {
...
   3720 	mutex_enter(wgp->wgp_intr_lock);
   3721 	while ((tasks = wgp->wgp_tasks) != 0) {
   3722 		wgp->wgp_tasks = 0;
   3723 		mutex_exit(wgp->wgp_intr_lock);
...
   3740 		mutex_enter(wgp->wgp_intr_lock);
   3741 	}
   3742 	mutex_exit(wgp->wgp_intr_lock);

https://nxr.NetBSD.org/xref/src/sys/net/if_wg.c?r=1.143#2811






Home | Main Index | Thread Index | Old Index