summaryrefslogtreecommitdiff
path: root/sys/uvm
AgeCommit message (Collapse)Author
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@
2014-09-09Make the cleaner, syncer, pagedaemon, aiodone daemons allBret Lambert
yield() if the cpu is marked SHOULDYIELD. ok miod@ tedu@ phessler@
2014-09-08Don't sleep on allocation of hash table entries. Should fix crashes peopleMark Kettenis
have been seeing with tmpfs. Based on a similar fix from Bitrig by Owain Ainsworth. ok jsg@
2014-09-07typo in commentPhilip Guenther
2014-08-14Bring back 1.173 (reverting 1.174) - mips64 systems are still unhappy whenMiod Vallat
the hint returned is over VM_MAXUSER_ADDRESS, apparently; better be safe for now while this is investigated further.
2014-08-12Revert 1.173 now that the real cause of the octeon regression has been fixed.Miod Vallat
2014-07-13Fall back to smaller spacing on the mips64 machines.Paul Irofti
Please spare some change for the mips64 memory-challenged machines.. Some change, Sir? Fixes at least the octeon platform. Found the hardway on my DSR500. Found by Boss tedu@ and Boss deraadt@ Okay Boss miod@
2014-07-13more mmap random on 64-bit platforms. noticed in freebsd aslr patches.Ted Unangst
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-07-12Add a function to drop all clean pages on the page daemon queues and callMark Kettenis
it when we hibernate. ok mlarkin@, miod@, 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-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).