Unverified Commit 3e112d46 authored by Oran Agra's avatar Oran Agra Committed by GitHub
Browse files

Use jemalloc by default also on ARM (#11407)

Till now Redis attempted to avoid using jemalloc on ARM, but didn't do that properly (missing armv8l and aarch64), so in fact we did you jemalloc on these without a problem.

Side notes:

Some ARM platforms, which share instruction set and can share binaries (docker images), may have different page size, and apparently jemalloc uses the page size of the build machine as the maximum page size to be supported by the build.
see https://github.com/redis-stack/redis-stack/issues/187

To work around that, when building for ARM, one can change the maximum page size to 64k (or greater if present on the build machine) In recent versions of jemalloc, this should not have any severe side effects (like VM map fragmentation), see:
https://github.com/jemalloc/jemalloc/issues/467
https://github.com/redis/redis/pull/11170#issuecomment-1236265230

To do that, one can use:
```
JEMALLOC_CONFIGURE_OPTS="--with-lg-page=16" make
```

Besides that, this PR fixes a messy makefile condition that was created
here: f30b18f4
parent 1f245638
...@@ -59,24 +59,16 @@ ifndef PYTHON ...@@ -59,24 +59,16 @@ ifndef PYTHON
PYTHON := $(shell which python3 || which python) PYTHON := $(shell which python3 || which python)
endif endif
# Default allocator defaults to Jemalloc if it's not an ARM # Default allocator defaults to Jemalloc on Linux and libc otherwise
MALLOC=libc MALLOC=libc
ifneq ($(uname_M),armv6l)
ifneq ($(uname_M),armv7l)
ifeq ($(uname_S),Linux) ifeq ($(uname_S),Linux)
MALLOC=jemalloc MALLOC=jemalloc
endif endif
endif
endif
# To get ARM stack traces if Redis crashes we need a special C flag. # To get ARM stack traces if Redis crashes we need a special C flag.
ifneq (,$(filter aarch64 armv,$(uname_M))) ifneq (,$(filter aarch64 armv%,$(uname_M)))
CFLAGS+=-funwind-tables
else
ifneq (,$(findstring armv,$(uname_M)))
CFLAGS+=-funwind-tables CFLAGS+=-funwind-tables
endif endif
endif
# Backwards compatibility for selecting an allocator # Backwards compatibility for selecting an allocator
ifeq ($(USE_TCMALLOC),yes) ifeq ($(USE_TCMALLOC),yes)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment