Skip to content

[wasm] mmap/lock free allocator optimizations#102265

Merged
kg merged 1 commit intodotnet:mainfrom
kg:lfa-nozero
May 23, 2024
Merged

[wasm] mmap/lock free allocator optimizations#102265
kg merged 1 commit intodotnet:mainfrom
kg:lfa-nozero

Conversation

@kg
Copy link
Member

@kg kg commented May 15, 2024

Right now on WASM we ask mmap for 16KB pages in the lock-free allocator, and mmap hands us 64KB pages that we end up wasting 3/4 of.

We also ask for zeroed pages, but we don't need zeroed pages because all of the lock-free allocator's callers memset or fully initialize their allocations anyway.

Partially fixes dotnet/perf-autofiling-issues#34303 and fixes dotnet/perf-autofiling-issues#34274

…enabled

Request non-zeroed pages from custom mmap in lock free allocator, since all of its callers memset their allocations anyway
@kg kg added the arch-wasm WebAssembly architecture label May 15, 2024
@ghost ghost added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 15, 2024
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

@kg
Copy link
Member Author

kg commented May 15, 2024

According to the profiler this also makes sgen meaningfully faster at scanning roots, but I'm not sure why. Maybe it always scans complete pages so by more efficiently using pages there are less bytes for it to scan?

@kg kg merged commit 4219e45 into dotnet:main May 23, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Perf] Linux/x64: 3 Regressions on 5/10/2024 2:50:16 AM [Perf] Linux/x64: 1 Regression on 5/10/2024 2:50:16 AM

2 participants