- 
                Notifications
    You must be signed in to change notification settings 
- Fork 109
fix(mman): don't deallocate PROT_NONE frames #2008
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
Conversation
| CC: @m-mueller678 | 
| This looks like an ok fix for the issue at hand to me. However, I think  For a proper solution, we should decide on which level  If it is a high level api, we should track the state of all pages mapped via  If it is a low level api, it should interact directly with the free lists and the page table. In that case,  I would prefer  | 
| Yeah, this was meant to be a stopgap solution without rewriting mmap now to be able to move forward with infallible deallocations for #2002. I think our goal would be a POSIX-compatible mmap implementation, but currently we don't even have the correct signature. Stefan started working on improving the situation but did not get around to finishing it yet (#1885). Your idea sounds good to me, though. 👍 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark Results
| Benchmark | Current: 0cc67df | Previous: e747b5a | Performance Ratio | 
|---|---|---|---|
| startup_benchmark Build Time | 113.67s | 114.77s | 0.99 | 
| startup_benchmark File Size | 0.89MB | 0.89MB | 1.00 | 
| Startup Time - 1 core | 0.92s (±0.04s) | 0.92s (±0.03s) | 1.00 | 
| Startup Time - 2 cores | 0.93s (±0.03s) | 0.90s (±0.04s) | 1.03 | 
| Startup Time - 4 cores | 0.92s (±0.04s) | 0.91s (±0.03s) | 1.00 | 
| multithreaded_benchmark Build Time | 114.29s | 114.10s | 1.00 | 
| multithreaded_benchmark File Size | 1.00MB | 1.00MB | 1.00 | 
| Multithreaded Pi Efficiency - 2 Threads | 85.38% (±9.31%) | 89.62% (±6.95%) | 0.95 | 
| Multithreaded Pi Efficiency - 4 Threads | 42.74% (±4.41%) | 45.18% (±3.88%) | 0.95 | 
| Multithreaded Pi Efficiency - 8 Threads | 24.63% (±2.28%) | 25.55% (±1.65%) | 0.96 | 
| micro_benchmarks Build Time | 237.81s | 231.77s | 1.03 | 
| micro_benchmarks File Size | 1.01MB | 1.01MB | 1.00 | 
| Scheduling time - 1 thread | 139.36ticks (±28.83ticks) | 113.09ticks (±35.98ticks) | 1.23 | 
| Scheduling time - 2 threads | 76.40ticks (±16.60ticks) | 70.15ticks (±23.09ticks) | 1.09 | 
| Micro - Time for syscall (getpid) | 8.56ticks (±4.58ticks) | 6.31ticks (±2.49ticks) | 1.36 | 
| Memcpy speed - (built_in) block size 4096 | 57964.41MByte/s (±42036.72MByte/s) | 60024.89MByte/s (±42578.47MByte/s) | 0.97 | 
| Memcpy speed - (built_in) block size 1048576 | 23280.56MByte/s (±21198.90MByte/s) | 23888.20MByte/s (±20500.48MByte/s) | 0.97 | 
| Memcpy speed - (built_in) block size 16777216 | 14754.68MByte/s (±12183.73MByte/s) | 13939.73MByte/s (±11551.16MByte/s) | 1.06 | 
| Memset speed - (built_in) block size 4096 | 56529.06MByte/s (±41465.35MByte/s) | 60259.47MByte/s (±42726.53MByte/s) | 0.94 | 
| Memset speed - (built_in) block size 1048576 | 23653.33MByte/s (±21380.78MByte/s) | 24990.35MByte/s (±21422.35MByte/s) | 0.95 | 
| Memset speed - (built_in) block size 16777216 | 15191.54MByte/s (±12461.50MByte/s) | 14008.28MByte/s (±11573.03MByte/s) | 1.08 | 
| Memcpy speed - (rust) block size 4096 | 55805.58MByte/s (±40388.88MByte/s) | 55064.94MByte/s (±38976.39MByte/s) | 1.01 | 
| Memcpy speed - (rust) block size 1048576 | 19831.67MByte/s (±16980.91MByte/s) | 28247.94MByte/s (±24357.11MByte/s) | 0.70 | 
| Memcpy speed - (rust) block size 16777216 | 14892.23MByte/s (±12361.28MByte/s) | 14239.45MByte/s (±11877.65MByte/s) | 1.05 | 
| Memset speed - (rust) block size 4096 | 56643.79MByte/s (±40940.21MByte/s) | 55273.06MByte/s (±39093.56MByte/s) | 1.02 | 
| Memset speed - (rust) block size 1048576 | 20148.48MByte/s (±17110.00MByte/s) | 29360.47MByte/s (±25105.97MByte/s) | 0.69 | 
| Memset speed - (rust) block size 16777216 | 15199.58MByte/s (±12505.15MByte/s) | 14321.88MByte/s (±11903.00MByte/s) | 1.06 | 
| alloc_benchmarks Build Time | 239.83s | 215.99s | 1.11 | 
| alloc_benchmarks File Size | 0.96MB | 0.96MB | 1.00 | 
| Allocations - Allocation success | 100.00% | 100.00% | 1 | 
| Allocations - Deallocation success | 70.00% (±0.22%) | 70.04% (±0.38%) | 1.00 | 
| Allocations - Pre-fail Allocations | 100.00% | 100.00% | 1 | 
| Allocations - Average Allocation time | 10396.52Ticks (±357.13Ticks) | 18387.00Ticks (±564.30Ticks) | 0.57 | 
| Allocations - Average Allocation time (no fail) | 10396.52Ticks (±357.13Ticks) | 18387.00Ticks (±564.30Ticks) | 0.57 | 
| Allocations - Average Deallocation time | 1382.00Ticks (±154.75Ticks) | 1278.91Ticks (±218.11Ticks) | 1.08 | 
| mutex_benchmark Build Time | 239.20s | 225.69s | 1.06 | 
| mutex_benchmark File Size | 1.01MB | 1.01MB | 1.00 | 
| Mutex Stress Test Average Time per Iteration - 1 Threads | 26.86ns (±5.33ns) | 21.70ns (±3.91ns) | 1.24 | 
| Mutex Stress Test Average Time per Iteration - 2 Threads | 23.88ns (±2.92ns) | 22.60ns (±3.10ns) | 1.06 | 
This comment was automatically generated by workflow using github-action-benchmark.
Wasmtime allocates 4 GiB of
PROT_NONE(Data cannot be accessed) memory.Since we don't allocate any backing physical frames in
mmapforPROT_NONE, we should neither try to deallocate any physical frames inmunmapin those cases.