Skip to content

refactor(virtio-console): remove VirtioUART wrapper#2556

Open
cagatay-y wants to merge 9 commits into
hermit-os:mainfrom
cagatay-y:refactor-console
Open

refactor(virtio-console): remove VirtioUART wrapper#2556
cagatay-y wants to merge 9 commits into
hermit-os:mainfrom
cagatay-y:refactor-console

Conversation

@cagatay-y

Copy link
Copy Markdown
Contributor

Rather than accessing the virtio-console driver through the global driver vector, place it into the using struct in a way similar to what was done in b735657.

cagatay-y added 9 commits July 9, 2026 00:40
This will allow sharing code between PCI and MMIO based devices.
Device ID is a constant defined in the VIRTIO specification for a given device
on a transport, so storing and printing it on error does not provide additional
information to the user.
Structures initialized with placeholder values can allow incorrect code that
reads them before they are actually filled in. This previously caused bugs in
virtio-net. For virtio-net, our solution was to work around it by making the
structure generic over its initialization stage. This approach, however, causes
the way the driver is initialized to differ in structure from how the other
drivers are initialized. This is an issue for us because it prevents making more
parts of the driver initialization common between the different device types.
Rather than accessing the virtio-console driver through the global driver
vector, place it into the using struct in a way similar to what was done in
b735657.

@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: d1e4d1d Previous: 2e23902 Performance Ratio
startup_benchmark Build Time 82.26 s 80.34 s 1.02
startup_benchmark File Size 0.80 MB 0.80 MB 1.00
Startup Time - 1 core 0.74 s (±0.02 s) 0.75 s (±0.02 s) 0.99
Startup Time - 2 cores 0.75 s (±0.02 s) 0.74 s (±0.02 s) 1.02
Startup Time - 4 cores 0.75 s (±0.02 s) 0.74 s (±0.02 s) 1.01
multithreaded_benchmark Build Time 78.93 s 82.11 s 0.96
multithreaded_benchmark File Size 0.86 MB 0.86 MB 1.00
Multithreaded Pi Efficiency - 2 Threads 87.37 % (±7.86 %) 85.89 % (±6.61 %) 1.02
Multithreaded Pi Efficiency - 4 Threads 43.68 % (±2.78 %) 43.43 % (±2.56 %) 1.01
Multithreaded Pi Efficiency - 8 Threads 25.50 % (±1.51 %) 25.76 % (±1.53 %) 0.99
micro_benchmarks Build Time 77.03 s 80.40 s 0.96
micro_benchmarks File Size 0.86 MB 0.86 MB 1.00
Scheduling time - 1 thread 60.93 ticks (±1.58 ticks) 62.65 ticks (±4.06 ticks) 0.97
Scheduling time - 2 threads 33.33 ticks (±4.80 ticks) 34.08 ticks (±4.10 ticks) 0.98
Micro - Time for syscall (getpid) 3.49 ticks (±0.61 ticks) 3.45 ticks (±0.58 ticks) 1.01
Memcpy speed - (built_in) block size 4096 85499.68 MByte/s (±59119.64 MByte/s) 82448.38 MByte/s (±56997.13 MByte/s) 1.04
Memcpy speed - (built_in) block size 1048576 30798.27 MByte/s (±24804.39 MByte/s) 30585.98 MByte/s (±24707.84 MByte/s) 1.01
Memcpy speed - (built_in) block size 16777216 29275.04 MByte/s (±24046.06 MByte/s) 26340.06 MByte/s (±21720.96 MByte/s) 1.11
Memset speed - (built_in) block size 4096 86183.74 MByte/s (±59530.54 MByte/s) 82292.76 MByte/s (±56891.50 MByte/s) 1.05
Memset speed - (built_in) block size 1048576 31556.11 MByte/s (±25247.62 MByte/s) 31323.85 MByte/s (±25145.86 MByte/s) 1.01
Memset speed - (built_in) block size 16777216 30048.25 MByte/s (±24498.92 MByte/s) 27104.68 MByte/s (±22209.94 MByte/s) 1.11
Memcpy speed - (rust) block size 4096 76111.40 MByte/s (±53064.48 MByte/s) 74097.96 MByte/s (±51811.44 MByte/s) 1.03
Memcpy speed - (rust) block size 1048576 30559.42 MByte/s (±24655.13 MByte/s) 30361.60 MByte/s (±24602.37 MByte/s) 1.01
Memcpy speed - (rust) block size 16777216 29349.83 MByte/s (±24124.94 MByte/s) 27625.34 MByte/s (±22806.88 MByte/s) 1.06
Memset speed - (rust) block size 4096 76881.83 MByte/s (±53580.25 MByte/s) 74373.47 MByte/s (±51976.48 MByte/s) 1.03
Memset speed - (rust) block size 1048576 31299.60 MByte/s (±25104.47 MByte/s) 31110.89 MByte/s (±25033.24 MByte/s) 1.01
Memset speed - (rust) block size 16777216 30120.52 MByte/s (±24572.97 MByte/s) 28386.93 MByte/s (±23265.03 MByte/s) 1.06
alloc_benchmarks Build Time 75.96 s 74.76 s 1.02
alloc_benchmarks File Size 0.87 MB 0.87 MB 1.00
Allocations - Allocation success 91.31 % 91.31 % 1
Allocations - Deallocation success 100.00 % 100.00 % 1
Allocations - Pre-fail Allocations 61.44 % 61.44 % 1
Allocations - Average Allocation time 6024.16 Ticks (±249.03 Ticks) 5860.58 Ticks (±98.43 Ticks) 1.03
Allocations - Average Allocation time (no fail) 6797.69 Ticks (±237.15 Ticks) 6554.81 Ticks (±92.86 Ticks) 1.04
Allocations - Average Deallocation time 2189.94 Ticks (±473.48 Ticks) 1805.01 Ticks (±250.35 Ticks) 1.21
mutex_benchmark Build Time 79.66 s 79.82 s 1.00
mutex_benchmark File Size 0.86 MB 0.86 MB 1
Mutex Stress Test Average Time per Iteration - 1 Threads 12.04 ns (±0.20 ns) 12.10 ns (±0.41 ns) 1.00
Mutex Stress Test Average Time per Iteration - 2 Threads 40.58 ns (±2.28 ns) 40.26 ns (±1.68 ns) 1.01

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.

1 participant