summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Add extent_grow_mtx in pre_ / post_fork handlers.Qi Wang2017-06-302-5/+15
| | | | This fixed the issue that could cause the child process to stuck after fork.
* Fix pthread_sigmask() usage to block all signals.Qi Wang2017-06-261-1/+1
|
* Switch ctl to explicitly use tsd instead of tsdn.Qi Wang2017-06-232-24/+23
|
* Check arena in current context in pre_reentrancy.Qi Wang2017-06-236-46/+47
|
* Set reentrancy when invoking customized extent hooks.Qi Wang2017-06-233-25/+102
| | | | | Customized extent hooks may malloc / free thus trigger reentry. Support this behavior by adding reentrancy on hook functions.
* Fix assertion typos.Jason Evans2017-06-232-2/+2
| | | | Reported by Conrad Meyer.
* Add thread name for background threads.Qi Wang2017-06-231-1/+3
|
* Avoid inactivity_check within background threads.Qi Wang2017-06-221-17/+22
| | | | | | Passing is_background_thread down the decay path, so that background thread itself won't attempt inactivity_check. This fixes an issue with background thread doing trylock on a mutex it already owns.
* Mask signals during background thread creation.Jason Evans2017-06-211-3/+35
| | | | | This prevents signals from being inadvertently delivered to background threads.
* Clear tcache_ql after fork in child.Qi Wang2017-06-201-0/+17
|
* Add minimal initialized TSD.Qi Wang2017-06-162-16/+38
| | | | | | | | | We use the minimal_initilized tsd (which requires no cleanup) for free() specifically, if tsd hasn't been initialized yet. Any other activity will transit the state from minimal to normal. This is to workaround the case where a thread has no malloc calls in its lifetime until during thread termination, free() happens after tls destructors.
* Pass tsd to tcache_flush().Qi Wang2017-06-162-3/+2
|
* Log decay->nunpurged before purging.Qi Wang2017-06-151-2/+3
| | | | | During purging, we may unlock decay->mtx. Therefore we should finish logging decay related counters before attempt to purge.
* Only abort on dlsym when necessary.Qi Wang2017-06-142-3/+18
| | | | | If neither background_thread nor lazy_lock is in use, do not abort on dlsym errors.
* Fix extent_hooks in extent_grow_retained().Qi Wang2017-06-141-3/+12
| | | | | | | This issue caused the default extent alloc function to be incorrectly used even when arena.<i>.extent_hooks is set. This bug was introduced by 411697adcda2fd75e135cdcdafb95f2bd295dc7f (Use exponential series to size extents.), which was first released in 5.0.0.
* Combine background_thread started / paused into state.Qi Wang2017-06-122-29/+50
|
* Not re-enable background thread after fork.Qi Wang2017-06-122-36/+46
| | | | Avoid calling pthread_create in postfork handlers.
* Move background thread creation to background_thread_0.Qi Wang2017-06-122-144/+249
| | | | | To avoid complications, avoid invoking pthread_create "internally", instead rely on thread0 to launch new threads, and also terminating threads when asked.
* Normalize background thread configuration.Jason Evans2017-06-091-0/+2
| | | | Also fix a compilation error #ifndef JEMALLOC_PTHREAD_CREATE_WRAPPER.
* Update a UTRACE() size argument.Jason Evans2017-06-081-1/+1
|
* Add internal tsd for background_thread.Qi Wang2017-06-082-6/+14
|
* Drop high rank locks when creating threads.Qi Wang2017-06-084-13/+42
| | | | | | Avoid holding arenas_lock and background_thread_lock when creating background threads, because pthread_create may take internal locks, and potentially cause deadlock with jemalloc internal locks.
* Make tsd no-cleanup during tsd reincarnation.Qi Wang2017-06-072-21/+48
| | | | | Since tsd cleanup isn't guaranteed when reincarnated, we set up tsd in a way that needs no cleanup, by making it going through slow path instead.
* Remove assertions on extent_hooks being default.Qi Wang2017-06-051-16/+0
| | | | | It's possible to customize the extent_hooks while still using part of the default implementation.
* Take background thread lock when setting extent hooks.Qi Wang2017-06-052-3/+13
|
* Set reentrancy level to 1 during init.Qi Wang2017-06-021-15/+28
| | | | This makes sure we go down slow path w/ a0 in init.
* Set isthreaded when enabling background_thread.Qi Wang2017-06-022-23/+40
|
* Fix background thread creation.Qi Wang2017-06-011-13/+17
| | | | The state initialization should be done before pthread_create.
* Refactor/fix background_thread/percpu_arena bootstrapping.Jason Evans2017-06-015-93/+114
| | | | | Refactor bootstrapping such that dlsym() is called during the bootstrapping phase that can tolerate reentrant allocation.
* Witness assertions: only assert locklessness when non-reentrant.David Goldblatt2017-06-011-49/+62
| | | | | Previously we could still hit these assertions down error paths or in the extended API.
* Use real pthread_create for creating background threads.Qi Wang2017-05-312-3/+9
|
* Header refactoring: Pull size helpers out of jemalloc module.David Goldblatt2017-05-3111-189/+198
|
* Header refactoring: unify and de-catchall mutex_pool.David Goldblatt2017-05-312-0/+2
|
* Header refactoring: unify and de-catchall extent_mmap module.David Goldblatt2017-05-317-0/+7
|
* Header refactoring: unify and de-catchall extent_dss.David Goldblatt2017-05-315-0/+5
|
* Header refactoring: unify and de-catchall rtree module.David Goldblatt2017-05-315-0/+5
|
* Pass the O_CLOEXEC flag to open(2).Jason Evans2017-05-312-4/+5
| | | | This resolves #528.
* Track background thread status separately at fork.Qi Wang2017-05-311-3/+8
| | | | | Use a separate boolean to track the enabled status, instead of leaving the global background thread status inconsistent.
* Output total_wait_ns for bin mutexes.Qi Wang2017-05-311-19/+5
|
* Explicitly say so when aborting on opt_abort_conf.Qi Wang2017-05-311-2/+10
|
* Add the --disable-thp option to support cross compiling.Jason Evans2017-05-302-0/+4
| | | | This resolves #669.
* Fix npages during arena_decay_epoch_advance().Qi Wang2017-05-301-20/+14
| | | | | We do not lock extents while advancing epoch. This change makes sure that we only read npages from extents once in order to avoid any inconsistency.
* Fix extent_grow_next management.Jason Evans2017-05-302-150/+211
| | | | | | | | | | | | | Fix management of extent_grow_next to serialize operations that may grow retained memory. This assures that the sizes of the newly allocated extents correspond to the size classes in the intended growth sequence. Fix management of extent_grow_next to skip size classes if a request is too large to be satisfied by the next size in the growth sequence. This avoids the potential for an arbitrary number of requests to bypass triggering extent_grow_next increases. This resolves #858.
* Fix OOM paths in extent_grow_retained().Jason Evans2017-05-301-2/+8
|
* Add opt.stats_print_opts.Qi Wang2017-05-293-43/+52
| | | | The value is passed to atexit(3)-triggered malloc_stats_print() calls.
* Added opt_abort_conf: abort on invalid config options.Qi Wang2017-05-273-0/+22
|
* Cleanup smoothstep.sh / .h.Qi Wang2017-05-251-1/+1
| | | | h_step_sum was used to compute moving sum. Not in use anymore.
* Fix stats.mapped during deallocation.Qi Wang2017-05-241-1/+1
|
* Header refactoring: unify and de-catchall mutex moduleDavid Goldblatt2017-05-2412-0/+24
|
* Header refactoring: unify and de-catchall witness code.David Goldblatt2017-05-246-74/+100
|