summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exit.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Use msleep() in the reaper to make it not lose events. Based on discussionderaadt2008-10-301-8/+4
| | | | | PR 5609, and revisited with dlg. Tested on all platforms. ok miod
* Back-in; problems were apparently elsewhere.guenther2008-10-141-2/+2
| | | | | | | | | Put a reference count in struct process to prevent use-after-free if the main thread reaches the reaper ahead of some other thread in the process. Use the reference count to update the user process count correctly when changin real uid. "please re-commit before something else nasty comes in" deraadt@
* backout; is causing some people difficultyderaadt2008-10-101-2/+2
|
* Put a reference count in struct process to prevent use-after-freeguenther2008-10-091-2/+2
| | | | | | | if the main thread reaches the reaper ahead of some other thread in the process. ok art@ tedu@
* set p_flag to 0 sooner, so we don't overwrite the thread flag. and correctlytedu2008-05-111-5/+3
| | | | free things when exiting a threaded proc. from philip guenther
* Make context switching much more MI:art2007-10-101-14/+4
| | | | | | | | | | | | | | | | | | | | - 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
* move p_limit and p_cred into struct processtedu2007-04-121-12/+8
| | | | | leave macros behind for now to keep the commit small ok art beck miod pedro
* remove proc from process thread list sooner in exit (notably, before waitingtedu2007-04-111-13/+5
| | | | | for the list to become empty) ok art
* undotedu2007-04-101-5/+13
|
* remove process from thread list sooner in exit (notably, before waitingtedu2007-04-101-13/+5
| | | | for the list to become empty)
* jason crawford noticed that the rthreads diff didn't compile with rthreads!tedu2007-04-051-2/+2
|
* oursleves -> ourselvespedro2007-04-041-2/+2
|
* Don't remove the process from the threads queue in proc_zap() as thatpedro2007-04-041-2/+3
| | | | currently already happens in exit1(), okay art@
* Start moving state that is shared among threads in a process intoart2007-04-031-18/+31
| | | | | | | | | | | a new struct. Instead of doing a huge rename and deal with the fallout for weeks, like other projects that need no mention, we will slowly and carefully move things out of struct proc into a new struct process. - Create struct process and the infrastructure to create and remove them. - Move threads in a process into struct process. deraadt@, tedu@ ok
* Since p_flag is often manipulated in interrupts and without biglockart2007-03-151-10/+10
| | | | | | | | | | | | 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
* consistantly count context switches on exit; miod@ okmickey2006-06-231-1/+2
|
* Nothing sets P_FSTRACE anymore, so remove all what's left of it.miod2006-06-151-8/+2
|
* release kernel lock _after_ the emulation exit hook is called to protect possible free()s; tedu@ deraadt@ okmickey2006-04-061-4/+4
|
* Compile out more rthreads stuff unless option RTHREADS;miod2006-02-201-2/+5
| | | | discussed with a few, ok tedu@
* make exiting actually work when a thread receives a signal.tedu2005-12-131-11/+5
| | | | | previously, the child and parent would deadlock in the kernel and be unable to exit. help with diagnosis from art@.
* kernel support for threaded processes (rthreads).tedu2005-12-031-4/+62
| | | | | | | | uses rfork(RFTHREAD) to create threads, which are presently processes that are a little more tightly bound together. several new syscalls added to facilitate a userland thread library. all conditional on RTHREADS, currently disabled. ok deraadt
* ansi/deregister.jsg2005-11-281-19/+9
| | | | 'go for it' deraadt@
* ptrace(2) following fork(2)kettenis2005-09-141-1/+3
| | | | ok miod@
* 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@