summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_tc.c
Commit message (Collapse)AuthorAgeFilesLines
* Commit the results of the typo hunt by Darren Pilgrim.yar2006-08-041-1/+1
| | | | | | | | | | This change affects documentation and comments only, no real code involved. PR: misc/101245 Submitted by: Darren Pilgrim <darren pilgrim bitfreak org> Tested by: md5(1) MFC after: 1 week
* Add a kern.timecounter.tc sysctl tree that contains the mask,dwmalone2006-06-161-0/+40
| | | | | | | | | frequency, quality and current value of each available time counter. At the moment all of these are read-only, but it might make sense to make some of these read-write in the future. MFC after: 3 months
* Disable the "cputick increased..." message now that the dust has settled.phk2006-03-151-1/+1
|
* Oops, forgot newline.phk2006-03-091-1/+1
|
* silence cpu_tick calibration and notice only (under bootverbose)phk2006-03-091-15/+8
| | | | when the frequency increases.
* Style nit.jhb2006-03-071-2/+1
|
* Add missing cast.phk2006-03-041-1/+1
|
* More detailed logging if timestepwarnings are enabled.phk2006-03-041-5/+8
|
* Suffer a little bit of math every 16 second and tighten calibration ofphk2006-03-021-12/+24
| | | | cpu_ticks to the low side of PPM.
* CPU time accounting speedup (step 2)phk2006-02-111-5/+133
| | | | | | | | | | | | | | | | | | | Keep accounting time (in per-cpu) cputicks and the statistics counts in the thread and summarize into struct proc when at context switch. Don't reach across CPUs in calcru(). Add code to calibrate the top speed of cpu_tickrate() for variable cpu_tick hardware (like TSC on power managed machines). Don't enforce monotonicity (at least for now) in calcru. While the calibrated cpu_tickrate ramps up it may not be true. Use 27MHz counter on i386/Geode. Use TSC on amd64 & i386 if present. Use tick counter on sparc64
* Modify the way we account for CPU time spent (step 1)phk2006-02-071-0/+21
| | | | | | | | | | | | | | | | Keep track of time spent by the cpu in various contexts in units of "cputicks" and scale to real-world microsec^H^H^H^H^H^H^H^Hclock_t only when somebody wants to inspect the numbers. For now "cputicks" are still derived from the current timecounter and therefore things should by definition remain sensible also on SMP machines. (The main reason for this first milestone commit is to verify that hypothesis.) On slower machines, the avoided multiplications to normalize timestams at every context switch, comes out as a 5-7% better score on the unixbench/context1 microbenchmark. On more modern hardware no change in performance is seen.
* Start time_uptime with 1 instead of 0.andre2005-09-191-1/+1
| | | | Discussed with: phk
* Forward declaring static variables as extern is invalid ISO-C. Now thatobrien2005-09-071-1/+1
| | | | GCC can properly handle forward static declarations, do this properly.
* s/ENOTTY/ENOIOCTL/phk2005-03-261-1/+1
|
* Put on my peril sensitive sunglasses and add a flags field to the internalpeter2004-10-111-2/+17
| | | | | | | | | | | | | | | | sysctl routines and state. Add some code to use it for signalling the need to downconvert a data structure to 32 bits on a 64 bit OS when requested by a 32 bit app. I tried to do this in a generic abi wrapper that intercepted the sysctl oid's, or looked up the format string etc, but it was a real can of worms that turned into a fragile mess before I even got it partially working. With this, we can now run 'sysctl -a' on a 32 bit sysctl binary and have it not abort. Things like netstat, ps, etc have a long way to go. This also fixes a bug in the kern.ps_strings and kern.usrstack hacks. These do matter very much because they are used by libc_r and other things.
* Add some KASSERTS.phk2004-08-141-0/+3
|
* Just because the timecounter reads the same value on two samplesphk2004-03-041-4/+0
| | | | after each other doesn't mean that nothing happened.
* Write 100 times for tomorrow:phk2004-01-221-2/+3
| | | | "Always print time_t as %jd, you never know what width it has"
* Add a sysctl (default: off) which enables a log(LOG_INFO...) warningphk2004-01-211-10/+19
| | | | if the clock is stepped.
* Various minor details:phk2003-11-131-8/+17
| | | | | | | | Give the HZ/overflow check a 10% margin. Eliminate bogus newline. If timecounters have equal quality, prefer higher frequency. Some inspiration from: bde
* Use the quality to disable timecounters for which we deem Hz too low.phk2003-09-031-6/+10
|
* bde made a number of suggested improvements to the code. This commitimp2003-08-201-20/+17
| | | | | | | | | | represents the pruely stylistic changes and should have no net impact on the rest of the code. bde's more substantive changes will follow in a separate commit once we've come to closure on them. Submitted by: bde
* Fix an extreme edge case in leap second handling. We need to callimp2003-08-201-4/+6
| | | | | | | | | | | ntp_update_second twice when we have a large step in case that step goes across a scheduled leap second. The only way this could happen would be if we didn't call tc_windup over the end of day on the day of a leap second, which would only happen if timeouts were delayed for seconds. While it is an edge case, it is an important one to get right for my employer. Sponsored by: Timing Solutions Corporation
* Give timecounters a numeric quality field.phk2003-08-161-8/+35
| | | | | | | | | | | | | | | | A timecounter will be selected when registered if its quality is not negative and no less than the current timecounters. Add a sysctl to report all available timecounters and their qualities. Give the dummy timecounter a solid negative quality of minus a million. Give the i8254 zero and the ACPI 1000. The TSC gets 800, unless APM or SMP forces it negative. Other timecounters default to zero quality and thereby retain current selection behaviour.
* Remove extra space.mux2003-08-121-1/+1
|
* typo fix in comment.phk2003-07-021-1/+1
|
* Fix leap second processing by the kernel time keeping routines.imp2003-06-251-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, we would add/subtract the leap second when the system had been up for an even multiple of days, rather than at the end of the day, as a leap second is defined (at least wrt ntp). We do this by calculating the notion of UTC earlier in the loop, and passing that to get it adjusted. Any adjustments that ntp_update_second makes to this time are then transferred to boot time. We can't pass it either the boot time or the uptime because their sum is what determines when a leap second is needed. This code adds an extra assignment and two extra compare in the typical case, which is as cheap as I could made it. I have confirmed with this code the kernel time does the correct thing for both positive and negative leap seconds. Since the ntp interface doesn't allow for +2 or -2, those cases can't be tested (and the folks in the know here say there will never be a +2s or -2s leap event, but rather two +1s or -1s leap events). There will very likely be no leap seconds for a while, given how the earth is speeding up and slowing down, so there will be plenty of time for this fix to propigate. UT1-UTC is currently at "about -0.4s" and decrementing by .1s every 8 months or so. 6 * 8 is 48 months, or 4 years. -stable has different code, but a similar bug that was introduced about the time of the last leap second, which is why nobody has noticed until now. MFC After: 3 weeks Reviewed by: phk "Furthermore, leap seconds must die." -- Cato the Elder
* Use UTC rather than GMT to describe time scale. latter is obsolete.imp2003-06-231-2/+2
|
* Use __FBSDID().obrien2003-06-111-2/+3
|
* Including <sys/stdint.h> is (almost?) universally only to be able to usephk2003-03-181-1/+0
| | | | | %j in printfs, so put a newsted include in <sys/systm.h> where the printf prototype lives and save everybody else the trouble.
* Move timecounters notion of frequency to 64 bits.phk2003-01-291-3/+4
| | | | [WARNING: CPUs in the distant future may be closer than they appear!]
* Add sysctl kern.timecounter.nsetclock which indicates the number ofphk2003-01-251-0/+2
| | | | | | | | | | potential discontinuities in our UTC timescale. Applications can monitor this variable if they want to be informed about steps in the timescale. Slews (ntp and adjtime(2)) and frequency adjustments (ntp) will not increment this counter, only operations which set the clock. No attempt is made to classify size or direction of the step.
* Move a local variable to avoid the compiler warning about it being unused.phk2003-01-161-1/+2
|
* hardpps() wants the raw hardware counter value converted to nanoseconds.jhay2003-01-161-7/+7
|
* Explicitly have the timecounter init happen after the cpu_initclocks ispeter2003-01-061-1/+1
| | | | | | | | | called. Otherwise (depending on a non-deterministic sort), the timecounter code can be initialized before the clock rate has been set (on ia64) and it assumes hz = 100, rather than the real value of 1024. I'm not sure how much gets upset by this. Glanced at by: phk
* Export tc_tick with sysctl, not tick.phk2003-01-041-1/+1
| | | | Spotted by: bde
* Introduce a "time_uptime" global variable which holds the time since bootphk2002-11-011-0/+2
| | | | in seconds.
* Use strlcpy() instead of strncpy() to copy NUL terminated stringsrobert2002-10-171-2/+2
| | | | for safety and consistency.
* Do not employ timecounter hardware if our hz does not support theirphk2002-09-041-2/+10
| | | | correct rewinding.
* Give up on calling tc_ticktock() from a timeout, we have timeoutphk2002-09-041-4/+6
| | | | | | | | functions which run for several milliseconds at a time and getting in queue behind one or more of those makes us miss our rewind. Instead call it from hardclock() like we used to do, but retain the prescaler so we still cope with high HZ values.
* Use a semicolon at the end of a function-like macro invocation. Killsmarkm2002-07-151-1/+1
| | | | warnings and makes the visual style easier.
* Time counter stats are unsigned, advertise them to sysctl(8) that way.kbyanc2002-06-111-1/+1
| | | | | PR: (one small part of) 19720 Approved by: phk
* Mistyped and lost a '&' in previous commit.phk2002-05-301-1/+1
|
* Don't forget to factor in the boottime when we calculate PPS timestamps.phk2002-05-301-0/+1
| | | | Submitted by: Akira Watanabe <akira@myaw.ei.meisei-u.ac.jp>
* Initialize time_second to 1 instead of zero to pacify slightly bogus arp code.phk2002-05-031-6/+4
| | | | Various minor style fixes from BDE.
* kern_tc.c doesn't use <machine/psl.h>, and having this #include breakspeter2002-05-011-2/+0
| | | | other platforms.
* Brucifixion ? Yes, out that door, row on the left, one patch each.phk2002-04-301-87/+101
| | | | Many thanks to: bde
* Stylistic sweep through the timecounter code.phk2002-04-281-142/+222
| | | | Renovate comments.
* Don't screw up our uptime with historical dates.phk2002-04-281-1/+1
|
* Explain magic number.phk2002-04-271-2/+15
| | | | | | | Add magic date no explanation. Add a delta which was lost in transit yesterday which prevented other timecounters from actually being used.
OpenPOWER on IntegriCloud