Re: sched_clock() uses are broken

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

 



On Wed, 3 May 2006, George Anzinger wrote:

> Nicolas Pitre wrote:
> > Yet that counter isn't necessarily nanosecond based.  So rescaling the
> > returned value to nanosecs requires expensive divisions which could be done
> > only once within sched_clock_diff() instead of twice as often in each
> > sched_clock() calls.
> 
> Oh phooey!!  Scaling can be done with a mpy and a shift.  See the new clock
> code where the TSC (or what ever) is scaled to ns.

I know.

And if you want to preserve more than 32 bits of precision you need 4 
mpy_and_add insns with a shift on ARM at least.

But the point remains that it is more efficient to do it once rather 
than twice or more.


Nicolas
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux