summaryrefslogtreecommitdiff
path: root/sys/uvm
AgeCommit message (Collapse)Author
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2015-02-28Typo in comment 'reseve' -> 'reserve'Mike Larkin
2015-02-19Remove a lie from a comment that ratholed me for an evening.Mike Larkin
Thanks to tedu for hinting that I may have been the victim of UVM's lies, which pointed me in this direction. ok tedu
2015-02-15Change pmap_remove_holes() to take a vmspace instead of a map as its argument.Miod Vallat
Use this on vax to correctly pick the end of the stack area now that the stackgap adjustment code will no longer guarantee it is a fixed location.
2015-02-13Include sys/stdint.h for SIZE_MAX instead of relying on the misplacedTodd C. Miller
define in sys/limits.h. OK guenther@
2015-02-10First step towards making uiomove() take a size_t size argument:Miod Vallat
- rename uiomove() to uiomovei() and update all its users. - introduce uiomove(), which is similar to uiomovei() but with a size_t. - rewrite uiomovei() as an uiomove() wrapper. ok kettenis@
2015-02-09Stop using USRSTACK as the edge of the stack, but rather use the vmspaceMiod Vallat
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@
2015-02-09Make sure we actually have an entry before checking its limits.Mark Kettenis
ok deraadt@
2015-02-08Something is subtly wrong with this. On ramdisks, processes run out ofTheo de Raadt
mappable memory (direct or via execve), perhaps because of the address allocator behind maps and the way wiring counts work?
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-07Tedu the old idle page zeroing code.Mark Kettenis
ok tedu@, guenther@, miod@
2015-02-07recombine some of the split uvm_mmap functions. the precondition checksTed Unangst
are not necessary because the caller already ensures these. the tail section for handing mlock can be shared as well. ok beck 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-06Clear PQ_AOBJ before calling uvm_pagefree(), clearing up one false XXXTheo de Raadt
comment (one is fixed, one is deleted). ok kettenis beck
2015-02-06make vm_map_lock lock when it's supposed to. add mutex to protect flagsTed Unangst
and then double check we didn't lose the unavoidable race. ok beck guenther kettenis miod
2015-02-05Remove some unneeded <uvm/uvm_extern.h> inclusions.Martin Pieuchot
ok deraadt@, miod@
2015-01-27remove the second void * argument on tasks.David Gwynne
when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
2015-01-23Make km_alloc(9) use the direct map for all "phys contig" mappings requestedMark Kettenis
by the caller on architectures that implement them. Make sure that we physically align memory such that we meet any demands on virtual alignment in this case. This should reduce the overhead of mapping large pool pages for pools that request dma'able memory. ok deraadt@, dlg@
2015-01-20Move ps_strings "after" the random stackgap. This makes its location aMark Kettenis
per-process value, and therefpore turns the VM_PSSTRINGS sysctl into a per-process one as well. This gets rid of a pointer to the bottom of the stack at a fixed location. Also clears the road for unmapping the stackgap. ok deraadt@
2015-01-13pass the vnd xfer pointer to the tasks callback as part of theDavid Gwynne
vndbuf allocation. luke-warm support and ok krw@
2014-12-23convert pool_init nointr to waitokTed Unangst
2014-12-23I don't like these macros, they obscure the code.Ted Unangst
We can use pool_setipl instead of doing the dance ourselves. The bufpool is already setipl, we don't need to dance at all. We should zero the buf. ok deraadt dlg
2014-12-23convert nointr pool_init argument to pr_waitokTed Unangst
2014-12-18remove two useless and unused hash penalty definesTed Unangst
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-17Prefer MADV_* over POSIX_MADV_* in kernel for consistency: the latterPhilip Guenther
doesn't have all the values and therefore can't be used everywhere. ok deraadt@ kettenis@
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-15don't drop the kernel lock everytime. on a busy system, this results inTed Unangst
the reaper spending more than half its time in uvm_pause. we want the system to be interactive, but we want throughput too. this seems like a decent balance.
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-09Sprinkle in a little more mallocarray().Doug Hogan
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-30panic if the kernel requests W | X pages; ok kettenisTheo de Raadt
2014-11-27The sti(4) driver copies its ROM into kernel memory and executes the codeMark Kettenis
in there. It explicitly changes the mapping of that memory to RX, but this only works if the maximum protection of the mapping includes PROT_EXEC. ok miod@, deraadt@
2014-11-21somebody permitted simple_locks back into uvm. they will be referred toTed Unangst
the bureau of party loyalty for reeducation.
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-18Nuke yet more obvious #include duplications.Kenneth R Westerback
ok miod@
2014-11-18move arc4random prototype to systm.h. more appropriate for most codeTed Unangst
to include that than rdnvar.h. ok deraadt dlg
2014-11-17More cases of kernel map entries being created as EXEC by default; notTheo de Raadt
just the base permission but the maxprot as well. ok tedu
2014-11-17There is no reason for uvm_km_alloc1() to allocate kernel memoryTheo de Raadt
that is executable. ok tedu kettenis guenther
2014-11-17instead of PROT_MASK, use PROT_READ | PROT_WRITE | PROT_EXEC toTheo de Raadt
show the maxprot available in obreak mappings. (the default remains PROT_READ | PROT_WRITE, so don't be afraid). ok tedu
2014-11-17convert a copystr to strlcpy.Ted Unangst
rearrange things in mountswap to delay malloc and always allocate needed size.
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-11-13sizes for simple frees. new diff without the bug spotted by deraadtTed Unangst
2014-11-13bzero -> memsetTed Unangst
2014-10-25Display uvmexp.zeropages in ddb's `show uvmexp' command.Miod Vallat
2014-10-03Initialize uvm_pagezero_thread()'s page list variable.Philip Guenther
ok krw@ sthen@
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-09-14remove uneeded proc.h includesJonathan Gray
ok mpi@ kspillner@