[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4665AEE5.7040904@zytor.com>
Date: Tue, 05 Jun 2007 11:43:49 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Andi Kleen <ak@...e.de>
CC: Andrew Morton <akpm@...ux-foundation.org>,
Rusty Russell <rusty@...tcorp.com.au>,
Matt Mackall <mpm@...enic.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] lguest-fix-divide-error-implement-sched_clock
Andi Kleen wrote:
>
> I don't think it's a good idea for the TSC. There are various
> setups where it is unreliable and also often simulators don't
> implement it correctly. And it's always a valuable workaround
> to be able to turn it off.
>
I dug some more into the TSC code, and found some other annoying stuff:
/*
* Make an educated guess if the TSC is trustworthy and synchronized
* over all CPUs.
*/
__cpuinit int unsynchronized_tsc(void)
{
if (!cpu_has_tsc || tsc_unstable)
return 1;
/*
* Intel systems are normally all synchronized.
* Exceptions must mark TSC as unstable:
*/
if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) {
/* assume multi socket systems are not synchronized: */
if (num_possible_cpus() > 1)
tsc_unstable = 1;
}
return tsc_unstable;
}
That's a vendor check foul. That should be a CPU feature flag.
Looks like there is some work to be done here.
-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists