Repository navigation
mmaptrim-probe: 0c, because the fix disarmed 0b's own question - #716
Merged
Merged
Conversation
The threshold change worked: 2MB and 16MB mappings now take the malloc arm, none of the eight fail, and section 0b answers 64 / 64 / 64 instead of 64 / 5 / 5. That is the right answer and worth keeping as a regression check -- mmap spends no slot at any size a program is likely to ask for -- but all three of 0b's cases are now on the SAME arm, so its smallest size has stopped being a control and a run of 64/64/64 says nothing about how many slots exist. Read on its own it looks exactly like the Linux control. A section whose cases have collapsed onto one path is a check that can only pass. Section 0c asks the platform question of the platform: _SEGATTACH in a loop at 64KB until refused. Cheaper as well as still alive -- reaching the ceiling through mmap would now need 64MB mappings, and five of those is 320MB of real pages, since p9_mmap_impl memsets what it returns. It is the one place a test here reaches past the POSIX surface on purpose, because the number is a property of the kernel and going through mmap would measure the library's policy instead. The header also records that section 0 is no longer measuring what it measured in the first run. A 2MB mapping is malloc-backed now, so it reports where the allocator puts things, not where segattach does -- 0x436000, 0x837000, 0xc37000 ... spaced 4MB apart at offset 0x37000. Both readings are true of their own run and neither describes the other; the 2MB grid off by one page was a fact about segattach and is no longer reachable from here. The conclusion is unchanged where it counts: still misaligned, so zend still trims, and section 1's head trim went from 0 to 0x1c8000, so the real path now exercises both trims rather than only the tail. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
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.
The threshold change worked: 2MB and 16MB mappings now take the malloc arm, none of the eight fail, and section 0b answers 64 / 64 / 64 instead of 64 / 5 / 5.
That is the right answer and worth keeping as a regression check -- mmap spends no slot at any size a program is likely to ask for -- but all three of 0b's cases are now on the SAME arm, so its smallest size has stopped being a control and a run of 64/64/64 says nothing about how many slots exist. Read on its own it looks exactly like the Linux control. A section whose cases have collapsed onto one path is a check that can only pass.
Section 0c asks the platform question of the platform: _SEGATTACH in a loop at 64KB until refused. Cheaper as well as still alive -- reaching the ceiling through mmap would now need 64MB mappings, and five of those is 320MB of real pages, since p9_mmap_impl memsets what it returns. It is the one place a test here reaches past the POSIX surface on purpose, because the number is a property of the kernel and going through mmap would measure the library's policy instead.
The header also records that section 0 is no longer measuring what it measured in the first run. A 2MB mapping is malloc-backed now, so it reports where the allocator puts things, not where segattach does -- 0x436000, 0x837000, 0xc37000 ... spaced 4MB apart at offset 0x37000. Both readings are true of their own run and neither describes the other; the 2MB grid off by one page was a fact about segattach and is no longer reachable from here. The conclusion is unchanged where it counts: still misaligned, so zend still trims, and section 1's head trim went from 0 to 0x1c8000, so the real path now exercises both trims rather than only the tail.
Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs