Public bug reported:

arch/x86/include/asm/timer.h:
#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */

static inline unsigned long long __cycles_2_ns(unsigned long long cyc)
{
        int cpu = smp_processor_id();
        unsigned long long ns = per_cpu(cyc2ns_offset, cpu);
        ns += cyc * per_cpu(cyc2ns, cpu) >> CYC2NS_SCALE_FACTOR;                
// !!!
        return ns;
}

Apparently he or she was not very 'careful' to chose
CYC2NS_SCALE_FACTOR.

cyc*cyc2ns overflows after 
(0xffffffffffffffff>>CYC2NS_SCALE_FACTOR)/10^9/60/60/24=208.5 days after
TSC reset.  sched_clock should not wrap virtually forever (584years) and many 
kernel subsystems assume
it; for example the softlockup detector is confused by this;

[18446743993.431771] BUG: soft lockup - CPU#1 stuck for 17163091968s!
[???:XXXXX]

Of course the time stamp (18446743993.431771) and 17163091968s (544
years!) are false.

Other problems caused by this overflow include task scheduler unfairness.  
softlockups ('stuck for 61s!') are
observed in 210~220 days after reboot but I've not yet succeeded to explain the 
logic.

I believe the problem is not solved in the latest 2.6.32-32.62 kernel
packages (from code inspection).

Thanks.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: linux-image-2.6.32-22-server 2.6.32-22.36
Regression: No
Reproducible: Yes
ProcVersionSignature: Ubuntu 2.6.32-22.36-server 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-server x86_64
AlsaDevices: Error: command ['ls', '-l', '/dev/snd/'] failed with exit code 2: 
ls: /dev/snd/にアクセスできません: No such file or directory
AplayDevices: Error: [Errno 2] No such file or directory
Architecture: amd64
ArecordDevices: Error: [Errno 2] No such file or directory
Date: Mon Jul  4 15:31:06 2011
InstallationMedia: Ubuntu-Server 10.04.1 LTS "Lucid Lynx" - Release amd64 
(20100816.2)
Lsusb:
 Bus 002 Device 003: ID 0000:0000  
 Bus 002 Device 002: ID 8087:0020  
 Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 001 Device 002: ID 8087:0020  
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
MachineType: HP ProLiant DL120 G6
PciMultimedia:
 
ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.32-22-server 
root=UUID=67bbc9ef-18cb-46c3-af61-c6d2e0645c07 ro console=tty 
console=ttyS0,9600n8 apic=debug crashkernel=384M-2G:64M,2G-:128M quiet
ProcEnviron:
 LANG=C
 SHELL=/bin/bash
SourcePackage: linux
dmi.bios.date: 09/06/2010
dmi.bios.vendor: HP
dmi.bios.version: O26
dmi.board.name: ProLiant DL120 G6
dmi.board.vendor: Wistron Corporation
dmi.chassis.asset.tag: quest
dmi.chassis.type: 23
dmi.chassis.vendor: HP
dmi.chassis.version: N/A
dmi.modalias: 
dmi:bvnHP:bvrO26:bd09/06/2010:svnHP:pnProLiantDL120G6:pvr:rvnWistronCorporation:rnProLiantDL120G6:rvr:cvnHP:ct23:cvrN/A:
dmi.product.name: ProLiant DL120 G6
dmi.sys.vendor: HP

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug lucid needs-upstream-testing

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/805341

Title:
  sched clock overflows in 208 days (i386 and amd64)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/805341/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to