Commit Graph

14 Commits

Author SHA1 Message Date
yamt c3b17808da cc_microset: #if 0 out a diagnositc printf.
this functions is called from ipi handler.
2005-01-23 08:39:51 +00:00
yamt d2fe4b34bb move some per-cpu data definitions to MI place so that they can be modified
without touching all ports.  discussed on tech-kern@.
2004-09-22 11:32:02 +00:00
hannken bc4af00256 Make it compile again for sparc64/DIAGNOSTIC.
All archs should use `cpuid_t ci_cpuid' ...
2004-08-12 12:15:21 +00:00
christos 5647899427 make the reset time a DIAGNOSTIC, and print the cpu#. 2004-08-11 16:25:51 +00:00
fredb 430f0ecf15 Multiply before divide, correcting a mistake introduced by revision 1.7.
The loss of precision could be significant in some cases.
2004-06-27 15:21:30 +00:00
fredb ca3c6f824f Partly back out the last, to avoid a deadlock when microtime() is called
from levels below IPL_CLOCK (pointed out by thorpej). Just take the lock
before reading the time and cycle counter.
2004-06-27 01:36:04 +00:00
fredb f17b436426 Take the lock earlier, before reading the cycle counter, so that it
doesn't advance while we're waiting on the lock. In fact, try to take
the lock even before blocking interrupts: the lock is locking "lasttime"
against other callers of cc_microtime(), not against the clock routines,
and if we take a clock interrupt while waiting for the lock, that's one
we don't have to take after the computations, but before returning to
the caller, and that makes the data a little fresher to the caller.

Moreover, inverting the order of splXXX() and simple_lock() permits us
to unblock interrupts before doing the long division.

With this, finally, performance of "ntpd" on my MP i386 seems to be no
worse than on non-MP i386, so this may fix PR kern/24207.
2004-06-26 16:31:33 +00:00
fredb c6f9967d69 Introduce a variable "cc" to hold the cpu counter delta, rather than
overloading "usec". The counter isn't counting micro-seconds, and using
the same variable to mean two different things is false economy: with
this change, the compiled object is 72 bytes smaller on i386, and the
code is easier to understand, to boot.
2004-06-19 20:02:38 +00:00
fredb e89e654031 Fix a typo in the comments. 2004-06-19 18:12:55 +00:00
nathanw 78c16ce8ed Adjust code that tries to prevent cc_microtime() from going backwards
so that it doesn't fire when called twice in the same microsecond,
which can lead to large error accumulation.

Appears to fix "repeated gettimeofday() goes backwards" on a fast
alpha and i386 box.
2004-05-18 16:09:07 +00:00
simonb 02c392e820 Remove an unnecessary local variable (and save a read of the "time"
variable if we don't need to use it).
2003-06-28 15:02:24 +00:00
martin d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
nakayama b89b148783 Avoid integer constant is too large warnings in gcc 3.3. 2003-05-17 01:50:56 +00:00
nakayama 8920acd333 Switch to use cycle counter (%tick) based microtime().
This is derived from alpha/microtime.c and i386/tsc_microtime.c,
and will share with both ports.

This should fix PR port-sparc64/18452.
(approved by martin)
2003-02-05 12:06:51 +00:00