lwkt_token_is_stale patch

Matthew Dillon dillon at apollo.backplane.com
Fri Feb 29 11:53:07 PST 2008


::   http://leaf.dragonflybsd.org/mailarchive/kernel/2008-02/msg00015.html
:
:    Absolutely.  I'll check it out right now.
:..
:...
:    Hmm.  Yes, if the compiler breaks the operation down into multiple
:    instructions the decrement could get lost.  The compiler will virtually
:    never do that, but the only way for us to guarantee that it doesn't
:    (that is, to guarantee that the decrement is performed with a 
:    single instruction) is to call the atomic_subtract_int_nonlocked()
:    inline.
:
:    I will make that change.

    Ok, turns out you fixed the UP race issue in your patch already, by
    decrementing t_count prior to removing the token from the list.  Cool.

    I fleshed out some of the comments in the patch but otherwise it looks
    like it will be able to go in without any more adjustments to the code.
    It looks very good.  I'm running some tests now and will commit it
    today.

    Once we get it in we can check the code base for places where using
    the new lwkt_token_is_stale() call would be beneficial, but even if
    there aren't any obvious locations as yet the changes definitely
    revitalize the token code and I'll bet we will be able to use it in
    more places.

					-Matt
					Matthew Dillon 
					<dillon at backplane.com>





More information about the Submit mailing list