[PATCH core-updates] gnu: jemalloc: Build with THP support on aarch64.

  • Done
  • quality assurance status badge
Details
2 participants
  • Christopher Baines
  • Roman Scherer
Owner
unassigned
Submitted by
Roman Scherer
Severity
normal
R
R
Roman Scherer wrote on 12 Feb 2023 21:07
(name . Guix Patches)(address . guix-patches@gnu.org)
86fsbavdzl.fsf@burningswell.com
Hello Guix,

I'm running Guix on an aarch64 system that uses a Linux kernel configured with
a page size of 16K. Some of the substitutes I receive from Guix sometimes do
not work. I believe all packages that use jemalloc, which are quite a lot.

Rust is one example. It fails like this:

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

Building packages that depend on jemalloc also fail. I can't compile the rust
package from Guix for example.

This patch series updates jemalloc and enables the use of transparent huge
pages on the aarch64 architecture. I saw we support THP as well for i686-linux
and x86_64-linux, so I think it's fine to enable it here as well. At least
it's better than crashing.

The patch should also make it possible to use substitutes built on CI by
systems running with larger kernel pages sizes, avoiding long compilation
times for things like the whole rust toolchain.

Since jemalloc has a lot of dependencies, I think it's a candidate for
core-updates.

I submitted parts of this patch series in another ticket where I tried to fix
Icecat compilation on my aarch64 system. But I think it's worth a separate
issue. And I'm blocked on the other issue at the moment.

Could you please review the patchs?

Thanks, Roman.
From ae69696267b0651fb2be40e4b31584d1c84647b6 Mon Sep 17 00:00:00 2001
From: r0man <roman@burningswell.com>
Date: Sun, 5 Feb 2023 10:57:15 +0100
Subject: [PATCH 1/2] gnu: jemalloc: Update to 5.3.0.

