Commit Graph

130 Commits

Author SHA1 Message Date
Antonio Andelic
c93d8cbb66 Fixes 2024-07-04 13:57:47 +02:00
Antonio Andelic
5fd36059e4 Try disabling background threads 2024-07-03 15:28:01 +02:00
Antonio Andelic
8f9beffc65 No jemalloc profiler for non-Linux 2024-06-28 16:04:45 +02:00
Antonio Andelic
c9fa974472 Use background thread 2024-06-27 08:46:10 +02:00
Antonio Andelic
35820eaa7b Build jemalloc with profiler 2024-06-26 11:13:18 +02:00
Antonio Andelic
b3dc2f6870
Merge pull request #58648 from ClickHouse/jemalloc-disable-muzzy-decay
Try disabling `muzzy_decay_ms` in jemalloc
2024-01-17 16:23:25 +01:00
Alexey Milovidov
3b1cc5179b Fix error 2024-01-14 08:05:57 +01:00
Antonio Andelic
f7d171e6a3 Try disabling muzzy_decay_ms 2024-01-10 11:10:30 +00:00
袁焊忠
47d9b0e6a1
[hotfix] [docs] Fix typo 2023-11-02 15:56:45 +08:00
Alexey Milovidov
f0f69a2e3a Update CMakeLists.txt 2023-07-14 10:13:36 -04:00
Alexey Milovidov
b2546c8bb5 Update CMakeLists.txt 2023-07-14 10:13:36 -04:00
Alexey Milovidov
efa78a377e Update CMakeLists.txt 2023-07-14 10:13:36 -04:00
Boris Kuschel
dff5d78126 Add jemalloc support 2023-07-14 10:13:36 -04:00
Azat Khuzhin
a10aa9ad50 Force libunwind usage (removes gcc_eh support)
libunwind is reentrant and signal safe, and works faster then then
gcc_eh (plus it has some custom patches for problems that have been
found during it's usage in ClickHouse).

gcc_eh may be missing in the system (if gcc was not installed), and
even if it exists clickhouse uses -nodefaultlibs, so some care should be
made to make it work.

Also this library is tiny and there shouln't be any problem to require
it always (there is already tendency to require some contrib libraries,
i.e. poco).

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-08 20:55:50 +02:00
Michael Kolupaev
10d597676c Refactor IColumn::forEachSubcolumn to make it slightly harder to implement incorrectly 2023-06-16 11:08:12 -07:00
Alexey Milovidov
9a48cf0da8
Merge pull request #40422 from pkubaj/patch-1
Add FreeBSD/powerpc64le support
2022-12-11 09:38:04 +03:00
Azat Khuzhin
95b3a02779 Fix strerror_r() configuration for jemalloc with musl under clang-15
Build error [1]:

    Sep 06 18:40:53 FAILED: contrib/jemalloc-cmake/CMakeFiles/_jemalloc.dir/__/jemalloc/src/malloc_io.c.o
    Sep 06 18:40:53 /usr/bin/ccache /usr/bin/clang-15 --target=x86_64-linux-musl --sysroot=/build/cmake/linux/../../contrib/sysroot/linux-x86_64-musl -DHAS_RESERVED_IDENTIFIER -DJEMALLOC_NO_PRIVATE_NAMESPACE -DJEMALLOC_PROF=1 -DJEMALLOC_PROF_LIBGCC=1 -DSTD_EXCEPTION_HAS_STACK_TRACE=1 -DUSE_MUSL=1 -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -D_LIBCPP_HAS_MUSL_LIBC=1 -I../contrib/jemalloc/include -isystem ../contrib/jemalloc-cmake/include -isystem contrib/jemalloc-cmake/include_linux_x86_64_musl/jemalloc/internal -isystem ../contrib/libcxx/include -isystem ../contrib/libcxxabi/include -isystem ../contrib/libunwind/include --gcc-toolchain=/build/cmake/linux/../../contrib/sysroot/linux-x86_64-musl --gcc-toolchain=/build/cmake/linux/../../contrib/sysroot/linux-x86_64-musl -fdiagnostics-color=always -Xclang -fuse-ctor-homing  -gdwarf-aranges -pipe -mssse3 -msse4.1 -msse4.2 -mpclmul -mpopcnt -fasynchronous-unwind-tables -ffile-prefix-map=/build=. -falign-functions=32 -mbranches-within-32B-boundaries  -fdiagnostics-absolute-paths -fexperimental-new-pass-manager -w -O2 -g -DNDEBUG -O3 -g -gdwarf-4  -flto=thin -fwhole-program-vtables -fno-pie   -D OS_LINUX -D_GNU_SOURCE -Werror -std=gnu11 -MD -MT contrib/jemalloc-cmake/CMakeFiles/_jemalloc.dir/__/jemalloc/src/malloc_io.c.o -MF contrib/jemalloc-cmake/CMakeFiles/_jemalloc.dir/__/jemalloc/src/malloc_io.c.o.d -o contrib/jemalloc-cmake/CMakeFiles/_jemalloc.dir/__/jemalloc/src/malloc_io.c.o   -c ../contrib/jemalloc/src/malloc_io.c
    Sep 06 18:40:53 /build/contrib/jemalloc/src/malloc_io.c💯8: error: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion]
    Sep 06 18:40:53         char *b = strerror_r(err, buf, buflen);
    Sep 06 18:40:53               ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Sep 06 18:40:53 1 error generated.

  [1]: https://s3.amazonaws.com/clickhouse-builds/41046/0e9265ad951d40cdce3716fb8a679360b2e0c156/package_release/build_log.log

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-09-10 21:38:35 +02:00
pkubaj
17f757a94c Add FreeBSD/powerpc64le support 2022-08-19 21:41:03 +02:00
Azat Khuzhin
1f049e8bac Bump jemalloc to fix possible assertion
This patch also updates the jemalloc version.

