summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exit.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use list and queue macros where applicable to make the code easier to read;miod2004-12-261-5/+5
| | | | no change in compiler assembly output.
* hardclock detects if ITIMER_VIRTUAL and ITIMER_PROF have expired andart2004-08-041-1/+3
| | | | | | | | | | | | | | | | | | | 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.
* SIMPLELOCK -> mutex for the lock around deadproc list.art2004-07-221-12/+21
| | | | | | | Also move the whole deadproc infrastructure to kern_exit, it's only used there. miod@ ok
* debranch SMP, have funniklas2004-06-131-6/+18
|
* make acct(2) optional with ACCOUNTINGtedu2004-05-271-1/+3
| | | | ok art@ deraadt@
* one proc.h is sufficienttedu2004-03-201-2/+1
|
* wait4(2) takes and returns pid_t, not int. OK deraadt@ and miod@millert2003-12-311-3/+3
|
* Implement the WCONTINUED flag to the wait(2) family of syscalls and themillert2003-08-031-2/+14
| | | | | | | | | associated WIFCONTINUED macro as per 1003.1-2001. Adapted from FreeBSD. A minor amount of trickiness is involved here. The value for WCONTINUED is chosen in such a way that _WSTATUS(_WCONTINUED) == _WSTOPPED and the WIFSTOPPED macro has been modified such that WIFSTOPPED(_WCONTINUED) != _WSTOPPED. This means we don't need to add an extra check to the WIFSIGNALED and WIFSTOPPED macros. deraadt@ OK.
* remove caddr_t casts. it's just silly to cast something when the functiontedu2003-07-211-17/+14
| | | | takes a void *. convert uiomove to take a void * as well. ok deraadt@
* add exec/fork/exit hooks per process for compat emulations.tedu2003-06-211-1/+7
| | | | | | | | | | use them to correctly emulate linux brk. update to TNF copyright in linux_exec.c. from netbsd, mostly from a diff by Kurt Miller in pr3318. this should fix java. no regressions in testing by kurt and sturm@. be prepared for "proc size mismatch" -- recompile ps and friends. ok deraadt@
* 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 to free the address space in exit1(), we'll do that in the reaper.art2002-10-291-22/+3
| | | | | | | | That gives us the advantage of not being the active address space when freeing the mappings in the pmap, which can lead to expensive TLB flushes on some architectures. plus some minor cleaning.
* systrace facility, used to enforce and generate policies for system callsprovos2002-05-161-1/+8
| | | | okay deraadt@
* First round of __P removal in sysmillert2002-03-141-2/+2
|
* poolify pcreds.art2002-01-251-2/+2
|
* Allocate rusage, pgrp, ucred and session with pool.art2002-01-231-4/+3
|
* Don't include <sys/map.h> when you don't need what's in it.miod2002-01-161-2/+1
|
* Bring in more changes from NetBSD. Mostly pagedaemon improvements.art2001-11-121-5/+1
|
* Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.miod2001-11-061-3/+1
| | | | (Look ma, I might have broken the tree)
* Don't include <vm/vm_kern.h> if you don't need foo_map.miod2001-09-111-2/+1
|
* cleanupart2001-08-251-4/+4
|
* remove old vmart2001-06-271-14/+1
|
* WALTSIG is a valid option for sys_wait4().angelos2001-06-031-2/+2
|
* kill COMPAT_{09,10,11} kernel options. We still need kern_info_09.c and kern_ipc_10.c for other compat modules.millert2001-05-161-5/+1
|
* On popular demand, the Linux-compatibility clone(2) implementation basedniklas2001-04-021-2/+25
| | | | | on NetBSD's code, as well as some faked Posix RT extensions by me. This makes at least simple linuxthreads tests work.
* Use pool to allocate processes.art2001-03-231-2/+3
|
* support kernel event queues, from FreeBSD by Jonathan Lemon,provos2000-11-161-1/+6
| | | | okay art@, millert@
* If the process is P_NOZOMBIE free it's resources in the reaper.art2000-06-061-35/+54
| | | | Noone will wait for it (because noone is allowed to wait for it).
* No need to use curproc here. We already know who we are.art2000-06-051-2/+2
|
* Changes to exit handling.art2000-06-051-26/+101
| | | | | | | | cpu_exit no longer frees the vmspace and u-area. This is now handled by a separate kernel thread "reaper". This is to avoid sleeping locks in the critical path of cpu_exit where we're not allowed to sleep. From NetBSD
* Don't set filesize limit to infinity on exit.art2000-05-051-4/+3
| | | | | | | This is only needed in accounting and has to be done carefully because the limit structures are shared between processes. Found by Denis A. Doroshenko, analysed by Hannah Schroeter.
* Add a function "ktrsettracevnode", that changes the ktrace vnode for a processart2000-04-201-2/+3
| | | | | in a correct way. Use it in all places where the vnode was changed. (most of the earlier code was incorrect and had races).
* Use the new timeout facilities for ITIMER_REAL.art2000-03-231-2/+2
|
* dead code and symbol pollution.art2000-02-211-4/+2
|
* Adopt NetBSD fix for scheduler problems (nice was broken). From the NetBSDpjanzen1999-08-151-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit messages: Scheduler bug fixes and reorganization * fix the ancient nice(1) bug, where nice +20 processes incorrectly steal 10 - 20% of the CPU, (or even more depending on load average) * provide a new schedclock() mechanism at a new clock at schedhz, so high platform hz values don't cause nice +0 processes to look like they are niced * change the algorithm slightly, and reorganize the code a lot * fix percent-CPU calculation bugs, and eliminate some no-op code === nice bug === Correctly divide the scheduler queues between niced and compute-bound processes. The current nice weight of two (sort of, see `algorithm change' below) neatly divides the USRPRI queues in half; this should have been used to clip p_estcpu, instead of UCHAR_MAX. Besides being the wrong amount, clipping an unsigned char to UCHAR_MAX is a no-op, and it was done after decay_cpu() which can only _reduce_ the value. It has to be kept <= NICE_WEIGHT * PRIO_MAX - PPQ or processes can scheduler-penalize themselves onto the same queue as nice +20 processes. (Or even a higher one.) === New schedclock() mechanism === Some platforms should be cutting down stathz before hitting the scheduler, since the scheduler algorithm only works right in the vicinity of 64 Hz. Rather than prescale hz, then scale back and forth by 4 every time p_estcpu is touched (each occurance an abstraction violation), use p_estcpu without scaling and require schedhz to be generated directly at the right frequency. Use a default stathz (well, actually, profhz) / 4, so nothing changes unless a platform defines schedhz and a new clock. [ To do: Define these for alpha, where hz==1024, and nice was totally broke.] === Algorithm change === The nice value used to be added to the exponentially-decayed scheduler history value p_estcpu, in _addition_ to be incorporated directly (with greater weight) into the priority calculation. At first glance, it appears to be a pointless increase of 1/8 the nice effect (pri = p_estcpu/4 + nice*2), but it's actually at least 3x that because it will ramp up linearly but be decayed only exponentially, thus converging to an additional .75 nice for a loadaverage of one. I killed this: it makes the behavior hard to control, almost impossible to analyze, and the effect (~~nothing at for the first second, then somewhat increased niceness after three seconds or more, depending on load average) pointless. === Other bugs === hz -> profhz in the p_pctcpu = f(p_cpticks) calcuation. Collect scheduler functionality. Try to put each abstraction in just one place.
* Don't destroy sysvshm if the vmspace is shared (only affects uvm)art1999-07-151-2/+2
|
* Improved sysv shared memory. Works with UVM.art1999-06-231-2/+2
| | | | | Original work done in FreeBSD, but this code was ported from NetBSD by Chuck Cranor.
* in scheduler, bias parents for child cpu usage; ross@ghs.comderaadt1999-03-121-1/+5
|
* RFNOWAIT does not dissociate the child from its parent in any otherniklas1999-03-021-3/+4
| | | | | way than that the parent wait call will never get the status of this child, says Rob
* vm allocation changes for uvmart1999-02-261-1/+11
|
* comment typoniklas1999-01-111-2/+2
|
* Make RFNOWAIT work in rfork(2)niklas1999-01-101-5/+5
|
* Updates for VFS Lite 2 + soft update.csapuntz1997-11-061-2/+2
|
* back out vfs lite2 till after 2.2deraadt1997-10-061-2/+2
|
* VFS Lite2 Changescsapuntz1997-10-061-2/+2
|
* From FreeBSD (joerg@freebsd.org):millert1997-09-151-2/+16
| | | | | | | Implement SA_NOCLDWAIT by reparenting kids of processes that have the appropriate bit set to PID 1, and let PID 1 handle the zombie. This assumes that PID 1 will wait for its kids (which is true of init). This also includes some FreeBSD sigaction.2.
* Verify that options to wait4() are legaltholo1996-10-261-3/+2
|
* Clear p_pctcpu when a process exittholo1996-08-151-1/+6
|
* sync syscalls, no sys/cpu.hderaadt1996-05-021-3/+2
|
* From NetBSD: 960217 mergeniklas1996-03-031-13/+26
|