[kconfig]: Set THP default to madvise instead of always#573
Merged
saiarcot895 merged 1 commit intoMay 13, 2026
Conversation
Contributor
Author
|
/azp run Azure.sonic-linux-kernel |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Prabhat Aravind <paravind@microsoft.com>
7fb8a2c to
2fe657b
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates SONiC’s kernel config fragment to change the compile-time default mode for Transparent Huge Pages (THP) from always to madvise, so THP is only used when applications explicitly opt in via madvise(MADV_HUGEPAGE).
Changes:
- Add
CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=yto the SONiC featureset config fragment. - Document the intent inline with a short comment.
Contributor
Author
|
@prsunny for viz |
saiarcot895
approved these changes
May 13, 2026
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.
What I did
Set the kernel compile-time default for Transparent Huge Pages (THP) from always to madvise by adding CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y in
config.local/featureset-sonic/configWhy I did it
With CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y, khugepaged continuously promotes 4KB pages to 2MB huge pages in the background. On memory-constrained network switches this has several negative effects:
Setting the default to madvise ensures THP is only used when applications explicitly opt in via madvise(MADV_HUGEPAGE). This is the recommended setting for latency-sensitive and embedded networking workloads (consistent with guidance by other linux distributions for similar environments).
How I verified it
always [madvise] neverDetails if related