| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Avoid relying pthread_once which creates dependency during init.
|
|
|
|
|
| |
ctl_init sets isthreaded, which means it should be done without holding any
locks.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This prevents signals from being inadvertently delivered to background
threads.
|
|
|
|
|
| |
If neither background_thread nor lazy_lock is in use, do not abort on dlsym
errors.
|
| |
|
|
|
|
| |
Avoid calling pthread_create in postfork handlers.
|
|
|
|
|
| |
To avoid complications, avoid invoking pthread_create "internally", instead rely
on thread0 to launch new threads, and also terminating threads when asked.
|
|
|
|
| |
Also fix a compilation error #ifndef JEMALLOC_PTHREAD_CREATE_WRAPPER.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
The state initialization should be done before pthread_create.
|
|
|
|
|
| |
Refactor bootstrapping such that dlsym() is called during the
bootstrapping phase that can tolerate reentrant allocation.
|
| |
|
|
|
|
|
| |
Use a separate boolean to track the enabled status, instead of leaving the
global background thread status inconsistent.
|
|
|
|
|
|
| |
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.
|
| |
|
|
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).
|