summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_timeout.c
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of DIAGNOSTIC that gives false positives on slow CPUs.mckusick2003-11-041-28/+0
|
* On ia64 time_t is 64 bit. Explicitly cast tv_sec to long and changemarcel2003-08-231-2/+2
| | | | | | | the corresponding format specifier to %ld in a call to printf() in function softclock(). The printf() is conditional upon DIAGNOSTIC. Found by: LINT
* Don't put callout_lock under #ifdef DIAGNOSTIC despite the fact that itphk2003-06-201-1/+2
| | | | works anyway.
* Crude but efficient:phk2003-06-201-1/+8
| | | | | #ifdef DIAGNOSTIC hold a mutex while calling callout's so that we hear about it if they sleep.
* Use __FBSDID().obrien2003-06-111-1/+3
|
* Add instrumentation which tells us how much work softclock() doesphk2003-06-041-2/+26
| | | | per invocation.
* Under DIAGNOSTIC, only report expensive timeouts if they are more expensivephk2003-02-011-1/+2
| | | | than the last on we reported.
* Fix a format buglet.phk2002-09-051-1/+1
| | | | Spotted by: iedowse
* Under DIAGNOSTIC, complain if a timeout(9) routine took more than 1msec.phk2002-09-041-4/+23
|
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-1/+1
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Remove __P.alfred2002-03-191-1/+1
|
* Move most of the kernel submap initialization code, including thedillon2001-08-221-0/+49
| | | | | | | | timeout callwheel and buffer cache, out of the platform specific areas and into the machine independant area. i386 and alpha adjusted here. Other cpus can be fixed piecemeal. Reviewed by: freebsd-smp, jake
* Change callout_stop() to return an integer. If callout_stop() succeeds injhb2001-08-101-2/+3
| | | | | | | | | | removing the callout entry, return 1. If callout_stop() fails to remove the callout entry because it is currently executing or has already been executed, then the function returns 0. The idea was obtained from BSD/OS, however, BSD/OS changed untimeout(), and I've just changed callout_stop() to be more conservative. Obtained from: BSD/OS
* Axe spl's obsoleted by the callout mutex.jhb2001-08-101-26/+4
|
* Catch up to header include changes:jhb2001-03-281-0/+1
| | | | | - <sys/mutex.h> now requires <sys/systm.h> - <sys/mutex.h> and <sys/sx.h> now require <sys/lock.h>
* Change and clean the mutex lock interface.bmilekic2001-02-091-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order)
* Revert the last commit to the callout interface, and add a flag tojlemon2000-11-251-6/+7
| | | | | | | callout_init() indicating whether the callout is safe or not. Update the callers of callout_init() to reflect the new interface. Okayed by: Jake
* - Rename callout_reset to _callout_reset and add a flags argument.jake2000-11-251-2/+4
| | | | | - Add macros callout_reset, which does the obvious, and mp_callout_reset, which passes the CALLOUT_MPSAFE flag.
* - Protect the callout wheel with a separate spin mutex, callout_lock.jake2000-11-191-17/+24
| | | | | | | | | | | - Use the mutex in hardclock to ensure no races between it and softclock. - Make softclock be INTR_MPSAFE and provide a flag, CALLOUT_MPSAFE, which specifies that a callout handler does not need giant. There is still no way to set this flag when regstering a callout. Reviewed by: -smp@, jlemon
* Release sched_lock very briefly to give interrupts a chance to fire if wejhb2000-11-181-0/+2
| | | | | | are in softclock() for a long time. The old code already did an splx()/slphigh() pair here, I just missed adding in the equivalent mutex operations on sched_lock earlier.
* The recent changes to msleep() and mawait() resulted in timeout() andjhb2000-11-161-1/+16
| | | | | | | | untimeout() not being called with Giant in those functions. For now, use the sched_lock to protect the callout wheel in softclock() and in the various timeout and callout functions. Noticed by: tegge
* - Overhaul the software interrupt code to use interrupt threads for eachjhb2000-10-251-1/+1
| | | | | | | | | | | | | | | | | | | type of software interrupt. Roughly, what used to be a bit in spending now maps to a swi thread. Each thread can have multiple handlers, just like a hardware interrupt thread. - Instead of using a bitmask of pending interrupts, we schedule the specific software interrupt thread to run, so spending, NSWI, and the shandlers array are no longer needed. We can now have an arbitrary number of software interrupt threads. When you register a software interrupt thread via sinthand_add(), you get back a struct intrhand that you pass to sched_swi() when you wish to schedule your swi thread to run. - Convert the name of 'struct intrec' to 'struct intrhand' as it is a bit more intuitive. Also, prefix all the members of struct intrhand with 'ih_'. - Make swi_net() a MI function since there is now no point in it being MD. Submitted by: cp
* Restructure TCP timeout handling:jlemon1999-08-301-9/+9
| | | | | | | | | | - eliminate the fast/slow timeout lists for TCP and instead use a callout entry for each timer. - increase the TCP timer granularity to HZ - implement "bad retransmit" recovery, as presented in "On Estimating End-to-End Network Path Properties", by Allman and Paxson. Submitted by: jlemon, wollmann
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Fix callout_init(). This didn't have any practical effect since itwollman1999-03-061-2/+2
| | | | | was only used to initialize the static timeouts, which unconditionally clears the only bits which could have caused problems.
* Expose a slightly-lower-level interface to timeouts which allows callerswollman1999-03-061-24/+96
| | | | | | | | to manage their own memory. Tested on my machine (make buildworld). I've made analogous changes on the alpha, but don't have a machine to test. Not-objected-to by: dg, gibbs
* Fixed stale references to hzto() in comments.bde1998-05-171-2/+2
|
* Declare function pointer args as pointers, not as functions.bde1998-02-251-3/+3
|
* A bunch of nits from bde.phk1998-02-151-15/+13
|
* Make softticks static.phk1998-01-141-35/+2
| | | | Remove unneeded stuff.
* Fix softclock calling so we don't loose timeouts (I broke this ~10h ago)phk1998-01-111-6/+2
|
* Whoops. softclock is called from doreti_swi as well. Abandon call fromphk1998-01-101-8/+2
| | | | | | | | hardclock(). Forgot this: Pointed hat sent by: bd
* Effect the divorce of kern_clock.c and kern_timeout.c (which wasphk1998-01-101-1111/+20
| | | | repository copied from kern_clock.c)
* Improve hardpps readability a bit:phk1998-01-071-50/+45
| | | | | * Rename usec to p_usec so you can search for it. * Macroize the huge median_of_3_samples if statement.
* This patch causes the "calltodo" timer list to be decremented by the amountnate1997-12-231-1/+68
| | | | | | | | | | | | | | | | | | | | | | of time that the laptop was suspending. Thus, select() calls that might have suspended rather than firing at 1hr + "time suspended" since the timer was posted. Adding: options APM_FIXUP_CALLTODO to the kernel config enables the patch. [ This patch was slightly modified to use a consistant indent style and I removed some unused local variables. After this has been tested a few weeks we'll make the options the default, so for now I'm now documenting it in LINT. Mike can later if he wants. ] Reviewed by: Mike Smith <msmith@freebsd.org> Submitted by: Ken Key <key@cs.utk.edu>
* The improvements to clock statistics by Tor Eggefsmp1997-12-081-1/+20
| | | | | | | Wrappered and enabled by the define BETTER_CLOCK (on by default in smpyests.h) Reviewed by: smp@csn.net Submitted by: Tor Egge <Tor.Egge@idi.ntnu.no>
* Removed all traces of P_IDLEPROC. It was tested but never set.bde1997-11-241-2/+2
|
* Removed unused #include.bde1997-11-181-3/+1
|
* Remove a bunch of variables which were unused both in GENERIC and LINT.phk1997-11-071-3/+1
| | | | Found by: -Wunused
* Store an absolute tick value in callout entries so that a subtraction ongibbs1997-09-241-10/+18
| | | | | | | | hash chain traversal isn't needed. This also allows untimeout to recompute the hash to find the bucket that the entry to remove is stored in so that each callout entry no longer needs to store that information. Reviewed by: Nate Williams <nate@mt.sri.com>
* init_main.c subr_autoconf.c:gibbs1997-09-211-81/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for "interrupt driven configuration hooks". A component of the kernel can register a hook, most likely during auto-configuration, and receive a callback once interrupt services are available. This callback will occur before the root and dump devices are configured, so the configuration task can affect the selection of those two devices or complete any tasks that need to be performed prior to launching init. System boot is posponed so long as a hook is registered. The hook owner is responsible for removing the hook once their task is complete or the system boot can continue. kern_acct.c kern_clock.c kern_exit.c kern_synch.c kern_time.c: Change the interface and implementation for the kernel callout service. The new implemntaion is based on the work of Adam M. Costello and George Varghese, published in a technical report entitled "Redesigning the BSD Callout and Timer Facilities". The interface used in FreeBSD is a little different than the one outlined in the paper. The new function prototypes are: struct callout_handle timeout(void (*func)(void *), void *arg, int ticks); void untimeout(void (*func)(void *), void *arg, struct callout_handle handle); If a client wishes to remove a timeout, it must store the callout_handle returned by timeout and pass it to untimeout. The new implementation gives 0(1) insert and removal of callouts making this interface scale well even for applications that keep 100s of callouts outstanding. See the updated timeout.9 man page for more details.
* Some staticized variables were still declared to be extern.bde1997-09-071-2/+2
|
* Removed unused #includes.bde1997-09-021-3/+1
|
* #include <machine/limits.h> explicitly in the few places that it is required.bde1997-08-211-1/+2
|
* Add tickadj to struct clockinfo, like NetBSD and OpenBSD.jhay1997-06-241-1/+2
| | | | NOTE: libc, time, kgmon and rpc.rstatd will have to be recompiled.
* Man the liferafts! Here comes the long awaited SMP -> -current merge!peter1997-04-261-2/+2
| | | | | | | | | | | | | | | | There are various options documented in i386/conf/LINT, there is more to come over the next few days. The kernel should run pretty much "as before" without the options to activate SMP mode. There are a handful of known "loose ends" that need to be fixed, but have been put off since the SMP kernel is in a moderately good condition at the moment. This commit is the result of the tinkering and testing over the last 14 months by many people. A special thanks to Steve Passe for implementing the APIC code!
* Restore Bruce's original comment. It seems that "iff" = if and only if,mpp1997-03-221-2/+2
| | | | and is not a typo. It is used other places in the kernel, too.
* Fix a typo in a comment of a recent commit.mpp1997-03-221-2/+2
|
* Fixed some invalid (non-atomic) accesses to `time', mostly ones of thebde1997-03-221-1/+12
| | | | | | form `tv = time'. Use a new function gettime(). The current version just forces atomicicity without fixing precision or efficiency bugs. Simplified some related valid accesses by using the central function.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
OpenPOWER on IntegriCloud