summaryrefslogtreecommitdiff
path: root/sys/uvm
AgeCommit message (Collapse)Author
2011-06-06Backout vmmap in order to repair virtual address selection algorithmsAriane van der Steldt
outside the tree.
2011-06-03randomness might be broken, but this changeTheo de Raadt
a) chooses incorrect kernel memory on the macppc b) perhaps on zaurus too, which does not make it to copyright c) was not tested on those platforms before commit
2011-06-01Oops, I broke randomness. (Please upgrade, this is _bad_.)Ariane van der Steldt
sel_addr &= ~(pmap_align - 1); with pmap_align allowed to be 0 (no PMAP_PREFER) is a bad idea. Fix this by a conditional. ok oga@
2011-05-30Remove the freelist member from vm_physsegOwain Ainsworth
The new world order of pmemrange makes this data completely redundant (being dealt with by the pmemrange constraints instead). Remove all code that messes with the freelist. While touching every caller of uvm_page_physload() anyway, add the flags argument to all callers (all but one is 0 and that one already used PHYSLOAD_DEVICE) and remove the macro magic to allow callers to continue without it. Should shrink the code a bit, as well. matthew@ pointed out some mistakes i'd made. ``freelist death, I like. Ok.' ariane@ `I agree with the general direction, go ahead and i'll fix any fallout shortly'' miod@ (68k 88k and vax i could not check would build)
2011-05-30for (some; stuff; here)Owain Ainsworth
; instead of for (some; stuff; here); reads easier. ok ariane@
2011-05-30s/hart/heart/ to make more sense (another dutchism).Owain Ainsworth
ok ariane@
2011-05-29Replace the lower bound PAGE_SIZE with VMMAP_MIN_ADDR.Ariane van der Steldt
This makes writing a diff that makes 64-bit unclean applications explode a one-line diff. ok deraadt
2011-05-29Fix parameter range clamping in vmmap routines.Ariane van der Steldt
The old VM_MAP_RANGE_CHECK macro was wrong and caused code to be unreadable (argument altering macros are harmful). Each function now treats the memory range outside the map as it would treat free memory: if it would error on being given free memory, it'll error in a similar fashion when the start,end parameters fall outside the map. If it would accept free memory in its argument range, it'll silently accept the outside-map memory too. Confirmed to help ports build machines.
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.
2011-05-10Don't leak swapslots when doing a uvm_km_pgremove and a page is in swap only.Owain Ainsworth
Before we were only calling uao_dropswap() if there was a page, maning that if the buffer was swapped out then we would leak the slot. Quite rare because only pipebuffers should swap from the kernel object, but i've seen panics that implied this had happened (alpha.p for example). ok thib@ after a lot of discussion and checking the semantics.
2011-05-10Kill vm_page_lookup_freelist.Owain Ainsworth
it belongs to a world order that isn't here anymore. More importantly it has been unused for a fair while now. ok thib@
2011-05-07Uvm Anonymous Objects depending on size either use an array or aOwain Ainsworth
hashtable to keep the list of swap slots in use in. Only one of these will be in use at any one tmie, so shave some bytes and make it a union. ok thib@
2011-05-07So long, uvm_pglist.hOwain Ainsworth
This header defined three thing. two of which are unused throughout the tree, the final one was the definition of the pagq head type, move that to uvm_page.h and nuke the header ok thib@. Thanks to krw@ for testing the hppa build for me.
2011-04-26MMU address space holes are at a fixed position (ofcourse).Ariane van der Steldt
Therefore set UVM_FLAG_FIXED and enforce this. ok oga@
2011-04-23Fix management of the list of free uvm_km_pages. Seems art@ lost a lineMark Kettenis
when he copied this code from uvm_km_putpage() into km_free(). Found independently by ariane@; ok deraadt@
2011-04-19Add missing call to pmap_update() in km_alloc().Matthew Dempsky
ok deraadt@, miod@
2011-04-19Free the correct pages when we failed to allocate va.Artur Grabowski
2011-04-18Put back the change of pool and malloc into the new km_alloc(9) api.Artur Grabowski
The problems during the hackathon were not caused by this (most likely). prodded by deraadt@ and beck@
2011-04-17construct a better path to the swapdevice (as seen in pstat/swapctl output)Theo de Raadt
ok miod
2011-04-15unused variable on !PMAP_DIRECTTheo de Raadt
2011-04-15for uvm_pager_dropcluster in the PG_RELEASED case we specifically unbusy theOwain Ainsworth
page so that um_anfree will free it for us. uvm_anfree does a pmap_page_protect(, VM_PROT_NONE) just before it frees the page, so we don't need to do it here ourselves. ok ariane@
2011-04-15move uvm_pageratop from uvm_pager.c local to a general uvm functionOwain Ainsworth
(uvm_atopg) and use it in uvm_km_doputpage to replace some handrolled code. Shrinks the kernel a trivial amount. ok beck@ and miod@ (who suggested i name it uvm_atopg not uvm_atop)
2011-04-15Add a bit of paranoia to uvm_pageinsert.Owain Ainsworth
At various times diffs have had debugging that checked that we don't insert a page into the tree on top of an existing page, leaking that page's references. Until the recent hackathon (and introduction if uvm_pagealloc_multi) the bufcache for example did a rb tree look up on insert to check (under #ifdef DEBUG || 1) so instead just check it on pageinsert every time, since RB_INSERT returns any duplicates so this check is pretty much free. ``emphatically yes'' beck@
2011-04-15When I switched uvm objects to use a per-object page tree instead of theOwain Ainsworth
global hash I forgot to remove the has declarations from struct uvm. So remove them now. pointed out by blambert@, ok beck@
2011-04-07Do not use NULL in integer comparisons. No functional change.Miod Vallat
ok matthew@ tedu@, also eyeballed by at least krw@ oga@ kettenis@ jsg@
2011-04-07In uvm_vslock_device(), if uvm_pglistalloc() fails, make sure to not passMiod Vallat
an uninitialized variable to uvm_km_free().
2011-04-06Backout the uvm_km_getpage -> km_alloc conversion. Weird things are happeningArtur Grabowski
and we aren't sure what's causing them. shouted oks by many before I even built a kernel with the diff.
2011-04-06fix uvm_pmr_alloc_pig to return the proper pig range sizeMike Larkin
ok ariane
2011-04-05Test iterated variable instead of a temporary variable from the previousAriane van der Steldt
code block (not 'high_next' but 'low'). While here, change the KASSERT to a KDASSERT. Pointed out by Amit Kulkarni. ok thib@, miod@
2011-04-05 - Change pool constraints to use kmem_pa_mode instead of uvm_constraint_rangeArtur Grabowski
- Use km_alloc for all backend allocations in pools. - Use km_alloc for the emergmency kentry allocations in uvm_mapent_alloc - Garbage collect uvm_km_getpage, uvm_km_getpage_pla and uvm_km_putpage ariane@ ok
2011-04-04Remove debug code.Ariane van der Steldt
Pointed out and ok mlarkin@
2011-04-04Few minor ninja fixes while this isn't being used anywhere in -current.Artur Grabowski
- Change a few KASSERT(0) into proper panics. - Match the new behavior of single page freeing. - kremove pages and then free them, it's safer. thib@ ok
2011-04-04Better.Artur Grabowski
2011-04-04Make gcc stop whining. pointed out by ariane@.Artur Grabowski
2011-04-04Some minor fixes:Artur Grabowski
- Clarify a comment. - Change all the flags to chars from ints to make the structs smaller.
2011-04-04Disallow swapping to vnd's and return ENOTSUPP backThordur I. Bjornsson
to userland. Wrap the checking code in #if NVND > 0 as pointed out by miod. ok beck@ ok deraadt@, krw@ (on an earlier diff)
2011-04-04New unified allocator of kernel memory.Artur Grabowski
We've reached the point where we have a dozen allocators that all do more or less the same thing, but slightly different, with slightly different semantics, slightly different default behaviors and default behaviors that most callers don't expect or want. A random sample on the last general hackathon showed that no one could explain what all the different allocators did. And every time someone needed to do something slightly different a new allocator was written. Unify everything. One single function to allocate multiples of PAGE_SIZE kernel memory. Four arguments: size, how va is allocated, how pa is allocated and misc parameters. Same parameters are passed to the free function so that we don't need to guess what's going on. Functions are currently unused, we'll do one thing at a time to avoid a giant commit. looked at by lots of people, deraadt@ and beck@ are yelling at me to commit.
2011-04-03Helper functions for suspend.Ariane van der Steldt
Allow reclaiming pages from all pools. Allow zeroing all pages. Allocate the more equal pig. mlarking@ needs this. Not called yet. ok mlarkin@, theo@
2011-04-03Fix an #ifdef: uvm_pmr_isfree() is also used when DEBUG is definedPhilip Guenthe
Pointed out by Fred Crowson. ok ariane@
2011-04-03knf - trailing whitespace flense.Bob Beck
ok henning@
2011-04-02Constrain the buffer cache to use only the dma reachable region of memory.Bob Beck
With this change bufcachepercent will be the percentage of dma reachable memory that the buffer cache will attempt to use. ok deraadt@ thib@ oga@
2011-04-02Count the number of physical pages within a memory range.Ariane van der Steldt
Bob needs this. ok art@ bob@ thib@
2011-04-01Two problems with vslock_device functions.Artur Grabowski
- Fix error handling so that we free stuff on error. - We use the mappings to keep track of which pages need to be freed so don't unmap before freeing (this is theoretically incorrect and will be fixed soon). This makes fsck happy on bigmem machines (it doesn't leak all dma:able memory anymore). beck@, drahn@, oga@ ok
2011-04-01Typo in comment.Kenneth R Westerback
2011-01-11for key material that is being being discarded, convert bzero() toTheo de Raadt
explicit_bzero() where required ok markus mikeb
2010-12-26Kill pmap_phys_address(), and force every driver's mmap() routine to returnMiod Vallat
a physical address [more precisely, something suitable to pass to pmap_enter()'sphysical address argument]. This allows MI drivers to implement mmap() routines without having to know about the pmap_phys_address() implementation and #ifdef obfuscation.
2010-12-24add a param to uvm_map_hint to not skip over the heap, and use it as a lastTed Unangst
resort if mmap fails otherwise to enable more complete address space utilization. tested for a while with no ill effects.
2010-12-21Bring back the "End the VOP experiment." diff, naddy's issues whereThordur I. Bjornsson
unrelated, and his alpha is much happier now. OK deraadt@
2010-12-15add a BRKSIZ define and use it for the heap gap constant, decouplingTed Unangst
heap gap from max data size. nothing else changes yet. ok deraadt
2010-12-06Change the signature of PMAP_PREFER from void PMAP_PREFER(..., vaddr_t *) toMiod Vallat
vaddr_t PMAP_PREFER(..., vaddr_t). This allows better compiler optimization when the function is inlined, and avoids accessing memory on architectures when we can pass function arguments in registers.