TSC as timecounter makes system lag

Jia-Shiun Li jiashiun at gmail.com
Wed Feb 22 17:12:01 UTC 2017

I got the impression that TSC was not preferred timecounter
if it is not C-state invariant. But this apparenly is not the case now.
Dig a bit and found r277900 chose to prefer TSC over saving power
by disabling C2 state when TSC is selected as timecounter.

But with EARLY_AP_STARTUP, and TSC as timecounter,
CPU still enters C2 state.
(Observed by sysctl dev.cpu.0.cx_usage_counters)
With nooptions EARLY_AP_STARTUP, CPU correctly stays 100%
in C1 and no lower.

I added a printf in tc_windup() to check. With EARLY_AP_STARTUP,
cpu_disable_c2_sleep is never increased, so it can not prevent CPU
from entering C2.

Guess there's some kind of race or init order issue, but it is
beyond my understanding for now.


More information about the freebsd-current mailing list