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

Re: Detangle lwkt_switch() and the idle thread and consolidate sleep variables


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 3 Sep 2007 10:38:03 -0700 (PDT)

:That's exactly my concern.  I guess we don't use so many tokens anymore, 
:but as long as we use the MP lock, we'll have this issue.  And it would 
:be nice if we could use WMAIT in this case.
:
:>     Then we can use MONITOR and MWAIT in both the spinlock contended
:>     procedure and in the idle loop without having to physically disable
:>     interrupts.
:
:Yes, we should even use this directly, without doing this backoff dance. 
:  There is no sense in running NOPs if we could instead simply wait 
:until the lock gets updated.
:
:However the code right now doesn't look like it was written with this in 
:mind :)
:
:cheers
:   simon

    Well, at least insofar as spinlocks go it's all in one nifty little
    procedure.  Yah, we probably dont need the backoff dance when MWAIT
    is available, though it should still loop a few times trying to get
    the spinlock because I'm sure actually calling MWAIT has some serious
    cycle overhead.  Spinlocks aren't meant to be held for long periods
    of time.

    I suspect that the biggest benefit would come from an idle loop
    implementation.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>



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