Note, that I've enabled page_id for jemalloc
PR_SET_VMA/PR_SET_VMA_ANON_NAME, that requires linux 5.17+ (but ignores
EINVAL anyway).

v2: add -isystem to fix reserved name for JEMALLOC_OVERRIDE___LIBC_PVALLOC
Refs: https://github.com/jemalloc/jemalloc/pull/2304
Refs: https://github.com/ClickHouse/ClickHouse/issues/31531
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-12 07:57:27 +03:00
Robert Schulze
933f98a900
Removed warning flags in contribs
warnings are disabled for all contribs in contrib/CMakeLists.txt already
2022-06-01 11:02:39 +02:00
Alexey Milovidov
dd2b2380fa Add a comment #37078 2022-05-24 04:22:51 +02:00
mergify[bot]
cc1362511a
Merge branch 'master' into patch-2 2022-05-23 00:12:44 +00:00
Robert Schulze
eb9f11da3d
Replace variable ARCH_ARM by ARCH_AARCH64
Both are equivalent and removing the duplication was a leftover of PR #36614
2022-05-15 09:48:02 +02:00
Yuriy Chernyshov
6d28b22687
Fix jemalloc compatibility with LLVM libunwind
jemalloc provides support for two different libunwind flavors: the original HP libunwind and the one coming with gcc / g++ / libstdc++.

The latter is identified by `JEMALLOC_PROF_LIBGCC` and provides `_Unwind_Backtrace` method instead of `unw_backtrace`.
At the time ClickHouse uses LLVM libunwind which follows libgcc's way of backtracing.

ClickHouse has to provide `unw_backtrace` method by the means of [commit 8e2b31e](8e2b31e766).

While this PR does not allow complete remove of the patch (as ClickHouse itself uses unw_backtrace directly), it definitely sorts the things out.
2022-05-10 16:14:59 +03:00
alesapin
ffca5c3cdc
Merge branch 'master' into musl-check 2022-04-19 17:51:54 +02:00
Azat Khuzhin
91979cdd17 jemalloc: enable logging in debug build
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-04-18 23:06:41 +03:00
alesapin
f011864386 Build clickhouse-keeper with musl 2022-04-12 18:48:16 +02:00
zhanghuajie
53a8987b3b fix build fail with gcc --fix warnings without disabling some parameters 2022-03-11 21:59:19 +08:00
Azat Khuzhin
01583ba10e jemalloc: fix includes order to avoid overlaps
If you had jemalloc build in contrib/jemalloc, and not current version
but some outdated, then compiler will pick incorrect file and may fail.

Also SYSTEM should be removed since regular -I is in the different list,
and will be checked before -isystem.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-21 08:32:45 +03:00
Azat Khuzhin
5a8cf3ac98 jemalloc: update version (to 5.3-rc) and commit SHA1
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:30:55 +03:00
Azat Khuzhin
c045a95a37 jemalloc: update provisioned headers for freebsd aarch64
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
d3b60c011c jemalloc: update provisioned headers for freebsd x86_64
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
04be7a5809 jemalloc: update provisioned headers for darwin aarch64
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
ac31c648ab jemalloc: update provisioned headers for darwin x86_64
Generated on osx 10.14

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
054e84c382 jemalloc: add a note about JEMALLOC_PREFIX
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
4d3c4c7c8c jemalloc: update provisioned headers for linux aarch64
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
ddcf0f96e8 jemalloc: update provisioned headers for linux ppc64le
v2: define JEMALLOC_DEFINE_MADVISE_FREE
    https://s3.amazonaws.com/clickhouse-builds/33057/6482a1c48f22d80f704bf869857091045a3f6917/binary_ppc64le/build_log.log
v3: fix pthread_atfork
    https://github.com/ClickHouse/ClickHouse/runs/5128801105?check_suite_focus=true

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>

f
2022-02-17 21:25:58 +03:00
Azat Khuzhin
bd5137db15 jemalloc: update provisioned headers for linux riscv64
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
bc5aeb4dcf jemalloc: add a note about musl support
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
daa292cf5a jemalloc: remove README for linux x86_64
Note, that there is no need to disable JEMALLOC_PURGE_MADVISE_FREE,
since jemalloc does check in runtime, and ClickHouse already
successfully works w/o this change.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
1a98c1aace jemalloc: move JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF out from per-arch
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
e962649899 jemalloc: correctly disable JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
560f813c46 jemalloc: cleanup README for linux x86_64
- remove GNU_SOURCE it is done in common CMakeLists.txt
- remove JEMALLOC_OVERRIDE___POSIX_MEMALIGN (there is no need to since
  __posix_memalign() does not exists in linux)

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
be4d95e444 jemalloc: remove superfluous READMEs
Those were just copied from include_linux_x86_64, and replaced x86_64
with the arch.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
bc183223c5 jemalloc: update provisioned headers for linux x86_64
v2: update jemalloc

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
0c73b860e5 jemalloc: update generic headers
v2: update jemalloc one more time
v3:
- do not include jemalloc_mangle*.h
- do not change jemalloc.h
- fix for JEMALLOC_NOTHROW/JEMALLOC_SYS_NOTHROW

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
569d613326 jemalloc: update cmake rules
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-17 21:25:58 +03:00
Azat Khuzhin
eba636613a contrib/jemalloc: use hidden library
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-21 10:11:22 +03:00
Azat Khuzhin
a6d482d3e1 Cleanup jemalloc contrib 2022-01-20 10:02:03 +03:00
Azat Khuzhin
4709ff9340 More generic check for CMAKE_BUILD_TYPE in jemalloc 2021-12-04 09:19:34 +03:00