aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_time.c
Commit message (Collapse)AuthorAgeFilesLines
* kern_time: minor style nitsWarner Losh2025-06-131-16/+16
| | | | | | | | | Typically we spell error values 'error' not 'err'. And fix EINVAL markup nit. Suggested by: kib Fixes: 7b7ba7857ce8 Sponsored by: Netflix
* Implement CLOCK_TAINathan Whitehorn2025-06-121-15/+31
| | | | | | | | | | | | | | Provide a clock through clock_gettime() that returns the current TAI time (UTC without leap seconds) as a complement to CLOCK_REALTIME. This provides compatibility with Linux, which also provides a CLOCK_TAI since kernel 2.6.26, and this seems to be becoming the standard way to acquire TAI time. Unlike Linux, this code will return EINVAL if the TAI offset (set by ntpd, ptpd, etc.) is not known since it seems pathological for CLOCK_TAI to silently give the wrong (UTC) time if the offset is not known as it does on Linux. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D46268
* time: use precise callout for clock_nanosleep(2) and nanosleep(2)Gleb Smirnoff2025-04-301-7/+29
| | | | | | | | | | | | | | | | | | | | | Don't apply tc_precexp and TIMESEL() that uses sbt_timethreshold (both derivatives of kern.timecounter.alloweddeviation) to sleep callout when processing the default and precise clocks. The default timer deviation of 5% is our internal optimization in the kernel, and we shouldn't leak that into the POSIX APIs. Note that application doesn't have any control to cancel the deviation, only a superuser can change the global tunable [with side effects]. Leave the deviation for CLOCK_*_FAST and CLOCK_SECOND that are documented as imprecise. Provide a sysctl kern.timecounter.nanosleep_precise that allows to restore the previous behavior. Improve documentation. Reviewed by: ziaee, vangyzen, imp, kib Differential Revision: https://reviews.freebsd.org/D50075
* proc: Disallow re-enabling of process itimers during exitMark Johnston2025-03-311-0/+2
| | | | | | | | | | | | | | | | | | During process exit, it's possible for the exiting thread to send a signal to its process, via killjobc(). This happens after the itimer is drained. If itimers are stopped, i.e., P2_ITSTOPPED is set, then itimer_proc_continue() will resume the callout after it has been drained. Fix the problem by simply clearing P2_ITSTOPPED as part of the drain. Then, a signal received after that point will not re-enable the callout. For good measure, also make sure that we don't reset the itimer callout in an exiting process. Reported by: syzkaller Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D49529
* Reduce reliance on sys/sysproto.h pollutionBrooks Davis2024-04-151-0/+1
| | | | | | | | | | | Add sys/errno.h, sys/malloc.h, sys/queue.h, and vm/uma.h as needed. sys/sysproto.h currently includes sys/acl.h which currently includes sys/param.h, sys/queue.h, and vm/uma.h which in turn bring in sys/errno.h sys/malloc.h. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44465
* sys: Remove ancient SCCS tags.Warner Losh2023-11-271-2/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* time: s/ppsratecheck/eventratecheckMateusz Guzik2023-02-241-9/+9
| | | | | | | | | | | The routine is used as a general event-limiting routine in places which have nothing to do with packets. Provide a define to keep everything happy. Reviewed by: rew Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D38746
* time: Make realitexpire() local to kern_time.cMark Johnston2022-07-131-1/+3
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* sysent: Get rid of bogus sys/sysent.h include.Dmitry Chagin2022-05-281-1/+0
| | | | | | Where appropriate hide sysent.h under proper condition. MFC after: 2 weeks
* Add timespecvalid_interval macro and use it.Dmitry Chagin2022-04-251-2/+2
| | | | | | Reviewed by: jhb, imp (early rev) Differential revision: https://reviews.freebsd.org/D34848 MFC after: 2 weeks
* setitimer: Fix exit raceMark Johnston2022-03-231-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | We use the p_itcallout callout, interlocked by the proc lock, to schedule timeouts for the setitimer(2) system call. When a process exits, the callout must be stopped before the process struct is recycled. Currently we attempt to stop the callout in exit1() with the call _callout_stop_safe(&p->p_itcallout, CS_EXECUTING). If this call returns 0, then we sleep in order to drain the callout. However, this happens only if the callout is not scheduled at all. If the callout thread is blocked on the proc lock, then exit1() will not block and the callout may execute after the process has fully exited, typically resulting in a panic. I cannot see a reason to use the CS_EXECUTING flag here. Instead, use the regular callout_stop()/callout_drain() dance to halt the callout. Reported by: ler Tested by: ler, pho MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34625
* kern_tc.c/cputick2usec() (which is used to calculate cputime fromfirk2022-03-211-7/+5
| | | | | | | | | | | | | | | | | cpu ticks) has some imprecision and, worse, huge timestep (about 20 minutes on 4GHz CPU) near 53.4 days of elapsed time. kern_time.c/cputick2timespec() (it is used for clock_gettime() for querying process or thread consumed cpu time) Uses cputick2usec() and then needlessly converting usec to nsec, obviously losing precision even with fixed cputick2usec(). kern_time.c/kern_clock_getres() uses some weird (anyway wrong) formula for getting cputick resolution. PR: 262215 Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D34558
* clock_gettime: Fix CLOCK_THREAD_CPUTIME_ID racefirk2022-03-171-2/+2
| | | | | | | | | | | Use a spinlock section instead of a critical section to synchronize with statclock(). Otherwise the CLOCK_THREAD_CPUTIME_ID clock can appear to go backwards. PR: 262273 Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D34568
* itimers: strip unused bits from struct itimer and struct itimersKonstantin Belousov2021-12-281-6/+0
| | | | | | | Reviewed by: imp, markj, mav Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33670
* itimers_alloc: no need to initialize its_timers arrayKonstantin Belousov2021-12-281-3/+0
| | | | | | | | | | struct itimers is allocated with M_ZERO, setting all members to NULL is tautological. Reviewed by: imp, markj, mav Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33670
* itimer: Serialize access to the p_itimers arrayMark Johnston2021-08-311-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the following race between itimer_proc_continue() and process exit. itimer_proc_continue() may be called via realitexpire(), the real interval timer. Note that exit1() drains this timer _after_ draining and freeing itimers. Moreover, itimers_exit() is called without the process lock held; it only acquires the proc lock when deleting individual itimers, so once they are drained we free p->p_itimers without any synchronization. Thus, itimer_proc_continue() may load a non-NULL p->p_itimers array and iterate over it after it has been freed. Fix the problem by using the process lock when clearing p->p_itimers, to synchronize with itimer_proc_continue(). Formally, accesses to this field should be protected by the process lock anyway, and since the array is allocated lazily this will not incur any overhead in the common case. Reported by: syzbot+c40aa8bf54fe333fc50b@syzkaller.appspotmail.com Reported by: syzbot+929be2f32503bbc3844f@syzkaller.appspotmail.com Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31759
* posix timers: Check for overflow when converting to nsMark Johnston2021-05-131-9/+12
| | | | | | | | | | | | | | | Disallow a time or timer period value when the conversion to nanoseconds would overflow. Otherwise it is possible to trigger a divison by zero in realtime_expire_l(), where we compute the number of overruns by dividing by the timer interval. Fixes: 7995dae9 ("posix timers: Improve the overrun calculation") Reported by: syzbot+5ab360bd3d3e3c5a6e0e@syzkaller.appspotmail.com Reported by: syzbot+157b74ff493140d86eac@syzkaller.appspotmail.com Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30233
* realtimer_expire: avoid proc lock recursion when called from ↵Konstantin Belousov2021-04-141-7/+17
| | | | | | | | | | | | | itimer_proc_continue() It is fine to drop the process lock there, process cannot exit until its timers are cleared. Found by: syzkaller Reported and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29746
* Stop arming realtime posix process timers on suspend or terminateKonstantin Belousov2021-04-091-9/+39
| | | | | | | | Reported and reviewed by: markj Tested by: markj, pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29106
* Stop arming periodic process timers on suspend or terminateKonstantin Belousov2021-04-091-2/+36
| | | | | | | | Reported and reviewed by: markj Tested by: markj, pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D29106
* posix timers: Improve the overrun calculationMark Johnston2021-03-081-7/+28
| | | | | | | | | | | | | | | | | | | timer_settime(2) may be used to configure a timeout in the past. If the timer is also periodic, we also try to compute the number of timer overruns that occurred between the initial timeout and the time at which the timer fired. This is done in a loop which iterates once per period between the initial timeout and now. If the period is small and the initial timeout was a long time ago, this loop can take forever to run, so the system is effectively DOSed. Replace the loop with a more direct calculation of (now - initial timeout) / period to compute the number of overruns. Reported by: syzkaller Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29093
* posix timers: Sprinkle some style fixesMark Johnston2021-03-081-11/+11
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* posix timers: Declare unexported functions as staticMark Johnston2021-03-081-4/+4
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* Stop using eventhandlers for itimers subsystem exec and exit hooks.Konstantin Belousov2020-11-211-46/+33
| | | | | | | | | | | | | | | | | | While there, do some minor cleanup for kclocks. They are only registered from kern_time.c, make registration function static. Remove event hooks, they are not used by both registered kclocks. Add some consts. Perhaps we can stop registering kclocks at all and statically initialize them. Reviewed by: mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D27305 Notes: svn path=/head/; revision=367923
* kern: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-4/+4
| | | | Notes: svn path=/head/; revision=365222
* Remove bogus use of useracc() in (clock_)nanosleep.Brooks Davis2020-04-141-7/+2
| | | | | | | | | | | | | | | There's no point in pre-checking that we can access the user's rmtp pointer before we do it in copyout(). While here, improve style(9) compliance. Reviewed by: imp MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24409 Notes: svn path=/head/; revision=359938
* Remove unneeded assert for curproc. Simplify.Konstantin Belousov2020-02-041-5/+1
| | | | | | | | Reported by: syzkaller by markj Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=357530
* For code reuse in Linuxulator rename get_proccess_cputime()Dmitry Chagin2020-02-041-9/+15
| | | | | | | | | | | | | | | | and get_thread_cputime() and add prototypes for it to <sys/syscallsubr.h>. As both functions become a public interface add process lock assert to ensure that the process is not exiting under it. Fix whitespace nit while here. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23340 MFC after 2 weeks Notes: svn path=/head/; revision=357492
* Remove duplicated empty lines from kern/*.cMateusz Guzik2020-01-301-1/+0
| | | | | | | No functional changes. Notes: svn path=/head/; revision=357312
* Disallow excessively small times of day in clock_settime(2).Mark Johnston2019-05-031-1/+3
| | | | | | | | | | | Reported by: syzkaller Reviewed by: cem, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20151 Notes: svn path=/head/; revision=347063
* Kill tz_minuteswest and tz_dsttime.Warner Losh2019-03-121-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Research Unix, 7th Edition introduced TIMEZONE and DSTFLAG compile-time constants in sys/param.h to communicate these values for the machine. 4.2BSD moved from the compile-time to run-time and introduced these variables and used for localtime() to return the right offset from UTC (sometimes referred to as GMT, for this purpose is the same). 4.4BSD migrated to using the tzdata code/database and these variables were basically unused. FreeBSD removed the real need for these with adjkerntz in 1995. However, some RTC clocks continued to use these variables, though they were largely unused otherwise. Later, phk centeralized most of the uses in utc_offset, but left it using both tz_minuteswest and adjkerntz. POSIX (IEEE Std 1003.1-2017) states in the gettimeofday specification "If tzp is not a null pointer, the behavior is unspecified" so there's no standards reason to retain it anymore. In fact, gettimeofday has been marked as obsolecent, meaning it could be removed from a future release of the standard. It is the only interface defined in POSIX that references these two values. All other references come from the tzdata database via tzset(). These were used to more faithfully implement early unix ABIs which have been removed from FreeBSD. NetBSD has completely eliminated these variables years ago. Linux has migrated to tzdata as well, though these variables technically still exist for compatibility with unspecified older programs. So, there's no real reason to have them these days. They are a historical vestige that's no longer used in any meaningful way. Reviewed By: jhb@, brooks@ Differential Revision: https://reviews.freebsd.org/D19550 Notes: svn path=/head/; revision=345049
* Make timespecadd(3) and friends publicAlan Somers2018-07-301-9/+11
| | | | | | | | | | | | | | | | | | | | | | The timespecadd(3) family of macros were imported from NetBSD back in r35029. However, they were initially guarded by #ifdef _KERNEL. In the meantime, we have grown at least 28 syscalls that use timespecs in some way, leading many programs both inside and outside of the base system to redefine those macros. It's better just to make the definitions public. Our kernel currently defines two-argument versions of timespecadd and timespecsub. NetBSD, OpenBSD, and FreeDesktop.org's libbsd, however, define three-argument versions. Solaris also defines a three-argument version, but only in its kernel. This revision changes our definition to match the common three-argument version. Bump _FreeBSD_version due to the breaking KPI change. Discussed with: cem, jilles, ian, bde Differential Revision: https://reviews.freebsd.org/D14725 Notes: svn path=/head/; revision=336914
* Improve the accuracy of the POSIX "process CPU-time" clocks by adding theColin Percival2018-06-221-0/+2
| | | | | | | | | | | | | | | | | | | | used portion of the current thread's time slice if the current thread belongs to the process being queried (i.e., if clock_gettime is invoked with a clock ID of CLOCK_PROCESS_CPUTIME_ID or the value provided by passing getpid(2) to clock_getcpuclockid(3)). The CLOCK_VIRTUAL and CLOCK_PROF timers already make this adjustment via long-standing code in calcru(), but since those timers are not specified by POSIX it seems useful to add it here so that the higher accuracy is available to code which aims to be portable. PR: 228669 Reported by: Graham Percival Reviewed by: kib MFC after: 1 week Notes: svn path=/head/; revision=335553
* nanosleep(2): Fix bogus incrementing of rmtp by tc_tick_sbt on [EINTR].Bryan Drewery2018-02-141-1/+2
| | | | | | | | | | | | | | | | | | | | | sbt is the time in the future that the tsleep_sbt() is expected to be completed at. sbtt is the current time. Depending on the precision with sysctl kern.timecounter.alloweddeviation the start time may be incremented by tc_tick_sbt. The same increment is needed for the current time of sbtt before calculating the difference. The impact of missing this increment is that rmtp may increase by one tc_tick_sbt on every early [EINTR] return. If the same struct is passed in for rqtp as rmtp this can result in rqtp effectively incrementing by tc_tick_sbt and sleeping longer than originally intended. This problem was introduced in r247797. Reviewed by: kib, markj, vangyzen (all on an older version of the test) MFC after: 2 weeks Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D14362 Notes: svn path=/head/; revision=329271
* sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326023
* disallow clock_settime too far in the future to avoid panicEd Maste2017-11-141-1/+1
| | | | | | | | | | | | | | | | | | | clock_ts_to_ct has a KASSERT that the converted year fits into four digits. By default (sysctl debug.allow_insane_settime is 0) the kernel disallows a time too far in the future, using a value of 9999 366-day years. However, clock_settime is epoch-relative and the assertion will fail with a tv_sec corresponding to some 8030 years. Avoid trying to be too clever, and just use a limit of 8000 365-day years past the epoch. Submitted by: Heqing Yan <scottieyan@gmail.com> Reported by: Syzkaller (https://github.com/google/syzkaller) MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=325825
* Add clock_nanosleep()Eric van Gyzen2017-03-191-30/+108
| | | | | | | | | | | | | | | | | | | | | | | | Add a clock_nanosleep() syscall, as specified by POSIX. Make nanosleep() a wrapper around it. Attach the clock_nanosleep test from NetBSD. Adjust it for the FreeBSD behavior of updating rmtp only when interrupted by a signal. I believe this to be POSIX-compliant, since POSIX mentions the rmtp parameter only in the paragraph about EINTR. This is also what Linux does. (NetBSD updates rmtp unconditionally.) Copy the whole nanosleep.2 man page from NetBSD because it is complete and closely resembles the POSIX description. Edit, polish, and reword it a bit, being sure to keep any relevant text from the FreeBSD page. Reviewed by: kib, ngie, jilles MFC after: 3 weeks Relnotes: yes Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D10020 Notes: svn path=/head/; revision=315526
* nanosleep: plug a kernel memory disclosureEric van Gyzen2017-03-181-1/+1
| | | | | | | | | | | | | | | | | nanosleep() updates rmtp on EINVAL. In that case, kern_nanosleep() has not updated rmt, so sys_nanosleep() updates the user-space rmtp by copying garbage from its stack frame. This is not only a kernel memory disclosure, it's also not POSIX-compliant. Fix it to update rmtp only on EINTR. Reviewed by: jilles (via D10020), dchagin MFC after: 3 days Security: possibly Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D10044 Notes: svn path=/head/; revision=315510
* Use time_t for intermediate values to avoid overflow in clock_ts_to_ctConrad Meyer2017-01-241-0/+7
| | | | | | | | | | | | | | | | | | | Add additionally safety and overflow checks to clock_ts_to_ct and the BCD routines while we're here. Perform a safety check in sys_clock_settime() first to avoid easy local root panic, without having to propagate an error value back through dozens of APIs currently lacking error returns. PR: 211960, 214300 Submitted by: Justin McOmie <justin.mcomie at gmail.com>, kib@ Reported by: Tim Newsham <tim.newsham at nccgroup.trust> Reviewed by: kib@ Sponsored by: Dell EMC Isilon, FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9279 Notes: svn path=/head/; revision=312702
* Renumber license clauses in sys/kern to avoid skipping #3Ed Maste2016-09-151-1/+1
| | | | Notes: svn path=/head/; revision=305832
* Remove Giant from settime(), tc_setclock_mtx guards tc_windup() calls,Konstantin Belousov2016-07-271-7/+1
| | | | | | | | | | | | | | | and there is no other issues with parallel settime(). Remove spl() vestiges there as well. Tested by: pho (as part of the whole patch) Reviewed by: jhb (same) Discussed wit: bde Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D7302 Notes: svn path=/head/; revision=303388
* Trace timeval parameters to the getitimer(2) and setitimer(2) syscalls.Konstantin Belousov2016-07-131-0/+17
| | | | | | | | | | | Reviewed by: jhb Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D7158 Notes: svn path=/head/; revision=302770
* sys: extend use of the howmany() macro when available.Pedro F. Giffuni2016-04-261-1/+1
| | | | | | | | We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read. Notes: svn path=/head/; revision=298649
* Verify that tv_sec value specified in settimeofday() and clock_settime()Dmitry Chagin2015-12-271-2/+4
| | | | | | | | | | | | | | | | | (CLOCK_REALTIME case) system calls is non negative. This commit hides a kernel panic in atrtc_settime() as the clock_ts_to_ct() does not properly convert negative tv_sec. ps. in my opinion clock_ts_to_ct() should be rewritten to properly handle negative tv_sec values. Differential Revision: https://reviews.freebsd.org/D4714 Reviewed by: kib MFC after: 1 week Notes: svn path=/head/; revision=292777
* Fix an off by one in ppsratecheck(). If you asked for N=1 you'd get one,Ian Lepore2015-01-111-1/+1
| | | | | | | but for any N>1 you'd get N-1 packets/events per second. Notes: svn path=/head/; revision=277025
* Allow clock_getcpuclockid() on the CPU-time clock for zombie process.Dmitry Chagin2015-01-101-5/+2
| | | | | | | | | | | | Posix does not prohibit this. Differential Revision: https://reviews.freebsd.org/D1470 Reviewed by: kib MFC after: 1 week Notes: svn path=/head/; revision=276906
* The process spin lock currently has the following distinct uses:Konstantin Belousov2014-11-261-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Threads lifetime cycle, in particular, counting of the threads in the process, and interlocking with process mutex and thread lock. The main reason of this is that turnstile locks are after thread locks, so you e.g. cannot unlock blockable mutex (think process mutex) while owning thread lock. - Virtual and profiling itimers, since the timers activation is done from the clock interrupt context. Replace the p_slock by p_itimmtx and PROC_ITIMLOCK(). - Profiling code (profil(2)), for similar reason. Replace the p_slock by p_profmtx and PROC_PROFLOCK(). - Resource usage accounting. Need for the spinlock there is subtle, my understanding is that spinlock blocks context switching for the current thread, which prevents td_runtime and similar fields from changing (updates are done at the mi_switch()). Replace the p_slock by p_statmtx and PROC_STATLOCK(). The split is done mostly for code clarity, and should not affect scalability. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=275121
* Split up sys_ktimer_getoverrun() into a sys_ and a kern_ variantBjoern A. Zeeb2014-08-071-2/+9
| | | | | | | | | | and export the kern_ version needed by an upcoming linuxolator change. MFC after: 3 days Sponsored by: DARPA,AFRL Notes: svn path=/head/; revision=269669
* Fix VIRTUAL and PROF interval timers for short intervals, broken at r247903.Alexander Motin2014-04-161-0/+8
| | | | | | | | | | | | Due to the way those timers are implemented, we can't handle very short intervals. In addition to that mentioned patch caused math overflows for short intervals. To avoid that round those intervals to 1 tick. PR: kern/187668 MFC after: 1 week Notes: svn path=/head/; revision=264550