config: enabling madvise syscalls for user mode deallocations (v6.18)#136
Merged
Merged
Conversation
This config change includes madvise.o in the final build image, enabling madvise syscalls. This is necessary because MiMalloc (the allocator for OpenHCL) uses madvise syscalls to deallocate memory. Without this change, madvise is excluded from the final build image resulting in the syscalls for deallocating memory from the user mode being unrecognized by the kernel. This results in a major memory leak where no user mode process is able to free physical memory. OpenHCL builds with the kernel with this fix indicate steady memory usage in a reproduction scenario that would otherwise expose the memory leak. Duplicate of PR 133 for kernel version 6.18
There was a problem hiding this comment.
Pull request overview
Enables the kernel’s advise syscalls (madvise/fadvise) in the OpenHCL kernel configs so mm/madvise.o is built into the image, preventing user-mode allocators (e.g., MiMalloc) from hitting ENOSYS on madvise-based deallocation paths.
Changes:
- Set
CONFIG_ADVISE_SYSCALLS=yfor x64 OpenHCL kernel config. - Set
CONFIG_ADVISE_SYSCALLS=yfor arm64 OpenHCL kernel config.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Microsoft/hcl-x64.config | Enables CONFIG_ADVISE_SYSCALLS to ensure madvise.o is built and madvise/fadvise syscalls are available. |
| Microsoft/hcl-arm64.config | Same enablement for arm64 to keep syscall availability consistent across architectures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
benhillis
added a commit
to microsoft/openvmm
that referenced
this pull request
May 21, 2026
This change updates the OpenHCL kernel to the latest version which contains this patch: microsoft/OHCL-Linux-Kernel#136 Huge props to @dpaliulis-msft for debugging this! Co-authored-by: OpenVMM Team <openvmm@microsoft.com>
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.
This config change includes madvise.o in the final build image, enabling madvise syscalls. This is necessary because MiMalloc (the allocator for OpenHCL) uses madvise syscalls to deallocate memory. Without this change, madvise is excluded from the final build image resulting in the syscalls for deallocating memory from the user mode being unrecognized by the kernel. This results in a major memory leak where no user mode process is able to free physical memory. OpenHCL builds with the kernel with this fix indicate steady memory usage in a reproduction scenario that would otherwise expose the memory leak.
Duplicate of PR 133 for kernel version 6.18