summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_synch.c
Commit message (Collapse)AuthorAgeFilesLines
* Compare p_cpulimit with RLIM_INFINITY before comparing it with the processdg1998-11-271-2/+3
| | | | | | runtime. p_runtime is unsigned while p_cpulimit is not, so this avoids the nasty side effect of the process getting killed when the runtime comes up "negative" due to other bugs.
* Fixed the previous fix - stathz doesn't give the statclock frequencybde1998-11-261-5/+6
| | | | | | when it is 0. Submitted by: mostly by Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
* Oops, yet again back out some local changes that shouldn't have beenbde1998-11-261-5/+5
| | | | in the previous commit.
* Fixed scaling of p_pctcpu. It was wrong by a factor of stathz/hz.bde1998-11-261-8/+8
| | | | | Until recently, this was half compensated for in at least ps and top by multiplying by 100/stathz to get a better wrong factor of 100/hz.
* Oops, back out some local changes that shouldn't have been in thebde1998-10-251-5/+5
| | | | previous commit.
* Fixed breakage of the !SMP case of roundrobin() in the previous commit.bde1998-10-251-5/+8
|
* Nitpicking and dusting performed on a train. Removes trivial warningsphk1998-10-251-4/+3
| | | | about unused variables, labels and other lint.
* priority comparison in maybe_resched() didn't work properly if currentdillon1998-08-261-6/+13
| | | | and chk process were on different scheduler queues. Fixed.
* Cast pointers to uintptr_t/intptr_t instead of to u_long/long,bde1998-07-151-2/+2
| | | | | | | respectively. Most of the longs should probably have been u_longs, but this changes is just to prevent warnings about casts between pointers and integers of different sizes, not to fix poorly chosen types.
* Moved definition of fscale from param.c to kern_synch.c where itbde1998-07-111-1/+5
| | | | | should always have been (it has no user-servicable parts even at compile time) and staticized it.
* Add 3 sysctl variables for future use by ps)1_phk1998-06-301-1/+2
|
* Removed unused includes.bde1998-06-211-2/+1
|
* Some cleanups related to timecounters and weird ifdefs in <sys/time.h>.phk1998-05-281-28/+16
| | | | | | | | | | | | | | | | | | | | Clean up (or if antipodic: down) some of the msgbuf stuff. Use an inline function rather than a macro for timecounter delta. Maintain process "on-cpu" time as 64 bits of microseconds to avoid needless second rollover overhead. Avoid calling microuptime the second time in mi_switch() if we do not pass through _idle in cpu_switch() This should reduce our context-switch overhead a bit, in particular on pre-P5 and SMP systems. WARNING: Programs which muck about with struct proc in userland will have to be fixed. Reviewed, but found imperfect by: bde
* Add forwarding of roundrobin to other cpus. This gives a more regulartegge1998-05-171-1/+10
| | | | | | | | | | | update of cpu usage as shown by top when one process is cpu bound (no system calls) while the system is otherwise idle (except for top). Don't attempt to switch to the BSP in boot(). If the system was idle when an interrupt caused a panic, this won't work. Instead, switch to the BSP in cpu_reset. Remove some spurious forward_statclock/forward_hardclock warnings.
* s/nanoruntime/nanouptime/gphk1998-05-171-3/+3
| | | | | | s/microruntime/microuptime/g Reviewed by: bde
* Time changes mark 2:phk1998-04-041-5/+5
| | | | | | | | | | | | | | | | | * Figure out UTC relative to boottime. Four new functions provide time relative to boottime. * move "runtime" into struct proc. This helps fix the calcru() problem in SMP. * kill mono_time. * add timespec{add|sub|cmp} macros to time.h. (XXX: These may change!) * nanosleep, select & poll takes long sleeps one day at a time Reviewed by: bde Tested by: ache and others
* Remove duplicate commentdufault1998-03-281-4/+1
|
* Finish _POSIX_PRIORITY_SCHEDULING. Needs P1003_1B anddufault1998-03-281-1/+4
| | | | | | | | | | | | | | | | _KPOSIX_PRIORITY_SCHEDULING options to work. Changes: Change all "posix4" to "p1003_1b". Misnamed files are left as "posix4" until I'm told if I can simply delete them and add new ones; Add _POSIX_PRIORITY_SCHEDULING system calls for FreeBSD and Linux; Add man pages for _POSIX_PRIORITY_SCHEDULING system calls; Add options to LINT; Minor fixes to P1003_1B code during testing.
* Moved some #includes from <sys/param.h> nearer to where they are actuallybde1998-03-281-1/+2
| | | | used.
* idprio processes must be preempted as soon as anything is runnable.dufault1998-03-111-4/+7
|
* Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman)julian1998-03-081-2/+2
| | | | | Submitted by: Kirk McKusick (mcKusick@mckusick.com) Obtained from: WHistle development tree
* Reviewed by: msmith, bde long agodufault1998-03-041-11/+31
| | | | | | | Fix for RTPRIO scheduler to eliminate invalid context switches. POSIX.4 headers and sysctl variables. Nothing should change unless POSIX4 is defined or _POSIX_VERSION is set to 199309.
* Fixed a missing newline in a debugging printf.bde1998-02-251-4/+4
| | | | Fixed punctuation in some comments.
* Back out DIAGNOSTIC changes.eivind1998-02-061-2/+1
|
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-041-1/+2
|
* Fixed style bugs in previous commit.bde1997-12-291-3/+3
|
* Lots of improvements, including restructring the caching and managementdyson1997-12-291-1/+3
| | | | | | | | | | | | | | of vnodes and objects. There are some metadata performance improvements that come along with this. There are also a few prototypes added when the need is noticed. Changes include: 1) Cleaning up vref, vget. 2) Removal of the object cache. 3) Nuke vnode_pager_uncache and friends, because they aren't needed anymore. 4) Correct some missing LK_RETRY's in vn_lock. 5) Correct the page range in the code for msync. Be gentle, and please give me feedback asap.
* Shift a few SYSINT() calls around.julian1997-11-251-3/+16
| | | | | | | | | | this results in a few functions becoming static, and the SYSINITs being close to the code they are related to. setting up the dump device is with dumpsys() and kicking off the scheduler is with the scheduler. Mounting root is with the code that does it. Reviewed by: phk
* Staticized.bde1997-11-221-7/+7
|
* Const poisoning from ks_shortdesc.bde1997-11-211-2/+2
|
* init_main.c subr_autoconf.c:gibbs1997-09-211-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Removed unused #includes.bde1997-09-021-5/+1
|
* #include <machine/limits.h> explicitly in the few places that it is required.bde1997-08-211-1/+2
|
* Take verbal beating by wollman into account and fix DIAGNOSTIC test.julian1997-08-181-11/+10
| | | | | | | | | This version. 1/ avoids garret's introduced potential page fault. (I got one) 2/ removes compiler warnings Also fix the tunable scheduling quantum to return a better error code when fed a bad argument.
* Dejulianize DIAGNOSTIC panic code. The types are wrong; probably there'swollman1997-08-161-4/+6
| | | | a missing dereference.
* add a diagnostic to catch some common cases of tsleep beingjulian1997-08-131-1/+8
| | | | called from the wrong place.
* Make the scheduler quantum a tunable parameterjulian1997-08-081-2/+26
| | | | Reviewd by: John Dyson dyson@freebsd.org
* Preliminary support for per-cpu data pages.peter1997-06-221-9/+3
| | | | | | | | | | | | | | | | This eliminates a lot of #ifdef SMP type code. Things like _curproc reside in a data page that is unique on each cpu, eliminating the expensive macros like: #define curproc (SMPcurproc[cpunumber()]) There are some unresolved bootstrap and address space sharing issues at present, but Steve is waiting on this for other work. There is still some strictly temporary code present that isn't exactly pretty. This is part of a larger change that has run into some bumps, this part is standalone so it should be safe. The temporary code goes away when the full idle cpu support is finished. Reviewed by: fsmp, dyson
* Man the liferafts! Here comes the long awaited SMP -> -current merge!peter1997-04-261-2/+17
| | | | | | | | | | | | | | | | 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!
* Wrapped mi_switch() with splstatclock()/splx(). This fixes excessivebde1997-02-271-3/+23
| | | | | interrupt latency for certain cases involving for restarting stopped processes.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-101-3/+4
| | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Make processes waken up eligible for immediate swap-in.dyson1996-10-171-2/+6
|
* Remove the code that renices +4 a process that has had 10 minutes ofgpalmer1996-09-221-7/+2
| | | | | | CPU time. I find it slightly annoying on one of our servers here. Also disliked by: David Greenman
* Change an splstatclock that should be an splhigh into an splhigh.dg1996-09-011-2/+2
| | | | Reviewed by: bde
* Fixed a stale comment.bde1996-08-281-2/+2
|
* Changed wakeup_one() to continue looping, possibly waking up additionaldg1996-07-311-8/+5
| | | | | | processes, until it finds one that is not swapped out. Submitted by: dyson
* Converted timer/run queues to 4.4BSD queue style. Removed old and unuseddg1996-07-311-104/+72
| | | | | | | sleep(). Implemented wakeup_one() which may be used in the future to combat the "thundering herd" problem for some special cases. Reviewed by: dyson
* Don't generate code for the unused function sleep().bde1996-04-071-1/+3
|
OpenPOWER on IntegriCloud