Kevin Lawton wrote:

> I'm not sure we should forget about this.  Here's how
> udelay() is implemented in 2.2 and 2.4 kernels, if
> RDTSC is available:
> 
> static void __rdtsc_delay(unsigned long loops)
> {
>         unsigned long bclock, now;
>  
>         rdtscl(bclock);
>         do
>         {
>                 rdtscl(now);
>         }
>         while((now-bclock) < loops);
> }
> 
> There are a number of kernel drivers which call udelay().
> If we're trapping RDTSC, then performance would be horrible.

Why are you worrying about the performance of code that
does nothing but wait?  As long as we skew the values 
returned from RDTSC properly, that loop should run for
exactly the same amount of (guest) wall-clock time, no
matter whether it will take a million or a thousand
passes through the loop ...


Bye,
Ulrich 


-- 
  Dr. Ulrich Weigand
  [EMAIL PROTECTED]

Reply via email to