Re: the time problem

Ingo Molnar (mingo@pc5829.hil.siemens.co.at)
Tue, 14 May 1996 19:41:40 +0200 (MET DST)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

--79898887-599443427-832095700=:25404
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Tue, 14 May 1996, Ulrich Windl wrote:

> In 1.99.2 the time still jumps backward from time to time (with or
> without the Pentium CC). Even though H. G. Wells would have been a
> great fan of it, I think the rest of the users won't like it that
> much.

I have patches for time warps, with or without the pentium stuff.
those patches fix all 3 kinds of time warps i found so far. Since i see no
more time warps, i need some feedback.

I suspected some general time warp too, in sched.c, but the tricky thing
is that concurrently there are bugs/problems in both do_fast_gettimeoffset()
and do_slow_gettimoffset().

the best test i found so far is:

dd if=/dev/hda1 of=/dev/null & sleep 1; dd if=/dev/hda2 of=/dev/null

(hda1 and hda2 should be two IDE partitions ...)

-- mingo

ps. i've attached a patch against pre2.0.4, that fixes all problems for
me. Please if ppl with time warps could test it out. They work on my
systems perfectly. I've attached a small testprogram too (posted by the
original bug-reporter), which should be run concurrently with the "dd"-s
(or find /-s, or whatever).

--79898887-599443427-832095700=:25404
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=d8
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.93.960514194140.25404E@pc5829.hil.siemens.co.at>
Content-Description:

LS0tIHRpbWUuYy5vcmlnLjEuOTkuNAlUdWUgTWF5IDE0IDE5OjMxOjIzIDE5
OTYNCisrKyB0aW1lLmMJVHVlIE1heSAxNCAxOTozMDo1MyAxOTk2DQpAQCAt
MTAsNiArMTAsOCBAQA0KICAqIDE5OTUtMDMtMjYgICAgTWFya3VzIEt1aG4N
CiAgKiAgICAgIGZpeGVkIDUwMCBtcyBidWcgYXQgY2FsbCB0byBzZXRfcnRj
X21tc3MsIGZpeGVkIERTMTI4ODcNCiAgKiAgICAgIHByZWNpc2lvbiBDTU9T
IGNsb2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1NJWkU7DQorDQorICAgICAgICAgICAgICAgIC8qKioq
DQorICAgICAgICAgICAgICAgICAqIG1ha2Ugc3VyZSB0aGF0IHdlIGdldCBp
bnRvIHRoaXMgYnJhbmNoIHRpbGwgDQorICAgICAgICAgICAgICAgICAqIHRo
ZSB0aW1lciBpbnRlcnJ1cHQgZ2V0cyBoYW5kbGVkIA0KKyAgICAgICAgICAg
ICAgICAgKi8NCisJCWNvdW50X3AgPSAwOwkJDQogCX0NCisJZWxzZSB7DQor
CQljb3VudF9wID0gY291bnQ7DQorCQlqaWZmaWVzX3AgPSBqaWZmaWVzOw0K
KyAJfQ0KKw0KIAljb3VudCA9ICgoTEFUQ0gtMSkgLSBjb3VudCkgKiBUSUNL
X1NJWkU7DQogCWNvdW50ID0gKGNvdW50ICsgTEFUQ0gvMikgLyBMQVRDSDsN
CiAJcmV0dXJuIG9mZnNldCArIGNvdW50Ow0K
--79898887-599443427-832095700=:25404
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="bug3.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.93.960514194140.25404F@pc5829.hil.siemens.co.at>
Content-Description:

I2luY2x1ZGUgPHN5cy90aW1lLmg+DQojaW5jbHVkZSA8dW5pc3RkLmg+DQoj
aW5jbHVkZSA8c3RkaW8uaD4NCg0Kdm9pZCBtYWluKCkNCnsNCiAgICBzdHJ1
Y3QgdGltZXZhbCB0LCB0X29sZDsNCg0KICAgIHRpbWVyY2xlYXIoJnQpOw0K
ICAgIHRpbWVyY2xlYXIoJnRfb2xkKTsNCg0KICAgIGZvcig7OykNCiAgICB7
DQogICAgICAgIGdldHRpbWVvZmRheSgmdCwgTlVMTCk7DQoNCiAgICAgICAg
aWYoICgodC50dl9zZWMqMTAwMDAwMCt0LnR2X3VzZWMpIDwgKHRfb2xkLnR2
X3NlYyoxMDAwMDAwK3Rfb2xkLnR2X3VzZWMpKSApDQoJeyAgICAgICAgICAg
IA0KCQlwcmludGYoInRpbWUgd2FycDogb2xkIHZhbHVlOiAlZCwgbmV3IHZh
bHVlOiAlZC5cbiIsIA0KCQkJdF9vbGQudHZfc2VjKjEwMDAwMDArdF9vbGQu
dHZfdXNlYywNCgkJCXQudHZfc2VjKjEwMDAwMDArdC50dl91c2VjKTsNCgl9
DQogICAgICAgIHRfb2xkID0gdDsNCiAgICB9DQp9DQoNCg==
--79898887-599443427-832095700=:25404--