summaryrefslogtreecommitdiff
path: root/sys/kern/kern_fork.c
AgeCommit message (Collapse)Author
2001-06-27no more fork braindamageArtur Grabowski
2001-06-27mips_cachealias is no moreArtur Grabowski
2001-06-27remove old vmArtur Grabowski
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
2001-02-13More sane spl handling. Don't just assume that we're called at spl0.Artur Grabowski
2000-11-16support kernel event queues, from FreeBSD by Jonathan Lemon,Niels Provos
okay art@, millert@
2000-11-09PHOLD/PRELE instead manual fiddling with p_holdcntArtur Grabowski
2000-07-10last change was not tested on VM systemsTheo de Raadt
2000-07-07The rfork sharing of vmspace is .. special and was broken with UVM.Artur Grabowski
Add a new flag to fork1 - FORK_VMNOSTACK that shares all of the vmspace except the stack and use it for rfork.
2000-06-18Mark kernel threads as system processes. Make ps hide them by default,Niklas Hallqvist
show them with -k. Do not try to show RSS based values for them as they mess up column alignment. vmstat -f now shows kernel threads separately from rforks too.
2000-03-23Don't reinitialize the tsleep and ITIMER_REAL timers all the time.Artur Grabowski
The function and the argument never change.
2000-03-03Use the LIST_FIRST macro to get the head of zombproc list.Artur Grabowski
2000-03-03Use LIST_ macros instead of internal field names to walk the allproc list.Artur Grabowski
2000-02-21dead code and symbol pollution.Artur Grabowski
2000-01-31re-add fixed vfork code from artTheo de Raadt
2000-01-31undo vfork changes, since non-UVM was not consideredTheo de Raadt
2000-01-28Change fork1() from taking forktype and rforkflags, into a single flagsArtur Grabowski
argument. Let sys_rfork build the arguments to fork1() and do the sanity checks itself.
1999-08-17New cpu_fork API to take a stack in which you point the child's stackpointerNiklas Hallqvist
to, at the bottom or the top, depending on your architecture's stack growth direction. This is in preparation for Linux' clone(2) emulation. port maintainers, please check that I did the work right.
1999-08-15Adopt NetBSD fix for scheduler problems (nice was broken). From the NetBSDPaul Janzen
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.
1999-07-17correct fork statistics for UVMArtur Grabowski
1999-07-15vm_offset_t -> {v,p}addr_t ; vm_size_t -> {v,p}size_tArtur Grabowski
1999-03-12in scheduler, bias parents for child cpu usage; ross@ghs.comTheo de Raadt
1999-03-02RFNOWAIT does not dissociate the child from its parent in any otherNiklas Hallqvist
way than that the parent wait call will never get the status of this child, says Rob
1999-02-26kmem allocation changes for uvm, and vm_fork -> uvm_fork (with one extra ↵Artur Grabowski
argument)
1999-02-23update the comment about number of allowed processesArtur Grabowski
1999-02-23Allow up to 5 (was 1) root processes when the process limit is reached.Artur Grabowski
This gives root a bigger chance to fix any problem that caused the limit to be reached.
1999-02-23Ooops! Move the allocation of the U area to after the limits checks.Artur Grabowski
That was a memory leak.
1999-02-19Allocate the u-area early in fork1 instead of in vm_fork.Artur Grabowski
Now we can return ENOMEM instead of doing a panic when we run out of memory.
1999-01-11just check rforkflags if ISRFORKNiklas Hallqvist
1999-01-10Make RFNOWAIT work in rfork(2)Niklas Hallqvist
1997-08-01only allow setuid if fd_refcnt == 1, due to rforkTheo de Raadt
1997-08-01disable RFFDG; long explanation...Theo de Raadt
1997-07-07count pages in forkstat, see "vmstat -f"kstailey
1997-06-05random pid generation, hehTheo de Raadt
1997-02-18cp P_SUGID/P_SUGIDEXEC to child, doh; half from freebsdTheo de Raadt
1996-09-02Rename nextpid to lastpid; make it a global with type pid_tThorsten Lockert
1996-03-03From NetBSD: 960217 mergeNiklas Hallqvist
1996-02-19Count number of forks, vforks, rforks; still need to count VM pages affectedThorsten Lockert
by the various fork types
1996-01-10plan9-like rfork() implimentation by me based on some earlier incompleteTheo de Raadt
work by rminnich@Sarnoff.COM. still needs RFNOWAIT support.
1995-12-14from netbsd:Theo de Raadt
Only expect vm_fork() to return if __FORK_BRAINDAMAGE is defined. Use splstatclock() rather than splhigh() in one place. Eliminate unused third arg to vm_fork().
1995-10-18initial import of NetBSD treeTheo de Raadt