unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#68261] [PATCH 0/2] Support 16K pages sizes with jemalloc on aarch64
@ 2024-01-05 12:33 Roman Scherer
  2024-01-05 12:36 ` [bug#68261] [PATCH 1/2] gnu: jemalloc: Build with large page size Roman Scherer
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Roman Scherer @ 2024-01-05 12:33 UTC (permalink / raw)
  To: 68261; +Cc: Roman Scherer, efraim, Efraim Flashner

Hello Guix,

I'm running Guix system on an Apple M1 using the Asahi Linux kernel. It works,
but there is a major issue due to the fact that the Asahi Linux kernel uses a
16k page size.

There are some programs that are incompatible with this and are being
fixed. You can find more information under the "Known broken applications"
section in [1].

One of those programs that has issues is jemalloc, used by some of the most
heavy Guix packages, like rust and icecat. Running any program that uses
jemalloc crashes with the following error:

```
roman@localhost guix]$ rustc
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
terminate called without an active exception
Aborted
```

This is because jemalloc is compiled to handle 4K page sizes by default. If
jemalloc is configured to handle larger page sizes it is working. From what I
understand you can use jemalloc configured with page size X on all systems
with a page size <= X, with a small cost in performance. There is an issue
here [2] that has a more detailed discussion.

Note that this only happens when I use substitutes. If I compile jemalloc
myself on a system with 16k page size it works. Compiling the whole rust
toolchain and icecat on a Guix updates however is not really practical.

I already tried to fix this issue a while ago here [3], but unfortunatly this
did not solve it. The Guix substitutes are still not compatible on a system
with 16k page size.

It looks like some distros compile jemalloc with a larger page size. I belive
the Asahi Fedora remix is doing this and Arch Linux ARM [4].

This patch series configures jemalloc to support 16k page sizes on the aarch64
architecture. It uses the --with-lg-page switch which specifies the page size
as log2(16384)=14 for 16k pages.

To make packages using jemalloc via rust-jemalloc-sys compatible, the same is
done by specifying the JEMALLOC_SYS_WITH_LG_PAGE environment variable.

Could you please review the patch series and/or help me to get substitutes
available that are compatible with larger page sizes?

Thanks, Roman.

[1] https://asahilinux.org/2022/03/asahi-linux-alpha-release/
[2] https://github.com/jemalloc/jemalloc/issues/467
[3] https://issues.guix.gnu.org/61461
[4] https://archlinuxarm.org/packages/aarch64/jemalloc

Roman Scherer (2):
  gnu: jemalloc: Build with large page size.
  gnu: rust-jemalloc-sys: Build with large page size.

 gnu/packages/crates-io.scm | 6 +++++-
 gnu/packages/jemalloc.scm  | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

base-commit: ac69b423865f12310cef5662d9c303aa4b90c869
--
2.41.0




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-01-05 13:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-05 12:33 [bug#68261] [PATCH 0/2] Support 16K pages sizes with jemalloc on aarch64 Roman Scherer
2024-01-05 12:36 ` [bug#68261] [PATCH 1/2] gnu: jemalloc: Build with large page size Roman Scherer
2024-01-05 12:36 ` [bug#68261] [PATCH 2/2] gnu: rust-jemalloc-sys: " Roman Scherer
2024-01-05 12:48   ` Efraim Flashner
2024-01-05 13:31     ` Roman Scherer
2024-01-05 13:30 ` [bug#68261] [PATCH v2 1/2] gnu: jemalloc: " Roman Scherer
2024-01-05 13:30   ` [bug#68261] [PATCH v2 2/2] build/cargo-build-system: Support 16k page sizes on aarch64 Roman Scherer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).