[SERVER-20791] Disable THP via MADV_NOHUGEPAGE Created: 07/Oct/15 Updated: 06/Feb/24 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Achille Brighton | Assignee: | Backlog - Service Architecture |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Service Arch
|
||||||||
| Participants: | |||||||||
| Description |
|
Calling madvise() with MADV_NOHUGEPAGE (added in Linux 2.6.38) would allow MongoDB to effectively mark regions unsuited for transparent hugepages. On 3.15 kernels and above we can use PR_SET_THP_DISABLE to disable THP process-wide. This approach should be more effective than simply instructing users to disable THP via warnings. |
| Comments |
| Comment by Jeremy Eder [ 07/Oct/16 ] |
|
Being able to selectively disable THP on a per application basis becomes much more important in systems that may run different types of workloads (such as container platforms), where globally disabling THP may adversely affect other workloads. There are two ways: or wrapper-capable: |