summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_clock.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move hzto(9) to the attic; OK dlgmikeb2015-06-111-54/+1
|
* Remove non-standard <sys/dkstat.h> header. It has not contained anythingmiod2014-09-151-2/+1
| | | | | | | | | | related to disk stastics for almost 17 years, and the remaining userland-visible defines duplicate those found in <sys/sched.h>. Move the remaining _KERNEL defines to <sys/tty.h> where they belong, and update all users to cope with this. ok kettenis@
* Remove global cp_time[] array; no longer used now that all arches implementmiod2014-09-041-3/+1
| | | | cpu_info.
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-081-2/+1
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* rename local ticks to nticks to avoid aliasing global. ok krwtedu2013-12-241-17/+17
|
* Fix delivery of SIGPROF and SIGVTALRM to threaded processes by havingguenther2013-10-081-37/+12
| | | | | | | | hardclock() set a flag on the running thread and force AST processing, and then have the thread signal itself from userret(). idea and flag names from FreeBSD ok jsing@
* Switch time_t, ino_t, clock_t, and struct kevent's ident and dataguenther2013-08-131-2/+3
| | | | | | | | | | | | | | | | | | | | 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 tstohz(9) as the timespec analog to tvtohz(9).matthew2013-04-241-1/+19
| | | | ok miod
* 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
* Fix kernel profiling on MP systems by using per-CPU buffers and teachmpi2013-03-121-3/+3
| | | | | | | | | | | kgmon(8) to deal with them, this time without public header changes. Previously various CPUs were iterating over the same global buffer at the same time to modify it and never ended. This diff includes some ideas submited by Thor Simon to NetBSD via miod@. ok deraadt@, mikeb@, haesbaert@
* Back out per-CPU kernel profiling, it shouldn't modify a public headermpi2013-02-121-3/+3
| | | | at this moment.
* Fix kernel profiling on MP systems by using per-CPU buffer. Previouslympi2013-02-111-3/+3
| | | | | | | | | various CPUs were iterating over the same global buffer at the same time to modify it and never ended. This diff includes some ideas submited by Thor Simon to NetBSD via miod@. ok mikeb@, haesbaert@
* unifdef -D __HAVE_TIMECOUNTERmiod2012-11-051-147/+1
|
* Apply profiling to all threads instead of just the thread that calledguenther2012-08-021-10/+12
| | | | | | | profil() by moving P_PROFIL from proc->p_flag to process->ps_flags with matching adjustment in fork1() and exit1() ok matthew@
* On resume, run forward the monotonic and realtimes clocks instead of jumpingguenther2012-05-241-4/+1
| | | | | | 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-17/+12
| | | | | | | of per-rthread. Handling of per-thread tick and runtime counters inspired by how FreeBSD does it. ok kettenis@
* The scheduling 'nice' value is per-process, not per-thread, so move itguenther2011-03-071-2/+2
| | | | | | into struct process. ok tedu@ deraadt@
* Change hzto(9) and tvtohz(9) arguments to const pointers.matthew2010-08-201-3/+3
| | | | ok krw@, "of course" tedu@
* fix typos in comments, no code changes;schwarze2010-01-141-2/+2
| | | | | from Brad Tilley <brad at 16systems dot com>; ok oga@
* Get rid of __HAVE_GENERIC_SOFT_INTERRUPTS now that all our platforms support it.kettenis2009-11-041-23/+3
| | | | ok jsing@, miod@
* Pass the new pointer to sysctl_clockrate(), so that trying to change themiod2009-01-211-3/+3
| | | | | value of kern.clockrate with sysctl(3) correctly sets errno on failure. PR #6040, ok tedu@
* At clock initialization, if we discover that tickadj is 0 (due to veryderaadt2008-10-041-1/+6
| | | | | | high HZ) set it to 1, to avoid various divide-by-zero errors later Based on discussion in PR 5511 ok miod
* In statclock(), fix local index type in the profiling code. Avoidsmiod2008-03-151-2/+2
| | | | out-of-bounds array accesses on some platforms.
* Make context switching much more MI:art2007-10-101-2/+2
| | | | | | | | | | | | | | | | | | | | - Move the functionality of choosing a process from cpu_switch into a much simpler function: cpu_switchto. Instead of having the locore code walk the run queues, let the MI code choose the process we want to run and only implement the context switching itself in MD code. - Let MD context switching run without worrying about spls or locks. - Instead of having the idle loop implemented with special contexts in MD code, implement one idle proc for each cpu. make the idle loop MI with MD hooks. - Change the proc lists from the old style vax queues to TAILQs. - Change the sleep queue from vax queues to TAILQs. This makes wakeup() go from O(n^2) to O(n) there will be some MD fallout, but it will be fixed shortly. There's also a few cleanups to be done after this. deraadt@, kettenis@ ok
* The world of __HAVEs and __HAVE_NOTs is reducing. All architecturesart2007-05-161-33/+9
| | | | | | have cpu_info now, so kill the option. eyeballed by jsg@ and grange@
* Don't bother performing ITIMER accounting on P_SYSTEM processes (i.e. kthreads).miod2007-04-171-2/+2
| | | | ok art@ kettenis@
* Garbage collect CPU_CLOCKUPDATE since it was only used by i386.art2007-03-251-5/+1
| | | | from brad.
* Since p_flag is often manipulated in interrupts and without biglockart2007-03-151-3/+3
| | | | | | | | | | | | it's a good idea to use atomic.h operations on it. This mechanic change updates all bit operations on p_flag to atomic_{set,clear}bits_int. Only exception is that P_OWEUPC is set by MI code before calling need_proftick and it's automatically cleared by ADDUPC. There's no reason for MD handling of that flag since everyone handles it the same way. kettenis@ ok
* If <machine/cpu.h> defines PROC_PC to compute the userland pc from an exceptionmiod2006-12-241-1/+6
| | | | frame, use it to report profiling information via addupc_intr().
* Introducing adjfreq(2), to adjust the clock frequency.otto2006-06-141-1/+22
| | | | Loosely based on dragonfly code. ok deraadt@
* revert auto-skew. some ntpd implementations interact poorly.tedu2006-01-201-3/+2
|
* auto adjusting adjtime. be more responsive to large clock deltas,tedu2006-01-131-2/+3
| | | | | and attempt to compensate for incorrect clocks by adjusting ticks slowly. ok deraadt
* Make #undef match its temporary #define.miod2006-01-031-2/+2
|
* ansi/deregister.jsg2005-11-281-14/+9
| | | | 'go for it' deraadt@
* dont' -> don't in comments;jmc2005-10-251-2/+2
| | | | from ray lai;
* In hardclock(), do not setup process virtual and profile timers if the processaaron2005-10-031-2/+2
| | | | | | is in 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 (observed on an i386 MP system). tedu@, deraadt@, miod@ ok
* Diff from art@:grange2004-11-101-2/+1
| | | | | | | | | Update ticks in timeout_hardclock_update to avoid errors in hardclock (this is the third time we mess up here). ticks is only used for timeouts anyway. At the same protect updating ticks with timeout_mutex and be slightly more paranoid in timeout_hardclock_update. ok tdeval@ miod@
* Typo in #endif comment.grange2004-09-151-2/+2
|
* Fix typos. Found by Dries Schellekensart2004-08-051-3/+3
|
* hardclock detects if ITIMER_VIRTUAL and ITIMER_PROF have expired andart2004-08-041-3/+44
| | | | | | | | | | | | | | | | | | | sends SIGVTALRM and SIGPROF to the process if they had. There is a big problem with calling psignal from hardclock on MULTIPROCESSOR machines though. It means we need to protect all signal state in the process with a lock because hardclock doesn't obtain KERNEL_LOCK. Trying to track down all the tentacles of this quickly becomes very messy. What saves us at the moment is that SCHED_LOCK (which is used to protect parts of the signal state, but not all) happens to be recursive and forgives small and big errors. That's about to change. So instead of trying to hunt down all the locking problems here, just make hardclock not send signals. Instead hardclock schedules a timeout that will send the signal later. There are many reasons why this works just as good as the previous code, all explained in a comment written in big, friendly letters in kern_clock. miod@ ok noone else dared to ok this, but noone screamed in agony either.
* Even when we have timecounters we still have to do the check for secondaryart2004-08-041-3/+3
| | | | | cpus calling hardclock and the statclock emulation. Move some ifdef __HAVE_TIMECOUNTER code.
* This touches only MI code, and adds new time keeping code. Thetholo2004-07-281-7/+24
| | | | | | | | | | | | | | | 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
* This moves access to wall and uptime variables in MI code,tholo2004-06-241-6/+76
| | | | | | | | | | | | | | 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-1/+6
| | | | | | | | 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-5/+14
|
* Merge in a piece of the SMP branch into HEAD.art2004-06-091-13/+52
| | | | | | | | | | | 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@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Force "struct timeval time" variable to be aligned to an 8-bit boundary.miod2003-05-131-2/+3
| | | | | | | This is at least necessary for the sparc microtime() function, and was only working before by goat luck. The recent commons removal triggered it. __atribute__ syntax borrowed from NetBSD.
* Restore pentium_microtime, testing by henning@, millert@. ok deraadt@nordin2002-09-241-1/+5
|
* Remove kernel support for NTP. ok deraadt@ and tholo@nordin2002-07-061-799/+2
|