Update on 'lwkt_preempt(): held and no count' panic.
Matthew Dillon
dillon at apollo.backplane.com
Thu Sep 25 00:38:33 PDT 2003
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
tomorrow.
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
as td_mpcount.
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.
-Matt
More information about the Kernel
mailing list