Bill.Holler wrote:

> On 09/05/08 17:47, Li, Aubrey wrote:
>> Bill.Holler wrote:
>> 
>> 
>>> Can't this code can just read the TSC directly with  something like
>>> tsc_read().  :-)  Both gethrtime() calls are done with interrupts
>>> disabled on the same CPU just before and after going into
>>> Deep C-State.  Interrups are not enabled between the two
>>> gethrtime() calls.  The two TSC values will be accurate with each
>>> other during this interval.  A difference is computed,
>>> so tsc_sync_tick_delta is not needed.
>>> 
>>> The TSC difference will have to be scaled to nonoseconds
>>> with something like tsc_scalehrtime.
>>> 
>>> 
>> 
>> Do you mean the following change?  :-)
>> 
> 
> Yes, this change is exactly when I meant.
> 
>> I tried it yesterday, I still saw 80%~ in C0 in powertop when system
>> is idle. Current cstate of most cpus are also in C0. But vmstat and
>> mpstat shows that idle is almost 100%(obtained from mstate). I
>> didn't figure out yesterday. 
>> 
> This has me baffled too.  :-0
> mpstat and vmstat show the same almost 100% idle on my system.
> I will not be able to look into it until tomorrow.
> 
>> Did I miss anything?
>> 
> 
> What is happening inside the DTRACE_PROBE1 ?
> Is it using gethrtime()?

When dtrace probe not fired, current_cstate can observe this as well.
"$kstat | grep current_cstate" should has nothing to do with
gethrtime(). :-)

Thanks,
-Aubrey

Reply via email to