加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

Suse linux查看可用时钟源和当前时钟源

(2013-01-23 23:18:44)
标签:

时钟源

tsc

hpet

分类: 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 enable HPET

bcdedit /deletevalue useplatformclock disable

 

查看tsc时钟源类型。《深入理解Linux内核》一书中说HPET时钟源是首选,但是现在的TSC时钟都是constant_tsc和nonstop_tsc类型的,不会受到CPU频率的变化影响精度。而且TSC时钟的高频率和读取速度,使得TSC比起HPET更有优势,所以Linux内核会选择更好的TSC时钟源。

 

# cat /proc/cpuinfo
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid

 

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.

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有