Repository navigation
Conversation
mimalloc v2.3.0/v3.3.0 changed `MI_NO_THP` to only skip `madvise(MADV_HUGEPAGE)`; disabling THP for the process now depends on the `allow_thp` option, whose default comes from `MI_DEFAULT_ALLOW_THP`. Define that instead, as `MI_NO_THP=ON` does in mimalloc's CMake build, and test it on Linux.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since libmimalloc-sys 0.1.45, the
no_thpfeature no longer disables transparent huge pages: on a host where THP isalways, the process still gets huge pages. mimalloc v2.3.0/v3.3.0 moved the process-wideprctl(PR_SET_THP_DISABLE)fromMI_NO_THPto theallow_thpoption, whose default comes fromMI_DEFAULT_ALLOW_THP(microsoft/mimalloc@67aeaf2);MI_NO_THPnow only skipsmadvise(MADV_HUGEPAGE). This PR definesMI_DEFAULT_ALLOW_THP=0instead, asMI_NO_THP=ONdoes in mimalloc's CMake build and asno_thpdoes in the Rust crate in microsoft/mimalloc.Unlike libmimalloc-sys 0.1.44 and earlier,
no_thpis now a default rather than a hard switch:MIMALLOC_ALLOW_THP=1turns THP back on, as with the CMake build.On Debian 13 (kernel 6.12, THP
always), a process that touches 512 MiB, for both v3 andv2:THP_enabled: 0, no huge pagesTHP_enabled: 1, more than 500 MiB of huge pagesTHP_enabled: 0, no huge pagesThe new test in libmimalloc-sys checks
PR_GET_THP_DISABLEand fails without the fix for v3 andv2; CI runs it on Linux. The change works unchanged with the mimalloc versions in #169. Only libmimalloc-sys needs a release.Thank you for maintaining this crate!