summaryrefslogtreecommitdiffstats
path: root/test/unit/stats.c
Commit message (Collapse)AuthorAgeFilesLines
* Pull out arena_bin_info_t and arena_bin_t into their own file.David T. Goldblatt2017-12-191-1/+1
| | | | | In the process, kill arena_bin_index, which is unused. To follow are several diffs continuing this separation.
* Implementing opt.background_thread.Qi Wang2017-05-231-2/+4
| | | | | | | | | | | 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).
* Remove --disable-tcache.Jason Evans2017-04-211-8/+12
| | | | | | | | | | | Simplify configuration by removing the --disable-tcache option, but replace the testing for that configuration with --with-malloc-conf=tcache:false. Fix the thread.arena and thread.tcache.flush mallctls to work correctly if tcache is disabled. This partially resolves #580.
* Add basic reentrancy-checking support, and allow arena_new to reenter.David Goldblatt2017-04-071-1/+1
| | | | | | | | | This checks whether or not we're reentrant using thread-local data, and, if we are, moves certain internal allocations to use arena 0 (which should be properly initialized after bootstrapping). The immediate thing this allows is spinning up threads in arena_new, which will enable spinning up background threads there.
* Implement two-phase decay-based purging.Jason Evans2017-03-151-10/+26
| | | | | | | | | | | | | | | | | | | | Split decay-based purging into two phases, the first of which uses lazy purging to convert dirty pages to "muzzy", and the second of which uses forced purging, decommit, or unmapping to convert pages to clean or destroy them altogether. Not all operating systems support lazy purging, yet the application may provide extent hooks that implement lazy purging, so care must be taken to dynamically omit the first phase when necessary. The mallctl interfaces change as follows: - opt.decay_time --> opt.{dirty,muzzy}_decay_time - arena.<i>.decay_time --> arena.<i>.{dirty,muzzy}_decay_time - arenas.decay_time --> arenas.{dirty,muzzy}_decay_time - stats.arenas.<i>.pdirty --> stats.arenas.<i>.p{dirty,muzzy} - stats.arenas.<i>.{npurge,nmadvise,purged} --> stats.arenas.<i>.{dirty,muzzy}_{npurge,nmadvise,purged} This resolves #521.
* Implement per-CPU arena.Qi Wang2017-03-091-51/+47
| | | | | | | | | | | | | | | | | | The new feature, opt.percpu_arena, determines thread-arena association dynamically based CPU id. Three modes are supported: "percpu", "phycpu" and disabled. "percpu" uses the current core id (with help from sched_getcpu()) directly as the arena index, while "phycpu" will assign threads on the same physical CPU to the same arena. In other words, "percpu" means # of arenas == # of CPUs, while "phycpu" has # of arenas == 1/2 * (# of CPUs). Note that no runtime check on whether hyper threading is enabled is added yet. When enabled, threads will be migrated between arenas when a CPU change is detected. In the current design, to reduce overhead from reading CPU id, each arena tracks the thread accessed most recently. When a new thread comes in, we will read CPU id and update arena if necessary.
* Remove extraneous parens around return arguments.Jason Evans2017-01-211-3/+3
| | | | This resolves #540.
* Update brace style.Jason Evans2017-01-211-20/+10
| | | | | | | Add braces around single-line blocks, and remove line breaks before function-opening braces. This resolves #537.
* Remove leading blank lines from function bodies.Jason Evans2017-01-131-2/+0
| | | | This resolves #535.
* Uniformly cast mallctl[bymib]() oldp/newp arguments to (void *).Jason Evans2016-10-281-83/+92
| | | | | This avoids warnings in some cases, and is otherwise generally good hygiene.
* Remove all vestiges of chunks.Jason Evans2016-10-121-10/+5
| | | | | | | | Remove mallctls: - opt.lg_chunk - stats.cactive This resolves #464.
* Rename huge to large.Jason Evans2016-06-061-24/+24
|
* Move slabs out of chunks.Jason Evans2016-06-061-9/+9
|
* Use huge size class infrastructure for large size classes.Jason Evans2016-06-061-97/+8
|
* Fix more 64-to-32 conversion warnings.Jason Evans2016-04-121-5/+5
|
* Fix test_stats_arenas_summary fragility.Jason Evans2016-02-201-4/+4
| | | | | Fix test_stats_arenas_summary to deallocate before asserting that purging must have happened.
* Rename arena_maxclass to large_maxclass.Jason Evans2015-09-121-3/+3
| | | | | arena_maxclass is no longer an appropriate name, because arenas also manage huge allocations.
* Clarify relationship between stats.resident and stats.mapped.Jason Evans2015-05-301-3/+7
|
* Move centralized chunk management into arenas.Jason Evans2015-02-121-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate all centralized data structures related to huge allocations and recyclable chunks into arena_t, so that each arena can manage huge allocations and recyclable virtual memory completely independently of other arenas. Add chunk node caching to arenas, in order to avoid contention on the base allocator. Use chunks_rtree to look up huge allocations rather than a red-black tree. Maintain a per arena unsorted list of huge allocations (which will be needed to enumerate huge allocations during arena reset). Remove the --enable-ivsalloc option, make ivsalloc() always available, and use it for size queries if --enable-debug is enabled. The only practical implications to this removal are that 1) ivsalloc() is now always available during live debugging (and the underlying radix tree is available during core-based debugging), and 2) size query validation can no longer be enabled independent of --enable-debug. Remove the stats.chunks.{current,total,high} mallctls, and replace their underlying statistics with simpler atomically updated counters used exclusively for gdump triggering. These statistics are no longer very useful because each arena manages chunks independently, and per arena statistics provide similar information. Simplify chunk synchronization code, now that base chunk allocation cannot cause recursive lock acquisition.
* Fix test_stats_arenas_bins for 32-bit builds.Yuriy Kaminskiy2014-12-031-0/+1
|
* Add per size class huge allocation statistics.Jason Evans2014-10-131-9/+94
| | | | | | | | | | | | | Add per size class huge allocation statistics, and normalize various stats: - Change the arenas.nlruns type from size_t to unsigned. - Add the arenas.nhchunks and arenas.hchunks.<i>.size mallctl's. - Replace the stats.arenas.<i>.bins.<j>.allocated mallctl with stats.arenas.<i>.bins.<j>.curregs . - Add the stats.arenas.<i>.hchunks.<j>.nmalloc, stats.arenas.<i>.hchunks.<j>.ndalloc, stats.arenas.<i>.hchunks.<j>.nrequests, and stats.arenas.<i>.hchunks.<j>.curhchunks mallctl's.
* Rename "small" local variable, because windows headers #define itMike Hommey2014-05-271-4/+4
|
* Refactor huge allocation to be managed by arenas.Jason Evans2014-05-161-7/+11
| | | | | | | | | | | | | | | | | | | | Refactor huge allocation to be managed by arenas (though the global red-black tree of huge allocations remains for lookup during deallocation). This is the logical conclusion of recent changes that 1) made per arena dss precedence apply to huge allocation, and 2) made it possible to replace the per arena chunk allocation/deallocation functions. Remove the top level huge stats, and replace them with per arena huge stats. Normalize function names and types to *dalloc* (some were *dealloc*). Remove the --enable-mremap option. As jemalloc currently operates, this is a performace regression for some applications, but planned work to logarithmically space huge size classes should provide similar amortized performance. The motivation for this change was that mremap-based huge reallocation forced leaky abstractions that prevented refactoring.
* Fix mallctl argument size mismatches (size_t vs. uint64_t).Jason Evans2014-01-291-8/+15
| | | | Reported by İsmail Dönmez.
* Avoid lazy-lock in a tcache-dependent test.Jason Evans2014-01-211-14/+34
|
* Fix warnings and a test failure exposed on CentOS 6.3.Jason Evans2014-01-151-2/+5
|
* Add stats unit tests.Jason Evans2013-12-201-0/+350