DragonFly kernel List (threaded) for 2007-09
Re: Detangle lwkt_switch() and the idle thread and consolidate sleep variables
: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
: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
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
I suspect that the biggest benefit would come from an idle loop