summaryrefslogtreecommitdiff
path: root/sys/uvm
AgeCommit message (Collapse)Author
2010-07-24Don't sleep while holding the uvm_psel_lck mutex. Should fix "locking againstMark Kettenis
myself" panics that some people have seen over the last year-and-a-half. Cherry picked from a more complex (and therefore scarier) diff from oga@. ok tedu@, oga@
2010-07-22Remove the VM_KMPAGESFREE sysctl. After the pmemrangeThordur I. Bjornsson
changes it was returing a constant 0, changing to cope with those changes makes less sense then just removing as it provides the user with no usefull information. sthen@ grepped the port's tree for me and found not hits, thanks! OK deraadt@, matthew@
2010-07-15the uvm_km_putpage is calling into tangly uvm guts again on not pmap direct.Ted Unangst
go back to something more like the previous design, and have the thread do the heavy lifting. solves vmmaplk panics. ok deraadt oga thib [and even simple diffs are hard to get perfect. help from mdempsky and deraadt]
2010-07-13need pool.h to initialize the dma allocatorTheo de Raadt
2010-07-13dma_alloc() and dma_free(). This is a thin shim on top of a bag ofTheo de Raadt
pools, sized by powers of 2, which are constrained to dma memory. ok matthew tedu thib
2010-07-03Be sure to initialize b_bq member of struct buf not allocated through theMiod Vallat
regular buf routines; and now we can swap again.
2010-07-03explicitly specify flags to malloc and pool_get instead of relying on 0.Ted Unangst
This is more clear, and as thib pointed out, the default in softraid was wrong. ok thib.
2010-07-02no need to call uvm_km_free_wakup for the kernel map, uvm_km_free isThordur I. Bjornsson
enough. ok tedu@, art@
2010-07-02Don't bother trying to handle a uvm_pglistalloc failure when called withThordur I. Bjornsson
UVM_PLA_WAITOK as it will not fail; Rather assert that it didn't fail. ok tedu@, oga@
2010-07-02nuke unused global and a comment.Thordur I. Bjornsson
ok tedu@, oga@
2010-07-02Add missing pmap_update. pointed out by matthew@Artur Grabowski
2010-07-02fix corrupt UVMHIST_LOGTakuya ASADA
2010-07-02add an align argument to uvm_km_kmemalloc_pla.Artur Grabowski
Use uvm_km_kmemalloc_pla with the dma constraint to allocate kernel stacks. Yes, that means DMA is possible to kernel stacks, but only until we've fixed all the scary drivers. deraadt@ ok
2010-07-02Drop the uvm_km_pages.mtx mutex in uvm_km_putpage before we free va's,Thordur I. Bjornsson
as calls to uvm_km_free_wakup can end up in uvm_mapent_alloc which tries to grab this mutex. ok tedu@
2010-07-01We don't do CamelCase: fix style(9) violations in goto labels.Owain Ainsworth
no binary change.
2010-07-01Implement vs{,un}lock_device and use it for physio.Artur Grabowski
Just like normal vs{,un}lock, but in case the pages we get are not dma accessible, we bounce them, if they are dma acessible, the functions behave exactly like normal vslock. The plan for the future is to have fault_wire allocate dma acessible pages so that we don't need to bounce (especially in cases where the same buffer is reused for physio over and over again), but for now, keep it as simple as possible.
2010-07-01Allow swapping to happen in the case where where we have more memoryOwain Ainsworth
than we can realistically dma to. In the swap encrypt case we already bounce through a intermediate buffer for pageout, so just make sure that that buffer is constrained to dmaable memory. In the other cases we check to see if the memory is dmaable, then if not we bounce it. ok beck@, art@, thib@.
2010-06-30knf function decleration nit.Thordur I. Bjornsson
2010-06-29Add PADDR_IS_DMA_REACHABLE macro so art stops whiningThordur I. Bjornsson
2010-06-29skip empty ranges in uvm_pmr_assertvalid;Thordur I. Bjornsson
ok oga@
2010-06-29Add a no_constraint uvm_constraint_range; use it in the pool code.Thordur I. Bjornsson
ok tedu@, beck@, oga@
2010-06-28Move uvm_km_pages struct declaration and watermark bounds to uvm_km.h, soMiod Vallat
that md code can peek at it, and update m68k !__HAVE_PMAP_DIRECT setup code to the recent uvm_km changes. ok thib@
2010-06-27Kill another #ifdef UBC chunk that was annoying me while doing somethingOwain Ainsworth
else. ok thib@
2010-06-27doh! Use pmap_kenter/pmap_kremove in the backend page allocator to preventThordur I. Bjornsson
recursion in pmap_enter as seen on zaurus. ok art@ also, release a the uvm_km_page.mtx before calling uvm_km_kmemalloc as we can sleep there. ok oga@
2010-06-27uvm constraints. Add two mandatory MD symbols, uvm_md_constraintsThordur I. Bjornsson
which contains the constraints for DMA/memory allocation for each architecture, and dma_constraints which contains the range of addresses that are dma accessable by the system. This is based on ariane@'s physcontig diff, with lots of bugfixes and additions the following additions by my self: Introduce a new function pool_set_constraints() which sets the address range for which we allocate pages for the pool from, this is now used for the mbuf/mbuf cluster pools to keep them dma accessible. The !direct archs no longer stuff pages into the kernel object in uvm_km_getpage_pla but rather do a pmap_extract() in uvm_km_putpages. Tested heavily by my self on i386, amd64 and sparc64. Some tests on alpha and SGI. "commit it" beck, art, oga, deraadt "i like the diff" deraadt
2010-06-23Fix a bug in uvm_pmr_get1page() which could cause us to bounceThordur I. Bjornsson
between an allocating process failing and waking up the pagedaemon and the pagedaemon (since everything was dandy). Rework the do ... while () logic searching for pages of a certain memtype in a pmr into a while () loop where we check if we've found enough pages and break out of the pmr and check the memtype inside the loop. This prevents us from doing an early return without enough pages for the caller even though more pages exist. comments and help from oga, style nit from miod. OK miod@, oga@
2010-06-17aligment -> alignmentMiod Vallat
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