summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_pool.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* This moves access to wall and uptime variables in MI code,tholo2004-06-241-8/+3
| | | | | | | | | | | | | | encapsulating all such access into wall-defined functions that makes sure locking is done as needed. It also cleans up some uses of wall time vs. uptime some places, but there is sure to be more of these needed as well, particularily in MD code. Also, many current calls to microtime() should probably be changed to getmicrotime(), or to the {,get}microuptime() versions. ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others "Oh, that is not your problem!" from miod@
* debranch SMP, have funniklas2004-06-131-6/+7
|
* rearrange the allocators we provide for general use.tedu2004-06-021-15/+36
| | | | | | | | the new one remains the default and _nointr. _kmem is restored to its former position, and _oldnointr is introduced. this is to allow some pool users who don't like the new allocator to continue working. testing/ok beck@ cedric@
* change uvm_km_getpage to take waitok argument and sleep if appropriate.tedu2004-05-271-8/+6
| | | | | | | | 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
* faster pools. split pagelist into full, partial, and empty so we find whattedu2003-11-181-188/+211
| | | | | | 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
* - Clean up the defines in pool.hart2002-12-201-1/+31
| | | | | | - Allow a pool to be initialized with PR_DEBUG which will cause it to allocate with malloc_debug. - sprinkle some splassert.
* - Call uvm_km_alloc_poolpage1 directly, no need to go through the macro.art2002-12-111-11/+4
| | | | | - uvm_km_alloc_poolpage1 has its own spl protection, no need to add additional layer around it.
* Reduce diff to NetBSD.art2002-10-271-41/+34
| | | | | One relevant change: round up pool element size to the alignment. VS: ----------------------------------------------------------------------
* - Do not try to drain other pools if PR_NOWAIT and the allocator can'tart2002-10-141-2/+6
| | | | | | | | | | | | | | | | | 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
* Remove more '\n's from panic() statements. From Chris Kuethe.krw2002-10-131-2/+2
|
* Remove more '\n's from panic() statements. Both trailing and leading.krw2002-10-121-4/+4
| | | | Diff generated by Chris Kuethe.
* Fix yet another braino.art2002-07-231-2/+11
| | | | | | | | 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.
* Please tell me what crack I've been smoking when I did that.art2002-07-231-7/+7
| | | | | | 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.
* different magics for malloc and pool, art@ okniklas2002-06-091-2/+2
|
* Whoops. missing simple_unlock.art2002-03-141-1/+2
| | | | From thorpej@netbsd.org
* Make pool_sethardlimit() check that it doesn't decrease the limit belowdhartmei2002-02-251-5/+14
| | | | the current size of the pool. ok art@
* Move out draining of the allocator to an own function andart2002-02-231-38/+54
| | | | let other parts of the kernel call it.
* If the allocator has the PA_WANT flag set, return whole pages immediately.art2002-02-231-2/+3
|
* Fix up some functions. Don't have static all over the placeart2002-02-231-14/+17
| | | | | and don't static inline big functions that are called multiple times and are not time critical.
* Honor the printf-like function argument in pool_printit(), instead ofmiod2002-01-291-3/+3
| | | | using printf(). Makes ddb sessions more fruitful.
* GC PR_STATIC and PR_MALLOCOK.art2002-01-281-26/+4
| | | | | PR_MALLOC wasn't used at all in the code and PR_STATIC was missing pieces and should be solved with allocators.
* Add a drain hook to each pool. This hook is called in three cases.art2002-01-251-2/+52
| | | | | | | | | | | | 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).
* Kill PR_FREEHEADER, not used anymore and confusing.art2002-01-231-4/+1
|
* Pool deals fairly well with physical memory shortage, but it doesn't dealart2002-01-231-102/+206
| | | | | | | | | | | | | | | | | | 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.
* Fix a locking error in pool_drain. Misc cleanup.art2002-01-101-30/+63
| | | | From NetBSD.
* - unbreak POOL_DIAGNOSTIC.art2002-01-101-10/+5
| | | | - use ltsleep instead of simple_unlock ; tsleep
* No more need for local define of LOCK_ASSERT.art2002-01-101-2/+1
|
* Protect the pool cache magazine pool with splvm.art2002-01-101-1/+7
|
* Convert some for-loops into TAILQ_FOREACH.art2002-01-101-22/+11
|
* Replace inclusion of <vm/foo.h> with the correct <uvm/bar.h> when necessary.miod2001-11-061-2/+1
| | | | (Look ma, I might have broken the tree)
* merge vm/vm_kern.h into uvm/uvm_extern.h; art@ okmickey2001-09-191-3/+1
|
* We now have predict_{true,false}art2001-08-071-3/+1
|
* (define simple_lock_only_held): add dummy nop macroassar2001-07-151-1/+2
|
* remove old vmart2001-06-271-31/+1
|
* No need to define splvm() here anymore.miod2001-06-241-2/+1
| | | | art@ ok
* Add a sysctl for getting pool information out of the kernel.art2001-06-241-10/+69
|
* ooops. remove unfinished work in progress.art2001-06-231-5/+3
|
* Bring in a bunch of improvements from NetBSD.art2001-06-231-268/+548
| | | | | | | - 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.
* Ok, I'm breaking my promise. I promised to not do anything with theart2001-03-211-2/+31
| | | | | | | 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!).
* Fix LOCKDEBUG compile.art2001-02-191-1/+4
|
* Bring in fresh pool from NetBSD. Some improvements and fixes.art2000-12-051-185/+659
|
* Pool will not work with old vm and is only used by uvm. Remove non-uvm code.art1999-11-111-22/+1
|
* pool allocator from NetBSD (stays until uvm is ready)art1999-02-261-0/+1092