-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wasm] stop using mmap/munmap #108512
Merged
Merged
[wasm] stop using mmap/munmap #108512
Conversation
This file contains 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
0d68ed9
to
779fbac
Compare
kg
reviewed
Oct 8, 2024
kg
reviewed
Oct 8, 2024
kg
reviewed
Oct 8, 2024
kg
reviewed
Oct 8, 2024
kg
reviewed
Oct 8, 2024
kg
reviewed
Oct 8, 2024
kg
reviewed
Oct 8, 2024
This was referenced Oct 8, 2024
Open
@radekdoulik could you please run startup benchmark on this PR ? Many thanks |
BrzVlad
reviewed
Oct 9, 2024
BrzVlad
reviewed
Oct 9, 2024
there are visible regressions in json on firefox. I will schedule the updated commit to have another measurement at hand |
2ca1b24
to
5070e99
Compare
This was referenced Oct 17, 2024
kg
reviewed
Oct 23, 2024
kg
reviewed
Oct 23, 2024
kg
approved these changes
Oct 23, 2024
/ba-g all CI issues are known |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
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.
Contributes to #108510
Fixes #107215
Context
sgen
GC is usingmono_valloc
->mmap
on all other platforms.mmap
emulator in emscripten andwasi-libc
doens't implement partialmunmap
malloc
rather than on top ofsbrk
.mmap
munmap
malloc
pool.Changes
MS_BLOCK_ALLOC_NUM
to1
which preventssgen
from doing partialmono_vfree
LOCK_FREE_ALLOC_SB_MAX_SIZE
to16384 * 32
to compensate for abovesgen_los_memory_usage_total
is accounting for alignmentmono_vfree
usingdlfree
mono_valloc_aligned
andmono_valloc
usingposix_memalign
sys_alloc
implementation will stitch last segment to new memory allocated viasbrk
mmap
which always callsmemset
to zero the memorysbrk
don't need that.mono_valloc
passMONO_MMAP_NOZERO
mono-wasm-pagemgr.c
andwasm-mmap
optionTODO