diff options
author | John Baldwin <jhb@FreeBSD.org> | 2015-01-29 20:41:42 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2015-01-29 20:41:42 +0000 |
commit | d141141610cd13c927e3460a22e49c8c21c237e5 (patch) | |
tree | 611a22134e925950340f50414f866f46b39d8798 | |
parent | 03ce3d7219f32ac05a4f824c7131d989120c14ad (diff) |
Notes
-rw-r--r-- | sys/x86/x86/tsc.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index e2ae73517fa1..a0b0f42a6aad 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -522,17 +522,22 @@ init_TSC_tc(void) } /* - * We cannot use the TSC if it stops incrementing while idle. * Intel CPUs without a C-state invariant TSC can stop the TSC - * in either C2 or C3. + * in either C2 or C3. Disable use of C2 and C3 while using + * the TSC as the timecounter. The timecounter can be changed + * to enable C2 and C3. + * + * Note that the TSC is used as the cputicker for computing + * thread runtime regardless of the timecounter setting, so + * using an alternate timecounter and enabling C2 or C3 can + * result incorrect runtimes for kernel idle threads (but not + * for any non-idle threads). */ if (cpu_deepest_sleep >= 2 && cpu_vendor_id == CPU_VENDOR_INTEL && (amd_pminfo & AMDPM_TSC_INVARIANT) == 0) { - tsc_timecounter.tc_quality = -1000; tsc_timecounter.tc_flags |= TC_FLAGS_C2STOP; if (bootverbose) - printf("TSC timecounter disabled: C2/C3 may halt it.\n"); - goto init; + printf("TSC timecounter disables C2 and C3.\n"); } /* |