Skip to content
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

fix: tell jemalloc to use 64-KiB pages when cross building aarch64 #7123

Merged
merged 10 commits into from
Mar 19, 2024

Conversation

jtraglia
Copy link
Contributor

@jtraglia jtraglia commented Mar 12, 2024

Fixes #6742.

This PR sets JEMALLOC_SYS_WITH_LG_PAGE to 16 for aarch64 cross builds, which will force jemalloc to use 64 KiB pages. This should work with most of the newer arm64 systems which use larger pages. This is an alternative to:

I have tested this myself by running make docker-build-push on an x86_64 system. I pulled the image (which I pushed to my local docker hub account) on my M1 Mac mini running Linux and it works.

Initially, setting the environment variable didn't seem to work. I realized that environment variables weren't being passed to cross build, which makes sense because it's a docker container. I had to configure passthrough variables.

image

Link: https://docs.rs/crate/cross/0.1.14

This PR also re-enables jemalloc to be a default feature.

@jtraglia jtraglia requested a review from gakonst as a code owner March 12, 2024 22:06
@Rjected Rjected self-requested a review March 12, 2024 22:11
Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd like to only do this on arm, not on x86

@jtraglia
Copy link
Contributor Author

i'd like to only do this on arm, not on x86

Sure, I can look into that. Might not be so easy in the Makefile.

@jtraglia jtraglia marked this pull request as draft March 13, 2024 17:19
@jtraglia jtraglia changed the title fix: tell jemallocator to use 64 KiB pages fix: tell jemalloc to use 64-KiB pages when cross building aarch64 Mar 13, 2024
@jtraglia jtraglia marked this pull request as ready for review March 13, 2024 18:08
Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good to me

@Rjected Rjected requested a review from onbjerg March 18, 2024 20:35
@Rjected
Copy link
Member

Rjected commented Mar 19, 2024

cc @onbjerg when you have time to review

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me too, thank you 👑

@onbjerg onbjerg added this pull request to the merge queue Mar 19, 2024
Merged via the queue into paradigmxyz:main with commit aed833b Mar 19, 2024
27 checks passed
@jtraglia jtraglia deleted the set-jemalloc-lg-page branch March 19, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with jemalloc on system with larger page size
3 participants