[lkml]   [2007]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/11] Sched clock paravirt op
Andi Kleen wrote:
>> .write_msr = native_write_msr,
>> .read_tsc = native_read_tsc,
>> .read_pmc = native_read_pmc,
>> + .get_scheduled_cycles = native_read_tsc,
>> + .get_cpu_khz = native_calculate_cpu_khz,
>> .load_tr_desc = native_load_tr_desc,
> Description missing?

I missed a title / signed-off on this guy.

Internally, sched_clock runs in units of nanoseconds, not CPU cycles.
This was wrong in my previous patch. Fix it so everyone can use the
same cycles_2_ns code in tsc.c.

Signed-off-by: Zachary Amsden <>

> Please write at least two paragraphs or more on each new hook
> you want to add.

Not a new hook; I just changed the name.

> My feeling is that rdtsc should work fine here. If not please explain.

It depends. Scheduled clock must be in units of available time - stolen
time is not always evenly distributed. If you make rdtsc just be
scheduled clock, that almost works. But most places that use rdtsc
expect it to be in cycles of approximate real time, and to leap forward
if something like SMM comes along and steals time.

Not that this is pretty. Arguably, the TSC should just run at a fixed
rate, not progress during stolen time. This idealized TSC assumption is
not however how Linux is making use of the TSC today. TSC is more like
real time, only in a VM, it can't quite keep up with real time, so it
gets simulated.

Scheduled (or available) time and real time are good notions. Stolen
time is debatable. But TSC is basically just always wrong. That's why
I don't want to overload the rdtsc operation.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-02-06 23:49    [W:0.216 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site