summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Kernel stack can be swapped. This means that stuff that's on the stackmiod2006-11-291-16/+3
| | | | | | | | | | should never be referenced outside the context of the process to which this stack belongs unless we do the PHOLD/PRELE dance. Loads of code doesn't follow the rules here. Instead of trying to track down all offenders and fix this hairy situation, it makes much more sense to not swap kernel stacks. From art@, tested by many some time ago.
* Backout last commit, it makes us crash when a ptraced program forks.kettenis2006-04-301-8/+7
|
* do not rush putting embrionic process on child/thread/sibling lists and set timeouts earlier as we can sleep later and get signals and exit and cause all kinds of hell; pedro@ okmickey2006-03-271-7/+8
|
* Compile out more rthreads stuff unless option RTHREADS;miod2006-02-201-1/+5
| | | | discussed with a few, ok tedu@
* fix memory leak conditions in thrsleep and significantly simplifytedu2005-12-221-2/+1
|
* forgot to set P_THREAD for threaded processestedu2005-12-041-1/+2
|
* kernel support for threaded processes (rthreads).tedu2005-12-031-1/+15
| | | | | | | | 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
* Avoid a theoretical race condition.aaron2005-11-021-4/+4
| | | | | | | | | | | In fork1(), setup the p_{prof,virt}_to timeouts _before_ putting the process on the runqueue. Since SCHED_UNLOCK() can cause pre-emption, it is possible (with the old code) for the newly created process to run and become curproc before the timeouts were set. If itimers are set early, and you're unlucky, hardclock() might fire at this time and attempt timeout_add() on the unset timeouts, leading to "panic: timeout_add: not initialized". deraadt@, miod@ ok
* ptrace(2) following fork(2)kettenis2005-09-141-3/+46
| | | | ok miod@
* sched work by niklas and art backed out; causes panicsderaadt2005-05-291-2/+2
|
* This patch is mortly art's work and was done *a year* ago. Art wants to thankniklas2005-05-251-2/+2
| | | | | | | | | | | | | | | | everyone for the prompt review and ok of this work ;-) Yeah, that includes me too, or maybe especially me. I am sorry. Change the sched_lock to a mutex. This fixes, among other things, the infamous "telnet localhost &" problem. The real bug in that case was that the sched_lock which is by design a non-recursive lock, was recursively acquired, and not enough releases made us hold the lock in the idle loop, blocking scheduling on the other processors. Some of the other processors would hold the biglock though, which made it impossible for cpu 0 to enter the kernel... A nice deadlock. Let me just say debugging this for days just to realize that it was all fixed in an old diff noone ever ok'd was somewhat of an anti-climax. This diff also changes splsched to be correct for all our architectures.
* fix pr4036, don't set p2->p_cpu to nulltedu2005-02-241-2/+2
| | | | ok deraadt miod markus
* Create the init process earlier, before the root filesystem is mounted,miod2004-11-231-7/+18
| | | | | | | | | | | and have it stall on a semaphore. This allows all kthread creations which could have been requested during autoconf to be processed before root is mounted as well. This causes umass devices attached to any usb with flags 1 (such as on macppc) to configure properly instead of panicing the kernel at mountroot time. From NetBSD; tested by various.
* provide md USPACE_ALIGN zero on all but mips; deradat@ pefo@ okmickey2004-08-061-2/+2
|
* hardclock detects if ITIMER_VIRTUAL and ITIMER_PROF have expired andart2004-08-041-1/+4
| | | | | | | | | | | | | | | | | | | 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.
* This moves access to wall and uptime variables in MI code,tholo2004-06-241-2/+2
| | | | | | | | | | | | | | encapsulating all such access into wall-defined functions that makes sure locking is done as needed. It also cleans up some uses of wall time vs. uptime some places, but there is sure to be more of these needed as well, particularily in MD code. Also, many current calls to microtime() should probably be changed to getmicrotime(), or to the {,get}microuptime() versions. ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others "Oh, that is not your problem!" from miod@
* debranch SMP, have funniklas2004-06-131-4/+21
|
* Merge in a piece of the SMP branch into HEAD.art2004-06-091-1/+5
| | | | | | | | | | | Introduce the cpu_info structure, p_cpu field in struct proc and global scheduling context and various changed code to deal with this. At the moment no architecture uses this stuff yet, but it will allow us slow and controlled migration to the new APIs. All new code is ifdef:ed out. ok deraadt@ niklas@
* retval may be NULL in fork1, take 2tedu2004-06-051-3/+5
|
* No way: This breaks nearly every architecturederaadt2004-05-241-7/+7
|
* according to fork1(9), retval is optional. make it so.tedu2004-05-231-7/+7
| | | | from form@pdp-11.org.ru via mpech. ok millert
* rfork(RFMEM) shares complete vmspace. much more useful, and in line withtedu2004-04-021-19/+3
| | | | other projects' implementations.
* Limit "proc: table is full" messages to once every 10 seconds which helps when there is a fork bomb going on. From NetBSD (jdolecek)millert2003-09-231-2/+8
|
* comitted->committed in a commentavsm2003-07-021-2/+2
|
* add exec/fork/exit hooks per process for compat emulations.tedu2003-06-211-1/+6
| | | | | | | | | | 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.
* Defer pid allocation and making the new process visible until after it'sart2002-10-311-17/+17
| | | | | | | | been fully initialized. Otherwise the scheduler and other things can accidentally stumble into semi-initialized processes and strange things can happen. This also requires us to do systrace attachment a bit later. Debugging help from fgs@
* Remove a part that did sneak in that wasn't meant to be commited yet.art2002-10-221-2/+2
|
* ANSIart2002-10-211-22/+6
|
* Two problems.art2002-10-211-5/+13
| | | | | | | | | | | | | First we check for running out of processes (nprocs variable) before we continue with the fork, then we do various calls that might sleep (and allow other forks to start and pass that check), then we increase that variable. This could allow processes to be created past the limit. Second is that we don't decrease the the process count for this uid if the stack allocation fails. So a user could run out of processes he's allowed to run without actually having them. miod@ ok
* 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-3/+3
|
* Fix stack sharing in FORK_VMNOSTACK.art2002-02-221-4/+14
| | | | | Don't assume that the stack is on the top of user address space. And don't assume that the stack grows down.
* Simplify pid selection algorithm. ok art@ deraadt@nordin2002-02-161-45/+23
|
* No more RFORK_FDSAHRE option, always allow FORK_SHAREFILES.art2002-02-141-8/+1
|
* Workaround for VM_MAXUSER_ADDRESS not being page aligned on sparc64.art2002-02-051-2/+2
|
* poolify pcreds.art2002-01-251-3/+2
|
* Don't include <sys/map.h> when you don't need what's in it.miod2002-01-161-2/+1
|
* Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.miod2001-11-061-2/+1
| | | | (Look ma, I might have broken the tree)
* Let fork1, uvm_fork, and cpu_fork take a function/argument pair as argument,art2001-11-061-7/+10
| | | | | | | | | | | instead of doing fork1, cpu_set_kpc. This lets us retire cpu_set_kpc and avoid a multiprocessor race. This commit breaks vax because it doesn't look like any other arch, someone working on vax might want to look at this and try to adapt the code to be more like the rest of the world. Idea and uvm parts from NetBSD.
* More sync to NetBSD.art2001-11-061-2/+3
| | | | | | - Use malloc/free instead of MALLOC/FREE for variable sized allocations. - Move the memory inheritance code to sys/mman.h and rename from VM_* to MAP_* - various cleanups and simplifications.
* Disable fd sharing for this release. Sorry.art2001-10-141-1/+8
| | | | deraadt@ ok.
* merge vm/vm_kern.h into uvm/uvm_extern.h; art@ okmickey2001-09-191-3/+1
|
* no more fork braindamageart2001-06-271-17/+2
|
* mips_cachealias is no moreart2001-06-271-5/+1
|
* remove old vmart2001-06-271-27/+1
|
* On popular demand, the Linux-compatibility clone(2) implementation basedniklas2001-04-021-6/+18
| | | | | 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
|
* More sane spl handling. Don't just assume that we're called at spl0.art2001-02-131-3/+4
|
* support kernel event queues, from FreeBSD by Jonathan Lemon,provos2000-11-161-1/+6
| | | | okay art@, millert@