summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_pool.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* POOL_DEBUG and DIAGNOSTIC should be better friendsderaadt2009-06-041-4/+4
|
* the POOL_DEBUG checks needed to be more friendly with DIAGNOSTICderaadt2009-06-041-4/+4
|
* enable POOL_DEBUG again just for the hackathon.oga2009-06-041-1/+2
| | | | | | slackers now get more bugs to fix, yay! discussed with deraadt@.
* Move splassert checks from pool_do_get to pool_get(). Since the formermiod2009-05-311-8/+6
| | | | | | is invoked with the pool mutex held, the asserts are satisfied by design. ok tedu@
* initialise the constructor and destructor function pointers to NULLdlg2009-04-221-1/+6
| | | | | in pool_init so you the pool struct doesn't have to be zeroed before you init it.
* ensure all pi_magic checks are inside DIAGNOSTICderaadt2009-02-171-2/+4
|
* at tedu's request, bring back the basic single "first word" PI_MAGIC checkderaadt2009-02-161-16/+21
| | | | | | since it is essentially free. To turn on the checking of the rest of the allocation, use 'option POOL_DEBUG' ok tedu
* Disable pool debug stuff for the release (it has a performance hit, butderaadt2009-02-161-14/+17
| | | | | | between releases we may want to turn it on, since it has uncovered real bugs) ok miod henning etc etc
* i got emptypages and fullpages mixed up in pool_walk. this now shows itemsdlg2008-12-231-2/+2
| | | | | | in fullpages that have been allocated. spotted by claudio@
* add pool_walk as debug code.dlg2008-12-231-1/+38
| | | | | | | this can be used to walk over all the items allocated with a pool and have them examined by a function the caller provides. with help from and ok tedu@
* record the offset into each pool page that item allocations actually begindlg2008-12-231-1/+3
| | | | | | on, aka, its coloring. ok tedu@
* Put back the support for pools > PAGE_SIZE. This time the compare functionart2008-12-041-20/+125
| | | | | works and there's even some sanity checks that it actually returns what we expect it to return.
* Back out the large page pools for now. The compare function isart2008-11-251-120/+20
| | | | | borked and instead of stressing to figure out how to fix it, I'll let peoples kernels to work.
* Make sure that equal elements always compare equal. Logic error spottedart2008-11-251-3/+5
| | | | | by otto@ ok otto@
* Protect kmem_map allocations with splvm.art2008-11-241-3/+12
| | | | This should make dlg happy.
* Allow allocations larger than PAGE_SIZE from pools.art2008-11-241-21/+110
| | | | | | | | | | | | This is solved by special allocators and an obfuscated compare function for the page header splay tree and some other minor adjustments. At this moment, the allocator will be picked automagically by pool_init and you can get a kernel_map allocator if you specify PR_WAITOK in flags (XXX), default is kmem_map. This will be changed in the future once the allocator code is slightly reworked. But people want to use it now. "nag nag nag nag" dlg@
* Do deadbeef-style protection in pools too, by default, even though it itderaadt2008-11-221-51/+68
| | | | | | | is a lot slower. Before release this should be backed out, but for now we need everyone to run with this and start finding the use-after-free style bugs this exposes. original version from tedu ok everyone in the room
* accidental commit ... backoutderaadt2008-10-311-70/+50
|
* kern_sysctl.cderaadt2008-10-311-50/+70
|
* yet again i prove unable to commit what i really wanted. spotted by deraadttedu2008-10-241-24/+5
|
* a better fix for the "uvm_km thread runs out of memory" problem.tedu2008-10-231-16/+42
| | | | | | | | | | | | add a new arg to the backend so it can tell pool to slow down. when we get this flag, yield *after* putting the page in the pool's free list. whatever we do, don't let the thread sleep. this makes things better by still letting the thread run when a huge pf request comes in, but without artificially increasing pressure on the backend by eating pages without feeding them forward. ok deraadt
* First pass at removing clauses 3 and 4 from NetBSD licenses.ray2008-06-261-8/+1
| | | | | | | | | Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
* oldnointr pool allocator is no longer used or necessary.art2008-06-141-26/+5
|
* unsigned -> u_int and warnmess -> warnmsgthib2008-05-161-3/+3
| | | | | | for pool_sethardlimit. prodded by and ok tedu@
* Add a PR_ZERO flag for pools, to compliment the M_ZEROthib2008-05-061-2/+5
| | | | | | | malloc flag, does the same thing. use it in a few places. OK tedu@, "then go ahead. and don't forget the manpage (-:" miod@
* remove an overlooked simple_lock everybody likes to point out to me.tedu2007-12-111-3/+1
|
* release the pool mutex if we may sleep in the backendtedu2007-12-111-2/+10
|
* big patch to simplify pool code.tedu2007-12-091-800/+97
| | | | | | | | | | | | | remove pool_cache code. it was barely used, and quite complex. it's silly to have both a "fast" and "faster" allocation interface. provide a ctor/dtor interface, and convert the few cache users to use it. no caching at this time. use mutexes to protect pools. they should be initialized with pool_setipl if the pool may be used in an interrupt context, without existing spl protection. ok art deraadt thib
* I don't really know what I was thinking when I wrote this. Not only does theart2007-08-161-2/+2
| | | | | | | | | "array" index start at 1, the code also abused index 0 to detect that we were doing a KERN_POOL_NPOOLS. Just look at *name == KERN_POOL_NPOOLS instead of using index == 0 for that. deraadt@ ok
* some remnants of the timestamping code i missedtedu2007-05-281-7/+1
|
* remove time from pool header. it slows us down quite a bit, and it'stedu2007-05-281-19/+3
| | | | | | | probably a better idea to just let reclaim have the emptypages. we can still use the partial pages. this lets dlg sling many many more packets ok dlg henning miod pedro ryan
* add a pool_setipl function, which allows setting an appropriate ipltedu2007-05-281-1/+16
| | | | | for splassert inside pool_get and pool_put (DIAGNOSTIC only) ok miod pedro thib
* Clean up an obsolete allocator.art2007-04-231-22/+1
| | | | miod@ ok
* Allow machine-dependant overrides for the ``deadbeef'' sentinel values,miod2007-04-121-1/+5
| | | | | | | | and make sure that nothing can ever be mapped at theses addresses. Only i386 overrides the default for now. From mickey@, ok art@ miod@
* Instead of managing pages for intrsafe maps in special objects (aka.art2007-04-111-3/+2
| | | | | | | | kmem_object) just so that we can remove them, just use pmap_extract to get the pages to free and simplify a lot of code to not deal with the list of intrsafe maps, intrsafe objects, etc. miod@ ok
* typos from bret lambert;jmc2006-11-171-4/+4
|
* add show all pools command listing all pools as vmstat -m does; miod@ okmickey2006-05-201-1/+77
|
* remove drain hooks from pool.tedu2006-05-071-149/+5
| | | | | | | | | | | | | | | 1. drain hooks and lists of allocators make the code complicated 2. the only hooks in the system are the mbuf reclaim routines 3. if reclaim is actually able to put a meaningful amount of memory back in the system, i think something else is dicked up. ie, if reclaiming your ip fragment buffers makes the difference thrashing swap and not, your system is in a load of trouble. 4. it's a scary amount of code running with very weird spl requirements and i'd say it's pretty much totally untested. raise your hand if your router is running at the edge of swap. 5. the reclaim stuff goes back to when mbufs lived in a tiny vm_map and you could run out of va. that's very unlikely (like impossible) now. ok/tested pedro krw sturm
* proper condition for freeing a page and fix a comment appropriately; art@ tedu@ okmickey2004-07-291-2/+2
|
* ifdef DDB a few functions only used (or usable) from DDB.art2004-07-201-1/+5
|
* 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
|