summaryrefslogtreecommitdiff
path: root/sys/kern/subr_pool.c
AgeCommit message (Collapse)Author
2010-11-03pool_sethardlimit should not imply pool_sethiwat; figured out with claudioMike Belopuhov
ok claudio tedu
2010-09-26unify some pool and malloc flag values. the important bit is that all flagsTed Unangst
have real values, no 0 values anymore. ok deraadt kettenis krw matthew oga thib
2010-09-21Add assertwaitok(9) to declare code paths that assume they can sleep.Matthew Dempsky
Currently only checks that we're not in an interrupt context, but will soon check that we're not holding any mutexes either. Update malloc(9) and pool(9) to use assertwaitok(9) as appropriate. "i like it" art@, oga@, marco@; "i see no harm" deraadt@; too trivial for me to bother prying actual oks from people.
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-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-06-29Add a no_constraint uvm_constraint_range; use it in the pool code.Thordur I. Bjornsson
ok tedu@, beck@, 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-17aligment -> alignmentMiod Vallat
2010-01-16When allocating from the item header pool, we can't sleep, as we may be ↵Ted Unangst
holding a mutex which won't be released. From Christian Ehrhardt. While here, fix another buglet: no need to pass down PR_ZERO either, as noticed by blambert@.
2009-09-05sync comment to reality, off-page page headers go intoThordur I. Bjornsson
an RB tree, not into a hashtable.
2009-08-26add commented out options for PAGEFASTRECYCLE, KVA_GUARDPAGES, shuffle VFSDEBUGThordur I. Bjornsson
around and add POOL_DEBUG as an enabled option, removing the define from subr_pool.c. comments & ok deraadt@.
2009-08-13add a show all vnodes command, use dlg's nice pool_walk() to accomplishThordur I. Bjornsson
this. ok beck@, dlg@
2009-08-09Use an RB tree instead of a SPLAY tree for the page headers tree.Thordur I. Bjornsson
ok beck@, dlg@
2009-07-30We enable POOL_DEBUG (except in a release)Theo de Raadt
2009-06-24turn off POOL_DEBUG as we go into release; pointed out by mpfTheo de Raadt
2009-06-12rework pool_get() a bit so that if you call if with a constructor setOwain Ainsworth
*and* PR_ZERO in flags, you will no longer zero our your nicely constructed object. Instead, now if you have a contructor set, and you set PR_ZERO, you will panic (it's invalid due to how constructor work). ok miod@ deraadt@ on earlier versions of the diff. ok tedu@ after he pointed out a couple of places I messed up. Problem initally noticed by ariane@ a while ago.
2009-06-04POOL_DEBUG and DIAGNOSTIC should be better friendsTheo de Raadt
2009-06-04the POOL_DEBUG checks needed to be more friendly with DIAGNOSTICTheo de Raadt
2009-06-04enable POOL_DEBUG again just for the hackathon.Owain Ainsworth
slackers now get more bugs to fix, yay! discussed with deraadt@.
2009-05-31Move splassert checks from pool_do_get to pool_get(). Since the formerMiod Vallat
is invoked with the pool mutex held, the asserts are satisfied by design. ok tedu@
2009-04-22initialise the constructor and destructor function pointers to NULLDavid Gwynne
in pool_init so you the pool struct doesn't have to be zeroed before you init it.
2009-02-17ensure all pi_magic checks are inside DIAGNOSTICTheo de Raadt
2009-02-16at tedu's request, bring back the basic single "first word" PI_MAGIC checkTheo de Raadt
since it is essentially free. To turn on the checking of the rest of the allocation, use 'option POOL_DEBUG' ok tedu
2009-02-16Disable pool debug stuff for the release (it has a performance hit, butTheo de Raadt
between releases we may want to turn it on, since it has uncovered real bugs) ok miod henning etc etc
2008-12-23i got emptypages and fullpages mixed up in pool_walk. this now shows itemsDavid Gwynne
in fullpages that have been allocated. spotted by claudio@
2008-12-23add pool_walk as debug code.David Gwynne
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@
2008-12-23record the offset into each pool page that item allocations actually beginDavid Gwynne
on, aka, its coloring. ok tedu@
2008-12-04Put back the support for pools > PAGE_SIZE. This time the compare functionArtur Grabowski
works and there's even some sanity checks that it actually returns what we expect it to return.
2008-11-25Back out the large page pools for now. The compare function isArtur Grabowski
borked and instead of stressing to figure out how to fix it, I'll let peoples kernels to work.
2008-11-25Make sure that equal elements always compare equal. Logic error spottedArtur Grabowski
by otto@ ok otto@
2008-11-24Protect kmem_map allocations with splvm.Artur Grabowski
This should make dlg happy.
2008-11-24Allow allocations larger than PAGE_SIZE from pools.Artur Grabowski
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@
2008-11-22Do deadbeef-style protection in pools too, by default, even though it itTheo de Raadt
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
2008-10-31accidental commit ... backoutTheo de Raadt
2008-10-31kern_sysctl.cTheo de Raadt
2008-10-24yet again i prove unable to commit what i really wanted. spotted by deraadtTed Unangst
2008-10-23a better fix for the "uvm_km thread runs out of memory" problem.Ted Unangst
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
2008-06-26First pass at removing clauses 3 and 4 from NetBSD licenses.Ray Lai
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@
2008-06-14oldnointr pool allocator is no longer used or necessary.Artur Grabowski
2008-05-16unsigned -> u_int and warnmess -> warnmsgThordur I. Bjornsson
for pool_sethardlimit. prodded by and ok tedu@
2008-05-06Add a PR_ZERO flag for pools, to compliment the M_ZEROThordur I. Bjornsson
malloc flag, does the same thing. use it in a few places. OK tedu@, "then go ahead. and don't forget the manpage (-:" miod@
2007-12-11remove an overlooked simple_lock everybody likes to point out to me.Ted Unangst
2007-12-11release the pool mutex if we may sleep in the backendTed Unangst
2007-12-09big patch to simplify pool code.Ted Unangst
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
2007-08-16I don't really know what I was thinking when I wrote this. Not only does theArtur Grabowski
"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
2007-05-28some remnants of the timestamping code i missedTed Unangst
2007-05-28remove time from pool header. it slows us down quite a bit, and it'sTed Unangst
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
2007-05-28add a pool_setipl function, which allows setting an appropriate iplTed Unangst
for splassert inside pool_get and pool_put (DIAGNOSTIC only) ok miod pedro thib
2007-04-23Clean up an obsolete allocator.Artur Grabowski
miod@ ok
2007-04-12Allow machine-dependant overrides for the ``deadbeef'' sentinel values,Miod Vallat
and make sure that nothing can ever be mapped at theses addresses. Only i386 overrides the default for now. From mickey@, ok art@ miod@