summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Header refactoring: hash - unify and remove from catchall.David Goldblatt2017-04-255-4/+6
|
* Header refactoring: ctl - unify and remove from catchall.David Goldblatt2017-04-2511-264/+257
| | | | | In order to do this, we introduce the mutex_prof module, which breaks a circular dependency between ctl and prof.
* Replace --disable-munmap with opt.munmap.Jason Evans2017-04-2516-85/+77
| | | | | | | | | Control use of munmap(2) via a run-time option rather than a compile-time option (with the same per platform default). The old behavior of --disable-munmap can be achieved with --with-malloc-conf=munmap:false. This partially resolves #580.
* Remove --enable-code-coverage.Jason Evans2017-04-246-109/+1
| | | | | | | This option hasn't been particularly useful since the original pre-3.0.0 push to broaden test coverage. This partially resolves #580.
* Remove --disable-cc-silence.Jason Evans2017-04-245-41/+6
| | | | | | | The explicit compiler warning suppression controlled by this option is universally desirable, so remove the ability to disable suppression. This partially resolves #580.
* Use trylock in arena_decay_impl().Qi Wang2017-04-241-8/+16
| | | | If another thread is working on decay, we don't have to wait for the mutex.
* Implement malloc_mutex_trylock() w/ proper stats update.Qi Wang2017-04-243-14/+36
|
* Remove --with-lg-tiny-min.Jason Evans2017-04-244-41/+11
| | | | | | This option isn't useful in practice. This partially resolves #580.
* Remove --with-lg-size-class-group.Jason Evans2017-04-242-39/+2
| | | | | | | | Four size classes per size doubling has proven to be a universally good choice for the entire 4.x release series, so there's little point to preserving this configurability. This partially resolves #580.
* Header refactoring: bitmap - unify and remove from catchall.David Goldblatt2017-04-249-387/+373
|
* Header refactoring: stats - unify and remove from catchallDavid Goldblatt2017-04-248-35/+29
|
* Header refactoring: move smoothstep.h out of the catchall.David Goldblatt2017-04-242-1/+1
|
* Header refactoring: size_classes module - remove from the catchallDavid Goldblatt2017-04-2420-1/+28
|
* Header refactoring: ckh module - remove from the catchall and unify.David Goldblatt2017-04-248-84/+106
|
* Header refactoring: ticker module - remove from the catchall and unify.David Goldblatt2017-04-2412-21/+26
|
* Header refactoring: prng module - remove from the catchall and unify.David Goldblatt2017-04-246-35/+49
|
* Get rid of most of the various inline macros.David Goldblatt2017-04-2431-669/+233
|
* Add missing 'test' to LG_SIZEOF_PTR tests.Jason Evans2017-04-241-3/+3
| | | | | | This fixes a bug/regression introduced by a01f99307719dcc8ca27cc70f0f0011beff914fa (Only disable munmap(2) by default on 64-bit Linux.).
* Output MALLOC_CONF and debug cmd when test failure happens.Qi Wang2017-04-221-9/+10
|
* Enable -Wundef, when supported.David Goldblatt2017-04-225-13/+12
| | | | | | This can catch bugs in which one header defines a numeric constant, and another uses it without including the defining header. Undefined preprocessor symbols expand to '0', so that this will compile fine, silently doing the math wrong.
* Remove --enable-ivsalloc.Jason Evans2017-04-215-42/+23
| | | | | | | | | | | | Continue to use ivsalloc() when --enable-debug is specified (and add assertions to guard against 0 size), but stop providing a documented explicit semantics-changing band-aid to dodge undefined behavior in sallocx() and malloc_usable_size(). ivsalloc() remains compiled in, unlike when #211 restored --enable-ivsalloc, and if JEMALLOC_FORCE_IVSALLOC is defined during compilation, sallocx() and malloc_usable_size() will still use ivsalloc(). This partially resolves #580.
* Remove --disable-tls.Jason Evans2017-04-216-43/+4
| | | | | | | This option is no longer useful, because TLS is correctly configured automatically on all supported platforms. This partially resolves #580.
* Use openat syscall if availableJim Chen2017-04-212-0/+8
| | | | | | | | | | Some architectures like AArch64 may not have the open syscall because it was superseded by the openat syscall, so check and use SYS_openat if SYS_open is not available. Additionally, Android headers for AArch64 define SYS_open to __NR_open, even though __NR_open is undefined. Undefine SYS_open in that case so SYS_openat is used.
* Remove --disable-tcache.Jason Evans2017-04-2125-416/+192
| | | | | | | | | | | Simplify configuration by removing the --disable-tcache option, but replace the testing for that configuration with --with-malloc-conf=tcache:false. Fix the thread.arena and thread.tcache.flush mallctls to work correctly if tcache is disabled. This partially resolves #580.
* Bypass extent tracking for auto arenas.Qi Wang2017-04-216-32/+49
| | | | | | | | Tracking extents is required by arena_reset. To support this, the extent linkage was used for tracking 1) large allocations, and 2) full slabs. However modifying the extent linkage could be an expensive operation as it likely incurs cache misses. Since we forbid arena_reset on auto arenas, let's bypass the linkage operations for auto arenas.
* Trim before commit in extent_recycle().Jason Evans2017-04-202-3/+9
| | | | | | | | | | This avoids creating clean committed pages as a side effect of aligned allocation. For configurations that decommit memory, purged pages are decommitted, and decommitted extents cannot be coalesced with committed extents. Unless the clean committed pages happen to be selected during allocation, they cause unnecessary permanent extent fragmentation. This resolves #766.
* Output 4 counters for bin mutexes instead of just 2.Qi Wang2017-04-191-8/+24
|
* Support --with-lg-page values larger than system page size.Jason Evans2017-04-198-111/+155
| | | | | | | | | All mappings continue to be PAGE-aligned, even if the system page size is smaller. This change is primarily intended to provide a mechanism for supporting multiple page sizes with the same binary; smaller page sizes work better in conjunction with jemalloc's design. This resolves #467.
* Revert "Remove BITMAP_USE_TREE."Jason Evans2017-04-195-0/+307
| | | | | | | | | Some systems use a native 64 KiB page size, which means that the bitmap for the smallest size class can be 8192 bits, not just 512 bits as when the page size is 4 KiB. Linear search in bitmap_{sfu,ffu}() is unacceptably slow for such large bitmaps. This reverts commit 7c00f04ff40a34627e31488d02ff1081c749c7ba.
* Header refactoring: unify spin.h and move it out of the catch-all.David Goldblatt2017-04-199-49/+42
|
* Header refactoring: unify nstime.h and move it out of the catch-allDavid Goldblatt2017-04-1910-29/+21
|
* Header refactoring: move jemalloc_internal_types.h out of the catch-allDavid Goldblatt2017-04-197-3/+10
|
* Header refactoring: move assert.h out of the catch-allDavid Goldblatt2017-04-1922-7/+34
|
* Header refactoring: move util.h out of the catchallDavid Goldblatt2017-04-1911-1/+18
|
* Header refactoring: move malloc_io.h out of the catchallDavid Goldblatt2017-04-199-1/+14
|
* Header refactoring: move bit_util.h out of the catchallDavid Goldblatt2017-04-195-1/+6
|
* Move CPP_PROLOGUE and CPP_EPILOGUE to the .cppDavid Goldblatt2017-04-195-21/+8
| | | | This lets us avoid having to specify them in every C file.
* Only disable munmap(2) by default on 64-bit Linux.Jason Evans2017-04-172-5/+11
| | | | | | | This reduces the likelihood of address space exhaustion on 32-bit systems. This resolves #350.
* Fix LD_PRELOAD_VAR configuration logic for 64-bit AIX.Jason Evans2017-04-171-1/+1
|
* Remove the function alignment of prof_backtrace.Qi Wang2017-04-171-1/+0
| | | | | This was an attempt to avoid triggering slow path in libunwind, however turns out to be ineffective.
* Prefer old/low extent_t structures during reuse.Jason Evans2017-04-1710-37/+80
| | | | | | Rather than using a LIFO queue to track available extent_t structures, use a red-black tree, and always choose the oldest/lowest available during reuse.
* Track extent structure serial number (esn) in extent_t.Jason Evans2017-04-177-48/+121
| | | | This enables stable sorting of extent_t structures.
* Allocate increasingly large base blocks.Jason Evans2017-04-172-27/+44
| | | | | Limit the total number of base block by leveraging the exponential size class sequence, similarly to extent_grow_retained().
* Update base_unmap() to match extent_dalloc_wrapper().Jason Evans2017-04-171-10/+10
| | | | | | | Reverse the order of forced versus lazy purging attempts in base_unmap(), in order to match the order in extent_dalloc_wrapper(), which was reversed by 64e458f5cdd64f9b67cb495f177ef96bf3ce4e0e (Implement two-phase decay-based purging.).
* Improve rtree cache with a two-level cache design.Qi Wang2017-04-175-35/+97
| | | | | | | | Two levels of rcache is implemented: a direct mapped cache as L1, combined with a LRU cache as L2. The L1 cache offers low cost on cache hit, but could suffer collision under circumstances. This is complemented by the L2 LRU cache, which is slower on cache access (overhead from linear search + reordering), but solves collison of L1 rather well.
* Skip percpu arena when choosing iarena.Qi Wang2017-04-171-1/+1
|
* Switch to fine-grained reentrancy support.Qi Wang2017-04-158-83/+87
| | | | | | | Previously we had a general detection and support of reentrancy, at the cost of having branches and inc / dec operations on fast paths. To avoid taxing fast paths, we move the reentrancy operations onto tsd slow state, and only modify reentrancy level around external calls (that might trigger reentrancy).
* Bundle 3 branches on fast path into tsd_state.Qi Wang2017-04-1410-78/+170
| | | | | | Added tsd_state_nominal_slow, which on fast path malloc() incorporates tcache_enabled check, and on fast path free() bundles both malloc_slow and tcache_enabled branches.
* Pass alloc_ctx down profiling path.Qi Wang2017-04-129-82/+133
| | | | | | With this change, when profiling is enabled, we avoid doing redundant rtree lookups. Also changed dalloc_atx_t to alloc_atx_t, as it's now used on allocation path as well (to speed up profiling).
* Pass dalloc_ctx down the sdalloc path.Qi Wang2017-04-125-24/+41
| | | | This avoids redundant rtree lookups.