summaryrefslogtreecommitdiff
path: root/sys/kern/kern_exit.c
AgeCommit message (Collapse)Author
2007-10-10Make context switching much more MI:Artur Grabowski
- 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
2007-04-12move p_limit and p_cred into struct processTed Unangst
leave macros behind for now to keep the commit small ok art beck miod pedro
2007-04-11remove proc from process thread list sooner in exit (notably, before waitingTed Unangst
for the list to become empty) ok art
2007-04-10undoTed Unangst
2007-04-10remove process from thread list sooner in exit (notably, before waitingTed Unangst
for the list to become empty)
2007-04-05jason crawford noticed that the rthreads diff didn't compile with rthreads!Ted Unangst
2007-04-04oursleves -> ourselvesPedro Martelletto
2007-04-04Don't remove the process from the threads queue in proc_zap() as thatPedro Martelletto
currently already happens in exit1(), okay art@
2007-04-03Start moving state that is shared among threads in a process intoArtur Grabowski
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
2007-03-15Since p_flag is often manipulated in interrupts and without biglockArtur Grabowski
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
2006-06-23consistantly count context switches on exit; miod@ okMichael Shalayeff
2006-06-15Nothing sets P_FSTRACE anymore, so remove all what's left of it.Miod Vallat
2006-04-06release kernel lock _after_ the emulation exit hook is called to protect ↵Michael Shalayeff
possible free()s; tedu@ deraadt@ ok
2006-02-20Compile out more rthreads stuff unless option RTHREADS;Miod Vallat
discussed with a few, ok tedu@
2005-12-13make exiting actually work when a thread receives a signal.Ted Unangst
previously, the child and parent would deadlock in the kernel and be unable to exit. help with diagnosis from art@.
2005-12-03kernel support for threaded processes (rthreads).Ted Unangst
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
2005-11-28ansi/deregister.Jonathan Gray
'go for it' deraadt@
2005-09-14ptrace(2) following fork(2)Mark Kettenis
ok miod@
2004-12-26Use list and queue macros where applicable to make the code easier to read;Miod Vallat
no change in compiler assembly output.
2004-08-04hardclock detects if ITIMER_VIRTUAL and ITIMER_PROF have expired andArtur Grabowski
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.
2004-07-22SIMPLELOCK -> mutex for the lock around deadproc list.Artur Grabowski
Also move the whole deadproc infrastructure to kern_exit, it's only used there. miod@ ok
2004-06-13debranch SMP, have funNiklas Hallqvist
2004-05-27make acct(2) optional with ACCOUNTINGTed Unangst
ok art@ deraadt@
2004-03-20one proc.h is sufficientTed Unangst
2003-12-31wait4(2) takes and returns pid_t, not int. OK deraadt@ and miod@Todd C. Miller
2003-08-03Implement the WCONTINUED flag to the wait(2) family of syscalls and theTodd C. Miller
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.
2003-07-21remove caddr_t casts. it's just silly to cast something when the functionTed Unangst
takes a void *. convert uiomove to take a void * as well. ok deraadt@
2003-06-21add exec/fork/exit hooks per process for compat emulations.Ted Unangst
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@
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2002-10-29No need to free the address space in exit1(), we'll do that in the reaper.Artur Grabowski
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.
2002-05-16systrace facility, used to enforce and generate policies for system callsNiels Provos
okay deraadt@
2002-03-14First round of __P removal in sysTodd C. Miller
2002-01-25poolify pcreds.Artur Grabowski
2002-01-23Allocate rusage, pgrp, ucred and session with pool.Artur Grabowski
2002-01-16Don't include <sys/map.h> when you don't need what's in it.Miod Vallat
2001-11-12Bring in more changes from NetBSD. Mostly pagedaemon improvements.Artur Grabowski
2001-11-06Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.Miod Vallat
(Look ma, I might have broken the tree)
2001-09-11Don't include <vm/vm_kern.h> if you don't need foo_map.Miod Vallat
2001-08-25cleanupArtur Grabowski
2001-06-27remove old vmArtur Grabowski
2001-06-03WALTSIG is a valid option for sys_wait4().Angelos D. Keromytis
2001-05-16kill COMPAT_{09,10,11} kernel options. We still need kern_info_09.c and ↵Todd C. Miller
kern_ipc_10.c for other compat modules.
2001-04-02On popular demand, the Linux-compatibility clone(2) implementation basedNiklas Hallqvist
on NetBSD's code, as well as some faked Posix RT extensions by me. This makes at least simple linuxthreads tests work.
2001-03-23Use pool to allocate processes.Artur Grabowski
2000-11-16support kernel event queues, from FreeBSD by Jonathan Lemon,Niels Provos
okay art@, millert@
2000-06-06If the process is P_NOZOMBIE free it's resources in the reaper.Artur Grabowski
Noone will wait for it (because noone is allowed to wait for it).
2000-06-05No need to use curproc here. We already know who we are.Artur Grabowski
2000-06-05Changes to exit handling.Artur Grabowski
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
2000-05-05Don't set filesize limit to infinity on exit.Artur Grabowski
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.
2000-04-20Add a function "ktrsettracevnode", that changes the ktrace vnode for a processArtur Grabowski
in a correct way. Use it in all places where the vnode was changed. (most of the earlier code was incorrect and had races).