summaryrefslogtreecommitdiff
path: root/sys/uvm
AgeCommit message (Collapse)Author
2010-06-14tidy this file up a bit. reorder a few comments,Thordur I. Bjornsson
fix up prototypes etc. ok oga@
2010-06-10fix typos in comments: lineair -> linear.Thordur I. Bjornsson
2010-06-10the pagedaemon sleeps on uvm.pagedaemon notThordur I. Bjornsson
uvm.pagedaemon_proc, do the wakeup on the right ident. this had been fixed, but the fix got backed out during The Big Backout. ok oga@
2010-06-09Move the prototype for uvm_wait() to uvm_extern.h and removeThordur I. Bjornsson
uvm_pdaemon.h has it was only holding that one prototype. OK art@, oga@, miod@, deraadt@
2010-05-21Fix a locking problem in mincore where it was possible for us to sleepOwain Ainsworth
with a spinlock (even vslocked() buffers may fault in the right (complicated) situation). We solve this by preallocating a bounded array for the response and copying the data out when all locks have been released. ok thib@, beck@
2010-05-18dont let sys/ioctl.h imply that you get the ioctls in dkio.h. thisDavid Gwynne
gets rid of #include <sys/dkio.h> in sys/ioctl.h and adds #include <sys/dkio.h> to the places that actually want and use the disk ioctls. this became an issue when krw@'s X build failed when he was testing a change to dkio.h. tested by krw@ help from and ok miod@
2010-05-01Unbreak ramdisks.Owain Ainsworth
I forgot that uvm_object.c wasn't build if SMALL_KERNEL. Fix this by building the file unconditionally and only building the less used functions when SMALL_KERNEL is not defined. unbreaks ramdisk build. ok jsg@
2010-04-30Right now, if anything internal changes with a uvm object, diverseOwain Ainsworth
places in the tree need to be touched to update the object initialisation with respect to that. So, make a function (uvm_initobj) that takes the refcount, object and pager ops and does this initialisation for us. This should save on maintainance in the future. looked good to fgs@. Tedu complained about the British spelling but OKed it anyway.
2010-04-30Prevent a possible case of lock recursion in swapoff.Owain Ainsworth
If when we have successfully swapped an aobj back in, then we release our reference count, and that reference is the last reference, we will free the the aobj and recursively lock the list lock. Fix this by keeping track of the last object we had a reference on, and releasing the refcount the next time we unlock the list lock. Put a couple of comments in explaining lock ordering in this file. noticed by, discussed with and ok guenther@.
2010-04-26cut down simple locks (so simple that they don't even lock) to the pointTheo de Raadt
where there is almost nothing left to them, so that we can continue getting rid of them ok oga
2010-04-25Switch uao_list_lock protecting the uao list (for create, destroy andOwain Ainsworth
most importantly swapoff) over to a mutex. No idea how many times i've written this diff in the past. ok deraadt@
2010-04-23Fix null-pointer dereference.Ariane van der Steldt
ok oga
2010-04-23remove unnecessary temp_entry variables and hoist simple check out of a loop.Ted Unangst
no functional change. from Anton Maksimenkov
2010-04-22Committing on behalf or ariane@.Owain Ainsworth
recommit pmemrange: physmem allocator: change the view of free memory from single free pages 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. Useable now that bugs have been found and fixed in most architecture's pmap.c ok by everyone who has done a pmap or uvm commit in the last year.
2010-04-21the atomic primitives are still impossible to get at without using proc.hTheo de Raadt
(because it pulls in so much of the world) so include it for now, but mark it XXX ok tedu
2010-04-20remove proc.h include from uvm_map.h. This has far reaching effects, asTed Unangst
sysctl.h was reliant on this particular include, and many drivers included sysctl.h unnecessarily. remove sysctl.h or add proc.h as needed. ok deraadt
2010-03-24Bring back PHYSLOAD_DEVICE for uvm_page_physload.Owain Ainsworth
ok kettenis@ beck@ (tentatively) and ariane@. deraadt asked for it to be commited now. original commit message: extend uvm_page_physload to have the ability to add "device" pages to the 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@, beck@
2010-02-12introduce a uvm_km_valloc_try function that won't get a lower level lockTed Unangst
for use by the uvm pseg code. this is the path of least resistance until we sort out how many of these functions we really need. problem found by mikeb ok kettenis oga
2009-11-25something hairy happened with cvs so this file didn't get added.Owain Ainsworth
re-add uvm_objwire and uvm_objunwire. "you may commit that" kettenis@ original diff oked by ariane@ and art@
2009-11-25re-add uvm_objwire and uvm_objunwire. needed for intel GEM support.Owain Ainsworth
It was backed out as part of the date-based revert after c2k9. "you can commit that" kettenis@ original diff oked by ariane@, art@.
2009-11-24Proper check for wrapping high address and setting the break below theOtto Moerbeek
base of data; with nicm@ ok miod@ guenther@
2009-10-14Fix buffer cache backoff in the page daemon - deal with inactive pages toBob Beck
more correctly reflect the new state of the world - that is - how many pages can be cheaply reclaimed - which now includes clean buffer cache pages. This change fixes situations where people would be running with a large bufcachepercent, and still notice swapping without the buffer cache backing off. ok oga@, testing by many on tech@ and others. Thanks.
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