summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'dev'5.3.0Qi Wang2022-05-06379-17135/+45977
|\
| * Update ChangeLog for 5.3.0.Qi Wang2022-05-061-0/+100
| |
| * Make the default option of zero realloc match the system allocator.Qi Wang2022-05-064-8/+26
| |
| * Make test/unit/background_thread_enable more conservative.Qi Wang2022-05-041-8/+19
| | | | | | | | To avoid resource exhaustion on 32-bit platforms.
| * Update TUNING.md to include the new tcache_max option.Qi Wang2022-05-041-4/+4
| |
| * Small doc tweak of opt.trust_madvise.Qi Wang2022-04-291-4/+3
| | | | | | | | Avoid quoted enabled and disabled because it's a bool type instead of char *.
| * Minor typo fix in doc.Qi Wang2022-04-281-1/+1
| |
| * Correct the name of stats.mutexes.prof_thds_data in doc.Qi Wang2022-04-261-1/+1
| |
| * Avoid abort() in test/integration/cpp/infallible_new_true.Qi Wang2022-04-254-46/+79
| | | | | | | | | | Allow setting the safety check abort hook through mallctl, which avoids abort() and core dumps.
| * fix some typoscuishuang2022-04-2510-11/+11
| | | | | | | | Signed-off-by: cuishuang <imcusg@gmail.com>
| * Rename zero_realloc option "strict" to "alloc".Qi Wang2022-04-207-16/+16
| | | | | | | | | | With realloc(ptr, 0) being UB per C23, the option name "strict" makes less sense now. Rename to "alloc" which describes the behavior.
| * Update FreeBSD image to 12.3 for cirrus ci.Qi Wang2022-04-191-1/+1
| |
| * Use volatile to workaround buffer overflow false positives.Qi Wang2022-04-041-5/+21
| | | | | | | | | | In test/integration/rallocx, full usable size is checked which may confuse overflow detection.
| * Reoreder TravisCI jobs to optimize CI timeAlex Lapenkou2022-03-292-77/+77
| | | | | | | | | | Sorting jobs by descending expected runtime helps to utilize concurrency better.
| * Enable TravisCI for WindowsAlex Lapenkou2022-03-292-1/+25
| |
| * Add FreeBSD to TravisCIAlex Lapenkou2022-03-295-0/+83
| | | | | | | | | | Implement the generation of Travis jobs for FreeBSD. The generated jobs replicate the existing CirrusCI config.
| * Do not disable SEC by default for 64k pages platformsAlex Lapenkou2022-03-252-2/+2
| | | | | | | | | | | | Default SEC max_alloc option value was 32k, disabling SEC for platforms with lg-page=16. This change enables SEC for all platforms, making minimum max_alloc value equal to PAGE.
| * Add comments and use meaningful vars in sz_psz2ind.Charles2022-03-245-10/+108
| |
| * Implement PAGE_FLOOR macroAlex Lapenkou2022-03-232-1/+4
| |
| * Fix size class calculation for secAlex Lapenkou2022-03-232-5/+9
| | | | | | | | | | | | Due to a bug in sec initialization, the number of cached size classes was equal to 198. The bug caused the creation of more than a hundred of unused bins, although it didn't affect the caching logic.
| * Add a default page size when cross-compile for Apple M1.Qi Wang2022-03-211-0/+9
| | | | | | | | | | When cross-compile for M1 and no page size specified, use the default 16K and skip detecting the page size (which is likely incorrect).
| * Fix FreeBSD system jemalloc TSD cleanupAlex Lapenkov2022-03-026-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, in case FreeBSD libc jemalloc was overridden by another jemalloc, proper thread shutdown callback was involved only for the overriding jemalloc. A call to _malloc_thread_cleanup from libthr would be redirected to user jemalloc, leaving data about dead threads hanging in system jemalloc. This change tackles the issue in two ways. First, for current and old system jemallocs, which we can not modify, the overriding jemalloc would locate and invoke system cleanup routine. For upcoming jemalloc integrations, the cleanup registering function will also be redirected to user jemalloc, which means that system jemalloc's cleanup routine will be registered in user's jemalloc and a single call to _malloc_thread_cleanup will be sufficient to invoke both callbacks.
| * Fix possible "nmalloc >= ndalloc" assertion.Azat Khuzhin2022-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is possible that ndalloc will be updated before nmalloc, in arena_large_ralloc_stats_update(), fix this by reorder those calls. It was found by ClickHouse CI, that periodically hits this assertion [1]. [1]: https://github.com/ClickHouse/ClickHouse/issues/31531 That issue contains lots of examples, with core dump and some gdb output [2]. [2]: https://s3.amazonaws.com/clickhouse-test-reports/34951/96390a9263cb5af3d6e42a84988239c9ae87ce32/stress_test__debug__actions_.html Here you can find binaries for that particular report [3] you need clickhouse debug build [4]. [3]: https://s3.amazonaws.com/clickhouse-builds/34951/96390a9263cb5af3d6e42a84988239c9ae87ce32/clickhouse_build_check_(actions)/report.html [4]: https://s3.amazonaws.com/clickhouse-builds/34951/96390a9263cb5af3d6e42a84988239c9ae87ce32/package_debug/clickhouse Brief info from that report: 2 0x000000002ad6dbfe in arena_stats_merge (tsdn=0x7f2399abdd20, arena=0x7f241ce01080, nthreads=0x7f24e4360958, dss=0x7f24e4360960, dirty_decay_ms=0x7f24e4360968, muzzy_decay_ms=0x7f24e4360970, nactive=0x7f24e4360978, ndirty=0x7f24e43 e4360988, astats=0x7f24e4360998, bstats=0x7f24e4363310, lstats=0x7f24e4364990, estats=0x7f24e4366e50, hpastats=0x7f24e43693a0, secstats=0x7f24e436a020) at ../contrib/jemalloc/src/arena.c:138 ndalloc = 226 nflush = 0 curlextents = 0 nmalloc = 225 nrequests = 0 Here you can see that they differs only by 1. Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
| * Fix failed assertion due to racy memory accessAlex Lapenkou2022-02-172-18/+63
| | | | | | | | | | | | | | | | | | | | While calculating the number of stashed pointers, multiple variables potentially modified by a concurrent thread were used for the calculation. This led to some inconsistencies, correctly detected by the assertions. The change eliminates some possible inconsistencies by using unmodified variables and only once a concurrently modified one. The assertions are omitted for the cases where we acknowledge potential inconsistencies too.
| * Properly detect background thread support on Darwin.Qi Wang2022-02-151-1/+2
| | | | | | | | | | When cross-compile, the host type / abi should be checked to determine background thread compatibility.
| * Document 'make uninstall'Alex Lapenkou2022-01-311-0/+4
| | | | | | | | Update INSTALL.md, reflecting the addition of 'uninstall' target.
| * Avoid overflow warnings in test/unit/safety_check.Qi Wang2022-01-271-6/+13
| |
| * Add a dependency checking step at the end of malloc_conf_init.Qi Wang2022-01-271-20/+19
| | | | | | | | Currently only prof_leak_error and prof_final are checked.
| * Initialize prof_leak during prof init.Qi Wang2022-01-272-1/+4
| | | | | | | | | | Otherwise, prof_leak may get set after prof_leak_error, and disagree with each other.
| * Disable TravisCI jobs generation for WindowsAlex Lapenkou2022-01-262-25/+1
| | | | | | | | | | | | These jobs take about 20 minutes to complete. We don't want to enable them until we switch to unlimited concurrency plan, otherwise the builds will take way too long.
| * Add Windows to TravisCIAlex Lapenkou2022-01-266-176/+376
| | | | | | | | | | | | | | | | | | Implement the generation of Travis jobs for Windows. Currently, the generated jobs replicate Appveyor setup and complete successfully. There is support for MinGW GCC and MSVC compilers as well as 64 and 32 bit compilation. Linux and MacOS jobs behave identically, but some environment variables change - CROSS_COMPILE_32BIT=yes is added for builds with cross compilation, empty COMPILER_FLAGS are not set anymore.
| * Add prof_leak_error optionyunxu2022-01-228-0/+56
| | | | | | | | | | | | The option makes the process to exit with error code 1 if a memory leak is detected. This is useful for implementing automated tools that rely on leak detection.
| * Forbid spaces in prefix and exec_prefixAlex Lapenkou2022-01-191-6/+8
| | | | | | | | | | Spaces in these are also not handled correctly by Make, so there's sense in not allowing that.
| * Forbid spaces in install suffixAlex Lapenkou2022-01-191-1/+4
| | | | | | | | | | | | | | | | To avoid potential issues with removing unintended files after 'make uninstall', spaces are no longer allowed in install suffix. It's worth mentioning, that with GNU Make on Linux spaces in install suffix didn't work anyway, leading to errors in the Makefile. But being verbose about this restriction makes it more transparent for the developers.
| * Add support for 'make uninstall'Shuduo Sang2022-01-191-0/+42
| |
| * Echo installed files via verbose 'install' commandAlex Lapenkou2022-01-191-13/+7
| | | | | | | | | | It's not necessary to manually echo all install commands, similar effect is achieved via 'install -v'
| * Avoid calculating size of size class twice & delete sc_data_global.Charles2022-01-181-5/+2
| |
| * Fix doc build with install-suffix.Qi Wang2022-01-121-3/+9
| |
| * Fix the HELP_STRING of --enable-doc.Qi Wang2022-01-121-1/+1
| |
| * Simplify arena_migrate() to take arena_t* instead of indices.Qi Wang2022-01-124-7/+6
| | | | | | | | | | This makes debugging slightly easier and avoids the confusion of "should we create new arenas" here.
| * Lower the num_threads in the stress test of test/unit/prof_recentQi Wang2022-01-121-1/+1
| | | | | | | | | | This takes a fair amount of resources. Under high concurrency it was causing resource exhaustion such as pthread_create and mmap failures.
| * Fix the extent state checking on the merge error path.Qi Wang2022-01-121-3/+17
| | | | | | | | | | | | With DSS as primary, the default merge impl will (correctly) decline to merge when one of the extent is non-dss. The error path should tolerate the not-merged extent being in a merging state.
| * FreeBSD also needs the OS-X "don't declare system functions asCraig Leres2022-01-111-1/+1
| | | | | | | | nothrow" fix since it also has jemalloc in the base system
| * Use the isb instruction instead of yield for spin locks on armJonathan Swinney2022-01-101-7/+8
| | | | | | | | isb introduces a small delay which is closer to the x86 pause instruction.
| * Add background thread sleep retry in test/unit/hpa_background_threadQi Wang2022-01-071-4/+12
| | | | | | | | | | | | Under high concurrency / heavy test load (e.g. using run_tests.sh), the background thread may not get scheduled for a longer period of time. Retry 100 times max before bailing out.
| * Purge all if the last thread migrated away from an arena.Qi Wang2022-01-071-0/+6
| |
| * #include <features.h> as requestedYuriy Chernyshov2022-01-061-0/+2
| |
| * Fix symbol conflict with musl libcYuriy Chernyshov2022-01-061-1/+1
| | | | | | | | | | `__libc` prefixed functions are used by musl libc as non-replaceable malloc stubs. Fix this conflict by checking if we are linking against glibc.
| * Fix two conversion warnings in tcache.Qi Wang2022-01-041-2/+6
| |
| * Fix unnecessary returns in san_(un)guard_pages_two_sided.Qi Wang2022-01-041-3/+2
| |