DragonFly BSD
DragonFly kernel List (threaded) for 2003-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Update on 'lwkt_preempt(): held and no count' panic.

From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 25 Sep 2003 00:38:17 -0700 (PDT)

    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
    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.


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