summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_fault.c
AgeCommit message (Collapse)Author
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-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-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-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-07typo in commentPhilip Guenther
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-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-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-04-13compress code by turning four line comments into one line comments.Ted Unangst
emphatic ok usual suspects, grudging ok miod
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@
2013-05-30in the brave new world of void *, we don't need caddr_t castsTed Unangst
2013-05-30UVM_UNLOCK_AND_WAIT no longer unlocks, so rename it to UVM_WAIT.Ted Unangst
2013-05-30remove lots of comments about locking per beck's requestTed Unangst
2013-05-30remove simple_locks from uvm code. ok beck deraadtTed Unangst
2012-04-12uvm: keep track of maxrssAriane van der Steldt
The fault path is used to update the maxrss of the faulting proc. Doesn't affect anything, as it was 0 before. Requested by espie, "just commit it" deraadt
2012-03-23Make rusage totals, itimers, and profile settings per-process insteadPhilip Guenthe
of per-rthread. Handling of per-thread tick and runtime counters inspired by how FreeBSD does it. ok kettenis@
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-03Rip out and burn support for UVM_HIST.Owain Ainsworth
The vm hackers don't use it, don't maintain it and have to look at it all the time. About time this 800 lines of code hit /dev/null. ``never liked it'' tedu@. ariane@ was very happy when i told her i wrote this diff.
2011-06-23Replace handrolled version of uvmfault_unlockmaps with uvmfault_unlockmaps.Owain Ainsworth
ok ariane@
2011-06-06Backout vmmap in order to repair virtual address selection algorithmsAriane van der Steldt
outside the tree.
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.
2009-07-22Put the PG_RELEASED changes diff back in.Owain Ainsworth
This has has been tested very very thoroughly on all archs we have excepting 88k and 68k. Please see cvs log for the individual commit messages. ok beck@, thib@
2009-06-16date based reversion of uvm to the 4th May.Owain Ainsworth
We still have no idea why this stops the crashes. but it does. a machine forced to 64mb of ram cycled 10GB through swap with this diff and is still running as I type this. Other tests by ariane@ and thib@ also seem to show that it's alright. ok deraadt@, thib@, ariane@
2009-06-16Backout all changes to uvm after pmemrange (which will be backed outOwain Ainsworth
separately). a change at or just before the hackathon has either exposed or added a very very nasty memory corruption bug that is giving us hell right now. So in the interest of kernel stability these diffs are being backed out until such a time as that corruption bug has been found and squashed, then the ones that are proven good may slowly return. a quick hitlist of the main commits this backs out: mine: uvm_objwire the lock change in uvm_swap.c using trees for uvm objects instead of the hash removing the pgo_releasepg callback. art@'s: putting pmap_page_protect(VM_PROT_NONE) in uvm_pagedeactivate() since all callers called that just prior anyway. ok beck@, ariane@. prompted by deraadt@.
2009-06-06Since all callers of uvm_pagedeactivate did pmap_page_protect(.., VM_PROT_NONE)Artur Grabowski
just move that into uvm_pagedeactivate. oga@ ok
2009-06-01Since we've now cleared up a lot of the PG_RELEASED setting, remove theOwain Ainsworth
pgo_releasepg() hook and just free the page the "normal" way in the one place we'll ever see PG_RELEASED and should care (uvm_page_unbusy, called in aiodoned). ok art@, beck@, thib@
2009-05-08Remove static qualifier of functions that are not inline.Ariane van der Steldt
Makes trace in ddb useful. ok oga
2009-03-25Move all of the pseudo-inline functions in uvm into C files.Owain Ainsworth
By pseudo-inline, I mean that if a certain macro was defined, they would be inlined. However, no architecture defines that, and none has for a very very long time. Therefore mainly this just makes the code a damned sight easier to read. Some k&r -> ansi declarations while I'm in there. "just commit it" art@. ok weingart@.
2009-03-20While working on some stuff in uvm I've gotten REALLY sick of readingOwain Ainsworth
K&R function declarations, so switch them all over to ansi-style, in accordance with the prophesy. "go for it" art@
2008-09-16remove dead stores and newly created unused variables.Charles Longeau
Found by LLVM/Clang Static Analyzer. ok miod@ art@
2007-06-18Bring back Mickey's UVM anon change. Testing by thib@, beck@ andPedro Martelletto
ckuethe@ for a while. Okay beck@, "it is good timing" deraadt@.
2007-05-31zap the vm_amap am_l simplelock, and amap_{lock/unlock} macros forThordur I. Bjornsson
simple_{lock/unlock}. ok art@
2007-04-15minor indentation.Artur Grabowski
2007-04-13While splitting flags and pqflags might have been a good idea in theoryArtur Grabowski
to separate locking, on most modern machines this is not enough since operations on short types touch other short types that share the same word in memory. Merge pg_flags and pqflags again and now use atomic operations to change the flags. Also bump wire_count to an int and pg_version might go int as well, just for alignment. tested by many, many. ok miod@
2007-04-11Instead of managing pages for intrsafe maps in special objects (aka.Artur Grabowski
kmem_object) just so that we can remove them, just use pmap_extract to get the pages to free and simplify a lot of code to not deal with the list of intrsafe maps, intrsafe objects, etc. miod@ ok
2007-04-04Mechanically rename the "flags" and "version" fields in struct vm_pageArtur Grabowski
to "pg_flags" and "pg_version", so that they are a bit easier to work with. Whoever uses generic names like this for a popular struct obviously doesn't read much code. Most architectures compile and there are no functionality changes. deraadt@ ok ("if something fails to compile, we fix that by hand")
2007-03-26Rip out the KERN_ error codes.Artur Grabowski
ok otto@
2007-03-25remove KERN_SUCCESS and use 0 instead.Artur Grabowski
eyeballed by miod@ and pedro@
2006-07-31fix uvmhist #2: args are always u_long so fix missing %d and %x and no %ll; ↵Michael Shalayeff
no change for normal code
2006-07-26fix fmts for UVMHIST_LOG() entries making it more useful on 64bit archs; ↵Michael Shalayeff
miod@ ok
2006-07-13Back out the anon change. Apparently it was tested by a few, but most ofTheo de Raadt
us did not see it or get a chance to test it before it was commited. It broke cvs, in the ami driver, making it not succeed at seeing it's devices.
2006-06-21from netbsd: make anons dynamically allocated from pool.Michael Shalayeff
this results in lesse kva waste due to static preallocation of those for every phys page and also every swap page. tested by beck krw miod
2006-03-06do not panic unwiring unmapped memory (mmap3 regress); from netbsd; ↵Michael Shalayeff
kettenis@ tedu@ ok
2005-11-29apply patch from david hill for two netbsd prs:Ted Unangst
14060 skip MADV_SEQUENTIAL if refaulting 18037 missing pageactivate tested for some time by jolan krw
2005-10-23typoPedro Martelletto
2005-05-03repair file mmapings above 4g; found by chefren; art@ okMichael Shalayeff
2004-08-03the rest of the '#if DIAGNOSTIC' -> '#ifdef DIAGNOSTIC' in the kernel; ok miod@Todd T. Fries
2004-02-23sync of pmap_update() calls with NetBSD. pmap_update is defined away onDale Rahn
all architectures but arm, where it is needed.