Skip to content

Conversation

n0toose
Copy link
Member

@n0toose n0toose commented Oct 10, 2025

  • Skip memory probes, use default address directly on Uhyve.
  • Checking whether the processor supports x2apic in init_x2apic goes against the component's own conventions.
  • We need a local APIC, but IO-APIC is not supported.
  • Show more relevant info/warning messages.
  • Fix minor formatting issue that shows "0x0x" prefix.

Fixes #1352

@n0toose
Copy link
Member Author

n0toose commented Oct 10, 2025

As pointed out in #1352 (comment), a manual skip of x2apic causes an error (adding that it appears both under QEMU and Uhyve). I don't currently believe it is relevant to my changes.

Copy link
Contributor

@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

Benchmark Current: 9d15052 Previous: 376b966 Performance Ratio
startup_benchmark Build Time 108.61 s 110.37 s 0.98
startup_benchmark File Size 0.91 MB 0.90 MB 1.00
Startup Time - 1 core 0.91 s (±0.03 s) 0.93 s (±0.03 s) 0.99
Startup Time - 2 cores 0.90 s (±0.03 s) 0.93 s (±0.03 s) 0.96
Startup Time - 4 cores 0.92 s (±0.04 s) 0.93 s (±0.03 s) 0.99
multithreaded_benchmark Build Time 112.07 s 114.11 s 0.98
multithreaded_benchmark File Size 1.01 MB 1.01 MB 1.00
Multithreaded Pi Efficiency - 2 Threads 87.89 % (±9.00 %) 87.54 % (±7.72 %) 1.00
Multithreaded Pi Efficiency - 4 Threads 43.50 % (±3.24 %) 43.85 % (±3.71 %) 0.99
Multithreaded Pi Efficiency - 8 Threads 24.88 % (±2.03 %) 25.11 % (±2.07 %) 0.99
micro_benchmarks Build Time 106.56 s 106.92 s 1.00
micro_benchmarks File Size 1.01 MB 1.01 MB 1.00
Scheduling time - 1 thread 68.69 ticks (±5.22 ticks) 67.03 ticks (±3.54 ticks) 1.02
Scheduling time - 2 threads 38.19 ticks (±4.69 ticks) 38.31 ticks (±5.49 ticks) 1.00
Micro - Time for syscall (getpid) 3.20 ticks (±0.50 ticks) 2.98 ticks (±0.45 ticks) 1.07
Memcpy speed - (built_in) block size 4096 82695.54 MByte/s (±57207.20 MByte/s) 78287.67 MByte/s (±54207.29 MByte/s) 1.06
Memcpy speed - (built_in) block size 1048576 42700.92 MByte/s (±29572.30 MByte/s) 42758.95 MByte/s (±29603.37 MByte/s) 1.00
Memcpy speed - (built_in) block size 16777216 28953.71 MByte/s (±23785.36 MByte/s) 28796.76 MByte/s (±23654.74 MByte/s) 1.01
Memset speed - (built_in) block size 4096 82745.72 MByte/s (±57244.21 MByte/s) 78337.85 MByte/s (±54246.52 MByte/s) 1.06
Memset speed - (built_in) block size 1048576 42936.08 MByte/s (±29733.57 MByte/s) 43001.55 MByte/s (±29767.07 MByte/s) 1.00
Memset speed - (built_in) block size 16777216 29713.37 MByte/s (±24222.04 MByte/s) 29553.13 MByte/s (±24095.41 MByte/s) 1.01
Memcpy speed - (rust) block size 4096 72695.87 MByte/s (±50564.54 MByte/s) 70495.32 MByte/s (±49405.95 MByte/s) 1.03
Memcpy speed - (rust) block size 1048576 42717.91 MByte/s (±29581.54 MByte/s) 42856.55 MByte/s (±29682.27 MByte/s) 1.00
Memcpy speed - (rust) block size 16777216 28794.14 MByte/s (±23621.65 MByte/s) 28900.71 MByte/s (±23739.86 MByte/s) 1.00
Memset speed - (rust) block size 4096 72838.08 MByte/s (±50644.01 MByte/s) 69943.60 MByte/s (±49128.48 MByte/s) 1.04
Memset speed - (rust) block size 1048576 42918.33 MByte/s (±29718.03 MByte/s) 43095.53 MByte/s (±29843.91 MByte/s) 1.00
Memset speed - (rust) block size 16777216 29543.48 MByte/s (±24052.22 MByte/s) 29647.15 MByte/s (±24171.90 MByte/s) 1.00
alloc_benchmarks Build Time 104.71 s 105.40 s 0.99
alloc_benchmarks File Size 0.97 MB 0.97 MB 1.00
Allocations - Allocation success 100.00 % 100.00 % 1
Allocations - Deallocation success 70.01 % (±0.27 %) 70.03 % (±0.30 %) 1.00
Allocations - Pre-fail Allocations 100.00 % 100.00 % 1
Allocations - Average Allocation time 12238.43 Ticks (±206.43 Ticks) 12298.03 Ticks (±230.53 Ticks) 1.00
Allocations - Average Allocation time (no fail) 12238.43 Ticks (±206.43 Ticks) 12298.03 Ticks (±230.53 Ticks) 1.00
Allocations - Average Deallocation time 714.40 Ticks (±78.86 Ticks) 722.17 Ticks (±103.75 Ticks) 0.99
mutex_benchmark Build Time 104.83 s 105.06 s 1.00
mutex_benchmark File Size 1.02 MB 1.02 MB 1.00
Mutex Stress Test Average Time per Iteration - 1 Threads 12.72 ns (±0.87 ns) 12.74 ns (±0.74 ns) 1.00
Mutex Stress Test Average Time per Iteration - 2 Threads 14.54 ns (±1.04 ns) 14.80 ns (±1.47 ns) 0.98

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

@mkroening mkroening self-requested a review October 11, 2025 08:18
Copy link
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.

Could you split this up into several commits to ease review of separate changes? :)

I am not too convinced about the log changes. Not being able to find APIC via ACPI or MP is expected for certain machines (such as Uhyve). I don't think this warrants a warning. In what kind of cases are the logs useful in practice?

@mkroening mkroening self-assigned this Oct 11, 2025
Copy link
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.

Do I understand correctly that this is improving the performance and not fixing a problem?

@n0toose
Copy link
Member Author

n0toose commented Oct 16, 2025

Do I understand correctly that this is improving the performance and not fixing a problem?

I considered performing checks "that will not go anywhere" in the Uhyve environment to be a problem/bug, but I understand why the fix: might be misleading. Sorry.

To answer your question: Yes. To the best extend that I am aware of, I don't find that the previous checks are necessary within Uhyve (as far as its main branch is concerned) for Uhyve to work. This change removes this "small freeze effect"-feeling when launching Uhyve.

- Skip memory probes, use default address directly on Uhyve.
- We need a local APIC, but IO-APIC is not supported.
@mkroening mkroening changed the title fix(apic): skip apic probe on uhyve, simplify checks perf(x86_64): skip APIC probe on uhyve Oct 17, 2025
@mkroening
Copy link
Member

mkroening commented Oct 17, 2025

All right, I have further separated the refactoring from the first commit. I think you missed adding a condition in application_processor_init. I wonder why this caused no problems, though. It should have, as far as I understand.

Are you okay with my changes? :) c2159c8..9d15052

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.

Skip APIC detection on Uhyve

2 participants