login
Header Space

 
 

Re: sched_clock() on i386

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Daniel Walker <dwalker@...>
Cc: <linux-kernel@...>, <venkatesh.pallipadi@...>, <suresh.b.siddha@...>, <kenneth.w.chen@...>, <tony.luck@...>
Date: Wednesday, January 3, 2007 - 10:36 am

Daniel,

On Sat, Dec 23, 2006 at 07:53:47AM -0800, Daniel Walker wrote:
My understanding is that you'll get a per-CPU timestamp expressed in nanoseconds.
The granularity of the returned value is highly dependent on the CPU
architecture (and apparently on how you've compiled your kernel).

I do NOT need a wall-clock time. I am looking for a simple per-CPU clock
source with best possible granularity. I use the clock to compute elapsed
execution duration. I initially was using TSC, then during the code review
someone suggested I use sched_clock(). Using getttimeofday() can be failry
expensive and I need to compute the duration in the context switch path.

Now my understanding is that on some processors with frequence scaling,
using TSC may not easily allow computing elapsed time. So there may not
be any cheap solution to my problem.


-- 

-Stephane
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: sched_clock() on i386, Stephane Eranian, (Wed Jan 3, 10:36 am)
speck-geostationary