summaryrefslogtreecommitdiff
path: root/sys/uvm
AgeCommit message (Collapse)Author
2009-08-28kva_guardpages: make guard pages separate map entriesAriane van der Steldt
- fixes ps(1) - fixes kva deadbeef entries
2009-08-24Properly check for VM_MAX_KERNEL_ADDRESS wraparound in the guard pages code.Miod Vallat
ok ariane@
2009-08-14make the uvm device lock a mutex.Owain Ainsworth
This is the same diff that was backed out after c2k9 in the date-based revert. ok ariane@
2009-08-13Enable guard pages and slow recycling of kva.Ariane van der Steldt
Debugging aid, hiding in "option KVA_GUARDPAGES" in config.
2009-08-13PAGEFASTRECYCLE is an option we have been using for a while to encourageTheo de Raadt
the kernel to reuse freed pages as quickly as possible, and it has been finding bugs (some of which we have already fixed) ok kettenis
2009-08-11uvm_scheduler() sounds important, but ``while(1) tsleep()'' is kinda lameBret Lambert
inline the loop in the one place it exists, and remove it from uvm adjust a comment mentioning it accordingly originally inspired by a diff fixing a comment from oga@ ok art@ beck@ miod@ oga@
2009-08-08fix the page daemon to back off the buffer cache correctly even in the caseBob Beck
where we are below the inactive page target. This fixes a problem with a large buffer cache on low memory machines where the the page daemon would woken up, however the buffer cache would never be backed off because we were below the inactive page target, which could result in constant paging and basically a livelock condition. ok oga@ art@
2009-08-06reintroduce the uvm_tree commit.Owain Ainsworth
Now instead of the global object hashtable, we have a per object tree. Testing shows no performance difference and a slight code shrink. OTOH when locking is more fine grained this should be faster due to lock contention on uvm.hashlock. ok thib@, art@.
2009-08-02Dynamic buffer cache support - a re-commit of what was backed outBob Beck
after c2k9 allows buffer cache to be extended and grow/shrink dynamically tested by many, ok oga@, "why not just commit it" deraadt@
2009-07-26stop trying to fast-recycle pages for now. a few bugs have been found andTheo de Raadt
fixed, but now it is time for a little break from the chaos. ok kettenis
2009-07-25Add an extra argument to uvm_unmap_remove(), for the caller to tell itMiod Vallat
whether removing holes or parts of them is allowed or not. Only allow hole removal in uvmspace_free(), when tearing the vmspace down. ok art@
2009-07-23Insert free pages at the head of the page queues. Should provide betterMark Kettenis
cache locality and will pave the way for the new pmemrange allocator. Based on hints from art@ and ariane@. ok ariane@, deraadt@, oga@
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-07-09Remove the VREF() macro and replaces all instances with a call to verf(),Thordur I. Bjornsson
which is exactly what the macro does. Macro's that are nothing more then: #define FUNCTION(arg) function(arg) are almost always pointless and should go away. OK blambert@ Agreed by many.
2009-06-26Fix a use after free in the pagedaemon.Owain Ainsworth
specifically, if we free a RELEASED anon, then we will first of all remove the page from the anon, free the anon, then get the next page relative to the anon page, then call uvm_pagefree(). The problem is that while we zero out anon->an_page, we do not zero out pg->uanon. Now, uvm_pagefree() if pg->uanon is not NULL zeroes out some variables in the struct for us. One of the backed out commits added more zeroing there which would have exacerbated this use after free under heavy paging (which was where we saw bugs). Fix this by zeroing out pg->uanon. I have looked for other similar cases, but have not found any as of yet. been in snaps a while, "please do commit that" deraadt@
2009-06-17Recommit part of miod's no-coredumps-on-ramdisks diff that got lost in theMark Kettenis
big uvm backout mess. ok miod@
2009-06-17date based reversion of uvm to the 4th May.Owain Ainsworth
More backouts in line with previous ones, this appears to bring us back to a stable condition. 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-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 the PG_RELEASED changes.Owain Ainsworth
This is for the same reason as the earlier backouts, to avoid the bug either added or exposed sometime around c2k9. This *should* be the last one. prompted by deraadt@ ok ariane@
2009-06-16Backout pmemrange (which to most people is more well known as physmemAriane van der Steldt
allocator). "i can't see any obvious problems" oga
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-15Back out all the buffer cache changes I committed during c2k9. This reverts ↵Bob Beck
three commits: 1) The sysctl allowing bufcachepercent to be changed at boot time. 2) The change moving the buffer cache hash chains to a red-black tree 3) The dynamic buffer cache (Which depended on the earlier too). ok on the backout from marco and todd
2009-06-14backout:Theo de Raadt
> extend uvm_page_physload to have the ability to add "device" pages to the > system. since it was overlayed over a system that we warned would go "in to be tested, but may be pulled out". oga, you just made me spend 20 minutes of time I should not have had to spend doing this.
2009-06-14Noone else ever saw this diff except oga and ariane, so that is anTheo de Raadt
utter failure of process.
2009-06-14back out the free vs dirty fix, because pmemrange will go soon tooTheo de Raadt
2009-06-14backout the assert diff in 1.5Theo de Raadt
2009-06-12Add asserts on free memory, double free and while here, fix 1 assert.Ariane van der Steldt
Also de-inline functions. This diff is intended to ease debugging. Once the current bug is fixed, proper inlining will be redone. ok: oga
2009-06-10Fix: Clean and dirty pages had the memtype ids and the desparate case failedAriane van der Steldt
to function properly in the fast-allocation path (should not have triggered). ok: oga, deraadt
2009-06-09correct loop in debug code to not use an uninitialised page. it wasOwain Ainsworth
ass-backwards. afaik this was found by the LLVM CLang static analyser. ok ariane@ a couple of days ago.
2009-06-07extend uvm_page_physload to have the ability to add "device" pages to theOwain Ainsworth
system. This is needed in the case where you need managed pages so you can handle faulting and pmap_page_protect() on said pages when you manage memory in such regions (i'm looking at you, graphics cards). these pages are flagged PG_DEV, and shall never be on the freelists, assert this. behaviour remains unchanged in the non-device case, specifically for all archs currently in the tree we panic if called after bootstrap. ok art@, kettenis@, ariane@, beck@.
2009-06-06Somehow I missed comitting this.Artur Grabowski
2009-06-06We need miod's no-coredumps-on-ramdisks diff, because we have grown theTheo de Raadt
media just a wee bit too much.
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-06Add uvm_objwire() and uvm_objunwire(), I need this for some of my crazyOwain Ainsworth
shitz. Code mostly from netbsd with some tweaks from me. The loaning case is specifcically if 0ed out right now because we do not do loaning. ok ariane@, art@.
2009-06-05Dynamic buffer cache sizing.Bob Beck
This commit won't change the default behaviour of the system unless the buffer cache size is increased with sysctl kern.bufcachepercent. By default our buffer cache is 10% of memory, which with this commit is now treated as a low water mark. If the buffer cache size is increased, the new size is treated as a high water mark and the buffer cache is permitted to grow to that percentage of memory. If the page daemon is invoked, the page daemon will ask the buffer cache to relenquish pages. if the buffer cache has more than the low water mark it will relenquish pages allowing them to be consumed by uvm. after a short period the buffer cache will attempt to re-grow back to the high water mark. This permits the use of a large buffer cache without penalizing the available memory for other purposes. Above the low water mark the buffer cache remains entirely subservient to the page daemon, so if uvm requires pages, the buffer cache will abandon them. ok art@ thib@ oga@
2009-06-04don't grab the lock just to read uvmexp.free.Owain Ainsworth
"that's retarded" art@.
2009-06-04remove redefinitions of static and __inline arianeJonathan Gray
says were debugging leftovers. ok ariane@
2009-06-03add a flexible buffer queue (bufq) api, based on the never usedThordur I. Bjornsson
one by tedu@. It doesn't do anything smart yet, it just uses plain old disksort. we also keep the old method of queueing bufs since some miods have crazy MD drivers that need some love. ok beck@, art@ tested by many on many archs.
2009-06-03phys allocator fix: zeroed pages are not clean.Ariane van der Steldt
2009-06-02Instead of the global hash table with the terrible hashfunction and aOwain Ainsworth
global lock, switch the uvm object pages to being kept in a per-object RB_TREE. Right now this is approximately the same speed, but cleaner. When biglock usage is reduced this will improve concurrency due to lock contention.. ok beck@ art@. Thanks to jasper for the speed testing.
2009-06-02Clear PQ_ENCRYPT flag on uvm_pagefree, because free pages are by definitionAriane van der Steldt
not encrypted.
2009-06-01Deal with wraparound when checking RLIMIT_DATA.Todd C. Miller
OK guenther@ otto@
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-06-01physmem allocator: change the view of free memory from single free pagesAriane van der Steldt
to free ranges. Classify memory based on region with associated use-counter (which is used to construct a priority list of where to allocate memory). Based on code from tedu@, help from many. Ok art@
2009-05-30in the (currently unused) loaning case for uvm_anfree, zero out anon->an_pageOwain Ainsworth
so we won't hit the kassert a little bit below it. "obviously better than what is there now" beck@
2009-05-23More PG_RELEASED cleaning.Owain Ainsworth
similar to the aobj.c changes, this one does vnodes. Vnodes are more complex because they actaully have to sync to backing store. So firstly, convert sync to sleep instead of setting released. Now, for backing store, in the PGO_FREE case, if we set PG_RELEASED *before* an async io, (nothing else will see it, the page is busy), then we can ignore the page after the io is done. We could do something similar for PGO_DEACTIVATE too, but that is another change. On error we just clear the released flag, nothing else sets it for uobj pages other than aiodoned. ok thib@, beck@, ariane@
2009-05-12Convert the udv_lock for the list of uvm_device objects over to a mutex.Owain Ainsworth
ok thib@, weingart@.
2009-05-08Clear PQ_AOBJ at pageremove: when a page is no longer part of a uvm_object,Ariane van der Steldt
it is also not part of an aobj. Clear anon flags at pagefree: page is no longer part of an anon. ok oga
2009-05-08Remove static qualifier of functions that are not inline.Ariane van der Steldt
Makes trace in ddb useful. ok oga
2009-05-05Second step of PG_RELEASED cleanup.Owain Ainsworth
uvm_km deals with kernel memory which is either part of one of the kernel maps, or the main kernel object (a uao). If on km_pgremove we hit a busy page, just sleep on it, if so there's some async io (and that is unlikely). we can remove the check for uvm_km_alloc1() for a released page since now we will never end up with a removed but released page in the kernel map (due to the other chunk and the last diff). ok ariane@. Diff survived several make builds, on amd64 and sparc64, also forced paging with ariane's evil program.