On Dec 16, 2013, at 10:34, erik quanstrom <[email protected]> wrote:

>> /*
>> *  put the processor in the halt state if we've no processes to run.
>> *  an interrupt will get us going again.
>> */
>> void
>> idlehands(void)
>> {
>>        extern int nrdy;
>> 
>>        if(conf.nmach == 1)
>>                halt();
>>        else if(m->cpuidcx & Monitor)
>>                mwait(&nrdy);
>> }
>> 
>> the reason for not just unconditionally calling halt() on a
>> *multiprocessor*
>> is that this would keep the processor sleeping even when processes become
>> ready to be executed. there is currently no way for the first woken
>> processor
>> to wakup another one other than the monitor/mwait mechanism; which for some
>> reason seems not to be emulated in that vmware fusion setup. one can run
>> aux/cpuid to see what processor features are supported.
>> 
>> yes, theres the HZ tick that should wake up the sleeping processor
>> eventually,
>> but then it might be too late.
> 
> it won't be "too late"—as causing failures.  i've tried testing this and
> generally found that reduced contention on the dog pile lock means
> unconditionally halting gives a performance boost.
> 
> - erik
> 

What are the changes you made to 9atom to facilitate this? Just replacing the 
if/else with a halt?


Reply via email to