summaryrefslogtreecommitdiffstats
path: root/core/malloc.c
Commit message (Collapse)AuthorAgeFilesLines
* core: Move free-list locking to a separate per-region lockJeremy Kerr2015-05-131-6/+6
| | | | | | | | | | | | | | | | | | | | Currently, we have a single lock for the entire mem_region system; this protects both the global region list, and the allocations from each region. This means we can't allocate memory while traversing the global region list, as any malloc/realloc/free will try to acquire the mem_region lock again. This change separates the locking into different functions. We keep the mem_region_lock to protect the regions list, and introduce a per-region lock to protect allocations from the regions' free_lists. Then we remove the open-coded invocations of mem_alloc, where we'd avoided malloc() due to the above locking issue. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Rename mem_size() to mem_allocated_size()Stewart Smith2014-10-171-1/+1
| | | | | | | | | | | | This better states the intention of what it should return. I was bit unsure when fixing mem_size(), so hopefully this makes future me (or other people) less unsure as to the intended return value of this function. No functional changes, just rename. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Acked-by: Rusty Russell <rusty@au1.ibm.com>
* Initial commit of Open Source releaseBenjamin Herrenschmidt2014-07-021-0/+84
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
OpenPOWER on IntegriCloud