Describe the bug

Redis fails to start when run on an aarch64 machine with 16kb pages (Asahi Linux on Apple Silicon)

To reproduce

Install redis, start redis, observe failure:

redis-server[503343]: <jemalloc>: Unsupported system page size 

Expected behavior

Redis does not crash

Additional information

Redis 7.0.13 installed from Fedora 38 repositories

Comment From: sundb

Seem that Asahi linux uses 16K page size. You can try following patch:

diff --git a/deps/Makefile b/deps/Makefile
index 3bf0363d..06d65c16 100644
--- a/deps/Makefile
+++ b/deps/Makefile
@@ -112,7 +112,7 @@ endif

 jemalloc: .make-prerequisites
        @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
-       cd jemalloc && ./configure --disable-cxx --with-version=5.3.0-0-g0 --with-lg-quantum=3 --disable-cache-oblivious --with-jemalloc-prefix=je_ CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)" $(JEMALLOC_CONFIGURE_OPTS)
+       cd jemalloc && ./configure --disable-cxx --with-version=5.3.0-0-g0 --with-lg-page=14 --with-lg-quantum=3 --disable-cache-oblivious --with-jemalloc-prefix=je_ CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)" $(JEMALLOC_CONFIGURE_OPTS)
        cd jemalloc && $(MAKE) lib/libjemalloc.a

Comment From: 4e554c4c

Ideally redis should link to jemalloc instead of statically linking, which would allow the system jemalloc which is compiled correctly to be used

Comment From: yossigo

@4e554c4c To support memory defragmentation, Redis ships with a (very slightly) patched version of jemalloc. You can build against the system jemalloc if you're willing to give up on this capability.

Comment From: 4e554c4c

@yossigo What would the recommendation for package managers aiming for compatibility for wide aarch64 architecture support be?

Comment From: yossigo

@4e554c4c Use the bundled jemalloc and build it to support the largest page size you expect, as described in #11407.

Comment From: remicollet

notice: this is fixed in Fedora side (redis-7.0.13-2.fc38 and redis-7.2.1-2.fc39)