Commit 845d4284 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86_64: use TSC on SMP EM64T machines

x86-64 MP kernels always used HPET timing when available.  This was done
because AMD systems don't have synchronized TSCs in all cases.  On Intel
this is not true (except Summit), so use faster TSC timing for those.

Also only enable HPET gettimeofday when there is more than one CPU online.
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ca71c003
......@@ -909,15 +909,28 @@ void __init time_init_smp(void)
{
char *timetype;
if (vxtime.hpet_address) {
/*
* AMD systems with more than one CPU don't have fully synchronized
* TSCs. Always use HPET gettimeofday for these, although it is slower.
* Intel SMP systems usually have synchronized TSCs, so use always
* the TSC.
*
* Exceptions:
* IBM Summit. Will need to be special cased later.
* AMD dual core may also not need HPET. Check me.
*/
if (vxtime.hpet_address &&
num_online_cpus() > 1 &&
boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
timetype = "HPET";
vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick;
vxtime.mode = VXTIME_HPET;
do_gettimeoffset = do_gettimeoffset_hpet;
} else {
timetype = "PIT/TSC";
timetype = vxtime.hpet_address ? "HPET/TSC" : "PIT/TSC";
vxtime.mode = VXTIME_TSC;
}
printk(KERN_INFO "time.c: Using %s based timekeeping.\n", timetype);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment