Skip to content

feat: device alloc: appropriate entire pages, lazily - #2458

Closed
zyuiop wants to merge 1 commit into
hermit-os:mainfrom
zyuiop:feat/device-page-list
Closed

zyuiop wants to merge 1 commit into
hermit-os:mainfrom
zyuiop:feat/device-page-list

Conversation

@zyuiop

@zyuiop zyuiop commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

This is a partial rewrite of #1815.

The goal is to mapping memory lazily when it's requested, but by 2MB blocks.
When memory is requested, if there is not enough memory in the free list, we claim a 2MB page from the available free list, then we remap it at the offset

@zyuiop
zyuiop force-pushed the feat/device-page-list branch 2 times, most recently from e7d5a93 to 0e30ad1 Compare June 1, 2026 20:08
@mkroening
mkroening self-requested a review June 1, 2026 20:14
@mkroening mkroening self-assigned this Jun 1, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Results

Details
Benchmark Current: 92b1387 Previous: a025f19 Performance Ratio
startup_benchmark Build Time 110.61 s 116.82 s 0.95
startup_benchmark File Size 0.77 MB 0.77 MB 1.00
Startup Time - 1 core 0.83 s (±0.08 s) 1.00 s (±0.03 s) 0.83
Startup Time - 2 cores 1.03 s (±0.03 s) 1.04 s (±0.05 s) 0.99
Startup Time - 4 cores 1.01 s (±0.03 s) 1.02 s (±0.05 s) 0.99
multithreaded_benchmark Build Time 120.56 s 117.48 s 1.03
multithreaded_benchmark File Size 0.83 MB 0.84 MB 1.00
Multithreaded Pi Efficiency - 2 Threads 92.84 % (±10.16 %) 85.06 % (±19.28 %) 1.09
Multithreaded Pi Efficiency - 4 Threads 45.77 % (±4.92 %) 42.20 % (±9.32 %) 1.08
Multithreaded Pi Efficiency - 8 Threads 24.90 % (±2.96 %) 23.57 % (±5.00 %) 1.06
micro_benchmarks Build Time 95.13 s 92.09 s 1.03
micro_benchmarks File Size 0.84 MB 0.84 MB 1.00
Scheduling time - 1 thread 72.57 ticks (±3.97 ticks) 73.19 ticks (±3.39 ticks) 0.99
Scheduling time - 2 threads 41.56 ticks (±6.12 ticks) 44.10 ticks (±6.54 ticks) 0.94
Micro - Time for syscall (getpid) 3.02 ticks (±0.21 ticks) 3.09 ticks (±0.16 ticks) 0.98
Memcpy speed - (built_in) block size 4096 74425.40 MByte/s (±51313.71 MByte/s) 73877.55 MByte/s (±50900.64 MByte/s) 1.01
Memcpy speed - (built_in) block size 1048576 29443.39 MByte/s (±24050.95 MByte/s) 29621.41 MByte/s (±24412.82 MByte/s) 0.99
Memcpy speed - (built_in) block size 16777216 23957.92 MByte/s (±19818.40 MByte/s) 26615.80 MByte/s (±21973.01 MByte/s) 0.90
Memset speed - (built_in) block size 4096 74530.29 MByte/s (±51385.58 MByte/s) 74082.46 MByte/s (±51039.25 MByte/s) 1.01
Memset speed - (built_in) block size 1048576 30145.26 MByte/s (±24479.12 MByte/s) 30381.08 MByte/s (±24836.90 MByte/s) 0.99
Memset speed - (built_in) block size 16777216 24629.77 MByte/s (±20242.39 MByte/s) 27365.04 MByte/s (±22427.19 MByte/s) 0.90
Memcpy speed - (rust) block size 4096 67392.19 MByte/s (±47160.50 MByte/s) 67998.13 MByte/s (±47775.53 MByte/s) 0.99
Memcpy speed - (rust) block size 1048576 29331.78 MByte/s (±24083.46 MByte/s) 29415.03 MByte/s (±24216.28 MByte/s) 1.00
Memcpy speed - (rust) block size 16777216 24408.56 MByte/s (±19946.25 MByte/s) 26645.15 MByte/s (±21980.78 MByte/s) 0.92
Memset speed - (rust) block size 4096 67201.00 MByte/s (±47041.15 MByte/s) 68410.01 MByte/s (±48051.67 MByte/s) 0.98
Memset speed - (rust) block size 1048576 30095.61 MByte/s (±24531.26 MByte/s) 30182.39 MByte/s (±24662.20 MByte/s) 1.00
Memset speed - (rust) block size 16777216 25093.93 MByte/s (±20381.77 MByte/s) 27320.66 MByte/s (±22364.88 MByte/s) 0.92
alloc_benchmarks Build Time 89.78 s 91.56 s 0.98
alloc_benchmarks File Size 0.85 MB 0.85 MB 1.00
Allocations - Allocation success 100.00 % 100.00 % 1
Allocations - Deallocation success 100.00 % 100.00 % 1
Allocations - Pre-fail Allocations 100.00 % 100.00 % 1
Allocations - Average Allocation time 4058.15 Ticks (±54.61 Ticks) 4553.50 Ticks (±57.46 Ticks) 0.89
Allocations - Average Allocation time (no fail) 4058.15 Ticks (±54.61 Ticks) 4553.50 Ticks (±57.46 Ticks) 0.89
Allocations - Average Deallocation time 648.58 Ticks (±45.02 Ticks) 1035.15 Ticks (±129.57 Ticks) 0.63
mutex_benchmark Build Time 90.40 s 88.37 s 1.02
mutex_benchmark File Size 0.84 MB 0.84 MB 1.00
Mutex Stress Test Average Time per Iteration - 1 Threads 13.66 ns (±0.65 ns) 14.02 ns (±0.84 ns) 0.97
Mutex Stress Test Average Time per Iteration - 2 Threads 16.40 ns (±4.60 ns) 17.80 ns (±4.95 ns) 0.92

This comment was automatically generated by workflow using github-action-benchmark.

@zyuiop
zyuiop force-pushed the feat/device-page-list branch from 0e30ad1 to 92b1387 Compare June 1, 2026 21:56
@zyuiop zyuiop closed this Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants