DragonFly kernel List (threaded) for 2003-09
Update on 'lwkt_preempt(): held and no count' panic.
A couple of people have gotten this panic, as have I (leaf usually
panics on it within a week).
I finally tracked it down but the fix will not be comitted until
Basically the issue is that DragonFly has an mp_lock global for the
Big Giant Lock, but the lock count is stored on a per-thread basis
This means that manipulating the MP lock with interrupts enabled and
outside a critical section can result in races. e.g. if you were to
obtain mp_lock prior to incrementing td_mpcount an interrupt could
come along and obtain and release mp_lock, then return, and you would
end up not holding mp_lock.
I thought I had dealt with these race conditions but I missed one. I've
decided to clean the code up rather then just hack in a fix and I will
be comitting the cleaned up code tomorrow and, hopefully, not introduce
any new bugs in doing so.