sched clock overflows in 208 days (i386 and amd64)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Undecided
|
Chris J Arges | ||
Lucid |
Fix Released
|
Undecided
|
Chris J Arges | ||
Maverick |
Fix Released
|
Undecided
|
Chris J Arges | ||
Natty |
Fix Released
|
Undecided
|
Chris J Arges | ||
Precise |
Fix Released
|
Undecided
|
Chris J Arges |
Bug Description
arch/x86/
#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
static inline unsigned long long __cycles_
{
int cpu = smp_processor_id();
unsigned long long ns = per_cpu(
ns += cyc * per_cpu(cyc2ns, cpu) >> CYC2NS_
return ns;
}
Apparently he or she was not very 'careful' to chose CYC2NS_
cyc*cyc2ns overflows after (0xffffffffffff
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.
Of course the time stamp (18446743993.
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-
Regression: No
Reproducible: Yes
ProcVersionSign
Uname: Linux 2.6.32-22-server x86_64
AlsaDevices: Error: command ['ls', '-l', '/dev/snd/'] failed with exit code 2: ls: /dev/snd/
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=
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.
dmi.chassis.type: 23
dmi.chassis.vendor: HP
dmi.chassis.
dmi.modalias: dmi:bvnHP:
dmi.product.name: ProLiant DL120 G6
dmi.sys.vendor: HP
Changed in linux (Ubuntu): | |
status: | New → Confirmed |
tags: |
added: kernel-da-key maverick natty removed: lucid needs-upstream-testing |
tags: | added: patch |
Changed in linux (Ubuntu Precise): | |
status: | In Progress → Fix Released |
Changed in linux (Ubuntu Natty): | |
status: | New → Fix Committed |
Changed in linux (Ubuntu Maverick): | |
status: | New → Fix Committed |
Changed in linux (Ubuntu Maverick): | |
assignee: | nobody → Chris J Arges (christopherarges) |
Changed in linux (Ubuntu Natty): | |
assignee: | nobody → Chris J Arges (christopherarges) |
Changed in linux (Ubuntu Lucid): | |
assignee: | nobody → Chris J Arges (christopherarges) |
status: | New → In Progress |
> sched_clock should not wrap virtually forever
Actually it is not wrap but jump from 208.5 days to 584 years. cyc2ns_offset is around -100 secs.