summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Define 64-bits atomics unconditionallyMike Hommey2016-06-091-10/+8
| | | | They are used on all platforms in prng.h.
* Fix extent_*_get to build with MSVCMike Hommey2016-06-091-4/+4
|
* Don't use compact red-black trees with the pgi compilerElliot Ronaghan2016-06-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some bug (either in the red-black tree code, or in the pgi compiler) seems to cause red-black trees to become unbalanced. This issue seems to go away if we don't use compact red-black trees. Since red-black trees don't seem to be used much anymore, I opted for what seems to be an easy fix here instead of digging in and trying to find the root cause of the bug. Some context in case it's helpful: I experienced a ton of segfaults while using pgi as Chapel's target compiler with jemalloc 4.0.4. The little bit of debugging I did pointed me somewhere deep in red-black tree manipulation, but I didn't get a chance to investigate further. It looks like 4.2.0 replaced most uses of red-black trees with pairing-heaps, which seems to avoid whatever bug I was hitting. However, `make check_unit` was still failing on the rb test, so I figured the core issue was just being masked. Here's the `make check_unit` failure: ```sh === test/unit/rb === test_rb_empty: pass tree_recurse:test/unit/rb.c:90: Failed assertion: (((_Bool) (((uintptr_t) (left_node)->link.rbn_right_red) & ((size_t)1)))) == (false) --> true != false: Node should be black test_rb_random:test/unit/rb.c:274: Failed assertion: (imbalances) == (0) --> 1 != 0: Tree is unbalanced tree_recurse:test/unit/rb.c:90: Failed assertion: (((_Bool) (((uintptr_t) (left_node)->link.rbn_right_red) & ((size_t)1)))) == (false) --> true != false: Node should be black test_rb_random:test/unit/rb.c:274: Failed assertion: (imbalances) == (0) --> 1 != 0: Tree is unbalanced node_remove:test/unit/rb.c:190: Failed assertion: (imbalances) == (0) --> 2 != 0: Tree is unbalanced <jemalloc>: test/unit/rb.c:43: Failed assertion: "pathp[-1].cmp < 0" test/test.sh: line 22: 12926 Aborted Test harness error ``` While starting to debug I saw the RB_COMPACT option and decided to check if turning that off resolved the bug. It seems to have fixed it (`make check_unit` passes and the segfaults under Chapel are gone) so it seems like on okay work-around. I'd imagine this has performance implications for red-black trees under pgi, but if they're not going to be used much anymore it's probably not a big deal.
* Fix potential VM map fragmentation regression.Jason Evans2016-06-071-1/+1
| | | | | | | | Revert 245ae6036c09cc11a72fab4335495d95cddd5beb (Support --with-lg-page values larger than actual page size.), because it could cause VM map fragmentation if the kernel grows mmap()ed memory downward. This resolves #391.
* Fix extent_alloc_dss() regressions.Jason Evans2016-06-062-0/+2
| | | | | Page-align the gap, if any, and add/use extent_dalloc_gap(), which registers the gap extent before deallocation.
* Remove a stray memset(), and fix a junk filling test regression.Jason Evans2016-06-062-0/+4
|
* Modify extent hook functions to take an (extent_t *) argument.Jason Evans2016-06-063-37/+40
| | | | | | | This facilitates the application accessing its own extent allocator metadata during hook invocations. This resolves #259.
* Add rtree lookup path caching.Jason Evans2016-06-064-36/+176
| | | | | | | | | rtree-based extent lookups remain more expensive than chunk-based run lookups, but with this optimization the fast path slowdown is ~3 CPU cycles per metadata lookup (on Intel Core i7-4980HQ), versus ~11 cycles prior. The path caching speedup tends to degrade gracefully unless allocated memory is spread far apart (as is the case when using a mixture of sbrk() and mmap()).
* Make tsd cleanup functions optional, remove noop cleanup functions.Jason Evans2016-06-066-31/+17
|
* Add a missing prof_alloc_rollback() call.Jason Evans2016-06-061-0/+1
| | | | | | In the case where prof_alloc_prep() is called with an over-estimate of allocation size, and sampling doesn't end up being triggered, the tctx must be discarded.
* Miscellaneous s/chunk/extent/ updates.Jason Evans2016-06-063-5/+4
|
* Relax NBINS constraint (max 255 --> max 256).Jason Evans2016-06-061-4/+2
|
* Remove obsolete stats.arenas.<i>.metadata.mapped mallctl.Jason Evans2016-06-064-22/+18
| | | | | Rename stats.arenas.<i>.metadata.allocated mallctl to stats.arenas.<i>.metadata .
* Better document --enable-ivsalloc.Jason Evans2016-06-062-3/+10
|
* Rename most remaining *chunk* APIs to *extent*.Jason Evans2016-06-066-88/+87
|
* s/chunk_lookup/extent_lookup/g, s/chunks_rtree/extents_rtree/gJason Evans2016-06-064-20/+18
|
* s/CHUNK_HOOKS_INITIALIZER/EXTENT_HOOKS_INITIALIZER/gJason Evans2016-06-062-10/+10
|
* Rename chunks_{cached,retained,mtx} to extents_{cached,retained,mtx}.Jason Evans2016-06-062-9/+9
|
* Rename chunk_*_t hooks to extent_*_t.Jason Evans2016-06-061-21/+22
|
* s/chunk_hook/extent_hook/gJason Evans2016-06-064-22/+25
|
* Rename huge to large.Jason Evans2016-06-0611-115/+115
|
* Update private symbols.Jason Evans2016-06-061-11/+19
|
* Move slabs out of chunks.Jason Evans2016-06-068-863/+147
|
* Improve interval-based profile dump triggering.Jason Evans2016-06-061-1/+1
| | | | | | | | | | | When an allocation is large enough to trigger multiple dumps, use modular math rather than subtraction to reset the interval counter. Prior to this change, it was possible for a single allocation to cause many subsequent allocations to all trigger profile dumps. When updating usable size for a sampled object, try to cancel out the difference between LARGE_MINCLASS and usable size from the interval counter.
* Use huge size class infrastructure for large size classes.Jason Evans2016-06-0610-245/+133
|
* Implement cache-oblivious support for huge size classes.Jason Evans2016-06-035-23/+87
|
* Allow chunks to not be naturally aligned.Jason Evans2016-06-034-17/+26
| | | | | Precisely size extents for huge size classes that aren't multiples of chunksize.
* Remove CHUNK_ADDR2BASE() and CHUNK_ADDR2OFFSET().Jason Evans2016-06-033-99/+22
|
* Make extent_prof_tctx_[gs]et() atomic.Jason Evans2016-06-031-3/+7
|
* Add extent_dirty_[gs]et().Jason Evans2016-06-032-2/+25
|
* Convert rtree from per chunk to per page.Jason Evans2016-06-032-4/+2
| | | | Refactor [de]registration to maintain interior rtree entries for slabs.
* Refactor chunk_purge_wrapper() to take extent argument.Jason Evans2016-06-031-2/+1
|
* Refactor chunk_[de]commit_wrapper() to take extent arguments.Jason Evans2016-06-031-4/+2
|
* Refactor chunk_dalloc_{cache,wrapper}() to take extent arguments.Jason Evans2016-06-034-16/+9
| | | | | | Rename arena_extent_[d]alloc() to extent_[d]alloc(). Move all chunk [de]registration responsibility into chunk.c.
* Add/use chunk_split_wrapper().Jason Evans2016-06-034-35/+35
| | | | | | Remove redundant ptr/oldsize args from huge_*(). Refactor huge/chunk/arena code boundaries.
* Add/use chunk_merge_wrapper().Jason Evans2016-06-033-1/+4
|
* Add/use chunk_commit_wrapper().Jason Evans2016-06-032-0/+4
|
* Add/use chunk_decommit_wrapper().Jason Evans2016-06-032-0/+4
|
* Merge chunk_alloc_base() into its only caller.Jason Evans2016-06-032-2/+0
|
* Replace extent_tree_szad_* with extent_heap_*.Jason Evans2016-06-033-26/+18
|
* Use rtree rather than [sz]ad trees for chunk split/coalesce operations.Jason Evans2016-06-033-31/+12
|
* Remove redundant chunk argument from chunk_{,de,re}register().Jason Evans2016-06-031-5/+3
|
* Add extent_past_get().Jason Evans2016-06-032-0/+9
|
* Replace extent_achunk_[gs]et() with extent_slab_[gs]et().Jason Evans2016-06-034-22/+22
|
* Add extent_active_[gs]et().Jason Evans2016-06-033-10/+25
| | | | Always initialize extents' runs_dirty and chunks_cache linkage.
* Move *PAGE* definitions to pages.h.Jason Evans2016-06-032-15/+15
|
* Add rtree element witnesses.Jason Evans2016-06-035-19/+90
|
* Refactor rtree to always use base_alloc() for node allocation.Jason Evans2016-06-036-68/+71
|
* Use rtree-based chunk lookups rather than pointer bit twiddling.Jason Evans2016-06-037-170/+196
| | | | | | | | | | | Look up chunk metadata via the radix tree, rather than using CHUNK_ADDR2BASE(). Propagate pointer's containing extent. Minimize extent lookups by doing a single lookup (e.g. in free()) and propagating the pointer's extent into nearly all the functions that may need it.
* Add element acquire/release capabilities to rtree.Jason Evans2016-06-033-85/+166
| | | | | | | | This makes it possible to acquire short-term "ownership" of rtree elements so that it is possible to read an extent pointer *and* read the extent's contents with a guarantee that the element will not be modified until the ownership is released. This is intended as a mechanism for resolving rtree read/write races rather than as a way to lock extents.