Description of problem: I am attempting to use the TSC as a clocksource for a RHEL4.7 based KVM guest, and the TSC is declared unstable: ... kernel: checking TSC synchronization across 4 CPUs: passed. ... kernel: Losing too many ticks! kernel: TSC cannot be used as a timesource. kernel: Possible reasons for this are: kernel: You're running with Speedstep, kernel: You don't have DMA enabled for your hard disk (see hdparm), kernel: Incorrect TSC synchronization on an SMP system (see dmesg). kernel: Falling back to a sane timesource now. How reproducible: easy, just add the options and reboot. Steps to Reproduce: 1. Add 'divider=4 clock=tsc' to kernel parameters 2. reboot 3. on reboot, run dmesg | egrep -i 'clock|time|tsc|pit|lost' Actual results: TSC clocksource declared unstable. Expected results: TSC clocksource works. Additional info: I instrumented the 4.7 kernel -- timer_tsc.c, mark_offset_tsc(): if (lost >= 2) { printk("delta %ld, lost %ld, delay_at_last_interrupt %d\n", delta, lost, delay_at_last_interrupt); On boot the messages right before it drops the TSC as a clocksource are: delta 4000, lost 4, delay_at_last_interrupt 1 delta 4000, lost 4, delay_at_last_interrupt 1 delta 3999, lost 3, delay_at_last_interrupt 1 delta 4002, lost 4, delay_at_last_interrupt 1 At Marcelo's suggestion I changed HZ to REAL_HZ and the TSC clocksource works fine with the divider option. If you look at mark_offset_pmtmr, it uses REAL_HZ instead of HZ, so it appears to be an oversight on the TSC clocksource.
Created attachment 336058 [details] Patch to fix TSC timesource with the tick divider
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
Committed in 85.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2009-1024.html