mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 13:13:06 +00:00
Implementing opt.background_thread.
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).
This commit is contained in:
@@ -115,8 +115,10 @@ TEST_BEGIN(test_stats_arenas_summary) {
|
||||
"Unexepected mallctl() result");
|
||||
|
||||
if (config_stats) {
|
||||
assert_u64_gt(dirty_npurge + muzzy_npurge, 0,
|
||||
"At least one purge should have occurred");
|
||||
if (!background_thread_enabled()) {
|
||||
assert_u64_gt(dirty_npurge + muzzy_npurge, 0,
|
||||
"At least one purge should have occurred");
|
||||
}
|
||||
assert_u64_le(dirty_nmadvise, dirty_purged,
|
||||
"dirty_nmadvise should be no greater than dirty_purged");
|
||||
assert_u64_le(muzzy_nmadvise, muzzy_purged,
|
||||
|
||||
Reference in New Issue
Block a user