summaryrefslogtreecommitdiff
path: root/sys/kern/kern_proc.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-09-07Use M_ZERO in a few more places to shave bytes from the kernel.Artur Grabowski
eyeballed and ok dlg@
2007-08-04Allow ddb>ps to print the full name of the wait state. Things likeChris Kuethe
"flt_noram1" would get truncated otherwise. ok deraadt
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
2005-12-22fix memory leak conditions in thrsleep and significantly simplifyTed Unangst
2005-12-04older gcc (like real C) does not let you declare local variables afterTheo de Raadt
doing functional code; ie. LIST_INIT()
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-07-04oops, kernel free needs two args. thanks pedroTed Unangst
2005-07-03malloc(M_WAITOK) implies sleeping, so we have to double check thatTed Unangst
somebody else didn't beat us in uid_find().
2005-03-10split out uidinfo from kern_proc.c private, use it to store lock count,Ted Unangst
restrict lock count per uid to a global limit, add sysctl to adjust limit. this prevents a user from creating too many locks. problem noticed by devon o'dell. ok deraadt miod pedro
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-11-18handle SONPROC; ok aaron, deraadt, krwMarkus Friedl
2004-10-04cacheing -> cachingPedro Martelletto
2004-07-25move db_show_all_procs to kern_proc.c, proc_printit goes in DDB too.Ted Unangst
shuffle functions around so that scheduler is all together. no real functional changes. ok art@ testing miod@
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-01-29The Sxxx proc state defines start at 1, not 0. Also make the constTodd C. Miller
usage more correct and fix a signed/unsigned format mismatch. Based on a patch from Patrick Latifi. 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.
2003-05-12Quoting Theo: Do not approve diffs when you're hungover.Artur Grabowski
Accessing p_md members from MI code is not legal.
2003-05-12use snprintf. ok mickeyTed Unangst
2003-05-12sho proc [addr] to print some proc's field; art@ okMichael Shalayeff
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-23Pool deals fairly well with physical memory shortage, but it doesn't dealArtur Grabowski
well (not at all) with shortages of the vm_map where the pages are mapped (usually kmem_map). Try to deal with it: - group all information the backend allocator for a pool in a separate struct. The pool will only have a pointer to that struct. - change the pool_init API to reflect that. - link all pools allocating from the same allocator on a linked list. - Since an allocator is responsible to wait for physical memory it will only fail (waitok) when it runs out of its backing vm_map, carefully drain pools using the same allocator so that va space is freed. (see comments in code for caveats and details). - change pool_reclaim to return if it actually succeeded to free some memory, use that information to make draining easier and more efficient. - get rid of PR_URGENT, noone uses it.
2002-01-16Don't include <sys/map.h> when you don't need what's in it.Miod Vallat
2001-03-23Use pool to allocate processes.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
1999-04-28zap the newhashinit hack.Artur Grabowski
Add an extra flag to hashinit telling if it should wait in malloc. update all calls to hashinit.
1998-03-02Please gcc 2.8Todd T. Fries
1998-02-20Please GCC 2.8 -WallNiklas Hallqvist
1997-11-24fix memory leak; hbriceno@lcs.mit.eduTheo de Raadt
1996-03-03From NetBSD: 960217 mergeNiklas Hallqvist
1995-10-18initial import of NetBSD treeTheo de Raadt