summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_malloc.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* Include sys/stdint.h for SIZE_MAX instead of relying on the misplacedmillert2015-02-131-1/+2
| | | | define in sys/limits.h. OK guenther@
* convert bcopy to memcpy. ok millerttedu2014-12-101-2/+2
|
* move arc4random prototype to systm.h. more appropriate for most codetedu2014-11-181-3/+1
| | | | to include that than rdnvar.h. ok deraadt dlg
* Replace a plethora of historical protection options with justderaadt2014-11-161-2/+2
| | | | | | | PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis
* need to calculate correct size before doing the free checks. the biggesttedu2014-11-061-2/+3
| | | | | | malloc bucket isn't precise, it can have anything in it. should fix recent panics. sorry for inconvenience. ok deraadt millert
* let ramdisks compilederaadt2014-11-061-2/+5
|
* need to move lock up to prevent more than one malloc. ok guenthertedu2014-11-051-8/+6
|
* don't use loop variable (i) for not loop things. use a new var.tedu2014-11-051-4/+5
|
* use memname to print string of type. stolen from deraadttedu2014-11-051-5/+5
|
* also print type when free size is wrongtedu2014-11-051-4/+5
|
* tweak free panic messages tootedu2014-11-021-3/+3
|
* tweak panic messages for consistencytedu2014-11-021-3/+3
|
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* if the freedsize isn't zero, check that's reasonable. ok becktedu2014-07-131-2/+7
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-2/+2
| | | | after discussions with beck deraadt kettenis.
* instead of defining two versions of bucketidx, just don't inline for small.tedu2014-07-101-14/+6
| | | | ok deraadt
* Add mallocarray(9)matthew2014-07-101-2/+36
| | | | | | | While here, change malloc(9)'s size argument from "unsigned long" to "size_t". ok tedu
* pool_debug still needed for non-DIAGNOSTIC kernelsderaadt2014-07-101-2/+2
|
* hide the biglock thrashing under pool_debug so it can be turned offtedu2014-07-101-2/+2
|
* you've had 12+ years to update your kernel config.daniel2014-06-211-5/+1
| | | | ok deraadt@
* consistent use of uint32_t for poison valuestedu2014-05-191-2/+2
|
* if it's ok to wait, it must also be ok to give the kernel lock. do so.tedu2014-04-031-3/+7
| | | | | | (then immediately reacquire it). this has the effect of giving interrupts on other CPUs to a chance to run and reduces latency in many cases. ok deraadt
* Reduce uvm include madness. Use <uvm/uvm_extern.h> instead ofmpi2014-03-281-2/+2
| | | | | | <uvm/uvm.h> if possible and remove double inclusions. ok beck@, mlarkin@, deraadt@
* bzero -> memsettedu2014-01-211-3/+3
|
* Uncomment kprintf format attributes for sys/kernsyl2013-08-081-2/+2
| | | | tested on vax (gcc3) ok miod@
* permit free(NULL) to work. ok deraadttedu2013-07-041-1/+4
|
* open up some races. if pool_debug == 2, force a yield() whenever waitok.tedu2013-05-311-2/+8
| | | | ok miod
* switch the malloc and pool freelists to using xor simpleq.tedu2013-05-031-11/+13
| | | | this adds a tiny bit more protection from list manipulation.
* shuffle around some poison code, prototypes, values...tedu2013-04-061-13/+18
| | | | | allow some more pool debug code to be enabled if not compiled in bump poison size back up to 64
* separate memory poisoning code to a new file and make it usable kernel widetedu2013-03-281-48/+15
| | | | ok deraadt
* replace kern malloc's hand rolled freelist with simpleq macros.tedu2013-03-261-65/+31
| | | | ok deraadt mpi
* use PAGE_SHIFT instead of PGSHIFTderaadt2013-03-211-2/+2
|
* factor out the deadbeef code for legibility.tedu2013-03-151-37/+51
| | | | ok deraadt
* Comment out recently added __attribute__((__format__(__kprintf__))) annotationsmiod2013-02-171-2/+2
| | | | | | in MI code; gcc 2.95 does not accept such annotation for function pointer declarations, only function prototypes. To be uncommented once gcc 2.95 bites the dust.
* Add explicit __attribute__ ((__format__(__kprintf__)))) to the functions andmiod2013-02-091-5/+6
| | | | | | function pointer arguments which are {used as,} wrappers around the kernel printf function. No functional change.
* Expand the panic to show the malloc type and size. Okay deraadt@.pirofti2012-03-301-2/+3
|
* New vmmap implementation.ariane2012-03-091-3/+8
| | | | | | | | | | | | no oks (it is really a pain to review properly) extensively tested, I'm confident it'll be stable 'now is the time' from several icb inhabitants Diff provides: - ability to specify different allocators for different regions/maps - a simpler implementation of the current allocator - currently in compatibility mode: it will generate similar addresses as the old allocator
* Improve kernel malloc type checking.jsing2011-09-221-2/+2
| | | | ok deraadt@
* Backout vmmap in order to repair virtual address selection algorithmsariane2011-06-061-8/+3
| | | | outside the tree.
* push kernel malloc(9) and kernel stacks into non-dma memory, since thatderaadt2011-06-061-2/+2
| | | | | | appears to be safe now. If not, we'll know soon where the bugs lie, so that we can fix them. This diff has been in snapshots for many months. ok oga miod
* Reimplement uvm/uvm_map.ariane2011-05-241-3/+8
| | | | | | | | | | | | | vmmap is designed to perform address space randomized allocations, without letting fragmentation of the address space go through the roof. Some highlights: - kernel address space randomization - proper implementation of guardpages - roughly 10% system time reduction during kernel build Tested by alot of people on tech@ and developers. Theo's machines are still happy.
* unify some pool and malloc flag values. the important bit is that all flagstedu2010-09-261-1/+3
| | | | | have real values, no 0 values anymore. ok deraadt kettenis krw matthew oga thib
* Add assertwaitok(9) to declare code paths that assume they can sleep.matthew2010-09-211-1/+4
| | | | | | | | | | 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.
* We have this nice KMEMSTATS option to control when we use kmemstats,matthew2010-07-221-1/+3
| | | | | | so no point in reserving space for kmemstats unless it's enabled. ok thib@, deraadt@
* add an align argument to uvm_km_kmemalloc_pla.art2010-07-021-2/+2
| | | | | | | | | 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
* constrain malloc to only grab pages from dma reachable memory.thib2010-07-011-4/+6
| | | | | | | Do this by calling uvm_km_kmemalloc_pla with the dma_constraint. ok art@ (ofcourse, he eats his cereal and okeys everything). OK beck@, deraadt@
* If option DIAGNOSTIC, do not bother doing sanity checks, including anmiod2009-08-251-16/+28
| | | | | | | | uvm_map_checkprot() call, if the memory we're about to return has just been allocated with uvm_km_kmemalloc() instead of coming from the freelist. No functional change but a very small speedup when the freelist for the given bucket is empty.
* The BUCKETINDX() giant macro is used to compute the base 2 logarithm of itsmiod2009-08-251-1/+33
| | | | | | | | | input, in order to pick the appropriate malloc() bucket. Replace it with an inline function in kern_malloc.c, which will either do a tightest-but-slower loop (if option SMALL_KERNEL), or a geometric search equivalent to what the macro does, but producing smaller code (especially on platforms which can not load large constants in one instruction).
* Don't enforce a minimum size for nkmempages by default; if the computedmiod2009-02-221-2/+2
| | | | | | | value (based on physmem) is below NKMEMPAGES_MIN, we are on a low memory machine and can not afford more anyway. ok deraadt@ tedu@