summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_time.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Switch time_t, ino_t, clock_t, and struct kevent's ident and dataguenther2013-08-131-5/+338
| | | | | | | | | | | | | | | | | | | | members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything with time_t, timeval, itimerval, timespec, rusage, dirent, stat, or kevent arguments. Add a d_off member to struct dirent and replace getdirentries() with getdents(), thus immensely simplifying and accelerating telldir/seekdir. Build perl with -DBIG_TIME. Bump the major on every single base library: the compat bits included here are only good enough to make the transition; the T32 compat option will be burned as soon as we've reached the new world are are happy with the snapshots for all architectures. DANGER: ABI incompatibility. Updating to this kernel requires extra work or you won't be able to login: install a snapshot instead. Much assistance in fixing userland issues from deraadt@ and tedu@ and build assistance from todd@ and otto@
* Add support for the _POSIX_CPUTIME and _POSIX_THREAD_CPUTIME options,guenther2013-06-171-4/+31
| | | | | | | | including CLOCK_{PROCESS,THREAD}_CPUTIME_ID constants and {clock,pthread}_getcpuclockid() functions. Worked out at t2k13 with help from tedu@ and matthew@ and testing by aja@ ok matthew@
* Convert some internal APIs to use timespecs instead of timevalsguenther2013-06-031-8/+4
| | | | ok matthew@ deraadt@
* Use long long and %lld for printing tv_sec valuesguenther2013-06-021-5/+5
| | | | ok deraadt@
* do not include machine/cpu.h from a .c file; it is the responsibility ofderaadt2013-03-281-2/+1
| | | | | .h files to pull it in, if needed ok tedu
* unifdef -D __HAVE_TIMECOUNTERmiod2012-11-051-158/+1
|
* On resume, run forward the monotonic and realtimes clocks instead of jumpingguenther2012-05-241-2/+2
| | | | | | just the realtime clock, triggering and adjusting timeouts to reflect that. ok matthew@ deraadt@
* Make rusage totals, itimers, and profile settings per-process insteadguenther2012-03-231-25/+23
| | | | | | | of per-rthread. Handling of per-thread tick and runtime counters inspired by how FreeBSD does it. ok kettenis@
* Add tracing and dumping of "pointer to struct" syscall arguments forguenther2012-03-191-3/+41
| | | | | | structs timespec, timeval, sigaction, and rlimit. ok otto@ jsing@
* Add PS_EXITING to better differentiate between the process exiting andguenther2012-03-101-2/+2
| | | | the main thread exiting. c.f. regress/sys/kern/main-thread-exited/
* lots of SCARG simplification. ok matthewtedu2010-06-301-56/+69
|
* clock_gettime(CLOCK_PROF) didn't account for the time between the lastart2010-06-281-3/+8
| | | | | | context switch and the call to clock_gettime. oga@ ok
* clock_settime() should cancel an in-progress adjtime() just likeguenther2010-04-041-25/+25
| | | | | | settimeofday() does, so move those bits into settime() "I like it" deraadt@
* Convert thrsleep() to an absolute timeout with clockid to eliminate aguenther2009-11-271-15/+34
| | | | | | race condition and prep for later support of pthread_condattr_setclock() "get it in" deraadt@, tedu@, cheers by others
* cancel the timeout upon disabling profiling / virtual timer; somartynas2009-10-161-1/+5
| | | | | | | | | | | that the timeout doesn't happen if setitimer is called between the profiling / virtual timer expires and the timeout is scheduled. firefox triggered this Profiling timer expired problem when in uthread execve signal was being delivered after timer has already been disabled; as reported on ports@ recently. special thanks to kettenis@, kurt@, guenther@. agreed by kettenis@, tedu@. ok guenther@. reminded & ok fgs@. tested by ian@.
* abort any time adjustment in progress if the clock is set with settimeofdayckuethe2009-06-051-13/+27
| | | | ok millert
* system/5918: fix clearing of ITIMER_VIRTUAL and ITIMER_PROF it_intervaldjm2008-09-191-4/+4
| | | | ok tedu@
* ratecheck(9) only seems to be used to limit things to very coarse intervalsdlg2008-04-041-2/+2
| | | | | | | like .25 seconds or 5 seconds. the accuracy of microuptime is not really needed then, so switch it to getmicrouptime. ok henning@ art@
* Do not lose nanosleep() return value in the last copyout if nonzero; PR#5697miod2008-01-021-3/+5
|
* Implement clock_gettime(CLOCK_PROF) since it's so simple.art2007-04-041-4/+6
| | | | deraadt@ ok
* Fix getitimer to use uptime as setitimer does. Fixes bad output fromart2007-01-101-2/+2
| | | | | | getitimer when the clock on the machine has been reset. miod@ ok
* Timecounter based implementation of adjfreq(2). Largely from art@otto2006-10-301-4/+12
| | | | | Tested by various using not (yet) committed amd64 timecounter code. ok deraadt@
* Normalize the correction passed to adjtime(2) before using it in thekettenis2006-06-291-1/+10
| | | | | | __HAVE_TIMECOUNTER case. ok otto@
* Adapt adjtime() code and put in a better stub for adjfreq() for theotto2006-06-271-9/+19
| | | | | timecounters case. adjfreq() does not work with timecounters, but more is coming. with help from miod; tested by dlg@; ok miod@
* Make sys_adjfreq() compile on archs that use timecountersjsg2006-06-151-1/+3
| | | | (ie sgi). Diff and request to commit from otto@
* Introducing adjfreq(2), to adjust the clock frequency.otto2006-06-141-1/+34
| | | | Loosely based on dragonfly code. ok deraadt@
* Allow any user to request the current adjustment; ok henning@ deraadt@otto2006-06-041-1/+8
|
* revert auto-skew. some ntpd implementations interact poorly.tedu2006-01-201-47/+9
|
* auto adjusting adjtime. be more responsive to large clock deltas,tedu2006-01-131-9/+47
| | | | | and attempt to compensate for incorrect clocks by adjusting ticks slowly. ok deraadt
* ansi/deregister.jsg2005-11-281-63/+26
| | | | 'go for it' deraadt@
* make sure ppsratecheck() returns 0 if maxpps is 0;markus2005-10-271-2/+4
| | | | from alexander bluhm; ok deraadt
* In realitexpire(), do not re-add the itimer timeout if the process is inaaron2005-10-131-2/+3
| | | | | | | | | the midst of exiting. This solves a race condition that causes freed memory to be left referenced in the master kernel timeout worklist, leading to a uvm_fault. The same race condition was already fixed earlier in r1.53 of kern_clock.c for the process virtual and profile timeout structs. deraadt@ ok, testing by krw@
* Avoid arithmetic overflows in computation of adjtime(). Fixes adjusting in theotto2005-10-101-3/+16
| | | | | wrong direction for large offsets as nick@ saw. With tom@ and toby@; ok tdeval@ krw@
* Protect p_timer with splclock. It can be fiddled with in hardclock (butart2005-05-311-1/+5
| | | | | | | only for curproc, that's why no SCHED_LOCK or similar is necessary). miod@ "appears to be harmless" markus@ ok
* sched work by niklas and art backed out; causes panicsderaadt2005-05-291-5/+1
|
* This patch is mortly art's work and was done *a year* ago. Art wants to thankniklas2005-05-251-1/+5
| | | | | | | | | | | | | | | | everyone for the prompt review and ok of this work ;-) Yeah, that includes me too, or maybe especially me. I am sorry. Change the sched_lock to a mutex. This fixes, among other things, the infamous "telnet localhost &" problem. The real bug in that case was that the sched_lock which is by design a non-recursive lock, was recursively acquired, and not enough releases made us hold the lock in the idle loop, blocking scheduling on the other processors. Some of the other processors would hold the biglock though, which made it impossible for cpu 0 to enter the kernel... A nice deadlock. Let me just say debugging this for days just to realize that it was all fixed in an old diff noone ever ok'd was somewhat of an anti-climax. This diff also changes splsched to be correct for all our architectures.
* This touches only MI code, and adds new time keeping code. Thetholo2004-07-281-1/+70
| | | | | | | | | | | | | | | code is all conditionalized on __HAVE_TIMECOUNTER, and not enabled on any platforms. adjtime(2) support exists, courtesy of nordin@, sysctl(2) support and a concept of quality for each time source attached exists. High quality time sources exists for PIIX4 ACPI timer as well as some AMD power management chips. This will have to be redone once we actually add ACPI support (at that time we need to use the ACPI interfaces to get at these clocks). ok art@ ken@ miod@ jmc@ and many more
* Don't sleep forever on short nanosleeps.nordin2004-06-261-2/+3
|
* This moves access to wall and uptime variables in MI code,tholo2004-06-241-85/+59
| | | | | | | | | | | | | | encapsulating all such access into wall-defined functions that makes sure locking is done as needed. It also cleans up some uses of wall time vs. uptime some places, but there is sure to be more of these needed as well, particularily in MD code. Also, many current calls to microtime() should probably be changed to getmicrotime(), or to the {,get}microuptime() versions. ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others "Oh, that is not your problem!" from miod@
* First step towards more sane time handling in the kernel -- this changestholo2004-06-211-2/+2
| | | | | | | | things such that code that only need a second-resolution uptime or wall time, and used to get that from time.tv_secs or mono_time.tv_secs now get this from separate time_t globals time_second and time_uptime. ok art@ niklas@ nordin@
* debranch SMP, have funniklas2004-06-131-2/+2
|
* Merge in a piece of the SMP branch into HEAD.art2004-06-091-1/+12
| | | | | | | | | | | Introduce the cpu_info structure, p_cpu field in struct proc and global scheduling context and various changed code to deal with this. At the moment no architecture uses this stuff yet, but it will allow us slow and controlled migration to the new APIs. All new code is ifdef:ed out. ok deraadt@ niklas@
* pretty code that's easier to read, same effect.tedu2004-02-151-4/+8
| | | | from netbsd via Pedro Martelletto <pbastos@rdc.puc-rio.br>
* match syscallargs comments with realityhenning2003-09-011-5/+5
| | | | | from Patrick Latifi <patrick.l@hermes.usherb.ca> ok jason@ tedu@
* fix sys_clock_settime. hint from nordin@ ok deraadt@tedu2003-08-261-6/+4
|
* change arguments to suser. suser now takes the process, and a flagstedu2003-08-151-4/+6
| | | | | | | | | argument. old cred only calls user suser_ucred. this will allow future work to more flexibly implement the idea of a root process. looks like something i saw in freebsd, but a little different. use of suser_ucred vs suser in file system code should be looked at again, for the moment semantics remain unchanged. review and input from art@ testing and further review miod@
* implement CLOCK_MONOTONIC from NetBSD; ok marc@kevlo2003-08-111-14/+33
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* no need for nfs headers since nqnfs had been removed way long time agomickey2003-05-191-7/+1
|
* which is int not u_int so check for negative values. ok deraadt@, art@nordin2002-10-021-5/+5
|