summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix signed/unsigned comparison in arena_lg_dirty_mult_valid().Jason Evans2015-03-242-4/+5
|
* Fix arena_get() usage.Jason Evans2015-03-241-5/+17
| | | | | | | | Fix arena_get() calls that specify refresh_if_missing=false. In ctl_refresh() and ctl.c's arena_purge(), these calls attempted to only refresh once, but did so in an unreliable way. arena_i_lg_dirty_mult_ctl() was simply wrong to pass refresh_if_missing=false.
* We have pages_unmap(ret, size) so we use it.Igor Podlesny2015-03-241-9/+1
|
* Add the "stats.allocated" mallctl.Jason Evans2015-03-248-23/+67
|
* Fix indentation inconsistencies.Igor Podlesny2015-03-221-6/+6
|
* Fix a compile error caused by mixed declarations and code.Qinfan Wu2015-03-211-2/+3
|
* Fix lg_dirty_mult-related stats printing.Jason Evans2015-03-211-66/+82
| | | | | | | | This regression was introduced by 8d6a3e8321a7767cb2ca0930b85d5d488a8cc659 (Implement dynamic per arena control over dirty page purging.). This resolves #215.
* Restore --enable-ivsalloc.Jason Evans2015-03-196-5/+43
| | | | | | | | | However, unlike before it was removed do not force --enable-ivsalloc when Darwin zone allocator integration is enabled, since the zone allocator code uses ivsalloc() regardless of whether malloc_usable_size() and sallocx() do. This resolves #211.
* Implement dynamic per arena control over dirty page purging.Jason Evans2015-03-1913-96/+457
| | | | | | | | | | | | | | Add mallctls: - arenas.lg_dirty_mult is initialized via opt.lg_dirty_mult, and can be modified to change the initial lg_dirty_mult setting for newly created arenas. - arena.<i>.lg_dirty_mult controls an individual arena's dirty page purging threshold, and synchronously triggers any purging that may be necessary to maintain the constraint. - arena.<i>.chunk.purge allows the per arena dirty page purging function to be replaced. This resolves #93.
* Use InterlockedCompareExchange instead of non-existing ↵Mike Hommey2015-03-171-1/+1
| | | | InterlockedCompareExchange32
* Fix heap profiling regressions.Jason Evans2015-03-162-13/+31
| | | | | | | | | | | | | | | Remove the prof_tctx_state_destroying transitory state and instead add the tctx_uid field, so that the tuple <thr_uid, tctx_uid> uniquely identifies a tctx. This assures that tctx's are well ordered even when more than two with the same thr_uid coexist. A previous attempted fix based on prof_tctx_state_destroying was only sufficient for protecting against two coexisting tctx's, but it also introduced a new dumping race. These regressions were introduced by 602c8e0971160e4b85b08b16cf8a2375aa24bc04 (Implement per thread heap profiling.) and 764b00023f2bc97f240c3a758ed23ce9c0ad8526 (Fix a heap profiling regression.).
* Eliminate innocuous compiler warnings.Jason Evans2015-03-141-0/+2
|
* Fix a heap profiling regression.Jason Evans2015-03-142-13/+32
| | | | | | | | | | Add the prof_tctx_state_destroying transitionary state to fix a race between a thread destroying a tctx and another thread creating a new equivalent tctx. This regression was introduced by 602c8e0971160e4b85b08b16cf8a2375aa24bc04 (Implement per thread heap profiling.).
* use CLOCK_MONOTONIC in the timer if it's availableDaniel Micay2015-03-132-0/+27
| | | | | | Linux sets _POSIX_MONOTONIC_CLOCK to 0 meaning it *might* be available, so a sysconf check is necessary at runtime with a fallback to the mandatory CLOCK_REALTIME clock.
* Use the error code given to buferror on WindowsMike Hommey2015-03-131-1/+1
| | | | | | | | a14bce85 made buferror not take an error code, and make the Windows code path for buferror use GetLastError, while the alternative code paths used errno. Then 2a83ed02 made buferror take an error code again, and while it changed the non-Windows code paths to use that error code, the Windows code path was not changed accordingly.
* Fix a heap profiling regression.Jason Evans2015-03-121-2/+7
| | | | | | | | | | Fix prof_tctx_comp() to incorporate tctx state into the comparison. During a dump it is possible for both a purgatory tctx and an otherwise equivalent nominal tctx to reside in the tree at the same time. This regression was introduced by 602c8e0971160e4b85b08b16cf8a2375aa24bc04 (Implement per thread heap profiling.).
* Fix unsigned comparison underflow.Jason Evans2015-03-122-2/+2
| | | | These bugs only affected tests and debug builds.
* Fix a declaration-after-statement regression.Jason Evans2015-03-111-3/+2
|
* Normalize rdelm/rd structure field naming.Jason Evans2015-03-113-27/+27
|
* Refactor dirty run linkage to reduce sizeof(extent_node_t).Jason Evans2015-03-114-57/+95
|
* Update ChangeLog.Jason Evans2015-03-091-1/+150
|
* Fix a chunk_recycle() regression.Jason Evans2015-03-071-4/+15
| | | | | | This regression was introduced by 97c04a93838c4001688fe31bf018972b4696efe2 (Use first-fit rather than first-best-fit run/chunk allocation.).
* Use first-fit rather than first-best-fit run/chunk allocation.Jason Evans2015-03-073-30/+87
| | | | | | | This tends to more effectively pack active memory toward low addresses. However, additional tree searches are required in many cases, so whether this change stands the test of time will depend on real-world benchmarks.
* Quantize szad trees by size class.Jason Evans2015-03-074-14/+39
| | | | | | | Treat sizes that round down to the same size class as size-equivalent in trees that are used to search for first best fit, so that there are only as many "firsts" as there are size classes. This comes closer to the ideal of first fit.
* Change default chunk size from 4 MiB to 256 KiB.Jason Evans2015-03-072-14/+14
| | | | | | | | Recent changes have improved huge allocation scalability, which removes upward pressure to set the chunk size so large that huge allocations are rare. Smaller chunks are more likely to completely drain, so set the default to the smallest size that doesn't leave excessive unusable trailing space in chunk headers.
* Preserve LastError when calling TlsGetValueMike Hommey2015-03-041-2/+6
| | | | | | | TlsGetValue has a semantic difference with pthread_getspecific, in that it can return a non-error NULL value, so it always sets the LastError. But allocator callers may not be expecting calling e.g. free() to change the value of the last error, so preserve it.
* Make --without-export actually workMike Hommey2015-03-042-5/+15
| | | | | 9906660 added a --without-export configure option to avoid exporting jemalloc symbols, but the option didn't actually work.
* adding support for bitrigDave Huseby2015-02-261-1/+1
|
* Fix a compilation error and an incorrect assertion.Jason Evans2015-02-191-2/+2
|
* Fix chunk cache races.Jason Evans2015-02-195-134/+258
| | | | | | These regressions were introduced by ee41ad409a43d12900a5a3108f6c14f84e4eb0eb (Integrate whole chunks into unused dirty page purging machinery.).
* Rename "dirty chunks" to "cached chunks".Jason Evans2015-02-187-86/+91
| | | | | | | | | | Rename "dirty chunks" to "cached chunks", in order to avoid overloading the term "dirty". Fix the regression caused by 339c2b23b2d61993ac768afcc72af135662c6771 (Fix chunk_unmap() to propagate dirty state.), and actually address what that change attempted, which is to only purge chunks once, and propagate whether zeroed pages resulted into chunk_record().
* Fix chunk_unmap() to propagate dirty state.Jason Evans2015-02-183-8/+14
| | | | | | | | | | | | Fix chunk_unmap() to propagate whether a chunk is dirty, and modify dirty chunk purging to record this information so it can be passed to chunk_unmap(). Since the broken version of chunk_unmap() claimed that all chunks were clean, this resulted in potential memory corruption for purging implementations that do not zero (e.g. MADV_FREE). This regression was introduced by ee41ad409a43d12900a5a3108f6c14f84e4eb0eb (Integrate whole chunks into unused dirty page purging machinery.).
* arena_chunk_dirty_node_init() --> extent_node_dirty_linkage_init()Jason Evans2015-02-183-11/+13
|
* Remove obsolete type arena_chunk_miscelms_t.Jason Evans2015-02-181-1/+0
|
* Simplify extent_node_t and add extent_node_init().Jason Evans2015-02-176-43/+39
|
* Integrate whole chunks into unused dirty page purging machinery.Jason Evans2015-02-1712-249/+632
| | | | | | | | | | | | Extend per arena unused dirty page purging to manage unused dirty chunks in aaddtion to unused dirty runs. Rather than immediately unmapping deallocated chunks (or purging them in the --disable-munmap case), store them in a separate set of trees, chunks_[sz]ad_dirty. Preferrentially allocate dirty chunks. When excessive unused dirty pages accumulate, purge runs and chunks in ingegrated LRU order (and unmap chunks in the --enable-munmap case). Refactor extent_node_t to provide accessor functions.
* Remove more obsolete (incorrect) assertions.Jason Evans2015-02-161-2/+0
| | | | | | | This regression was introduced by 88fef7ceda6269598cef0cee8b984c8765673c27 (Refactor huge_*() calls into arena internals.), and went undetected because of the --enable-debug regression.
* Remove obsolete (incorrect) assertions.Jason Evans2015-02-162-23/+24
| | | | | | | This regression was introduced by 88fef7ceda6269598cef0cee8b984c8765673c27 (Refactor huge_*() calls into arena internals.), and went undetected because of the --enable-debug regression.
* Fix --enable-debug regression.Jason Evans2015-02-161-0/+3
| | | | | | Fix --enable-debug to actually enable debug mode. This regression was introduced by cbf3a6d70371d2390b8b0e76814e04cc6088002c (Move centralized chunk management into arenas.).
* Normalize *_link and link_* fields to all be *_link.Jason Evans2015-02-164-13/+12
|
* Remove redundant tcache_boot() call.Jason Evans2015-02-151-2/+0
|
* If MALLOCX_ARENA(a) is specified, use it during tcache fill.Jason Evans2015-02-133-36/+37
|
* Take into account the install suffix that jemalloc was built with in the ↵Abhishek Kulkarni2015-02-131-1/+2
| | | | | | pkg-config file. Signed-off-by: Abhishek Kulkarni <adkulkar@umail.iu.edu>
* Put VERSION file in object directoryDan McGregor2015-02-132-12/+16
| | | | | | Also allow for the possibility that there exists a VERSION file in the srcroot, in case of building from a release tarball out of tree.
* Build docs in object directoryDan McGregor2015-02-131-4/+4
|
* Make prof_tctx accesses atomic.Jason Evans2015-02-121-4/+10
| | | | | | | | Although exceedingly unlikely, it appears that writes to the prof_tctx field of arena_chunk_map_misc_t could be reordered such that a stale value could be read during deallocation, with profiler metadata corruption and invalid pointer dereferences being the most likely effects.
* Refactor huge_*() calls into arena internals.Jason Evans2015-02-124-225/+236
| | | | | Make redirects to the huge_*() API the arena code's responsibility, since arenas now take responsibility for all allocation sizes.
* add missing check for new_addr chunk sizeDaniel Micay2015-02-121-1/+1
| | | | | | 8ddc93293cd8370870f221225ef1e013fbff6d65 switched this to over using the address tree in order to avoid false negatives, so it now needs to check that the size of the free extent is large enough to satisfy the request.
* Move centralized chunk management into arenas.Jason Evans2015-02-1226-555/+394
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update ckh to support metadata allocation tracking.Jason Evans2015-02-121-9/+11
|