Commit Graph

77 Commits

Author SHA1 Message Date
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
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
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
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
Vladimir Smirnov
48451182f8 Initial support for risc-v
Make ClickHouse compilable and runnable on risc-v 64

So far only basic functionality was tested (on real hw),
clickhouse server runs, exceptions works, client works,
simple tests works.

What doesn't work:
 1. traces - they are always empty
 2. system.stack_trace only have first frame
2021-11-11 19:23:34 +01:00
Azat Khuzhin
6a600e5f6f jemalloc: fix under osx (zone_register() had been optimized out again)
v2: use ld -u
v3: move -u to executable
2021-08-18 09:47:59 +03:00
Azat Khuzhin
342c3fae3a Revert "Disable jemalloc under OSX" (only jemalloc hunk)
This reverts commit f062aa8574.
2021-08-18 09:47:59 +03:00
Raúl Marín
f062aa8574 Disable jemalloc under OSX 2021-08-16 18:04:46 +02:00
sdk2
717f7ed01b
Update contrib/jemalloc-cmake/CMakeLists.txt 2021-06-07 16:38:24 +08:00
Alexey Milovidov
4ff812db7f Maybe better support for paths with whitespaces 2021-04-24 22:47:52 +03:00
Maksim Kita
4be441c6d5
Merge branch 'master' into support-apple-m1 2021-04-16 23:33:12 +03:00
Azat Khuzhin
29281ea6e0 jemalloc: set muzzy_decay_ms/dirty_decay_ms to 5s 2021-04-16 10:54:11 +03:00
Azat Khuzhin
da6dc64e04 jemalloc: set dirty_decay_ms/muzzy_decay_ms to 1 second 2021-04-15 00:34:46 +03:00
changvvb
06e23ab981
Apply suggestions from code review
Co-authored-by: Denis Glazachev <traceon@users.noreply.github.com>
2021-04-10 20:08:49 +08:00
changvvb
facbb0368b Merge branch 'master' of https://github.com/ClickHouse/ClickHouse into support-apple-m1 2021-04-09 23:19:19 +08:00
Denis Glazachev
4e58b6fe11 Syntax fix 2021-04-08 19:07:34 +04:00
Denis Glazachev
4b116c214c Disable jemalloc for ALL macOS non-RelWithDebInfo builds
Revisit default ENABLE_* flag setting
2021-04-08 19:05:04 +04:00
Nicolae Vartolomei
dd75447514 Experiment building jemalloc with profiling support for all builds to see how it impacts performance tests 2021-04-08 09:52:28 +01:00
changvvb
fdcf077cf5 Disabled rocksdb jemalloc 2021-04-06 17:06:18 +08:00
mastertheknife
2d83cb38a3 ppc64le: Enable building with jemalloc 2021-04-01 18:25:42 +03:00
Azat Khuzhin
c160b251ba Drop support for unbundled jemalloc
unbundled jemalloc cannot be used, since it includes jemalloc_cpp.o that
contains new/delete overrides, so as clickhouse [1]:

    ld.lld: error: duplicate symbol: operator delete(void*, unsigned long)
    >>> defined at new_delete.cpp:147 (../src/Common/new_delete.cpp:147)
    >>>            new_delete.cpp.o:(operator delete(void*, unsigned long)) in archive src/libclickhouse_new_delete.a
    >>> defined at jemalloc_cpp.o:(.text+0x160) in archive /usr/lib/x86_64-linux-gnu/libjemalloc.a

  [1]: https://clickhouse-builds.s3.yandex.net/15828/35335f07dbf8cab89b4188a674b033c28409dc7b/clickhouse_build_check/build_log_793952627_1602401325.txt
2020-10-11 11:18:56 +03:00
Azat Khuzhin
35335f07db Fix INTERFACE_COMPILE_DEFINITIONS for IMPORTED targets
INTERFACE_COMPILE_DEFINITIONS does not work IMPORTED targets:

From 3.6:

    Specify compile definitions to use when compiling a given <target>.
    The named <target> must have been created by a command such as
    add_executable() or add_library() and must not be an Imported Target.

Since 3.11:

    Specify compile definitions to use when compiling a given <target>.
    The named <target> must have been created by a command such as
    add_executable() or add_library() and must not be an ALIAS target.

And this causes the -Wundef warning:
    src/Functions/FunctionsHashing.h:1326:5: warning: 'USE_XXHASH' is not defined, evaluates to 0 [-Wundef]
2020-10-11 09:06:01 +03:00
Konstantin Podshumok
0ad4b5dea6
cmake: disable jemalloc on alternative arches and with sanitizers
Signed-off-by: Konstantin Podshumok <kpp.live+signed@gmail.com>
2020-08-25 20:16:39 +03:00
Konstantin Podshumok
d456aa86ef
Revert "Revert "cmake: Add option to fail configuration instead of auto-reconfiguration""
This reverts commit 89419ceb9b
(curl part moved to separate commit)

Squashed:
- termcap removed
- fix for cassandra on apple merged
- cmake: fix "Can't find system zlib library" in unbundled build
- cmake: fix condition when testing for rdkafka platform
- cmake: PROTOBUF_OLD_ABI_COMPAT shouldn't be enabled for internal protobuf

Signed-off-by: Konstantin Podshumok <kpp.live+signed@gmail.com>
2020-08-25 20:16:37 +03:00
alexey-milovidov
89419ceb9b
Revert "cmake: Add option to fail configuration instead of auto-reconfiguration" 2020-08-13 23:10:06 +03:00
Konstantin Podshumok
262080132b cmake: disabling silent reconfigurations in contrib/*/CMakeLists.txt
Signed-off-by: Konstantin Podshumok <kpp.live+signed@gmail.com>
2020-08-09 21:37:46 +03:00
Alexander Kuzmenkov
8c0177b216
Update contrib/jemalloc-cmake/CMakeLists.txt 2020-06-29 15:01:29 +03:00
Alexander Kuzmenkov
8b82ff215f muzzy decay 10 ms 2020-06-27 04:08:21 +03:00
Azat Khuzhin
236cac3d52 Fix jemalloc under OSX (by registering it as default zone explicitly)
In case of OSX jemalloc register itself as a default zone allocator.

But when you link statically then zone_register() will not be called,
and even will be optimized out:

  $ nm clickhouse.patched  | grep -c zone_register
  0

Fix this, by manually calling it.

v2: extern C
2020-06-24 21:05:35 +03:00
Azat Khuzhin
f76511668f jemalloc: disable it for darwin
Right now it aborts (Abort trap: 6) on osx, the issue does not looks
like [1], but should be investigated, so disable for now.

What is interesting that it works under debugger, so I guess it is
indeed the order of symbol replacements...

  [1]: https://github.com/jemalloc/jemalloc/issues/420
2020-06-23 11:40:34 +03:00
Azat Khuzhin
c230d76cb9 jemalloc: disable percpu_arena on non-linux (not supported anyway)
And since it does not supported it produces the following warning:
  <jemalloc>: No getcpu support: percpu_arena:percpu
  <jemalloc>: perCPU arena getcpu() not available. Setting narenas to 8.

However it is uses narenas=ncpu instead of default narenas=ncpu*4
2020-06-23 11:14:22 +03:00
Azat Khuzhin
8b6e2e6c67 jemalloc: drop superfluous include directory 2020-06-23 01:47:56 +03:00
Azat Khuzhin
77a3f606f4 jemalloc: enable by default for freebsd/darwin 2020-06-23 01:47:56 +03:00
Azat Khuzhin
210e67d831 jemalloc: allow changing default malloc_conf without purging cmake cache 2020-05-27 02:19:13 +03:00