* gnu/packages/jemalloc.scm (jemalloc): Update to 5.3.0.
---
gnu/packages/jemalloc.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/jemalloc.scm b/gnu/packages/jemalloc.scm
index 2e25780257..354f07a838 100644
--- a/gnu/packages/jemalloc.scm
+++ b/gnu/packages/jemalloc.scm
@@ -75,7 +75,7 @@ (define-public jemalloc-4.5.0
(define-public jemalloc
(package
(inherit jemalloc-4.5.0)
- (version "5.2.1")
+ (version "5.3.0")
(source (origin
(method url-fetch)
(uri (string-append
@@ -83,7 +83,7 @@ (define-public jemalloc
version "/jemalloc-" version ".tar.bz2"))
(sha256
(base32
- "1xl7z0vwbn5iycg7amka9jd6hxd8nmfk7nahi4p9w2bnw9f0wcrl"))))
+ "1apyxjd1ixy4g8xkr61p0ny8jiz8vyv1j0k4nxqkxpqrf4g2vf1d"))))
(arguments
(substitute-keyword-arguments (package-arguments jemalloc-4.5.0)
;; Disable the thread local storage model in jemalloc 5 to prevent
--
2.38.1
From 7818da5d28d15099594df897da0dc62e299dee43 Mon Sep 17 00:00:00 2001
From: r0man <roman@burningswell.com>
Date: Sun, 5 Feb 2023 10:59:06 +0100
Subject: [PATCH 2/2] gnu: jemalloc: Build with transparent huge pages on
aarch64.

* gnu/packages/jemalloc.scm (jemalloc-4.5.0): Build with transparent huge pages on aarch64.
---
gnu/packages/jemalloc.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/jemalloc.scm b/gnu/packages/jemalloc.scm
index 354f07a838..6c6ba0f568 100644
--- a/gnu/packages/jemalloc.scm
+++ b/gnu/packages/jemalloc.scm
@@ -56,7 +56,7 @@ (define-public jemalloc-4.5.0
#t)))
#:configure-flags
'(,@(match (%current-system)
- ((or "i686-linux" "x86_64-linux")
+ ((or "aarch64-linux" "i686-linux" "x86_64-linux")
'())
("powerpc-linux"
(list "--disable-thp" "CPPFLAGS=-maltivec"))
--
2.38.1
-----BEGIN PGP SIGNATURE-----

iQFTBAEBCAA9FiEE0iajOdjfRIFd3gygPdpSUn0qwZkFAmPpSG4fHHJvbWFuLnNj
aGVyZXJAYnVybmluZ3N3ZWxsLmNvbQAKCRA92lJSfSrBmdCUB/0XTYNk+XdACfAk
7AKwRaRgdHYW9B8X1DeZLHMOS9qvNUAJElxJDtttEM56OqOJxojbbZyU4TfqXIS6
nO9aVrAu0xeukR6XHR4mP96NvTkVrodJdiNL8NdMsc7/eC8VAzATFm8m3+2FJdrM
hgKa3cknt4qcDNqWI6AgGhHOHsnEAiUSZxtuoiMOsd9XzQQNsJ+3ZPwXvHbB5XcU
mgvTeVaof+qA64DEgLe/zXBqxV9swG8RAK/MadMewx6GZIfTLiri8E6GTA8+BwO5
RIWslqnRhlHPW+lBv+bQQn53T12JvaLl5E+jXjCaLLjt/TDvyZxjtJqZ99Z/ddPN
QkYgXQJj
=V8cX
-----END PGP SIGNATURE-----

C
C
Christopher Baines wrote on 2 Mar 2023 11:05
(name . Roman Scherer)(address . roman.scherer@burningswell.com)
87bklbv54l.fsf@cbaines.net
Roman Scherer <roman.scherer@burningswell.com> writes:

Toggle quote (38 lines)
> Hello Guix,
>
> I'm running Guix on an aarch64 system that uses a Linux kernel configured with
> a page size of 16K. Some of the substitutes I receive from Guix sometimes do
> not work. I believe all packages that use jemalloc, which are quite a lot.
>
> Rust is one example. It fails like this:
>
> ```
> [roman@bombaclaat guix]$ rustc
> <jemalloc>: Unsupported system page size
> <jemalloc>: Unsupported system page size
> <jemalloc>: Unsupported system page size
> terminate called without an active exception
> Aborted
> ```
>
> Building packages that depend on jemalloc also fail. I can't compile the rust
> package from Guix for example.
>
> This patch series updates jemalloc and enables the use of transparent huge
> pages on the aarch64 architecture. I saw we support THP as well for i686-linux
> and x86_64-linux, so I think it's fine to enable it here as well. At least
> it's better than crashing.
>
> The patch should also make it possible to use substitutes built on CI by
> systems running with larger kernel pages sizes, avoiding long compilation
> times for things like the whole rust toolchain.
>
> Since jemalloc has a lot of dependencies, I think it's a candidate for
> core-updates.
>
> I submitted parts of this patch series in another ticket where I tried to fix
> Icecat compilation on my aarch64 system. But I think it's worth a separate
> issue. And I'm blocked on the other issue at the moment.
>
> Could you please review the patchs?

The patches don't look to apply to core-updates, as far as I can see,
core-updates already has jemalloc 5.3.0 and doesn't pass the
--disable-thp flag for any architecture.
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmQAdUpfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XcGxA//anCZLjBGiG+J2aCItj/8/3X2JbzFlaOP
vdsXMTOrNUsU2ZsbZjHbahGdPRBwxSa/H6Dn57xjV6/M5cFK30hyVxiw9Bv53rS/
T/m0YKfQuZ2uWCTikl5822uxZg4aEjr19Z+Q4wYv2pm0V8d1xTdP3DLIY/5mBHPn
8DnyUFF6mJ1tumf57fzI7TK4wmpvF6xSegDudyzOU9MzzxyIRk+hTkxgtJ5WgsGN
AhQMo14ZtdZ8DmStiC7B1NjwFeh6h7Q71ZR8WIjfKjQiErkkIlHw3STu1tvrsHRJ
+1IXmF7TVCnE42o0ur3LWg0ROq9w/SHclqwB8g10q5+pqSQvNcOC9D/Qmpt5BPT2
r9ustap710g0mr7LTErhshH/Gkwys3nOI8121UlHF/lFDG82Iyj3dIz84/uiBPAJ
FRsqzxK4bkl+3cyyJtlqFnEW0LrbX8ZLH4TQ19pA3kJKaFO18AcAcKF6rM3bVUoC
LbnFxWHL1jOZQBQA7pCOHhgs2IE11g+AhVjt1dC0efjodb50iFKuxozfDsE74yff
JV6e48M9lR3M3BoHPiv4fkQ7ekIUehMgEX0B/xV0aXyOFFfORk14np5xfcEGGHjI
l8gsgsAuN5x0Bgs2VaLQ7gqH9Yf4ogJMpCTkQNX/lo48PiqCrE+9SEivzhBkMteg
svZ79YnXjAY=
=qE7p
-----END PGP SIGNATURE-----

R
R
Roman Scherer wrote on 3 Mar 2023 14:05
(name . Christopher Baines)(address . mail@cbaines.net)
86sfemugqw.fsf@burningswell.com
Hi Christopher,

ok, I see. Thanks for looking into this.

Christopher Baines <mail@cbaines.net> writes:

Toggle quote (47 lines)
> [[PGP Signed Part:Undecided]]
>
> Roman Scherer <roman.scherer@burningswell.com> writes:
>
>> Hello Guix,
>>
>> I'm running Guix on an aarch64 system that uses a Linux kernel configured with
>> a page size of 16K. Some of the substitutes I receive from Guix sometimes do
>> not work. I believe all packages that use jemalloc, which are quite a lot.
>>
>> Rust is one example. It fails like this:
>>
>> ```
>> [roman@bombaclaat guix]$ rustc
>> <jemalloc>: Unsupported system page size
>> <jemalloc>: Unsupported system page size
>> <jemalloc>: Unsupported system page size
>> terminate called without an active exception
>> Aborted
>> ```
>>
>> Building packages that depend on jemalloc also fail. I can't compile the rust
>> package from Guix for example.
>>
>> This patch series updates jemalloc and enables the use of transparent huge
>> pages on the aarch64 architecture. I saw we support THP as well for i686-linux
>> and x86_64-linux, so I think it's fine to enable it here as well. At least
>> it's better than crashing.
>>
>> The patch should also make it possible to use substitutes built on CI by
>> systems running with larger kernel pages sizes, avoiding long compilation
>> times for things like the whole rust toolchain.
>>
>> Since jemalloc has a lot of dependencies, I think it's a candidate for
>> core-updates.
>>
>> I submitted parts of this patch series in another ticket where I tried to fix
>> Icecat compilation on my aarch64 system. But I think it's worth a separate
>> issue. And I'm blocked on the other issue at the moment.
>>
>> Could you please review the patchs?
>
> The patches don't look to apply to core-updates, as far as I can see,
> core-updates already has jemalloc 5.3.0 and doesn't pass the
> --disable-thp flag for any architecture.
>
> [[End of PGP Signed Part]]
-----BEGIN PGP SIGNATURE-----

iQFTBAEBCAA9FiEE0iajOdjfRIFd3gygPdpSUn0qwZkFAmQB8LkfHHJvbWFuLnNj
aGVyZXJAYnVybmluZ3N3ZWxsLmNvbQAKCRA92lJSfSrBmW9sCACBq+xRjbaNQJm3
ge3MbVk4kSC3AXPPGD+yFk/IAYjG60YTmA/YBCufFAeHTjx29BDYbPycDL1Om71g
HaGWGC+TSK78dweNbr+bnmV+vaugD5LnmCL53oNdgpdP7DGrCxs1o+qujzBa371/
k0aA9RBOt3XQurDSR8xgfbFp/qMIcP+pcxhrRN6sL/kk8og2R+uIXSNNItBMFTB8
Mf/HEBa66gcdejhzH+mDBVvqnROuKB5hGljBlvdE82I5hlsfmuAJM2EF5oRa1vL7
097Fb8fHSkaNRH7zrYRh06Pp8/fCzwbqhKnut36fnSvnSLqflOPgx38NL59beheu
AWLR7xJN
=qty0
-----END PGP SIGNATURE-----

R
R
Roman Scherer wrote on 4 Mar 2023 14:03
control message for bug #61461
(address . control@debbugs.gnu.org)
867cvwsm7i.fsf@burningswell.com
close 61461
quit
?
Your comment

This issue is archived.

To comment on this conversation send an email to 61461@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 61461
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch