Repository navigation
Build the CI toolchain with jemalloc 5.4.0 using transparent huge pages - #131745
Conversation
The toolchain job now builds jemalloc 5.4.0 from the sha256-pinned release tarball in a new stage and links its libjemalloc_pic.a into the stage 2 executables instead of Ubuntu noble's 5.3.0 from libjemalloc-dev, which is removed from the binary-builder image (nothing else used it). The archive is configured with --with-malloc-conf=thp:always,metadata_thp:always, so clang and lld ask for transparent huge pages for the heap and jemalloc's metadata (madvise on hosts in THP mode `madvise`); MALLOC_CONF still overrides it at run time. On Graviton3 the same jemalloc preloaded into the toolchain made a clean `ninja clickhouse` 13.2% faster and the ThinLTO link 4.7% faster (ClickHouse#131183 (comment)). --with-lg-page=16 on aarch64 because jemalloc refuses to start when the kernel page is larger than its own; --with-lg-hugepage=21 so the value does not depend on the build runner's /proc/meminfo; -g0 because configure adds -g3 by default. -lm is no longer needed: jemalloc only calls libm from its profiling code, which this build does not enable. The license now comes from the tarball's COPYING. Related: ClickHouse#131183 Related: ClickHouse#130064 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings), plus my own review (1 nit worth noting).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261115-043300 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261115-030200 |
|
Workflow [PR], commit [7074ad5] Summary: ✅
AI ReviewSummaryBuilds SHA-256-pinned jemalloc 5.4.0 for the stage 2 toolchain, enables transparent huge pages, includes the upstream license, and removes the distro dependency. No actionable findings. The supplied comparative benchmarks and local validation support the change; the fragmented-host performance tradeoff is explicitly documented. Missing context / blind spots
Final VerdictStatus: ✅ Approve |
The broken_links style check reads the URL in the added line up to the
first `{`, so the f-string left it the prefix
https://github.com/jemalloc/jemalloc/releases/download/, which is 404.
Keep the full asset URL in a JEMALLOC_URL constant next to its sha256, so
the check sees the real download link.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units15996 translation units recompiled, 42705 s compile time in total, 15967 of them have a recent master baseline. |
CI finish ledger - ae5e272Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20261115-090012 |
|
Fixing PR for the |
#119685 was reverted in #131765 because the `arm_release` binary died with SIGILL on cores without `FEAT_PAuth` (Graviton2, Ampere Altra) on the first SimSIMD call: SimSIMD compiles its CPU probe `_simsimd_capabilities_arm` and five bf16 NEON kernels for ARMv8.3+, where clang folds `autiasp; ret` into `retaa`, which is not in the `NOP` space. Build `_simsimd` with `-mbranch-protection=none` (the same fix as #131762). Compiled with the `arm_release` flags, `c/lib.c` goes from 7 `retaa` to 0. Add a check to the `arm_release` compatibility check that scans the code sections of the packaged binary for `retaa` and `retab` and names the functions through `system.symbols`. A test run on Graviton3 would never notice the next such case. On the `arm_release` package of #131745 (pac-ret on) it reports exactly the 6 SimSIMD functions; on that of d88a8f1 (the master commit before #119685) it passes. Closes: #131748 Related: #131762 Related: #131765 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@groeneai, update the branch. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Done: merged master ( |
|
@groeneai, fix conflicts. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
CI finish ledger - d76a9c6Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20261116-050013 |
Related: #131183
Related: #130064
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The CI toolchain's
clangandllduse jemalloc 5.4.0 built from source, with transparent huge pages for the heap and its metadata.Description
Follow-up to #131183, with the option chosen in #131183 (comment). The toolchain job now builds jemalloc 5.4.0 from the release tarball (pinned by sha256) and links its
libjemalloc_pic.ainto the stage 2 executables instead of Ubuntu's 5.3.0, configured with--with-malloc-conf=thp:always,metadata_thp:always: jemalloc asks for transparent huge pages for its extents and metadata (madvise, Ubuntu's default THP mode). With the same jemalloc configuration preloaded into the toolchain on Graviton3, page faults fell by about 90%, a cleanninja clickhousewas 13.2% faster and the ThinLTO link ofclickhouse4.7% faster, withlld's peak RSS at 15.7 GB instead of 15.2 GB: #131183 (comment).--with-lg-page=16on aarch64 keeps it working on 64 KiB-page kernels, and--with-lg-hugepage=21makes the value independent of the build runner.-lmis dropped (jemalloc uses libm only for profiling, which is off), the license now comes from the tarball, andlibjemalloc-devis removed fromclickhouse/binary-builder.On a host with little free contiguous memory, huge-page faults stall in compaction: on a long-running shared x86 server the ThinLTO link of
clangtook 58.1 s instead of 54.1 s (median of 5, peak RSS 1.07x) and a compile sample 3:40-4:24 instead of 2:43.MALLOC_CONF=thp:default,metadata_thp:disabledturns the huge pages off. A clean x86 host was not measured.It takes effect once
OptimizeToolchainruns on master and the toolchain pin inci/docker/binary-builder/Dockerfilemoves; with theci-toolchainlabel this PR's CI also builds both toolchains.Validation, run locally (x86, and aarch64 under qemu): the modified job ran end to end in the image without
libjemalloc-dev, BOLT applied; stage 2's configure results equal master's;clang,lld,llvm-tblgenandllvm-boltreport jemalloc 5.4.0 with the options; tablegen outputs, ClickHouse objects and links are byte-identical to those of the same LLVM tree linked with master's flags.Workflow [PR]
Sync PR [sync-upstream/pr/131745]
Version info
26.11.1.2651-master(included in26.11and later)