--1117298836-22831266-832297616=:27722
Content-Type: TEXT/PLAIN; charset=US-ASCII
So far i have found following problems that cause time warps:
- timer interrupt updating jiffies, but not xtime
- latencies bigger than LATCH/100
- some hardware is not providing monotonous timer ticks, small "jumps"
exist. Some motherboards do this, some not. No idea why this happens.
here is a log:
jiffie,counter
J:8623 C:8725 |t
J:8623 C:8676 |i
J:8623 C:8627 |m
J:8623 C:8508 |e
J:8623 C:8525 <------- here the timer counter jumps >upwards<
J:8623 C:8465 |
J:8623 C:5834 |
J:8623 C:5767 V
the attached time.c is from 1.99.4, and fixes all these problems, but
other problems can exist too. A program that detects time warps (posted
earlier on this list) is attached too.
-- mingo
--1117298836-22831266-832297616=:27722
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="time.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.93.960517024656.27722E@teto.sch.bme.hu>
Content-Description:
LyoNCiAqICBsaW51eC9hcmNoL2kzODYva2VybmVsL3RpbWUuYw0KICoNCiAq
ICBDb3B5cmlnaHQgKEMpIDE5OTEsIDE5OTIsIDE5OTUgIExpbnVzIFRvcnZh
bGRzDQogKg0KICogVGhpcyBmaWxlIGNvbnRhaW5zIHRoZSBQQy1zcGVjaWZp
YyB0aW1lIGhhbmRsaW5nIGRldGFpbHM6DQogKiByZWFkaW5nIHRoZSBSVEMg
YXQgYm9vdHVwLCBldGMuLg0KICogMTk5NC0wNy0wMiAgICBBbGFuIE1vZHJh
DQogKglmaXhlZCBzZXRfcnRjX21tc3MsIGZpeGVkIHRpbWUueWVhciBmb3Ig
Pj0gMjAwMCwgbmV3IG1rdGltZQ0KICogMTk5NS0wMy0yNiAgICBNYXJrdXMg
S3Vobg0KICogICAgICBmaXhlZCA1MDAgbXMgYnVnIGF0IGNhbGwgdG8gc2V0
X3J0Y19tbXNzLCBmaXhlZCBEUzEyODg3DQogKiAgICAgIHByZWNpc2lvbiBD
TU9TIGNsb2NrIHVwZGF0ZQ0KICovDQojaW5jbHVkZSA8bGludX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CQlfX2FzbV9fKCIuYnl0ZSAweDBmLDB4MzEiDQoJCQk6Ij1hIiAoKCh1bnNp
Z25lZCBsb25nICopICZpbml0X3RpbWVyX2NjKVswXSksDQoJCQkgIj1kIiAo
KCh1bnNpZ25lZCBsb25nICopICZpbml0X3RpbWVyX2NjKVsxXSkpOw0KCQlp
cnEwLmhhbmRsZXIgPSBwZW50aXVtX3RpbWVyX2ludGVycnVwdDsNCgl9DQoj
ZW5kaWYNCglzZXR1cF94ODZfaXJxKDAsICZpcnEwKTsNCn0NCg0K
--1117298836-22831266-832297616=:27722
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="bug.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.93.960517024656.27722F@teto.sch.bme.hu>
Content-Description:
DQojaW5jbHVkZSA8c3lzL3RpbWUuaD4NCiNpbmNsdWRlIDx1bmlzdGQuaD4N
CiNpbmNsdWRlIDxzdGRpby5oPg0KDQp2b2lkIG1haW4oKQ0Kew0KICAgIHN0
cnVjdCB0aW1ldmFsIHQsIHRfb2xkOw0KICAgIGxvbmcgaTsNCg0KICAgIHRp
bWVyY2xlYXIoJnQpOw0KICAgIGZvcihpPTA7IGk8MTAwMDAwMDAwbDsgaSsr
KSB7DQoJZ2V0dGltZW9mZGF5KCZ0LCBOVUxMKTsNCglpZihpPjAgJiYgdC50
dl9zZWM9PXRfb2xkLnR2X3NlYyAmJiB0LnR2X3VzZWM8dF9vbGQudHZfdXNl
YykNCgl7DQoJICAgIHByaW50Zigib2xkPSVkIG5ldz0lZFxuIiwgdF9vbGQu
dHZfdXNlYywgdC50dl91c2VjKTsNCgkgICAgZmZsdXNoKHN0ZG91dCk7DQoJ
fQ0KCXRfb2xkID0gdDsNCiAgICB9DQp9DQoNCg==
--1117298836-22831266-832297616=:27722--