Kevin Lawton wrote:
> 
> Ramon van Handel wrote:
> >
> > Kevin Lawton wrote:
> > > Which brings up something else.  One nice thing to put into
> > > open source OSes would be calling an interface to the VM
> > > code to handle delay loops.
> >
> > Most OSes do this pretty well...
> > If they can't fill up the delay, they call
> > HLT to idle the processor.
> 
> I haven't looked at the Linux delay code for 2.4.  How
> do they handle delays for IO devices (based on bogomips)
> these days?  HLT is no problem to handle.  Tight loops
> are a waste in the VM.

Tight loops (the BogoMIPS loop) are only used for very short
delays anyway (and they have always been) --- it would not only
be a waste of VM time if they were used for longer ones,
it would be a waste of "ordinary" CPU time as well!!
Tight loops are only used when you can't do anything useful
in the meantime anyway, and for such situations the VM could
not make it more efficient either.  Longer delays are handled
by the scheduler, which will run the idle thread (calling HLT)
if it has nothing better to do.

My opinion: don't worry about it --- it's not worth it.

-- Ramon

Reply via email to