Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | remove unused malloc_roundup() | 2021-02-23 | 1 | -13/+1 | |
| | |||||
* | Add trace points for malloc(9) and free(9). This makes them traceable | 2020-12-31 | 1 | -1/+7 | |
| | | | | | via dt(4) and btrace(8). OK mpi@ millert@ | ||||
* | delete strange historical FFS_SOFTUPDATES ifdef... | 2020-10-14 | 1 | -4/+4 | |
| | | | | ok millert | ||||
* | Convert infinite sleeps to {m,t}sleep_nsec(9). | 2019-12-19 | 1 | -2/+2 | |
| | | | | ok visa@ | ||||
* | Delete km_mapblocks from kmemstats and its always-zero column from the ddb | 2019-11-28 | 1 | -5/+5 | |
| | | | | | | "show malloc" output ok deraadt@ mpi@ | ||||
* | rework the zero warning slightly, and more completely disable until we're | 2019-05-15 | 1 | -8/+9 | |
| | | | | more ready to deal with the noise. | ||||
* | disable stack printing for now since at least arm64 can't print them | 2019-05-09 | 1 | -1/+3 | |
| | | | | reported by kettenis | ||||
* | print a few warnings when calling free with a zero size. | 2019-05-08 | 1 | -3/+14 | |
| | | | | | let's see what falls out. ok beck deraadt kettenis mpi | ||||
* | In free(9) call wakeup() after mtx_leave() consistently. | 2018-07-10 | 1 | -7/+12 | |
| | | | | OK kettenis@ visa@ mpi@ | ||||
* | Fix trailing whitespaces and too long line. | 2018-07-09 | 1 | -6/+6 | |
| | |||||
* | Make free(9) MP safe. It was wrong to set ku_indx to 0 after freeing | 2018-07-09 | 1 | -5/+8 | |
| | | | | | | | | | the memory in uvm. Another process could use the false 0 then. To be on the safe side, protect all access to ku_indx and ku_pagecnt with a mutex. Update ku_indx and ku_pagecnt before calling uvm_km_free(). Update ksp after uvm_km_free() to keep accounting correct. tested by sthen@; OK mpi@ visa@ deraadt@ | ||||
* | While booting it does not make sense to wait for memory, there is | 2018-01-18 | 1 | -1/+7 | |
| | | | | | | | no other process which could free it. Better panic in malloc(9) or pool_get(9) instead of sleeping forever. tested by visa@ patrick@ Jan Klemkow suggested by kettenis@; OK deraadt@ | ||||
* | Fix an off-by-one in the free(9) "passed size was too small" check: | 2018-01-02 | 1 | -3/+3 | |
| | | | | | | | | if the size passed is exactly half the size of the bucket that the allocation was actually from, then it was incorrect. problem noted by florian@ ok florian@ visa@ | ||||
* | remove MALLOC_DEBUG | 2017-11-14 | 1 | -17/+1 | |
| | | | | | | | | the code has rotted, and obviously hasnt been used for ages. it is also hard to make mpsafe. if we need something like this again it would be better to do it from scratch. ok tedu@ visa@ | ||||
* | make malloc(9) mpsafe by using a mutex instead of splvm. | 2017-07-10 | 1 | -32/+47 | |
| | | | | | | | | | | | | | this is almost a straightforward change of spl ops with mutex ops, except the accounting has been shuffled around. memory is counted as used before an attempt to allocate it from uvm is made to prevent overcommitting memory. this is modelled on how pools limit allocations. the uvm bits have been eyeballed by kettenis@ who says they should be safe. visa@ found some nits which have been fixed. tested by chris@ and amit kulkarni ok kettenis@ visa@ mpi@ | ||||
* | Assert that the calling CPU is holding the KERNEL_LOCK() in malloc(9) | 2017-06-07 | 1 | -1/+7 | |
| | | | | | | | | | and free(9). The exception is at early boot when only one CPU is running since we grab the KERNL_LOCK() relatively late in main(). ok kettenis@ | ||||
* | Remove some includes include-what-you-use claims don't | 2015-03-14 | 1 | -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 misplaced | 2015-02-13 | 1 | -1/+2 | |
| | | | | define in sys/limits.h. OK guenther@ | ||||
* | convert bcopy to memcpy. ok millert | 2014-12-10 | 1 | -2/+2 | |
| | |||||
* | move arc4random prototype to systm.h. more appropriate for most code | 2014-11-18 | 1 | -3/+1 | |
| | | | | to include that than rdnvar.h. ok deraadt dlg | ||||
* | Replace a plethora of historical protection options with just | 2014-11-16 | 1 | -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 biggest | 2014-11-06 | 1 | -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 compile | 2014-11-06 | 1 | -2/+5 | |
| | |||||
* | need to move lock up to prevent more than one malloc. ok guenther | 2014-11-05 | 1 | -8/+6 | |
| | |||||
* | don't use loop variable (i) for not loop things. use a new var. | 2014-11-05 | 1 | -4/+5 | |
| | |||||
* | use memname to print string of type. stolen from deraadt | 2014-11-05 | 1 | -5/+5 | |
| | |||||
* | also print type when free size is wrong | 2014-11-05 | 1 | -4/+5 | |
| | |||||
* | tweak free panic messages too | 2014-11-02 | 1 | -3/+3 | |
| | |||||
* | tweak panic messages for consistency | 2014-11-02 | 1 | -3/+3 | |
| | |||||
* | remove uneeded proc.h includes | 2014-09-14 | 1 | -2/+1 | |
| | | | | ok mpi@ kspillner@ | ||||
* | if the freedsize isn't zero, check that's reasonable. ok beck | 2014-07-13 | 1 | -2/+7 | |
| | |||||
* | add a size argument to free. will be used soon, but for now default to 0. | 2014-07-12 | 1 | -2/+2 | |
| | | | | after discussions with beck deraadt kettenis. | ||||
* | instead of defining two versions of bucketidx, just don't inline for small. | 2014-07-10 | 1 | -14/+6 | |
| | | | | ok deraadt | ||||
* | Add mallocarray(9) | 2014-07-10 | 1 | -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 kernels | 2014-07-10 | 1 | -2/+2 | |
| | |||||
* | hide the biglock thrashing under pool_debug so it can be turned off | 2014-07-10 | 1 | -2/+2 | |
| | |||||
* | you've had 12+ years to update your kernel config. | 2014-06-21 | 1 | -5/+1 | |
| | | | | ok deraadt@ | ||||
* | consistent use of uint32_t for poison values | 2014-05-19 | 1 | -2/+2 | |
| | |||||
* | if it's ok to wait, it must also be ok to give the kernel lock. do so. | 2014-04-03 | 1 | -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 of | 2014-03-28 | 1 | -2/+2 | |
| | | | | | | <uvm/uvm.h> if possible and remove double inclusions. ok beck@, mlarkin@, deraadt@ | ||||
* | bzero -> memset | 2014-01-21 | 1 | -3/+3 | |
| | |||||
* | Uncomment kprintf format attributes for sys/kern | 2013-08-08 | 1 | -2/+2 | |
| | | | | tested on vax (gcc3) ok miod@ | ||||
* | permit free(NULL) to work. ok deraadt | 2013-07-04 | 1 | -1/+4 | |
| | |||||
* | open up some races. if pool_debug == 2, force a yield() whenever waitok. | 2013-05-31 | 1 | -2/+8 | |
| | | | | ok miod | ||||
* | switch the malloc and pool freelists to using xor simpleq. | 2013-05-03 | 1 | -11/+13 | |
| | | | | this adds a tiny bit more protection from list manipulation. | ||||
* | shuffle around some poison code, prototypes, values... | 2013-04-06 | 1 | -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 wide | 2013-03-28 | 1 | -48/+15 | |
| | | | | ok deraadt | ||||
* | replace kern malloc's hand rolled freelist with simpleq macros. | 2013-03-26 | 1 | -65/+31 | |
| | | | | ok deraadt mpi | ||||
* | use PAGE_SHIFT instead of PGSHIFT | 2013-03-21 | 1 | -2/+2 | |
| | |||||
* | factor out the deadbeef code for legibility. | 2013-03-15 | 1 | -37/+51 | |
| | | | | ok deraadt |