From owner-freebsd-current Thu Aug 20 23:07:15 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA14017 for freebsd-current-outgoing; Thu, 20 Aug 1998 23:07:15 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from critter.freebsd.dk (obelix.trw.nl [195.193.64.5]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA14000 for ; Thu, 20 Aug 1998 23:07:12 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.9.1/8.8.5) with ESMTP id HAA00296; Fri, 21 Aug 1998 07:37:31 +0200 (CEST) To: Brian Somers cc: Brian Feldman , Terry Lambert , bde@zeta.org.au, freebsd-current@FreeBSD.ORG, jwd@unx.sas.com Subject: Re: 13 months of user time? In-reply-to: Your message of "Thu, 20 Aug 1998 22:37:34 BST." <199808202137.WAA03270@awfulhak.org> Date: Fri, 21 Aug 1998 07:37:30 +0200 Message-ID: <294.903677850@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >[...] the machine I was having problems with was >running apm, so it used the i8254 timecounter rather than the tsc >counter. Ahh... I bet that is it: APM sucks. Try to disable APM and see if you can reproduce it, I'll bet you my collection of genuine 11 row punched cards that you can't. Our handling of APM is probably not the best either, in sys/i386/apm/apm.c the apm_default_resume() and apm_default_resume() does things which most parents would not want their kids to see or even know about. The basic scoop on APM is: Normal mode: Your TSC may run on variable frequency, with no warning, or with warning by an APM bios event (usually after the fact). Your i8254 mostly seem to run at constant frequency, although some reports I've seen indicates it may not. The APM bios may issue events to report anomalies (post factum). Your RTC runs at nominal speed, and the interrupts will arrive one by one, mostly on time. Suspend mode: Your TSC may or may not run, frequency unknown. Your i8254 may or may not run, frequency unknown. Your RTC runs, but interrupts may be disabled or postponed and arrive in "batch mode" when the machine is resumed. There is no doubt that the right thing to do on resume is to spin-poll the RTC for a shift of second, fixup the boottime and let the system loose again. What to do about the i8254 being slowed is much more tricky. If you could add code to your system which counts the RTC interrupts and tracks the i8254 timecounter delta between irqs, then maybe we can see what is happening on your system and get an idea for handling it... "Unfortunately" both of the two laptops I have access to doesn't have any of these problems, so I can't work on it myself. I said "Unfortunately" because they were chosen partly because of that... Summary: It will take hacking by the people who see the problem on their machines to fix this problem... -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop." "ttyv0" -- What UNIX calls a $20K state-of-the-art, 3D, hi-res color terminal To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message