Use MADV_GUARD_INSTALL and MADV_GUARD_REMOVE in GuardedPageAllocator. - #1011
Draft
copybara-service[bot] wants to merge 1 commit into
Draft
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
test_983950148
branch
2 times, most recently
from
September 20, 2026 15:16
a755e2c to
f23bcff
Compare
`MADV_GUARD_INSTALL` and `MADV_GUARD_REMOVE` (Linux 6.13+) install and remove lightweight guard PTE markers under `mmap_read_lock` without splitting or merging VMAs, while `MADV_GUARD_INSTALL` also zaps physical pages on deallocation. Probe for support in `GuardedPageAllocator::MapPages` while the region is `PROT_NONE` before transitioning the VMA once to `PROT_READ | PROT_WRITE`, falling back to per-page `mprotect` on older kernels or when `TCMALLOC_INTERNAL_LEGACY_LOCKING` is defined. PiperOrigin-RevId: 983950148
copybara-service
Bot
force-pushed
the
test_983950148
branch
from
September 20, 2026 15:34
f23bcff to
304f01d
Compare
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.
Use MADV_GUARD_INSTALL and MADV_GUARD_REMOVE in GuardedPageAllocator.
MADV_GUARD_INSTALLandMADV_GUARD_REMOVE(Linux 6.13+) install and remove lightweight guard PTE markers undermmap_read_lockwithout splitting or merging VMAs, whileMADV_GUARD_INSTALLalso zaps physical pages on deallocation. Probe for support inGuardedPageAllocator::MapPageswhile the region isPROT_NONEbefore transitioning the VMA once toPROT_READ | PROT_WRITE, falling back to per-pagemprotecton older kernels or whenTCMALLOC_INTERNAL_LEGACY_LOCKINGis defined.