Suse linux查看可用时钟源和当前时钟源
(2013-01-23 23:18:44)
标签:
时钟源tschpet |
分类: Linux |
steve@sle11-sp2:~/Desktop>
cat
/sys/devices/system/clocksource/clocksource0/available_clocksource
tsc hpet acpi_pm
steve@sle11-sp2:~/Desktop>
cat
/sys/devices/system/clocksource/clocksource0/current_clocksource
tsc
设置HPET为当前时钟源
echo 'hpet' > /sys/devices/system/clocksource/clocksource0/current_clocksource
查看timer信息:
cat /proc/timer_list
Windows 7 使用HPET(需要重启):
bcdedit /set useplatformclock true
bcdedit /deletevalue
useplatformclock
查看tsc时钟源类型。《深入理解Linux内核》一书中说HPET时钟源是首选,但是现在的TSC时钟都是constant_tsc和nonstop_tsc类型的,不会受到CPU频率的变化影响精度。而且TSC时钟的高频率和读取速度,使得TSC比起HPET更有优势,所以Linux内核会选择更好的TSC时钟源。
# cat /proc/cpuinfo
flags
TSC 的4种类型:
1. Constant. Constant TSC means that the TSC does not change
with CPU frequency changes, however it does change on C state
transitions.
2. Invariant. As described in the Intel manual: “The invariant TSC
will run at a constant rate in all ACPI P-, C- and T-states”
3. Non-stop. The Non-stop TSC has the properties of both Constant
and Invariant TSC.
4. None of the above. The TSC changes with the C, P and S state
transitions.