Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support page size > 4K in jemalloc #5244

Closed
koraykoska opened this issue Feb 15, 2024 · 9 comments
Closed

Support page size > 4K in jemalloc #5244

koraykoska opened this issue Feb 15, 2024 · 9 comments
Labels
enhancement New feature or request good first issue Good for newcomers infra-ci

Comments

@koraykoska
Copy link

Description

Some ARM processors have a page size other than 4k (16k for example). lighthouse bn is unable to launch on those processors, with the error: <jemalloc>: Unsupported system page size

This is a know issue as can be seen here:

jemalloc/jemalloc#2572

As explained in the above issue, jemalloc page size is a compile time option, but higher ones are ok to use on lower page sizes, the other way round doesn't work.

My suggestion would be to increase the page size to 16k during the jemalloc compilation phase on the ARM docker images. As it's officially supported to have it higher, this shouldn't break anything, just make 16k systems work.

Version

v4.6.0

Present Behaviour

On launch of the BN: : Unsupported system page size

Expected Behaviour

Just work normally. Page size shouldn't be an issue for normal applications.

Steps to resolve

Right now the only way is to switch your kernel to a 4k page size. That's quite intrusive.

@michaelsproul michaelsproul added enhancement New feature or request good first issue Good for newcomers infra-ci labels Feb 19, 2024
@michaelsproul
Copy link
Member

I think a better option might be a feature flag that compiles jemalloc with 16K pages, which we can then decide to turn on or off by default.

I'm hesitant to turn it on by default without assessing the performance impact

@michaelsproul michaelsproul changed the title <jemalloc>: Unsupported system page size - for any page size other than 4k Support page size > 4K in jemalloc Feb 19, 2024
@koraykoska
Copy link
Author

@michaelsproul What about adding it by default to ARM builds? It's more common than 4k on ARM

@michaelsproul
Copy link
Member

@koraykoska Yeah I think that would probably be fine, but we should do some benchmarking first. Let's start with an optional feature, then we can switch it on for the ARM builds by default if it proves useful.

Btw, if you build from source on the board, I think jemalloc will already autodetect the page size, won't it? So this issue is more about cross-compiling, which includes the case of building the release binary, right?

@koraykoska
Copy link
Author

@michaelsproul Yes it's about the cross-compilation and especially also the docker image.

I would be happy with a special docker tag like arm-16k or something.

@michaelsproul
Copy link
Member

Sounds good. I'll see if anyone from the team is interested in working on it

@jtraglia
Copy link
Contributor

@bcaddy
Copy link

bcaddy commented Sep 17, 2024

I think I'm also having this issue. I'm trying to use Ruff on a Grace Hopper and getting this error

<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 5 bytes failed
Aborted

Any suggestions on how to fix it? I installed Ruff with Conda from the Conda-forge channel.

ph03 added a commit to ph03/lighthouse that referenced this issue Jan 21, 2025
Pass JEMALLOC_SYS_WITH_LG_PAGE=16 to aarch64
cross-compilation to support systems with
up to 64-KiB page sizes.
@ph03
Copy link

ph03 commented Jan 21, 2025

Pushed a PR (#6831) addressing this issue (in a similar way to paradigmxyz/reth#7123) - tested this both on a ARM raspberry-pi 4 kernel using 64-KiB pages (using a custom kernel build for it's BCM2711 chip), as well as on an official 16-KiB page-size ARM raspberry-pi 5 kernel (see tracking issue raspberrypi/bookworm-feedback#107)

mergify bot pushed a commit that referenced this issue Jan 30, 2025
#5244


  Pass `JEMALLOC_SYS_WITH_LG_PAGE=16` env to aarch64 cross-compilation to support systems with up to 64-KiB page sizes. This is backwards-compatible for the current (most usual) 4-KiB systems.
@jimmygchen
Copy link
Member

Completed in #6831 🎉

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request good first issue Good for newcomers infra-ci
Projects
None yet
Development

No branches or pull requests

6 participants