-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jemalloc: disable transparent hugepages by default on ARMv6/7 #33260
Conversation
I think enabling THP on 32-bit ARM is not possible by default, given that it depends on LPAE (and if LPAE is enabled, the kernel won't run on CPUs that lack it):
|
# jemalloc is unable to correctly detect transparent hugepage support on | ||
# ARM, and the default kernel ARMv6/7 kernel does not enable it, so we | ||
# explicitly disable support | ||
thpSupport ? stdenv.system != "armv7l-linux" && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use: stdenv.isArm
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also add a link to jemalloc/jemalloc#526 in the comments, so we know when we can strip this.
The default NixOS kernels for ARMv7 (and probably ARMv6) do not have support for transparent huge pages, but jemalloc is unable to detect this. This is a known bug and the current solution is to pass --disable-thp to ./configure.
c1daa60
to
98dd418
Compare
# jemalloc is unable to correctly detect transparent hugepage support on | ||
# ARM (https://github.com/jemalloc/jemalloc/issues/526), and the default | ||
# kernel ARMv6/7 kernel does not enable it, so we explicitly disable support | ||
thpSupport ? !stdenv.isArm }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not expose this as an option.
The only common use case so far seems ARMv6/ARMv7 support. The way this option is exposed might collide with a package with the same name. Also the option naming on its own is not self-descriptive without context.
This overlays NixOS/nixpkgs#33260 on top of the current release channel.
This overlays NixOS/nixpkgs#33260 on top of the current release channel.
Motivation for this change
This PR disables transparent hugepage support in jemalloc by default on ARMv6/7 (adding a parameter that allows it to be enabled if desired). The NixOS ARMv6/7 kernels do not enable transparent hugepage support, but jemalloc is not able to detect this (see jemalloc/jemalloc#526).
Even though the
--disable-thp
flag is available in jemalloc 4.5.0, it does not work correctly in this version, so this PR also updates jemalloc to 5.0.1 (which requires a large rebuild with the possibility of breakage).Alternatively, this problem could be solved by enabling THP in the default kernel config, but it still might be good to have an option to disable it in jemalloc.
Also, is
stdenv.system
the correct way to do platform detection nowadays (with the upcoming better cross compiling support)?Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)