summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge https://github.com/jemalloc/jemallocHEADmasterJoerg Koenig2018-01-1998-1069/+3907
|\ | | | | | | Change-Id: I44881ca21f4710f7ad5154a45c4a7204ae71c84c
| * Modify configure to determine return value of strerror_r.Christopher Ferris2018-01-113-1/+25
| | | | | | | | | | | | | | | | On glibc and Android's bionic, strerror_r returns char* when _GNU_SOURCE is defined. Add a configure check for this rather than assume glibc is the only libc that behaves this way.
| * Improve the fit for aligned allocation.Qi Wang2018-01-051-10/+61
| | | | | | | | | | | | | | We compute the max size required to satisfy an alignment. However this can be quite pessimistic, especially with frequent reuse (and combined with state-based fragmentation). This commit adds one more fit step specific to aligned allocations, searching in all potential fit size classes.
| * Check tsdn_null before reading reentrancy level.Qi Wang2018-01-051-1/+2
| |
| * In iallocztm, check lock rank only when not in reentrancy.Qi Wang2018-01-051-2/+4
| |
| * Make sure JE_CXXFLAGS_ADD uses CPP compilerNehal J Wani2018-01-041-0/+2
| | | | | | | | | | | | | | | | | | All the invocations of AC_COMPILE_IFELSE inside JE_CXXFLAGS_ADD were running 'the compiler and compilation flags of the current language' which was always the C compiler and the CXXFLAGS were never being tested against a C++ compiler. This patch fixes this issue by temporarily changing the chosen compiler to C++ by pushing it over the stack and popping it immediately after the compilation check.
| * Disable JEMALLOC_HAVE_MADVISE_HUGE for arm* CPUs.marxin2018-01-041-0/+6
| |
| * extent_t bitpacking logic refactoringRajeev Misra2018-01-041-36/+36
| |
| * handle 32 bit mutex countersRajeev Misra2018-01-042-45/+69
| |
| * Implement arena regind computation using div_info_t.David Goldblatt2017-12-211-17/+16
| | | | | | | | | | This eliminates the need to generate an enormous switch statement in arena_slab_regind.
| * Add the div module, which allows fast division by dynamic values.David Goldblatt2017-12-215-1/+129
| |
| * Split up and standardize naming of stats code.David T. Goldblatt2017-12-1910-333/+342
| | | | | | | | | | | | The arena-associated stats are now all prefixed with arena_stats_, and live in their own file. Likewise, malloc_bin_stats_t -> bin_stats_t, also in its own file.
| * Rename cache_alloc_easy to cache_bin_alloc_easy.David T. Goldblatt2017-12-193-4/+4
| | | | | | | | This lives in the cache_bin module; just a typo.
| * Move bin stats code from arena to bin module.David T. Goldblatt2017-12-193-15/+27
| |
| * Move bin forking code from arena to bin module.David T. Goldblatt2017-12-193-4/+22
| |
| * Move bin initialization from arena module to bin module.David T. Goldblatt2017-12-194-11/+21
| |
| * Pull out arena_bin_info_t and arena_bin_t into their own file.David T. Goldblatt2017-12-1916-155/+169
| | | | | | | | | | In the process, kill arena_bin_index, which is unused. To follow are several diffs continuing this separation.
| * Over purge by 1 extent always.Qi Wang2017-12-183-8/+5
| | | | | | | | | | | | | | | | | | When purging, large allocations are usually the ones that cross the npages_limit threshold, simply because they are "large". This means we often leave the large extent around for a while, which has the downsides of: 1) high RSS and 2) more chance of them getting fragmented. Given that they are not likely to be reused very soon (LRU), let's over purge by 1 extent (which is often large and not reused frequently).
| * Skip test/unit/pack when profiling is enabled.Qi Wang2017-12-181-0/+6
| | | | | | | | The test assumes no sampled allocations.
| * Output opt.lg_extent_max_active_fit in stats.Qi Wang2017-12-141-0/+3
| |
| * jemalloc_mangle.sh: set sh in strict modenicolov2017-12-121-1/+1
| |
| * Also use __riscv to detect builds for RISC-V CPUs.Ed Schouten2017-12-091-1/+1
| | | | | | | | | | | | | | According to the RISC-V toolchain conventions, __riscv__ is the old spelling of this definition. __riscv should be used going forward. https://github.com/riscv/riscv-toolchain-conventions#cc-preprocessor-definitions
| * Fix extent deregister on the leak path.Qi Wang2017-12-091-4/+14
| | | | | | | | On leak path we should not adjust gdump when deregister.
| * Fix test/integration/extent.Qi Wang2017-12-091-1/+1
| | | | | | | | | | Should only run the hook tests without background threads. This was introduced in 6e841f6.
| * Add more tests for extent hooks failure paths.Qi Wang2017-11-293-3/+25
| |
| * Add missing deregister before extents_leak.Qi Wang2017-11-201-0/+1
| | | | | | | | This fixes an regression introduced by 211b1f3 (refactor extent split).
| * Avoid setting zero and commit if split fails in extent_recycle.Qi Wang2017-11-201-14/+10
| |
| * Eagerly coalesce large extents.Qi Wang2017-11-161-1/+15
| | | | | | | | | | | | Coalescing is a small price to pay for large allocations since they happen less frequently. This reduces fragmentation while also potentially improving locality.
| * Fix an extent coalesce bug.Qi Wang2017-11-162-7/+18
| | | | | | | | | | When coalescing, we should take both extents off the LRU list; otherwise decay can grab the existing outer extent through extents_evict.
| * Add opt.lg_extent_max_active_fitQi Wang2017-11-167-3/+44
| | | | | | | | | | | | | | | | | | | | When allocating from dirty extents (which we always prefer if available), large active extents can get split even if the new allocation is much smaller, in which case the introduced fragmentation causes high long term damage. This new option controls the threshold to reuse and split an existing active extent. We avoid using a large extent for much smaller sizes, in order to reduce fragmentation. In some workload, adding the threshold improves virtual memory usage by >10x.
| * Use extent_heap_first for best fit.Qi Wang2017-11-161-1/+1
| | | | | | | | | | extent_heap_any makes the layout less predictable and as a result incurs more fragmentation.
| * Use tsd offset_state instead of atomicDave Watson2017-11-143-3/+22
| | | | | | | | | | | | While working on #852, I noticed the prng state is atomic. This is the only atomic use of prng in all of jemalloc. Instead, use a threadlocal prng state if possible to avoid unnecessary cache line contention.
| * Fix base allocator THP auto mode locking and stats.Qi Wang2017-11-102-21/+18
| | | | | | | | | | Added proper synchronization for switching to using THP in auto mode. Also fixed stats for number of THPs used.
| * Fix unbounded increase in stash_decayed.Qi Wang2017-11-093-15/+23
| | | | | | | | | | | | Added an upper bound on how many pages we can decay during the current run. Without this, decay could have unbounded increase in stashed, since other threads could add new pages into the extents.
| * Use hugepage alignment for base allocator.Qi Wang2017-11-041-2/+2
| | | | | | | | | | This gives us an easier way to tell if the allocation is for metadata in the extent hooks.
| * Add arena.i.retain_grow_limitQi Wang2017-11-038-5/+146
| | | | | | | | | | | | | | This option controls the max size when grow_retained. This is useful when we have customized extent hooks reserving physical memory (e.g. 1G huge pages). Without this feature, the default increasing sequence could result in fragmented and wasted physical memory.
| * Try to use sysctl(3) instead of sysctlbyname(3).Edward Tomasz Napierala2017-11-031-0/+13
| | | | | | | | | | | | | | | | | | This attempts to use VM_OVERCOMMIT OID - newly introduced in -CURRENT few days ago, specifically for this purpose - instead of querying the sysctl by its string name. Due to how syctlbyname(3) works, this means we do one syscall during binary startup instead of two. Signed-off-by: Edward Tomasz Napierala <trasz@FreeBSD.org>
| * Use getpagesize(3) under FreeBSD.Edward Tomasz Napierala2017-11-031-0/+2
| | | | | | | | | | | | | | This avoids sysctl(2) syscall during binary startup, using the value passed in the ELF aux vector instead. Signed-off-by: Edward Tomasz Napierala <trasz@FreeBSD.org>
| * metadata_thp: auto mode adjustment for a0.Qi Wang2017-11-012-19/+31
| | | | | | | | | | | | We observed that arena 0 can have much more metadata allocated comparing to other arenas. Tune the auto mode to only switch to huge page on the 5th block (instead of 3 previously) for a0.
| * Output all counters for bin mutex stats.Qi Wang2017-10-191-4/+7
| | | | | | | | The saved space is not worth the trouble of missing counters.
| * Add a "dumpable" bit to the extent state.David Goldblatt2017-10-166-21/+65
| | | | | | | | | | Currently, this is unused (i.e. all extents are always marked dumpable). In the future, we'll begin using this functionality.
| * Add pages_dontdump and pages_dodump.David Goldblatt2017-10-162-0/+25
| | | | | | | | This will, eventually, enable us to avoid dumping eden regions.
| * Add configure-time detection for madvise(..., MADV_DO[NT]DUMP)David Goldblatt2017-10-162-0/+16
| |
| * Factor out extent-splitting core from extent lifetime management.David Goldblatt2017-10-161-81/+149
| | | | | | | | | | | | | | Before this commit, extent_recycle_split intermingles the splitting of an extent and the return of parts of that extent to a given extents_t. After it, that logic is separated. This will enable splitting extents that don't live in any extents_t (as the grow retained region soon will).
| * Document some of the internal extent functions.David Goldblatt2017-10-161-0/+35
| |
| * Fix MSVC 2015 project and add a VS 2017 solutionrustyx2017-10-1614-10/+870
| |
| * Remove the default value for JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS.Qi Wang2017-10-111-2/+2
| |
| * Define MADV_FREE on our own when needed.Qi Wang2017-10-114-1/+23
| | | | | | | | | | | | On x86 Linux, we define our own MADV_FREE if madvise(2) is available, but no MADV_FREE is detected. This allows the feature to be built in and enabled with runtime detection.
| * Document the potential issues about opt.background_thread.Qi Wang2017-10-111-3/+6
| |
| * Set isthreaded manually.devQi Wang2017-10-061-5/+6
| | | | | | | | Avoid relying pthread_once which creates dependency during init.