summaryrefslogtreecommitdiff
path: root/sys/uvm
AgeCommit message (Collapse)Author
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-08white space repairsTheo de Raadt
2014-07-08rearrange some includes. also, pull in uvm/uvm.h because soon sysctl.hTheo de Raadt
won't be pulling in the uvm side of the kitchen.
2014-07-08the #ifdef _KERNEL can wrap the entire file. uvm_extern.h only pullsTheo de Raadt
this inside #ifdef _KERNEL in any case, so nothing really changes.
2014-07-08subtle rearrangement of includesTheo de Raadt
2014-07-08bye bye UBC; ok beck dlgTheo de Raadt
2014-07-03It is important that we don't release the kernel lock between issuing aMark Kettenis
wakeup and clearing the PG_BUSY and PG_WANTED flags, so try to keep those bits as close together and defenitely avoid calling random code in between. ok guenther@, tedu@
2014-07-02Use real parameter types for u{dv,vn}_attach() instead of void *Matthew Dempsky
ok guenther
2014-06-29delete a #ifdef _KERNEL chunk protecting userland from an #if 0 chunkTheo de Raadt
2014-06-27Cleanup support for legacy mmap flagsMatthew Dempsky
Move all legacy MAP_FOO values behind #ifndef _KERNEL and redefine them to either be aliases for existing flags (e.g., MAP_COPY -> MAP_PRIVATE) or 0. Also, add MAP_OLDFOO defines (behind #ifndef _KERNEL) so the kernel and kdump can remain compatible with current OpenBSD binaries. ok deraadt
2014-06-21Make sure kmthread never loops without making progress: if the freelistPhilip Guenther
was empty then the first page allocation should sleep until it can get one. ok tedu@
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-06-10KNFMark Kettenis
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-09stop using B_AGE, it was effectively retired some time ago.Ted Unangst
2014-05-08Fix some potential integer overflows caused by converting a page number intoMark Kettenis
an offset/size/address by shifting by PAGE_SHIFT. Make uvm_objwrire/unwire use voff_t instead of off_t. The former is the right type here even if it is equivalent to the latter. Inspired by a somewhat similar changes in Bitrig. ok deraadt@, guenther@
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-03Fix whitespace fail in previous commitPhilip Guenther
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-30Make sure we flush discarded pages even if the number of hash buckets doesn'tMark Kettenis
change. From Pedro Martelletto via bitrig. ok beck@, krw@
2014-04-30Assigning list pointers doesn't really work with doubly linked lists. UseMark Kettenis
a remove-and-insert-all-items approach for now and remove the comments that suggest manipulating list pointers. Pointed out by Pedro Martelletto. ok beck@, krw@, mikeb@
2014-04-29Replace 1 << PAGE_SHIFT with PAGE_SIZE.Mark Kettenis
ok beck@, miod@
2014-04-13compress code by turning four line comments into one line comments.Ted Unangst
emphatic ok usual suspects, grudging ok miod
2014-04-10rename waitable to waitok as suggested by kettenisTed Unangst
2014-04-08add IO_NOCACHE flag to vop_write arguments, which in turn sets B_NOCACHEBob Beck
on the written buffers. Use the flag for writes from the page daemon to ensure that we free buffers written out by the page daemon rather than caching them. ok kettenis@
2014-04-05Fix logic error and prevent theoretical infinite loop in the worst case scenarioMiod Vallat
in uvm_pmr_rootupdate(). Issue spotted and fix provided by Kieran Devlin.
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-04-03uvm_fault() will try to fault neighbouring pages for the MADV_NORMAL case,Miod Vallat
which is the default, unless the fault call is explicitly used to wire a given page. The amount of pages being faulted in was borrowed from the FreeBSD VM code, about 15 years ago, at a time FreeBSD was only reliably running on 4KB page size systems. It is questionable whether faulting the same amount of pages, on platforms where the page size is larger, is a good idea, as it may cause too much I/O. Add an uvmfault_init() routine, which will compute the proper number of pages at runtime, depending upon the actual page size, and attempting to fault in the same overall size the previous code would have done with 4KB pages. ok tedu@
2014-03-31In uvm_fault(), when attempting to map backpages and forwpages, deferMiod Vallat
the pmap_update() to the end of the loop, rather than after each loop iteration - which might not even end up invoking pmap_enter()! Quiet blessing from guenther@ 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-03-26Move p_emul and p_sigcode from proc to process.Philip Guenther
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@
2014-03-21Allow for two more pmap-specific bits in vm_page pg_flags. DefineMiod Vallat
PG_PMAPMASK as all the possible pmap-specific bits (similar to the other PG_fooMASK) to make sure MI code does not need to be updated, the next time more bits are allocated to greedy pmaps. No functional change, soon to be used by the (greedy) mips64 pmap.
2014-02-06add some more bufbackoff calls. uvm_wait optimistically (?), uvm_wait_plaTed Unangst
after analysis and testing. when flushing a large mmapped file, we can eat up all the reserve bufs, but there's a good chance there will be more clean ones available. ok beck kettenis
2014-02-06parenthesis to make the math right. ok beck kettenisTed Unangst
2014-02-04reduce the length of some pool names. ok deraadt guenther mpiTed Unangst
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).
2014-01-23unifdef -D__HAVE_VM_PAGE_MD - no functional change.Miod Vallat
2014-01-01Remove __HAVE_PMAP_PHYSSEG support, nothing uses it anymore.Miod Vallat
2013-12-09forgot to say: aobj grow/shrink tweaks are mostly from Pedro Martelletto,Marc Espie
like the rest of tmpfs
2013-12-08allow aobj to shrink grow, for tmpfs supportMarc Espie
A few tweaks asked by kettenis@ (code doesn't affect systems without mounted tmpfs at all) okay beck@
2013-11-24Replace the swapdev CIRCLEQ with a TAILQ and replace the manually rolledJoel Sing
list traversals with LIST_FOREACH. ok beck@ krw@
2013-11-21remove the #define b_cylinder b_resid from bufs. i hated theDavid Gwynne
overloading of that thing. the only hardware that seems to care about cylinders in our tree are floppy drives, and the drivers for those calculate their own cylinders from logical block addresses and ignore whatever the rest of the kernel thought b_cylinders should be. most of this diff is moving the floppy drivers to using b_resid as a resid and using that as part of the calculation for real cylinder values. the rest of the diff is getting rid of the useless assignments to b_cylinder that dont get used by anything (now that disksort is gone). ok miod@
2013-11-20Update comments mentioning `resource maps' to mention `extents' instead.Miod Vallat
Resource maps have been removed more than 10 years ago, it's about time to update comments to better match reality. No functional change.
2013-11-09Add KASSERT()s to tsleep() and msleep() to verify that bogus flagsPhilip Guenther
aren't being passed to them. Fix UVM_WAIT() to not pass PNORELOCK to tsleep(), as that flag only does something with msleep(). ok beck@ dlg@
2013-11-06remove some abuse of bufqs where they were overloaded to store workq_tasksDavid Gwynne
for completing swap io against files. this in turn bloated struct buf. this moves from using workq_tasks to the task api, but stores the task handler in vndbuf which is allocated specially for every io in this path anyway. ok kettenis@ beck@
2013-11-05new function uvm_hibswap() finds a the largest free zone in swap, whichTheo de Raadt
hibernate can use place the data. ok mlarkin
2013-11-04If compiled for hibernate, reserve the last page of the primary swapTheo de Raadt
space (in case we need to place a hibernate signature there) ok miod
2013-11-04improve a panic messageTheo de Raadt
2013-11-02fix some commentsTheo de Raadt
2013-11-02No need to cast constants or simple variables to (daddr_t). UseKenneth R Westerback
(u_int64_t) instead of (daddr_t) when casting a variable in an expression passed to DL_SETDSIZE(). Change a variable counting open files from daddr_t to int64_t. ok deraadt@ with the tweak to fix that pesky expression.