Bug 491154 - divider option does not work with TSC clocksource
Summary: divider option does not work with TSC clocksource
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.7
Hardware: i386
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Chris Lalancette
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-19 15:57 UTC by david ahern
Modified: 2018-10-20 01:53 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-05-18 19:35:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch to fix TSC timesource with the tick divider (485 bytes, patch)
2009-03-20 15:14 UTC, Chris Lalancette
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:1024 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 4.8 kernel security and bug fix update 2009-05-18 14:57:26 UTC

Description david ahern 2009-03-19 15:57:56 UTC
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.

Comment 3 Chris Lalancette 2009-03-20 15:14:01 UTC
Created attachment 336058 [details]
Patch to fix TSC timesource with the tick divider

Comment 4 RHEL Program Management 2009-03-20 15:18:01 UTC
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.

Comment 7 Vivek Goyal 2009-03-25 13:30:00 UTC
Committed in 85.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/

Comment 15 errata-xmlrpc 2009-05-18 19:35:57 UTC
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


Note You need to log in before you can comment on or make changes to this bug.