summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_extern.h
AgeCommit message (Collapse)Author
2017-04-30Unifdef KGDB.Martin Pieuchot
It doesn't compile und hasn't been working during the last decade. ok kettenis@, deraadt@
2017-03-05Generating a coredump requires walking the map twice; changePhilip Guenther
uvm_coredump_walkmap() to do both with a callback in between so it can hold locks/change state across the two. ok stefan@
2017-02-12Split up fork1():Philip Guenther
- FORK_THREAD handling is a totally separate function, thread_fork(), that is only used by sys___tfork() and which loses the flags, func, arg, and newprocp parameters and gains tcb parameter to guarantee the new thread's TCB is set before the creating thread returns - fork1() loses its stack and tidptr parameters Common bits factor out: - struct proc allocation and initialization moves to thread_new() - maxthread handling moves to fork_check_maxthread() - setting the new thread running moves to fork_thread_start() The MD cpu_fork() function swaps its unused stacksize parameter for a tcb parameter. luna88k testing by aoyama@, alpha testing by dlg@ ok mpi@
2016-06-05Add uvm_share() to share a memory range between two address spacesStefan Kempf
Its primary use is to make guest VM memory accessible to the host (e.g. vmd(8)). That will later allow us to remove the readpage and writepage ioctls from vmm(4), and use ordinary loads and stores instead. "looks good to me" kettenis@
2016-04-04UVM_FLAG_AMAPPAD has no effect anymore, nuke it.Stefan Kempf
This flag caused amaps to be allocated with additional spare slots, to make extending them cheaper. However, the kernel never extends amaps, so allocating spare slots is pointless. Also UVM_FLAG_AMAPPAD only has an effect in combination with UVM_FLAG_OVERLAY. The only function that used both flags was sys_obreak, but that function had the use of UVM_FLAG_OVERLAY removed recently. While there, kill the unused prototypes amap_flags and amap_refs. They're defined as macros already. ok mlarkin@ kettenis@ mpi@
2015-12-02remove declaration for nonexistant functionBret Lambert
ok tedu@
2015-11-11Remove the superfluous typedef uvm_flag_t (unsigned int). Also, fix anmmcc
associated mistake in the uvm manpage. Suggested by and ok tedu@
2015-09-28add a flag to indicate to uvm_map that it should unmap to make space.Ted Unangst
this pulls all the relevant operations under the same map locking, and relieves calling code from responsibility. ok kettenis matthew
2015-09-09All our pmap implementations provide pmap_resident_count(), so removeMiod Vallat
#ifndef pmap_resident_count code paths.
2015-07-19Change uvm_page[re]alloc_multi to actually use the flags passed in, and returnBob Beck
a value so that they may be called with UVM_PLA_NOWAIT ok kettenis@
2015-05-05emul_native is only used for kernel threads which can't dump core, soPhilip Guenther
delete coredump_trad(), uvm_coredump(), cpu_coredump(), struct md_coredump, and various #includes that are superfluous. This leaves compat_linux processes without a coredump callback. If that ability is desired, someone should update it to use coredump_elf32() and verify the results... ok kettenis@
2015-02-07Introduce VM_KERNEL_SPACE_SIZE as a replacement forMiod Vallat
(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS). This will allow these to no longer be constants in the future. ok guenther@
2015-02-06-Split out uvm_mmap and uvm_map into a version for anon's and a versionBob Beck
for everything else. -Adapt the anon version to be callable without the biglock held. Done by tedu@, kettenis@ and me.. pounded on a bunch. This does not yet make mmap a NOLOCK call, but permits it to be so. ok tedu@, kettenis@, guenther@ jsing@
2015-02-05Remove some unneeded <uvm/uvm_extern.h> inclusions.Martin Pieuchot
ok deraadt@, miod@
2014-12-17remove lock.h from uvm_extern.h. another holdover from the simpletonlockTed Unangst
era. fix uvm including c files to include lock.h or atomic.h as necessary. ok deraadt
2014-12-16primary change: move uvm_vnode out of vnode, keeping only a pointer.Ted Unangst
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
2014-12-15Use MAP_INHERIT_* for the 'inh' argument to the UMV_MAPFLAG() macro,Philip Guenther
eliminating the must-be-kept-in-sync UVM_INH_* macros ok deraadt@ tedu@
2014-12-05Introduce a new sysctl to retrieve VM map entriesMasao Uebayashi
This adds a new sysctl KERN_PROC_VMMAP, which returns an array of VM map entries of a specified process. This prevents debuggers from iterating vm_map_entry RB tree via kvm(3). The name KERN_PROC_VMMAP and struct kinfo_vmentry are chosen from the same function in FreeBSD. struct kinfo_vmentry is revised to reduce size, because OpenBSD does not keep track of filepaths. The semantic is also changed to return max buffer size as a hint, and start iteration at the specified base address. Much valuable input from deraadt@, guenther@, tedu@ OK tedu@ deraadt@
2014-11-21Kill kv_executable flag. We no longer allow requests for PROT_EXECTheo de Raadt
mappings via this interface (nothing uses it, in any case) ok uebayasi tedu
2014-11-16Replace a plethora of historical protection options with justTheo de Raadt
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
2014-11-15repair operator precedence in UVM_MAPFLAG() macro; ok teduTheo de Raadt
2014-10-03Introduce a thread for zeroing pages without holding the kernel lock. ThisMark Kettenis
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@
2014-10-03Introduce __MAP_NOFAULT, a mmap(2) flag that makes sure a mapping will notMark Kettenis
cause a SIGSEGV or SIGBUS when a mapped file gets truncated. Access to pages that are not backed by a file on such a mapping will be replaced by zero-filled anonymous pages. Makes passing file descriptors of mapped files usable without having to play tricks with signal handlers. "steal your mmap flag" deraadt@
2014-07-11Chuck Cranor rescinded clauses in his licenseJonathan Gray
on the 2nd of February 2011 in NetBSD. http://marc.info/?l=netbsd-source-changes&m=129658899212732&w=2 http://marc.info/?l=netbsd-source-changes&m=129659095515558&w=2 http://marc.info/?l=netbsd-source-changes&m=129659157916514&w=2 http://marc.info/?l=netbsd-source-changes&m=129665962324372&w=2 http://marc.info/?l=netbsd-source-changes&m=129666033625342&w=2 http://marc.info/?l=netbsd-source-changes&m=129666052825545&w=2 http://marc.info/?l=netbsd-source-changes&m=129666922906480&w=2 http://marc.info/?l=netbsd-source-changes&m=129667725518082&w=2
2014-07-08decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hTheo de Raadt
don't need to be married. ok guenther miod beck jsing kettenis
2014-07-02Use real parameter types for u{dv,vn}_attach() instead of void *Matthew Dempsky
ok guenther
2014-06-13Add support for MAP_INHERIT_ZERO.Matthew Dempsky
This provides a way for a process to designate pages in its address space that should be replaced by fresh, zero-initialized anonymous memory in forked child processes, rather than being copied or shared. ok jmc, kettenis, tedu, deraadt; positive feedback from many more
2014-05-15Move from struct proc to process the reference-count-holding pointersPhilip Guenther
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@
2014-05-06Include <sys/vmmeter.h> directly instead of relying on it beingMartin Pieuchot
pulled by <uvm/uvm_extern.h> and turn uvm_total() into a private function. The preferred way to get memory stats is through the VM_UVMEXP sysctl(3) since VM_METER is just a wrapper on top of it. In the kernel, use `uvmexp' directly instead of uvm_total(). This change does not remove <sys/vmmeter.h> from <uvm/uvm_extern.h> to give some more time to port maintainers to fix their ports. ok guenther@ as part of a larger diff.
2014-05-03Move the u-area allocation and pmap-magic logic to its own functionPhilip Guenther
uvm_uarea_alloc() function name from NetBSD; arm testing by miod@
2014-04-03add a uvm_yield function and use it in the reaper path to prevent theTed Unangst
reaper from hogging the cpu. it will do the kernel lock twiddle trick to allow other CPUs a chance to run, and also checks if the reaper has been running for an entire timeslice and should be preempted. ok deraadt
2014-03-28Reduce uvm include madness. Use <uvm/uvm_extern.h> instead ofMartin Pieuchot
<uvm/uvm.h> if possible and remove double inclusions. ok beck@, mlarkin@, deraadt@
2014-01-30Move declaration of struct vm_page_md from <machine/vmparam.h> toMiod Vallat
<machine/pmap.h> where it belongs, and compensate in <uvm/uvm_extern.h> by including <uvm/uvm_pmap.h> before <uvm/uvm_page.h>. Tested on all MACHINE_ARCH but amd64 and i386 (and hppa64).
2013-07-09back out the cache flipper temporarily to work out of tree.Bob Beck
will come back soon. ok deraadt@
2013-06-11High memory page flipping for the buffer cache.Bob Beck
This change splits the buffer cache free lists into lists of dma reachable buffers and high memory buffers based on the ranges returned by pmemrange. Buffers move from dma to high memory as they age, but are flipped to dma reachable memory if IO is needed to/from and high mem buffer. The total amount of buffers allocated is now bufcachepercent of both the dma and the high memory region. This change allows the use of large buffer caches on amd64 using more than 4 GB of memory ok tedu@ krw@ - testing by many.
2013-05-23the simplelock is a lieTed Unangst
2013-05-14restore ABI compatibility; guentherMiod Vallat
2013-05-14Remove `swapin' and `swapout' from uvm statistics, since we don't swap outMiod Vallat
u areas since quite a few years now.
2012-03-09New vmmap implementation.Ariane van der Steldt
no oks (it is really a pain to review properly) extensively tested, I'm confident it'll be stable 'now is the time' from several icb inhabitants Diff provides: - ability to specify different allocators for different regions/maps - a simpler implementation of the current allocator - currently in compatibility mode: it will generate similar addresses as the old allocator
2011-07-08some machines don't boot with the previous uvm reserve enforcement diff.Ted Unangst
back it out.
2011-07-07Move the uvm reserve enforcement from uvm_pagealloc to pmemrange.Owain Ainsworth
More and more things are allocating outside of uvm_pagealloc these days making it easy for something like the buffer cache to eat your last page with no repercussions (other than a hung machine, of course). ok ariane@ also ok ariane@ again after I spotted and fixed a possible underflow problem in the calculation.
2011-07-06uvm changes for buffer cache improvements.Bob Beck
1) Make the pagedaemon aware of the memory ranges and size of allocations where memory is being requested, and pass this information on to bufbackoff(), which will later (not yet) be used to ensure that the buffer cache gets out of the way in the right area of memory. Note that this commit does not yet make it *do* that - as currently the buffer cache is all in dma-able memory and it will simply back off. 2) Add uvm_pagerealloc_multi - to be used by the buffer cache code for reallocating pages to particular regions. much of this work by ariane, with smatterings of me, art,and oga ok oga@, thib@, ariane@, deraadt@
2011-07-03The UVM_STRAT defines have been unused since pmemrange was commited.Owain Ainsworth
They may die now. ``kill it'' thib@
2011-06-23Make mbufs and dma_alloc be contig allocations.Ariane van der Steldt
Requested by dlg@ ok oga@
2011-06-06Backout vmmap in order to repair virtual address selection algorithmsAriane van der Steldt
outside the tree.
2011-05-30Remove the freelist member from vm_physsegOwain Ainsworth
The new world order of pmemrange makes this data completely redundant (being dealt with by the pmemrange constraints instead). Remove all code that messes with the freelist. While touching every caller of uvm_page_physload() anyway, add the flags argument to all callers (all but one is 0 and that one already used PHYSLOAD_DEVICE) and remove the macro magic to allow callers to continue without it. Should shrink the code a bit, as well. matthew@ pointed out some mistakes i'd made. ``freelist death, I like. Ok.' ariane@ `I agree with the general direction, go ahead and i'll fix any fallout shortly'' miod@ (68k 88k and vax i could not check would build)
2011-05-24Reimplement uvm/uvm_map.Ariane van der Steldt
vmmap is designed to perform address space randomized allocations, without letting fragmentation of the address space go through the roof. Some highlights: - kernel address space randomization - proper implementation of guardpages - roughly 10% system time reduction during kernel build Tested by alot of people on tech@ and developers. Theo's machines are still happy.
2011-04-18Put back the change of pool and malloc into the new km_alloc(9) api.Artur Grabowski
The problems during the hackathon were not caused by this (most likely). prodded by deraadt@ and beck@
2011-04-06Backout the uvm_km_getpage -> km_alloc conversion. Weird things are happeningArtur Grabowski
and we aren't sure what's causing them. shouted oks by many before I even built a kernel with the diff.
2011-04-05 - Change pool constraints to use kmem_pa_mode instead of uvm_constraint_rangeArtur Grabowski
- Use km_alloc for all backend allocations in pools. - Use km_alloc for the emergmency kentry allocations in uvm_mapent_alloc - Garbage collect uvm_km_getpage, uvm_km_getpage_pla and uvm_km_putpage ariane@ ok