ULE can leak TDQ_LOCK() if statclock() called outside of critical_enter()

Ryan Stone rysto32 at gmail.com
Sun Jan 20 16:33:06 UTC 2013


On Sun, Jan 20, 2013 at 5:29 AM, Konstantin Belousov <kostikbel at gmail.com>wrote:

> Both atrtc and hpet register the interrupt handler as the filter.
> The filters call loop enters critical section around handlers, see
> kern_intr.c:intr_event_handle(). At least on HEAD it is so, and I see
> the same code in the 8.
>

Huh, I missed that.  However, on 8.2 ipi_bitmap_handler does not do a
critical_enter() (while HEAD does), so if CPU 0 gets an IPI_STATCLOCK, we
have my bug.  I have DTrace data (from 8.2) showing a thread entering
sched_switch() from sched_balance() when called through an IPI_STATCLOCK.

I'll poke around some more in HEAD to see if there are any entry points
(maybe on other architectures) that don't do a critical section, and then
add the assertions that you suggested.


More information about the freebsd-current mailing list