summaryrefslogtreecommitdiff
path: root/sys/uvm
AgeCommit message (Collapse)Author
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@
2016-03-29Remove dead assignments and now unused variables.Charles Longeau
Found by LLVM/Clang Static Analyzer. ok mpi@ stefan@
2016-03-27amap_extend is never called, remove it.Stefan Kempf
In the code, this function is called when vm_map_entries are merged. However, only kernel map entries are merged, and these do not use amaps. Therefore amap_extend() is never called at runtime. ok millert@, KASSERT suggestion and ok mpi@
2016-03-19Remove the unused flags argument from VOP_UNLOCK().natano
torture tested on amd64, i386 and macppc ok beck mpi stefan "the change looks right" deraadt
2016-03-16Remove redundant check.Stefan Kempf
The compiler is also smart enough to recognize that this is redundant. The resulting code on amd64 is basically equivalent (slightly different register allocation and instruction scheduling). ok mpi@ deraadt@
2016-03-15'accomodate' -> 'accommodate' in comments.Kenneth R Westerback
Started by diff from Mical Mazurek.
2016-03-15Allocate amap slots for a virtual memory range reserved with sbrk lazily.Stefan Kempf
This avoids wasting kernel memory if the user process does not make use of the allocated memory. Testing by sthen@ and tobiasu@, thanks! ok deraadt@
2016-03-15For amaps with only a few slots, allocate the slots via pool(9)Stefan Kempf
This saves some memory compared to using malloc, because there's no roundup to the next bucket size. And it reduces kmem pressure at least for some architectures (e.g. amd64). Testing by sthen@ and tobiasu@, thanks! ok sthen@ deraadt@
2016-03-09remove vaxismsTheo de Raadt
2016-03-07Sync no-argument function declaration and definition by adding (void).Christian Weisgerber
ok mpi@ millert@
2016-03-06Remove unused amap_share_protect().Stefan Kempf
ok mpi@ visa@
2016-03-06Tweak uvm assertions to avoid locking in some cases.Stefan Kempf
When only one thread can access a map, there's no need to lock it. Tweak the assertion instead of appeasing it by acquiring a lock when it's not necessary. ok kettenis@
2016-03-03Remove option USER_LDT and everything depending on it.Christian Weisgerber
Remove machdep.userldt sysctl. Remove i386_[gs]et_ldt syscall stub from libi386. Remove i386_[gs]et_ldt regression test. ok mlarkin@ millert@ guenther@
2016-01-29Therefor -> Therefore (where appropriate)tb
from ray@, ok jmc@
2016-01-09Use uiomove(9) instead of uiomovei(9). From Martin Natano.Mark Kettenis
2015-12-16Avoid grabbing the kernel lock in uvm_unmap() if we have an interrupt-safeMark Kettenis
map. This removes the (hopefully) last case in which pool_put() might try to grab the kernel lock for interrupt-safe pools. Note that pools that are created with the PR_WAITOK flag will still grab the kernel lock. ok mpi@, tedu@
2015-12-06Since the page zeroing thread runs without the kernel lock,Bret Lambert
it relies upon the fpageq lock for data consistency and sleep/wakeup interlocking. Therefore, code which modifies page zeroing thread data or performs a wakeup of the thread must also hold the fpageq lock. Fix an instance where this was not the case. ok kettenis@ diff --git a/sys/uvm/uvm_pmemrange.c b/sys/uvm/uvm_pmemrange.c
2015-12-02remove declaration for nonexistant functionBret Lambert
ok tedu@
2015-11-14mutli -> multiMiod Vallat
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-11-10UVM change needed for vmm.Mike Larkin
discussed with miod, deraadt, and guenther.
2015-11-01refactor pledge_*_check and pledge_fail functionsSebastien Marie
- rename _check function without suffix: a "pledge" function called from anywhere is a "check" function. - makes pledge_fail call the responsability to the _check function. remove it from caller. - make proper use of (potential) returned error of _check() functions. - adds pledge_kill() and pledge_protexec() with and OK deraadt@
2015-10-30Fix two (verified to be harmless) off-by-ones in bounds checks inMiod Vallat
uvm_page_init() (causing uvmexp.npages to be sligthly wrong if pmap_steal_memory() has been used) and uvm_page_physload(). ok guenther@ kettenis@ visa@ beck@
2015-10-23Add 3 new pledge requests. "ps" exposes enough sysctl information forTheo de Raadt
ps-style programs (there are quite a few in the tree, including tmux). "vminfo" exposes a bit more system operation information, which many observation programs want (such as top). settime allows setting the system time, and will be used to pledge-protect the last ntpd process.
2015-10-09Rename tame() to pledge(). This fairly interface has evolved to be moreTheo de Raadt
strict than anticipated. It allows a programmer to pledge/promise/covenant that their program will operate within an easily defined subset of the Unix environment, or it pays the price.
2015-10-08Lock the page queues by turning uvm_lock_pageq() and uvm_unlock_pageq() intoMark Kettenis
mtx_enter() and mtx_leave() operations. Not 100% this won't blow up but there is only one way to find out, and we need this to make progress on further unlocking uvm. prodded by deraadt@
2015-10-01In uvm_map_splitentry(), grab the kernel lock before calling into the amapMark Kettenis
or pager code. We may end up here without holding the kernel lock from uvm_unmap(). "ja ja" tedu@
2015-09-30implement new "prot_exec" tame(2) request:Sebastien Marie
- by default, a tamed-program don't have the possibility to use PROT_EXEC for mmap(2) or mprotect(2) - for that, use the request "prot_exec" (that could be dropped later) initial idea from deraadt@ and kettenis@ "make complete sense" beck@ ok deraadt@
2015-09-28the kernel lock is no longer needed in the fixed case since uvm_mapTed Unangst
will perform the unmap as necessary, holding the vm lock. reminded by kettenis
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-26Protect the list of free map entries with a mutex. This should fix theMark Kettenis
crashes seen by sthen@ on i386. ok visa@, guenther@, tedu@
2015-09-26matthew noticed there's a race where we are using the kernel lock to tieTed Unangst
together the unmap and map portions of a fixed mmap. make this explicit by pulling the lock up higher. in preparation for unlocking the syscall. there's still (always has been) a race where if the unmap sleeps, another mmap may see partial results because the map lock isn't held througout. another problem, another day.
2015-09-23Corect a kbind comment to describe the version that was settled on: no oldPhilip Guenther
data, only new
2015-09-21Drop a misleading XXX about PQ_AOBJ. Clear PQ_ANON unconditionally forVisa Hankala
consistency with PQ_AOBJ. Input kettenis@, ok beck@
2015-09-17Back out rev. 1.125. This bit was left behind (intentionally?) when theMark Kettenis
remainder of that commit was backed out. However,clearing the PQ_AOBJ bit here is definitely wrong. Our pagedaemon uses two separate lists to keep track of inactive pages. It uses PQ_SWAPBACKED, which really is both PQ_ANON and PQ_AOBJ to keep track of which inactive queue a page is sitting on. So if you twiddle PQ_AOBJ (or PQ_ANON) for an inactive page, a subsequent uvm_pagefree(9) will remove the page from the wrong queue! This usually goes unnoticed, but if the page happens to be the last one on the queue, the queues get corrupted. The damage quickly spreads to the free page queues and almost certainly results in the uvm_pmr_size_RB_REMOVE_COLOR() faults that people have seen sporadically since the spring of this year. ok visa@, beck@, krw@, guenther@
2015-09-13Rename __sysctl syscall to just sysctl, as the userland wrapper is no longerPhilip Guenther
necessary ok deraadt@ jsing@
2015-09-12Enable some diagnostics for interrupt-safe maps that are already happening forMark Kettenis
normal maps. ok beck@, miod@, guenther@
2015-09-09Add locking for interrupt-safe maps (those that have the VM_MAP_INTRSAFE flagMark Kettenis
set). Since we cannot sleep in that case, use a mutex instead of an rwlock. This is ok as the more complex code paths in the uvm code are not entered for interrupt-safe maps as paging isn't allowed in those maps. ok tedu@
2015-09-09All our pmap implementations provide pmap_resident_count(), so removeMiod Vallat
#ifndef pmap_resident_count code paths.
2015-09-06sizes for free(); ok semarieTheo de Raadt
2015-09-01size for free(), and make allocation side look similarTheo de Raadt
2015-08-28fairly simple sizes for free(); ok teduTheo de Raadt
2015-08-27After more than a decade it seems safe to conclude that amap_clean works.Mark Kettenis
ok mpi@, visa@
2015-08-27delete a comment about gcc -WuninitializedTheo de Raadt
2015-08-25In sys_kbind(), pages from uvm_map_extract() must be written to with kcopy()Philip Guenther
ok kettenis@
2015-08-23"XXXMRG: consider making it an inline or macro"Theo de Raadt
no way.
2015-08-21Remove the unused loan_count field and the related uvm logic. Most ofVisa Hankala
the page loaning code is already in the Attic. ok kettenis@, beck@
2015-08-19Make uvm_pmr_isfree() work correctly when RB_NFIND() returnsVisa Hankala
an exact match. ok kettenis@
2015-08-19Sync page_flagbits with reality.Visa Hankala
ok kettenis@
2015-07-20Actually return a value from sys_kbind() in the non-ld.so case, or theMiod Vallat
compiler will warn.