summaryrefslogtreecommitdiff
path: root/sys/kern/subr_pool.c
AgeCommit message (Collapse)Author
2004-05-27change uvm_km_getpage to take waitok argument and sleep if appropriate.Ted Unangst
change both the nointr and default pool allocators to using uvm_km_getpage. change pools to default to a maxpages value of 8, so they hoard less memory. change mbuf pools to use default pool allocator. pools are now more efficient, use less of kmem_map, and a bit faster. tested mcbride, deraadt, pedro, drahn, miod to work everywhere
2003-11-18faster pools. split pagelist into full, partial, and empty so we find whatTed Unangst
we're looking for. change small page_header hash table to a splay tree. from Chuck Silvers. tested by brad grange henning mcbride naddy otto
2002-12-20 - Clean up the defines in pool.hArtur Grabowski
- Allow a pool to be initialized with PR_DEBUG which will cause it to allocate with malloc_debug. - sprinkle some splassert.
2002-12-11 - Call uvm_km_alloc_poolpage1 directly, no need to go through the macro.Artur Grabowski
- uvm_km_alloc_poolpage1 has its own spl protection, no need to add additional layer around it.
2002-10-27Reduce diff to NetBSD.Artur Grabowski
One relevant change: round up pool element size to the alignment. VS: ----------------------------------------------------------------------
2002-10-14- Do not try to drain other pools if PR_NOWAIT and the allocator can'tArtur Grabowski
give us pages. PR_NOWAIT most likely means "hey, we're coming from an interrupt, don't mess with stuff that doesn't have proper protection". - pool_allocator_free is called in too many places so I don't feel comfortable without that added protection from splvm (and besides, pool_allocator_free is rarely called anyway, so the extra spl will be unnoticeable). It shouldn't matter when fiddling with those flags, but you never know. - Remove a wakeup without a matching tsleep. It's a left-over from some other code path that I've been investigating when reworking the pool a while ago and it should have been removed before that commit. deraadt@ ok
2002-10-13Remove more '\n's from panic() statements. From Chris Kuethe.Kenneth R Westerback
2002-10-12Remove more '\n's from panic() statements. Both trailing and leading.Kenneth R Westerback
Diff generated by Chris Kuethe.
2002-07-23Fix yet another braino.Artur Grabowski
Just because the pool allocates from intrsafe memory doesn't mean that the pool has to be protected by splvm. We can have an intrsafe pools at splbio or splsoftnet. pool_page_alloc and pool_page_free must du their own splvm protection.
2002-07-23Please tell me what crack I've been smoking when I did that.Artur Grabowski
When trying the drain hook just in pool_allocator_alloc, don't leak memory when the drain succeeds and don't avoid draining other pools if this pool doesn't have a drain hook.
2002-06-09different magics for malloc and pool, art@ okNiklas Hallqvist
2002-03-14Whoops. missing simple_unlock.Artur Grabowski
From thorpej@netbsd.org
2002-02-25Make pool_sethardlimit() check that it doesn't decrease the limit belowDaniel Hartmeier
the current size of the pool. ok art@
2002-02-23Move out draining of the allocator to an own function andArtur Grabowski
let other parts of the kernel call it.
2002-02-23If the allocator has the PA_WANT flag set, return whole pages immediately.Artur Grabowski
2002-02-23Fix up some functions. Don't have static all over the placeArtur Grabowski
and don't static inline big functions that are called multiple times and are not time critical.
2002-01-29Honor the printf-like function argument in pool_printit(), instead ofMiod Vallat
using printf(). Makes ddb sessions more fruitful.
2002-01-28GC PR_STATIC and PR_MALLOCOK.Artur Grabowski
PR_MALLOC wasn't used at all in the code and PR_STATIC was missing pieces and should be solved with allocators.
2002-01-25Add a drain hook to each pool. This hook is called in three cases.Artur Grabowski
1. When a pool hit the hard limit. Just before bailing out/sleeping. 2. When an allocator fails to allocate memory (with PR_NOWAIT). 3. Just before trying to reclaim some page in pool_reclaim. The function called form the hook should try to free some items to the pool if possible. Convert m_reclaim hooks that were embedded in MCLGET, MGET and MGETHDR into a pool drain hook (making the code much cleaner).
2002-01-23Kill PR_FREEHEADER, not used anymore and confusing.Artur Grabowski
2002-01-23Pool deals fairly well with physical memory shortage, but it doesn't dealArtur Grabowski
well (not at all) with shortages of the vm_map where the pages are mapped (usually kmem_map). Try to deal with it: - group all information the backend allocator for a pool in a separate struct. The pool will only have a pointer to that struct. - change the pool_init API to reflect that. - link all pools allocating from the same allocator on a linked list. - Since an allocator is responsible to wait for physical memory it will only fail (waitok) when it runs out of its backing vm_map, carefully drain pools using the same allocator so that va space is freed. (see comments in code for caveats and details). - change pool_reclaim to return if it actually succeeded to free some memory, use that information to make draining easier and more efficient. - get rid of PR_URGENT, noone uses it.
2002-01-10Fix a locking error in pool_drain. Misc cleanup.Artur Grabowski
From NetBSD.
2002-01-10- unbreak POOL_DIAGNOSTIC.Artur Grabowski
- use ltsleep instead of simple_unlock ; tsleep
2002-01-10No more need for local define of LOCK_ASSERT.Artur Grabowski
2002-01-10Protect the pool cache magazine pool with splvm.Artur Grabowski
2002-01-10Convert some for-loops into TAILQ_FOREACH.Artur Grabowski
2001-11-06Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.Miod Vallat
(Look ma, I might have broken the tree)
2001-09-19merge vm/vm_kern.h into uvm/uvm_extern.h; art@ okMichael Shalayeff
2001-08-07We now have predict_{true,false}Artur Grabowski
2001-07-15(define simple_lock_only_held): add dummy nop macroassar
2001-06-27remove old vmArtur Grabowski
2001-06-24No need to define splvm() here anymore.Miod Vallat
art@ ok
2001-06-24Add a sysctl for getting pool information out of the kernel.Artur Grabowski
2001-06-23ooops. remove unfinished work in progress.Artur Grabowski
2001-06-23Bring in a bunch of improvements from NetBSD.Artur Grabowski
- pool_cache similar to the slab allocator in Solaris. - clean up locking a bit. - Don't pass __LINE__ and __FILE__ to pool_get and pool_put unless POOL_DIAGNOSTIC is defined.
2001-03-21Ok, I'm breaking my promise. I promised to not do anything with theArtur Grabowski
old vm system and I hoped that it would make people help me to switch all archs to uvm. But that didn't help. Fix pool to work with the old vm system (not optimal, ha!).
2001-02-19Fix LOCKDEBUG compile.Artur Grabowski
2000-12-05Bring in fresh pool from NetBSD. Some improvements and fixes.Artur Grabowski
1999-11-11Pool will not work with old vm and is only used by uvm. Remove non-uvm code.Artur Grabowski
1999-02-26pool allocator from NetBSD (stays until uvm is ready)Artur Grabowski