summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* reenable page zeroing thread on SMP mips kernels.miod2015-05-011-2/+2
|
* disable the pool gc. there are reports of strange lockups on various mpdlg2015-04-121-1/+3
| | | | archs and this is the only interesting diff in the window.
* introduce a garbage collector for (very) idle pool pages.dlg2015-04-071-1/+7
| | | | | | | | | | | now that idle pool pages are timestamped we can tell how long theyve been idle. this adds a task that runs every second that iterates over all the pools looking for pages that have been idle for 8 seconds so it can free them. this idea probably came from a conversation with tedu@ months ago. ok tedu@ kettenis@
* Factor out the common bits of process_new() and main()'s code forguenther2015-02-101-14/+7
| | | | | | | setting up process0, 'cause I'm sick of forgetting to update main() when touching process_new() ok blambert@ miod@
* Stop using USRSTACK as the edge of the stack, but rather use the vmspacemiod2015-02-091-2/+3
| | | | | | | | vm_minsaddr or vm_maxsaddr, depending upon the direction the stack goes in. This should have no effect on the existing behaviourrr. ok kettenis@ deraadt@
* unneccessary cmask variable; ok guentherderaadt2015-01-191-2/+1
|
* Many architectures call initmsgbuf() really really early, before uvm iskettenis2015-01-131-1/+4
| | | | | | | | | initialized. Calling malloc(9) at that point is not a good idea. So initialize consbuf later. Fixes dmesg -s on sparc64 (and probably a few other architectures). ok miod@, deraadt@
* copyright_year=$(date +%Y)jsing2014-12-311-2/+2
|
* The greatest happiness is to scatter inferiour APIs, to drive themkrw2014-12-281-5/+2
| | | | | | | | | | before you, to see their files reduced to ashes, to see those who love them shrouded in tears, and to gather into your API all their invocations. In other words, workq is no more. There is only taskq. ok kettenis@ dlg@ (creator of taskq) jmc@
* Prefer MADV_* over POSIX_MADV_* in kernel for consistency: the latterguenther2014-12-171-2/+2
| | | | | | doesn't have all the values and therefore can't be used everywhere. ok deraadt@ kettenis@
* primary change: move uvm_vnode out of vnode, keeping only a pointer.tedu2014-12-161-1/+3
| | | | | | objective: vnode.h doesn't include uvm_extern.h anymore. followup changes: include uvm_extern.h or lock.h where necessary. ok and help from deraadt
* Use MAP_INHERIT_* for the 'inh' argument to the UMV_MAPFLAG() macro,guenther2014-12-151-2/+2
| | | | | | eliminating the must-be-kept-in-sync UVM_INH_* macros ok deraadt@ tedu@
* convert bcopy to memcpy. ok millerttedu2014-12-101-2/+2
|
* Disable the page zeroing thread on MULTIPROCESSOR mips64 kernels as well.miod2014-11-181-2/+3
| | | | | | | | Regression spotted by tobiasu@. XXX I wonder if the page zeroing thread shouldn't perform explicit XXX pmap_update(pmap_kernel()) calls after each page zeroing... but that XXX might not be enough.
* Replace a plethora of historical protection options with justderaadt2014-11-161-3/+3
| | | | | | | PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis
* Do not launch the page zeroing thread on MULTIPROCESSOR m88k systems. Thismiod2014-10-251-2/+2
| | | | causes a deadlock between reaper and zerothread I am currently investigating.
* redo the performance throttling in the kernel.tedu2014-10-171-1/+10
| | | | | | introduce a new sysctl, hw.perfpolicy, that governs the policy. when set to anything other than manual, hw.setperf then becomes read only. phessler was heading in this direction, but this is slightly different. :)
* disable pagezero thread on hppa, until failure gets diagnosed, ok miod kettenisderaadt2014-10-131-1/+3
|
* back out; does not even compilederaadt2014-10-111-10/+1
|
* resurrect a many year old diff. move CPU throttling into the kernel,tedu2014-10-111-1/+10
| | | | | | enabled by setting hw.setperf=-1. some other bugs preventing this from going in before have been fixed. my thanks to phessler for keeping the diff alive in the mean time. tested by several to not regress.
* Introduce a thread for zeroing pages without holding the kernel lock. Thiskettenis2014-10-031-1/+5
| | | | | | | | | | | | way we can do some useful kernel lock in parallel with other things and create a reservoir of zeroed pages ready for use elsewhere. This should reduce latency. The thread runs at the absolutel lowest priority such that we don't keep other kernel threads or userland from doing useful work. Can be easily disabled by disabling the kthread_create(9) call in main(). Which perhaps we should do for non-MP kernels. ok deraadt@, tedu@
* No need for raw_cb.hmpi2014-08-141-2/+1
|
* It's init as a process that's special, not init's original thread.guenther2014-07-111-10/+15
| | | | | | Remember initprocess instead of initproc. ok matthew@ blambert@
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-081-4/+1
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* Fix a few format string bugs with -DDEBUGsf2014-06-151-3/+3
|
* Move from struct proc to process the reference-count-holding pointersguenther2014-05-151-3/+3
| | | | | | | | | | to the process's vmspace and filedescs. struct proc continues to keep copies of the pointers, copying them on fork, clearing them on exit, and (for vmspace) refreshing on exec. Also, make uvm_swapout_threads() thread aware, eliminating p_swtime in kernel. particular testing by ajacoutot@ and sebastia@
* Add PS_SYSTEM, the process-level mirror of the thread-level P_SYSTEM,guenther2014-05-041-1/+2
| | | | | | | and FORK_SYSTEM as a flag to set them. This eliminates needing to peek into other processes threads in various places. Inspired by NetBSD ok miod@ matthew@
* Have each thread keeps its own (counted!) reference to the process's ucredsguenther2014-04-181-1/+4
| | | | | | | | | to avoid possible use-after-free references when swapping ids in threaded processes. "Do I have the right creds?" checks are always made with the threads creds. Inspired by FreeBSD and NetBSD "right time" deraadt@
* Grab the kernel lock before autoconf. This way device drivers can drop it inkettenis2014-03-311-4/+4
| | | | | | | any context if they feel like it. ok deraadt@, guenther@ (who both suggested we could probably grab it even earlier)
* Eliminates struct pcred by moving the real and saved ugids intoguenther2014-03-301-5/+3
| | | | | | | | | struct ucred; struct process then directly links to the ucred Based on a discussion at c2k10 or so before noting that FreeBSD and NetBSD did this too. ok matthew@
* It's been a quarter century: we can assume volatile is present with that name.guenther2014-03-291-2/+2
| | | | ok dlg@ mpi@ deraadt@
* Reduce uvm include madness. Use <uvm/uvm_extern.h> instead ofmpi2014-03-281-2/+2
| | | | | | <uvm/uvm.h> if possible and remove double inclusions. ok beck@, mlarkin@, deraadt@
* Move p_emul and p_sigcode from proc to process.guenther2014-03-261-2/+2
| | | | | | | | | Tweak the handling of ktrace EMUL when changing ktracing: only generate one per process (not one per thread) and pass the correct proc pointer down to the VFS layer. Permit generating of NAMI and CSW records inside ktrace(2) itself. ok deraadt@ millert@
* Move p_sigacts from struct proc to struct process.guenther2014-03-221-4/+4
| | | | testing help mpi@
* Eliminate the exit sig handling, which was only invokable via theguenther2014-02-121-2/+2
| | | | | | | | Linux-compat clone() syscall when *not* using CLONE_THREAD. pirofti@ confirms Opera runs in compat without this, so out it goes; one less hair to choke on in kern_exit.c ok tedu@ pirofti@
* Threads can't be zombies, only processes, so change zombproc to zombprocess,guenther2014-01-201-5/+8
| | | | | | | | make it a list of processes, and change P_NOZOMBIE and P_STOPPED from thread flags to process flags. Add allprocess list for the code that just wants to see processes. ok tedu@
* Refactor rnd startup so arc4random/arc4random_buf can create a chacha statederaadt2014-01-191-3/+1
| | | | | | | on first call, very early on, from boot-supplied entropy, then feed from that. Later when we have more subsystems ready, the main() can properly initialize the entropy-driven model. Lots of discussion with mikeb. ok kettenis markus mikeb
* insane typoderaadt2014-01-191-2/+2
|
* oops, forgotten partderaadt2014-01-191-2/+2
| | | | | | Initialize ci_randseed better using arc4random() + a trick. Remove the libkern srandom() API since it is not suitable for this use. ok kettenis miod
* With the earlier initialization of the random subsystem, random_hostseed()deraadt2014-01-191-3/+1
| | | | | | is no longer providing significant value. The random subsystem is in pretty good state, and moments later userland will feed the dmesg. ok jsing
* We can call random_start() immediately after cpu_startup, that is thederaadt2014-01-191-3/+3
| | | | | point at which everything it does is safe, including msg buffer access. ok kettenis jsing
* copyright++fgsch2014-01-011-2/+2
|
* oops, the fallback stack protector code must handle 64-bit guardsderaadt2013-12-281-2/+2
| | | | spotted by kettenis
* change the stack protector guard into a long word (removing the old legacyderaadt2013-12-281-14/+6
| | | | | | compat pointed out by miod), and place it inside the ELF .openbsd.randomdata segment. Inside main(), only re-initialize the guard if the bootblocks failed to initialize it for us.
* We can initialize the srandom/random system earlier from arc4random,deraadt2013-12-281-7/+1
| | | | and do not need microtime.
* We can random_start() earlier (not that it does too much) and callderaadt2013-12-281-3/+6
| | | | | arc4random() much earlier. Leading to random pids for anything besides 0 and 1.
* Change 'mountlist' from CIRCLEQ to TAILQ. Be paranoid andkrw2013-12-011-3/+3
| | | | | | | | | use TAILQ_*_SAFE more than might be needed. Bulk ports build by sthen@ showed nobody sticking their fingers so deep into the kernel. Feedback and suggestions from millert@. ok jsing@
* introduce tasks and taskqs as an alternative to workqs.dlg2013-10-291-1/+4
| | | | | | | | | | | | | | | | | | tasks are modelled on the timeout api, so users familiar with timeout_set, timeout_add, and timeout_del will already know what to expect from task_set, task_add, and task_del. i wrote this because workq_add_task can fail in the place you actually need it, and there arent any good ways of recovering at that point. workq_queue_task was added to try and help, but required external state to be stored for users of that api to know whether something was already queued or not. workqs also didnt provide a way to cancel or remove work. this has been percolating with a bunch of people. putting it in as i wrote it so i can apply their feedback to the code with the history kept in cvs.
* move attach mpath before any hardware. the benefits being:dlg2013-08-261-4/+6
| | | | | | | | | | | | | | | | | | - the mpath hooks path drivers call dont have to parse autoconf structures to tell if mpath may attach in the future. it now either has already attached or never will, which is simpler to check. - i can get rid of the global mpath target array by moving it into the mpath softc because of the above. - makes reasoning about state transitions (especially around when to attach) when groups of paths are implemented a lot simpler the only real caveat is dmesg feng shui may be ruined. i can come back and look at this after i move mpath itself forward though. discussed with deraadt@ miod@ ok todd@ matthew@ krw@
* Convert some internal APIs to use timespecs instead of timevalsguenther2013-06-031-5/+5
| | | | ok matthew@ deraadt@