Skip to content

Draft: Add virtio balloon#1995

Draft
hcsch wants to merge 2 commits intohermit-os:mainfrom
hcsch:add-virtio-balloon
Draft

Draft: Add virtio balloon#1995
hcsch wants to merge 2 commits intohermit-os:mainfrom
hcsch:add-virtio-balloon

Conversation

@hcsch
Copy link
Copy Markdown
Contributor

@hcsch hcsch commented Oct 20, 2025

Description and more explanatory comments are to follow

Copy link
Copy Markdown
Member

@mkroening mkroening left a comment

Choose a reason for hiding this comment

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

@mkroening
Copy link
Copy Markdown
Member

As of #2349, talc should not have to be patched anymore. See SFBdragon/talc#43.

@hcsch
Copy link
Copy Markdown
Contributor Author

hcsch commented Mar 26, 2026

I'll drop the commits that are no longer necessary then and will try to finish commit messages / doc comments by the end of the week. Sorry for leaving this a bit unfinished for so long, and thanks for picking up the side-chores/fixes ^^

@hcsch hcsch force-pushed the add-virtio-balloon branch from 9ae5b2c to e0b5689 Compare March 26, 2026 21:43
@hcsch
Copy link
Copy Markdown
Contributor Author

hcsch commented Mar 26, 2026

I've rerbased the PR, but I still have some writing to do. In hindsight I'm not quite sure the locking of the driver is sane for multi-core operation (what if an interrupt arrives at the same time that an OOM triggered deflation is running, or the other way around?), but the code still seems to be working rebased on the current main branch.
I'm also not quite sure about the balloon executer task being properly woken if it happens to run while the driver is locked elsewhere, but I think that should be alright (unless the registered waker stored in the driver has to be replaced on each poll of the async task).

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

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: e0b5689 Previous: 5127c77 Performance Ratio
startup_benchmark Build Time 88.65 s 89.35 s 0.99
startup_benchmark File Size 0.79 MB 0.79 MB 1.00
Startup Time - 1 core 0.79 s (±0.04 s) 0.81 s (±0.03 s) 0.98
Startup Time - 2 cores 0.80 s (±0.03 s) 0.82 s (±0.03 s) 0.98
Startup Time - 4 cores 0.82 s (±0.02 s) 0.83 s (±0.02 s) 1.00
multithreaded_benchmark Build Time 91.03 s 92.62 s 0.98
multithreaded_benchmark File Size 0.89 MB 0.89 MB 1.00
Multithreaded Pi Efficiency - 2 Threads 88.26 % (±8.29 %) 90.72 % (±8.59 %) 0.97
Multithreaded Pi Efficiency - 4 Threads 44.76 % (±2.34 %) 44.88 % (±4.39 %) 1.00
Multithreaded Pi Efficiency - 8 Threads 26.09 % (±2.26 %) 25.87 % (±3.25 %) 1.01
micro_benchmarks Build Time 98.57 s 100.57 s 0.98
micro_benchmarks File Size 0.90 MB 0.90 MB 1.00
Scheduling time - 1 thread 72.11 ticks (±3.77 ticks) 74.98 ticks (±4.47 ticks) 0.96
Scheduling time - 2 threads 39.79 ticks (±4.72 ticks) 40.19 ticks (±4.30 ticks) 0.99
Micro - Time for syscall (getpid) 2.99 ticks (±0.29 ticks) 2.97 ticks (±0.23 ticks) 1.00
Memcpy speed - (built_in) block size 4096 76756.73 MByte/s (±53085.03 MByte/s) 76264.90 MByte/s (±52720.43 MByte/s) 1.01
Memcpy speed - (built_in) block size 1048576 30419.56 MByte/s (±24923.19 MByte/s) 30292.34 MByte/s (±24927.05 MByte/s) 1.00
Memcpy speed - (built_in) block size 16777216 25033.08 MByte/s (±20915.94 MByte/s) 23336.56 MByte/s (±19347.79 MByte/s) 1.07
Memset speed - (built_in) block size 4096 76809.70 MByte/s (±53121.20 MByte/s) 76939.35 MByte/s (±53180.56 MByte/s) 1.00
Memset speed - (built_in) block size 1048576 31169.87 MByte/s (±25348.21 MByte/s) 31021.82 MByte/s (±25328.96 MByte/s) 1.00
Memset speed - (built_in) block size 16777216 25637.64 MByte/s (±21255.13 MByte/s) 24084.23 MByte/s (±19864.53 MByte/s) 1.06
Memcpy speed - (rust) block size 4096 70044.44 MByte/s (±49144.15 MByte/s) 67864.13 MByte/s (±47549.43 MByte/s) 1.03
Memcpy speed - (rust) block size 1048576 30350.89 MByte/s (±24987.75 MByte/s) 30092.92 MByte/s (±24855.28 MByte/s) 1.01
Memcpy speed - (rust) block size 16777216 25672.80 MByte/s (±21409.27 MByte/s) 23650.21 MByte/s (±19669.17 MByte/s) 1.09
Memset speed - (rust) block size 4096 70522.48 MByte/s (±49409.55 MByte/s) 67668.78 MByte/s (±47427.13 MByte/s) 1.04
Memset speed - (rust) block size 1048576 31104.57 MByte/s (±25403.45 MByte/s) 30783.24 MByte/s (±25249.62 MByte/s) 1.01
Memset speed - (rust) block size 16777216 26384.82 MByte/s (±21840.53 MByte/s) 24398.50 MByte/s (±20179.80 MByte/s) 1.08
alloc_benchmarks Build Time 91.38 s 96.87 s 0.94
alloc_benchmarks File Size 0.86 MB 0.86 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 5734.58 Ticks (±137.14 Ticks) 5277.51 Ticks (±516.92 Ticks) 1.09
Allocations - Average Allocation time (no fail) 5734.58 Ticks (±137.14 Ticks) 5277.51 Ticks (±516.92 Ticks) 1.09
Allocations - Average Deallocation time 746.14 Ticks (±129.18 Ticks) 959.09 Ticks (±254.64 Ticks) 0.78
mutex_benchmark Build Time 91.96 s 91.13 s 1.01
mutex_benchmark File Size 0.90 MB 0.90 MB 1.00
Mutex Stress Test Average Time per Iteration - 1 Threads 12.98 ns (±0.79 ns) 13.26 ns (±0.96 ns) 0.98
Mutex Stress Test Average Time per Iteration - 2 Threads 20.64 ns (±14.81 ns) 20.28 ns (±12.66 ns) 1.02

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

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