summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Make test/unit/background_thread not flaky.Qi Wang2017-05-271-3/+5
|
* Added opt_abort_conf: abort on invalid config options.Qi Wang2017-05-275-15/+56
|
* Fix run_tests to avoid percpu_arena on !Linux.Jason Evans2017-05-261-3/+3
|
* Cleanup smoothstep.sh / .h.Qi Wang2017-05-254-207/+205
| | | | h_step_sum was used to compute moving sum. Not in use anymore.
* Fix stats.mapped during deallocation.Qi Wang2017-05-241-1/+1
|
* Refactor run_tests to increase parallelism.Jason Evans2017-05-241-13/+45
| | | | | | | | Rather than relying on parallel make to build individual configurations one at a time, use xargs to build multiple configurations in parallel. This allows the configure scripts to run in parallel. On a 14-core system (28 hyperthreads), this increases average CPU utilization from ~20% to ~90%.
* Header refactoring: unify and de-catchall mutex moduleDavid Goldblatt2017-05-2434-287/+304
|
* Header refactoring: unify and de-catchall witness code.David Goldblatt2017-05-2418-540/+604
|
* Disable percpu_arena by default.Jason Evans2017-05-235-11/+36
|
* Do not assume dss never decreases.Jason Evans2017-05-231-38/+34
| | | | | | | | | An sbrk() caller outside jemalloc can decrease the dss, so add a separate atomic boolean to explicitly track whether jemalloc is concurrently calling sbrk(), rather than depending on state outside jemalloc's full control. This resolves #802.
* Add dss:primary testing.Jason Evans2017-05-233-20/+59
| | | | | | Generalize the run_tests.sh and .travis.yml test generation to handle combinations of arguments to the --with-malloc-conf configure option, and merge "dss:primary" into the existing "tcache:false" testing.
* Do not hold the base mutex while calling extent hooks.Jason Evans2017-05-231-0/+6
| | | | | | | | | Drop the base mutex while allocating new base blocks, because extent allocation can enter code that prohibits holding non-core mutexes, e.g. the extent_[d]alloc() and extent_purge_forced_wrapper() calls in extent_alloc_dss(). This partially resolves #802.
* Fix # of unpurged pages in decay algorithm.Qi Wang2017-05-232-10/+28
| | | | | | | | | | When # of dirty pages move below npages_limit (e.g. they are reused), we should not lower number of unpurged pages because that would cause the reused pages to be double counted in the backlog (as a result, decay happen slower than it should). Instead, set number of unpurged to the greater of current npages and npages_limit. Added an assertion: the ceiling # of pages should be greater than npages_limit.
* Check for background thread inactivity on extents_dalloc.Qi Wang2017-05-234-23/+91
| | | | | | To avoid background threads sleeping forever with idle arenas, we eagerly check background threads' sleep time after extents_dalloc, and signal the thread if necessary.
* Add tests for background threads.Qi Wang2017-05-233-0/+119
|
* Add documentation for background_thread related options.Qi Wang2017-05-231-0/+78
|
* Add profiling for the background thread mutex.Qi Wang2017-05-234-6/+21
|
* Add background thread related stats.Qi Wang2017-05-239-21/+214
|
* Implementing opt.background_thread.Qi Wang2017-05-2323-348/+1245
| | | | | | | | | | | Added opt.background_thread to enable background threads, which handles purging currently. When enabled, decay ticks will not trigger purging (which will be left to the background threads). We limit the max number of threads to NCPUs. When percpu arena is enabled, set CPU affinity for the background threads as well. The sleep interval of background threads is dynamic and determined by computing number of pages to purge in the future (based on backlog).
* Protect the rtree/extent interactions with a mutex pool.David Goldblatt2017-05-1918-536/+340
| | | | | | | | | | | | | | | | | | Instead of embedding a lock bit in rtree leaf elements, we associate extents with a small set of mutexes. This gets us two things: - We can use the system mutexes. This (hypothetically) protects us from priority inversion, and lets us stop doing a backoff/sleep loop, instead opting for precise wakeups from the mutex. - Cuts down on the number of mutex acquisitions we have to do (from 4 in the worst case to two). We end up simplifying most of the rtree code (which no longer has to deal with locking or concurrency at all), at the cost of additional complexity in the extent code: since the mutex protecting the rtree leaf elements is determined by reading the extent out of those elements, the initial read is racy, so that we may acquire an out of date mutex. We re-check the extent in the leaf after acquiring the mutex to protect us from this race.
* Allow mutexes to take a lock ordering enum at construction.David Goldblatt2017-05-1912-30/+75
| | | | | | | This lets us specify whether and how mutexes of the same rank are allowed to be acquired. Currently, we only allow two polices (only a single mutex at a given rank at a time, and mutexes acquired in ascending order), but we can plausibly allow more (e.g. the "release uncontended mutexes before blocking").
* Refactor *decay_time into *decay_ms.Jason Evans2017-05-1816-328/+320
| | | | | | | | Support millisecond resolution for decay times. Among other use cases this makes it possible to specify a short initial dirty-->muzzy decay phase, followed by a longer muzzy-->clean decay phase. This resolves #812.
* Add stats: arena uptime.Qi Wang2017-05-186-0/+42
|
* Avoid over-rebuilding due to namespace mangling.Jason Evans2017-05-172-3/+10
| | | | | | | Take care not to touch generated namespace mangling headers unless their contents would change. This resolves #838.
* Use srcroot path for private_namespace.sh.Qi Wang2017-05-161-2/+2
|
* Refactor (MALLOCX_ARENA_MAX + 1) to be MALLOCX_ARENA_LIMIT.Jason Evans2017-05-145-11/+11
| | | | This resolves #673.
* Automatically generate private symbol name mangling macros.Jason Evans2017-05-129-671/+239
| | | | | | | | Rather than using a manually maintained list of internal symbols to drive name mangling, add a compilation phase to automatically extract the list of internal symbols. This resolves #677.
* Remove unused private_unnamespace infrastructure.Jason Evans2017-05-123-15/+0
|
* Stop depending on JEMALLOC_N() for function interception during testing.Jason Evans2017-05-1213-281/+157
| | | | | | Instead, always define function pointers for interceptable functions, but mark them const unless testing, so that the compiler can optimize out the pointer dereferences.
* Do not build in parallel on AppVeyor.Jason Evans2017-05-121-2/+2
| | | | | | The compiler database used by MSVC is increasingly becoming corrupt, presumably due to concurrency-related corruption, despite the -FS compiler flag being specified as recommended.
* Update and rename INSTALL to INSTALL.mdArkady Shapkin2017-05-121-57/+107
|
* Specify -Werror for run_tests builds.Jason Evans2017-05-121-1/+1
|
* Avoid compiler warnings on Windows.Jason Evans2017-05-121-5/+5
|
* Remove mutex_prof_data_t redeclaration.Jason Evans2017-05-112-2/+1
| | | | | | | Redeclaration causes compilations failures with e.g. gcc 4.2.1 on FreeBSD. This regression was introduced by 89e2d3c12b573310e60b97beaf178007a71d83a3 (Header refactoring: ctl - unify and remove from catchall.).
* Add --with-version=VERSION .Jason Evans2017-05-032-6/+21
| | | | | | | This simplifies configuration when embedding a jemalloc release into another project's git repository. This resolves #811.
* Fix rtree_leaf_elm_szind_slab_update().Jason Evans2017-05-031-8/+7
| | | | | | | | | | | Re-read the leaf element when atomic CAS fails due to a race with another thread that has locked the leaf element, since atomic_compare_exchange_strong_p() overwrites the expected value with the actual value on failure. This regression was introduced by 0ee0e0c155a05d0d028a9972ad86b9eaac4ccabd (Implement compact rtree leaf element representation.). This resolves #798.
* rtree_leaf_elm_extent_write() --> rtree_leaf_elm_extent_lock_write()Jason Evans2017-05-031-8/+9
| | | | | | | Refactor rtree_leaf_elm_extent_write() as rtree_leaf_elm_extent_lock_write(), so that whether the leaf element is currently acquired is separate from what lock state to write. This allows for a relaxed atomic read when releasing the lock.
* Make VS2015 project work againrustyx2017-05-022-238/+9
|
* Revert "Use trylock in tcache_bin_flush when possible."Qi Wang2017-05-013-142/+63
| | | | | This reverts commit 8584adc451f31adfc4ab8693d9189cf3a7e5d858. Production results not favorable. Will investigate separately.
* Header refactoring: tsd - cleanup and dependency breaking.David Goldblatt2017-05-0129-913/+870
| | | | | | | | | | | | This removes the tsd macros (which are used only for tsd_t in real builds). We break up the circular dependencies involving tsd. We also move all tsd access through getters and setters. This allows us to assert that we only touch data when tsd is in a valid state. We simplify the usages of the x macro trick, removing all the customizability (get/set, init, cleanup), moving the lifetime logic to tsd_init and tsd_cleanup. This lets us make initialization order independent of order within tsd_t.
* Add extent_destroy_t and use it during arena destruction.Jason Evans2017-04-2910-17/+120
| | | | | | | | | | Add the extent_destroy_t extent destruction hook to extent_hooks_t, and use it during arena destruction. This hook explicitly communicates to the callee that the extent must be destroyed or tracked for later reuse, lest it be permanently leaked. Prior to this change, retained extents could unintentionally be leaked if extent retention was enabled. This resolves #560.
* Refactor !opt.munmap to opt.retain.Jason Evans2017-04-2916-43/+42
|
* Revert "Use try_flush first in tcache_dalloc."Qi Wang2017-04-281-10/+4
| | | | | | This reverts commit b0c2a28280d363fc85aa8b4fdbe7814ef46cb17b. Production benchmark shows this caused significant regression in both CPU and memory consumption. Will investigate separately later on.
* Inline tcache_bin_flush_small_impl / _large_impl.Qi Wang2017-04-281-2/+2
|
* Use try_flush first in tcache_dalloc.Qi Wang2017-04-261-4/+10
| | | | Only do must_flush if try_flush didn't manage to free anything.
* Use trylock in tcache_bin_flush when possible.Qi Wang2017-04-263-63/+142
| | | | | During tcache gc, use tcache_bin_try_flush_small / _large so that we can skip items with their bins locked already.
* Remove redundant extent lookup in tcache_bin_flush_large.Qi Wang2017-04-251-1/+1
|
* Avoid prof_dump during reentrancy.Qi Wang2017-04-252-12/+23
|
* Header refactoring: pages.h - unify and remove from catchall.David Goldblatt2017-04-256-34/+33
|
* Header refactoring: hash - unify and remove from catchall.David Goldblatt2017-04-255-4/+6
|