summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Stop #define-ining away 'inline'David Goldblatt2017-03-031-1/+0
| | | | | In the long term, we'll transition to C99-style inline semantics. In the short-term, this will allow both styles to coexist without breaking one another.
* Immediately purge cached extents if decay_time is 0.Jason Evans2017-03-032-5/+0
| | | | | | | | This fixes a regression caused by 54269dc0ed3e4d04b2539016431de3cfe8330719 (Remove obsolete arena_maybe_purge() call.), as well as providing a general fix. This resolves #665.
* Convert arena_decay_t's time to be atomically synchronized.Jason Evans2017-03-032-3/+10
|
* Fix {allocated,nmalloc,ndalloc,nrequests}_large stats regression.Jason Evans2017-02-271-1/+1
| | | | | | This fixes a regression introduced by d433471f581ca50583c7a99f9802f7388f81aa36 (Derive {allocated,nmalloc,ndalloc,nrequests}_large stats.).
* Tidy up extent quantization.Jason Evans2017-02-271-4/+0
| | | | | | | Remove obsolete unit test scaffolding for extent quantization. Remove redundant assertions. Add an assertion to extents_first_best_fit_locked() that should help prevent aligned allocation regressions.
* Update a comment.Jason Evans2017-02-261-4/+4
|
* Get rid of witness in malloc_mutex_t when !(configured w/ debug).Qi Wang2017-02-243-14/+34
| | | | | | We don't touch witness at all when config_debug == false. Let's only pay the memory cost in malloc_mutex_s when needed. Note that when !config_debug, we keep the field in a union so that we don't have to do #ifdefs in multiple places.
* Remove remainder of mb (memory barrier).Jason Evans2017-02-221-1/+0
| | | | | This complements 94c5d22a4da7844d0bdc5b370e47b1ba14268af2 (Remove mb.h, which is unused).
* Move arena_basic_stats_merge() prototype (hygienic cleanup).Jason Evans2017-02-211-3/+3
|
* Disable coalescing of cached extents.Jason Evans2017-02-172-1/+5
| | | | | | | | Extent splitting and coalescing is a major component of large allocation overhead, and disabling coalescing of cached extents provides a simple and effective hysteresis mechanism. Once two-phase purging is implemented, it will probably make sense to leave coalescing disabled for the first phase, but coalesce during the second phase.
* Fix arena->stats.mapped accounting.Jason Evans2017-02-162-0/+3
| | | | | Mapped memory increases when extent_alloc_wrapper() succeeds, and decreases when extent_dalloc_wrapper() is called (during purging).
* Synchronize arena->decay with arena->decay.mtx.Jason Evans2017-02-163-8/+4
| | | | This removes the last use of arena->lock.
* Derive {allocated,nmalloc,ndalloc,nrequests}_large stats.Jason Evans2017-02-161-4/+4
| | | | This mildly reduces stats update overhead during normal operation.
* Synchronize arena->tcache_ql with arena->tcache_ql_mtx.Jason Evans2017-02-162-8/+10
| | | | This replaces arena->lock synchronization.
* Convert arena->stats synchronization to atomics.Jason Evans2017-02-166-10/+19
|
* Convert arena->prof_accumbytes synchronization to atomics.Jason Evans2017-02-1612-44/+109
|
* Convert arena->dss_prec synchronization to atomics.Jason Evans2017-02-162-3/+3
|
* Do not generate unused tsd_*_[gs]et() functions.Jason Evans2017-02-133-32/+30
| | | | | | | | | This avoids a gcc diagnostic note: note: The ABI for passing parameters with 64-byte alignment has changed in GCC 4.6 This note related to the cacheline alignment of rtree_ctx_t, which was introduced by 4a346f55939af4f200121cc4454089592d952f18 (Replace rtree path cache with LRU cache.).
* Fix rtree_subkey() regression.Jason Evans2017-02-101-1/+1
| | | | | | | Fix rtree_subkey() to use uintptr_t rather than unsigned for key bitmasking. This regression was introduced by 4a346f55939af4f200121cc4454089592d952f18 (Replace rtree path cache with LRU cache.).
* Enable mutex witnesses even when !isthreaded.Jason Evans2017-02-101-9/+5
| | | | | | This fixes interactions with witness_assert_depth[_to_rank](), which was added in d0e93ada51e20f4ae394ff4dbdcf96182767c89c (Add witness_assert_depth[_to_rank]().).
* Spin adaptively in rtree_elm_acquire().Jason Evans2017-02-091-10/+11
|
* Enhance spin_adaptive() to yield after several iterations.Jason Evans2017-02-091-6/+11
| | | | | This avoids worst case behavior if e.g. another thread is preempted while owning the resource the spinning thread is waiting for.
* Replace spin_init() with SPIN_INITIALIZER.Jason Evans2017-02-093-7/+2
|
* Remove rtree support for 0 (NULL) keys.Jason Evans2017-02-091-30/+28
| | | | | NULL can never actually be inserted in practice, and removing support allows a branch to be removed from the fast path.
* Determine rtree levels at compile time.Jason Evans2017-02-095-23/+49
| | | | | | | Rather than dynamically building a table to aid per level computations, define a constant table at compile time. Omit both high and low insignificant bits. Use one to three tree levels, depending on the number of significant bits.
* Remove rtree leading 0 bit optimization.Jason Evans2017-02-091-31/+4
| | | | A subsequent change instead ignores insignificant high bits.
* Make non-essential inline rtree functions static functions.Jason Evans2017-02-093-111/+16
|
* Split rtree_elm_lookup_hard() out of rtree_elm_lookup().Jason Evans2017-02-093-101/+6
| | | | | Anything but a hit in the first element of the lookup cache is expensive enough to negate the benefits of inlining.
* Replace rtree path cache with LRU cache.Jason Evans2017-02-094-124/+108
| | | | | | | Rework rtree_ctx_t to encapsulate an rtree leaf LRU lookup cache rather than a single-path element lookup cache. The replacement is logically much simpler, as well as slightly faster in the fast path case and less prone to degraded performance during non-trivial sequences of lookups.
* Optimize a branch out of rtree_read() if !dependent.Jason Evans2017-02-091-1/+1
|
* Disentangle arena and extent locking.Jason Evans2017-02-0211-111/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor arena and extent locking protocols such that arena and extent locks are never held when calling into the extent_*_wrapper() API. This requires extra care during purging since the arena lock no longer protects the inner purging logic. It also requires extra care to protect extents from being merged with adjacent extents. Convert extent_t's 'active' flag to an enumerated 'state', so that retained extents are explicitly marked as such, rather than depending on ring linkage state. Refactor the extent collections (and their synchronization) for cached and retained extents into extents_t. Incorporate LRU functionality to support purging. Incorporate page count accounting, which replaces arena->ndirty and arena->stats.retained. Assert that no core locks are held when entering any internal [de]allocation functions. This is in addition to existing assertions that no locks are held when entering external [de]allocation functions. Audit and document synchronization protocols for all arena_t fields. This fixes a potential deadlock due to recursive allocation during gdump, in a similar fashion to b49c649bc18fff4bd10a1c8adbaf1f25f6453cb6 (Fix lock order reversal during gdump.), but with a necessarily much broader code impact.
* Fix/refactor tcaches synchronization.Jason Evans2017-02-023-15/+22
| | | | | | | Synchronize tcaches with tcaches_mtx rather than ctl_mtx. Add missing synchronization for tcache flushing. This bug was introduced by 1cb181ed632e7573fb4eab194e4d216867222d27 (Implement explicit tcache support.), which was first released in 4.0.0.
* Add witness_assert_depth[_to_rank]().Jason Evans2017-02-024-6/+36
| | | | | This makes it possible to make lock state assertions about precisely which locks are held.
* Replace tabs following #define with spaces.Jason Evans2017-01-2136-305/+304
| | | | This resolves #564.
* Remove extraneous parens around return arguments.Jason Evans2017-01-2120-346/+344
| | | | This resolves #540.
* Update brace style.Jason Evans2017-01-2126-758/+582
| | | | | | | Add braces around single-line blocks, and remove line breaks before function-opening braces. This resolves #537.
* Fix --disable-stats support.Jason Evans2017-01-202-19/+29
| | | | | Fix numerous regressions that were exposed by --disable-stats, both in the core library and in the tests.
* Added stats about number of bytes cached in tcache currently.Qi Wang2017-01-181-0/+3
|
* Don't rely on OSX SDK malloc/malloc.h for malloc_zone struct definitionsMike Hommey2017-01-182-2/+0
| | | | | | | | | | The SDK jemalloc is built against might be not be the latest for various reasons, but the resulting binary ought to work on newer versions of OSX. In order to ensure this, we need the fullest definitions possible, so copy what we need from the latest version of malloc/malloc.h available on opensource.apple.com.
* Fix prof_realloc() regression.Jason Evans2017-01-173-14/+25
| | | | | | | | | | | | | | Mostly revert the prof_realloc() changes in 498856f44a30b31fe713a18eb2fc7c6ecf3a9f63 (Move slabs out of chunks.) so that prof_free_sampled_object() is called when appropriate. Leave the prof_tctx_[re]set() optimization in place, but add an assertion to verify that all eight cases are correctly handled. Add a comment to make clear the code ordering, so that the regression originally fixed by ea8d97b8978a0c0423f0ed64332463a25b787c3d (Fix prof_{malloc,free}_sample_object() call order in prof_realloc().) is not repeated. This resolves #499.
* Remove leading blank lines from function bodies.Jason Evans2017-01-1320-200/+0
| | | | This resolves #535.
* Break up headers into constituent partsDavid Goldblatt2017-01-1293-3604/+3449
| | | | | | | | | | This is part of a broader change to make header files better represent the dependencies between one another (see https://github.com/jemalloc/jemalloc/issues/533). It breaks up component headers into smaller parts that can be made to have a simpler dependency graph. For the autogenerated headers (smoothstep.h and size_classes.h), no splitting was necessary, so I didn't add support to emit multiple headers.
* Remove mb.h, which is unusedDavid Goldblatt2017-01-112-119/+0
|
* Use better pre-processor defines for sparc64John Paul Adrian Glaubitz2017-01-111-1/+1
| | | | | | | | Currently, jemalloc detects sparc64 targets by checking whether __sparc64__ is defined. However, this definition is used on BSD targets only. Linux targets define both __sparc__ and __arch64__ for sparc64. Since this also works on BSD, rather use __sparc__ and __arch64__ instead of __sparc64__ to detect sparc64 targets.
* Implement arena.<i>.destroy .Jason Evans2017-01-076-1/+24
| | | | | | | Add MALLCTL_ARENAS_DESTROYED for accessing destroyed arena stats as an analogue to MALLCTL_ARENAS_ALL. This resolves #382.
* Range-check mib[1] --> arena_ind casts.Jason Evans2017-01-071-1/+1
|
* Move static ctl_epoch variable into ctl_stats_t (as epoch).Jason Evans2017-01-071-0/+1
|
* Refactor ctl_stats_t.Jason Evans2017-01-072-8/+15
| | | | | | | Refactor ctl_stats_t to be a demand-zeroed non-growing data structure. To keep the size from being onerous (~60 MiB) on 32-bit systems, convert the arenas field to contain pointers rather than directly embedded ctl_arena_stats_t elements.
* Rename the arenas.extend mallctl to arenas.create.Jason Evans2017-01-071-3/+3
|
* Add MALLCTL_ARENAS_ALL.Jason Evans2017-01-072-0/+18
| | | | | | | Add the MALLCTL_ARENAS_ALL cpp macro as a fixed index for use in accessing the arena.<i>.{purge,decay,dss} and stats.arenas.<i>.* mallctls, and deprecate access via the arenas.narenas index (to be removed in 6.0.0).