Description of problem: One of LTP (Linux Testing Project) test case was doing the following something similar to the following, gettimeofday() settimeofday() time() The result that time() returned was one less that we set. # ./time curr_time = 1228827598 pres_time = 1228827607 Failed. If we changed the above code to gettimeofday() settimeofday() gettimeofday() It worked fine. # ./time curr_time = 1228827598 pres_time = 1228827608 The following is the list of known affected machines and their timer information, sun-v40z-01.rhts.bos.redhat.com ... Detected 20.834 MHz APIC timer. time.c: Using 3.579545 MHz WALL PM GTOD PIT/TSC timer. ... x86-64-5s-m1.lab.bos.redhat.com ... Detected 12.453 MHz APIC timer. SMP alternatives: switching to SMP code Booting processor 1/8 APIC 0x1 ... hp-dl785g5-01.rhts.bos.redhat.com ... Detected 12.500 MHz APIC timer. ... hp-dl360g4-01.rhts.bos.redhat.com ... Detected 12.500 MHz APIC timer ... dell-pe2900-01.rhts.bos.redhat.com I have never seen it failed on any IA-32 machine. Version-Release number of selected component (if applicable): kernel-2.6.18-92.el5 kernel-2.6.18-125.el5 How reproducible: always Additional info: Ntpd had been stopped.
Created attachment 326300 [details] Reproducer
CANTFIX -- set/gettimeofday & time are known not to keep consistent time against one another. Attempting to make them consistent results in a unacceptable 2200% performance hit on the time() syscall. See BZ 461184.
Prait, someone in LTP mailing list pointed out that this upstream commit fixed the test failure. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9a055117d3d9cb562f83f8d4cd88772761f4cab0 I cannot apply this patch to RHEL 5 kernel though because there is no timekeeping.c. The discussion in LTP is here, http://article.gmane.org/gmane.linux.ltp/6730