Skip to content

Configure jemalloc for 64K pages on arm64#59

Merged
kalinstaykov merged 1 commit into
unstablefrom
fix-jemalloc-arm64-page-size
May 21, 2026
Merged

Configure jemalloc for 64K pages on arm64#59
kalinstaykov merged 1 commit into
unstablefrom
fix-jemalloc-arm64-page-size

Conversation

@kalinstaykov
Copy link
Copy Markdown
Contributor

@kalinstaykov kalinstaykov commented May 21, 2026

Summary

  • On arm64, export JEMALLOC_CONFIGURE_OPTS="--with-lg-page=16" before make all so the bundled jemalloc supports up to 64 KiB pages.
  • amd64 builds are untouched.

Why

The arm64 build runners (ubuntu24-arm64-2-8) use 4K pages, so jemalloc gets configured with a 4 KiB max page size. The resulting RPM then aborts at startup on aarch64 hosts that use 64K pages (default on Rocky Linux 8 aarch64, common on other distros too) with:

<jemalloc>: Unsupported system page size

This is exactly what was reported in redis/redis#15185. The recommended packaging-side fix (see the side note in redis/redis#11407) is to pass --with-lg-page=16 (= 2^16 = 64 KiB) to jemalloc's configure. Per the discussion in jemalloc/jemalloc#467 and redis/redis#11170, this is safe on recent jemalloc versions without serious VM-fragmentation side effects.

Test plan

  • CI builds succeed on all arm64 matrix entries (rockylinux 8/9/10)
  • Resulting arm64 RPM installs and redis-server starts on a 64K-page aarch64 host (e.g. Rocky Linux 8 aarch64)
  • Resulting arm64 RPM still starts on a 4K-page aarch64 host
  • amd64 build and smoke tests remain green

See the verification comment below for evidence.

🤖 Generated with Claude Code


Note

Medium Risk
Changes the arm64 build environment for Redis by altering jemalloc configuration, which could affect runtime behavior/memory characteristics and the resulting packaged binaries. Scope is limited to the GitHub Actions packaging workflow and is gated to arm64 builds.

Overview
Adjusts the RPM build action to set JEMALLOC_CONFIGURE_OPTS=--with-lg-page=16 when inputs.platform is arm64, ensuring the bundled jemalloc supports 64KiB page-size aarch64 hosts.

amd64 builds and the rest of the packaging flow are unchanged; this only modifies how Redis is compiled in the Build Redis with modules step.

Reviewed by Cursor Bugbot for commit 314625c. Bugbot is set up for automated code reviews on this repo. Configure here.

Pass JEMALLOC_CONFIGURE_OPTS="--with-lg-page=16" to the Redis build on
arm64 so the produced jemalloc supports up to 64 KiB pages. Without
this, the RPM built on a 4K-page runner aborts on aarch64 hosts that
use 64K pages (e.g. Rocky Linux 8 aarch64) with
"<jemalloc>: Unsupported system page size".

Refs redis/redis#15185
See side note in redis/redis#11407
@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented May 21, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@kalinstaykov
Copy link
Copy Markdown
Contributor Author

Test plan results

# Item Result Evidence
1 CI builds on all arm64 matrix entries ✅ PASS Build RPM (rockylinux{8,9,10}-arm64) all green on this PR's latest run
2 arm64 RPM starts on 64K-page aarch64 ✅ PASS Live test on Rocky 8.10 aarch64 / Graviton t4g.medium — see log below
3 arm64 RPM still starts on 4K-page aarch64 ✅ PASS (via CI) CI's Test RPM (rockylinux*-arm64) jobs run the full smoke (install → start → ping → modules) on ubuntu24-arm64-2-8 runners, which are 4K-page aarch64
4 amd64 build + smoke tests green ✅ PASS Build RPM (*-amd64) and Test RPM (*-amd64) all green

Item 2 — live verification on a real 64K-page aarch64 host

Host: AWS EC2 t4g.medium (Graviton), AMI ami-058f3a08579052f1a (Rocky-8-EC2-Base-8.10-20240528.0.aarch64), kernel 4.18.0-553.el8_10.aarch64.

$ getconf PAGE_SIZE
65536
$ sudo dnf install -y /tmp/redis-test.rpm   # rpm-rockylinux8-arm64 artifact from this PR's CI
Installed:
  redis-8.4.0-1.aarch64
$ redis-server --version
Redis server v=8.4.0 sha=00000000:1 malloc=jemalloc-5.3.0 bits=64 build=6e88c233d065051
$ timeout 5 redis-server --port 6399 --daemonize no
... * Running mode=standalone, port=6399.
... * Server initialized
... * Ready to accept connections tcp
... signal-handler Received SIGTERM scheduling shutdown...
... * DB saved on disk
... # Redis is now ready to exit, bye bye...
exit-code: 0

No <jemalloc>: Unsupported system page size — Redis reaches Ready to accept connections and shuts down cleanly. This is the exact host class reported in redis/redis#15185.

For reference, before this PR the same RPM on the same host produces:

<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size

(per the original issue reporter; we did not re-run the pre-fix case to save EC2 time, since the failure mode is what the bug report itself describes).

The EC2 instance was terminated after the test.

@kalinstaykov kalinstaykov merged commit 6bbab81 into unstable May 21, 2026
34 checks passed
@kalinstaykov kalinstaykov deleted the fix-jemalloc-arm64-page-size branch May 21, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants