Skip to content

fix(virtio-fs): de-assert interrupts#2231

Merged
mkroening merged 1 commit intomainfrom
virtio-fs-isr
Feb 10, 2026
Merged

fix(virtio-fs): de-assert interrupts#2231
mkroening merged 1 commit intomainfrom
virtio-fs-isr

Conversation

@mkroening
Copy link
Member

@mkroening mkroening commented Feb 9, 2026

Running httpd via virtio-net with virtio-fs also enabled, we run into #1680.

The symptoms are as follows:

  1. We set up the virtio-net device.
  2. We get an IP via DHCP and get two interrupts during configuration.
  3. We set up the virtio-fs device.
  4. We mount the virtio-fs directory and get one interrupt during configuration.
  5. We never get an virtio interrupt again.
    • Non-interrupt-based networking (with feature = "idle-poll") is not affected.
    • Sending other interrupts such as the serial device interrupt via the keyboard let's us make progress, since we currently always poll the network stack in all interrupts (until fix: Proper network wakers #2086).
    • Virtio-fs does not care, since we block on every operation.

The reason for this issue is related to virtio's ISR status capability:

To avoid an extra access, simply reading this register resets it to 0 and causes the device to de-assert the interrupt.

In this way, driver read of ISR status causes the device to de-assert an interrupt.

The problem is that for some reason, we never read the ISR status register for virtio-fs interrupts. This causes virtio-fs interrupts to never be de-asserted, preventing other virtio interrupt to be triggered.

The fix is straight forward: read the ISR status registers to deassert the virtio-fs interrupt as we already do for the other virtio devices. This PR just duplicates virtio-net's logic. In a follow up PR I will refactor the method name from is_queue_interrupt to something that signals that this is an active operation, not just a getter. In the future, I will merge the logic, deduplicating and unifying the methods.

Closes #1680.

@mkroening mkroening force-pushed the virtio-fs-isr branch 2 times, most recently from 7082b7d to 1b3025e Compare February 9, 2026 18:12
@mkroening mkroening marked this pull request as ready for review February 9, 2026 18:12
@mkroening mkroening self-assigned this Feb 9, 2026
Copy link

@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: 29a8ad2 Previous: af77eb8 Performance Ratio
startup_benchmark Build Time 99.41 s 96.76 s 1.03
startup_benchmark File Size 0.82 MB 0.82 MB 1.00
Startup Time - 1 core 0.94 s (±0.04 s) 0.93 s (±0.03 s) 1.01
Startup Time - 2 cores 0.97 s (±0.03 s) 0.93 s (±0.03 s) 1.04
Startup Time - 4 cores 0.97 s (±0.03 s) 0.95 s (±0.04 s) 1.02
multithreaded_benchmark Build Time 101.75 s 94.96 s 1.07
multithreaded_benchmark File Size 0.96 MB 0.96 MB 1.00
Multithreaded Pi Efficiency - 2 Threads 89.38 % (±7.03 %) 88.34 % (±8.83 %) 1.01
Multithreaded Pi Efficiency - 4 Threads 44.32 % (±2.96 %) 43.96 % (±2.87 %) 1.01
Multithreaded Pi Efficiency - 8 Threads 25.56 % (±1.80 %) 25.67 % (±1.88 %) 1.00
micro_benchmarks Build Time 114.06 s 107.03 s 1.07
micro_benchmarks File Size 0.97 MB 0.97 MB 1.00
Scheduling time - 1 thread 72.32 ticks (±4.96 ticks) 68.40 ticks (±2.80 ticks) 1.06
Scheduling time - 2 threads 39.98 ticks (±5.22 ticks) 36.75 ticks (±3.77 ticks) 1.09
Micro - Time for syscall (getpid) 3.66 ticks (±0.35 ticks) 3.72 ticks (±0.30 ticks) 0.98
Memcpy speed - (built_in) block size 4096 64939.19 MByte/s (±46463.88 MByte/s) 65936.06 MByte/s (±46962.77 MByte/s) 0.98
Memcpy speed - (built_in) block size 1048576 30122.60 MByte/s (±25106.05 MByte/s) 29711.39 MByte/s (±24468.80 MByte/s) 1.01
Memcpy speed - (built_in) block size 16777216 24314.25 MByte/s (±20484.53 MByte/s) 28572.31 MByte/s (±23801.85 MByte/s) 0.85
Memset speed - (built_in) block size 4096 65802.64 MByte/s (±47068.47 MByte/s) 66224.66 MByte/s (±47148.82 MByte/s) 0.99
Memset speed - (built_in) block size 1048576 30856.18 MByte/s (±25516.97 MByte/s) 30455.87 MByte/s (±24906.53 MByte/s) 1.01
Memset speed - (built_in) block size 16777216 25077.73 MByte/s (±20978.65 MByte/s) 29305.64 MByte/s (±24204.32 MByte/s) 0.86
Memcpy speed - (rust) block size 4096 56583.86 MByte/s (±41497.16 MByte/s) 59811.41 MByte/s (±43763.94 MByte/s) 0.95
Memcpy speed - (rust) block size 1048576 30093.61 MByte/s (±25060.67 MByte/s) 29629.02 MByte/s (±24504.10 MByte/s) 1.02
Memcpy speed - (rust) block size 16777216 25339.32 MByte/s (±21380.44 MByte/s) 28401.51 MByte/s (±23669.15 MByte/s) 0.89
Memset speed - (rust) block size 4096 57708.86 MByte/s (±42316.65 MByte/s) 60851.37 MByte/s (±44540.62 MByte/s) 0.95
Memset speed - (rust) block size 1048576 30861.29 MByte/s (±25475.71 MByte/s) 30426.48 MByte/s (±24959.19 MByte/s) 1.01
Memset speed - (rust) block size 16777216 26085.84 MByte/s (±21836.24 MByte/s) 29175.93 MByte/s (±24111.52 MByte/s) 0.89
alloc_benchmarks Build Time 103.50 s 102.72 s 1.01
alloc_benchmarks File Size 0.89 MB 0.89 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 10867.18 Ticks (±160.69 Ticks) 8547.70 Ticks (±113.80 Ticks) 1.27
Allocations - Average Allocation time (no fail) 10867.18 Ticks (±160.69 Ticks) 8547.70 Ticks (±113.80 Ticks) 1.27
Allocations - Average Deallocation time 963.68 Ticks (±307.52 Ticks) 1117.79 Ticks (±513.75 Ticks) 0.86
mutex_benchmark Build Time 105.38 s 111.82 s 0.94
mutex_benchmark File Size 0.97 MB 0.97 MB 1.00
Mutex Stress Test Average Time per Iteration - 1 Threads 12.98 ns (±0.68 ns) 13.38 ns (±0.85 ns) 0.97
Mutex Stress Test Average Time per Iteration - 2 Threads 15.34 ns (±0.65 ns) 15.68 ns (±0.79 ns) 0.98

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

@mkroening mkroening added this pull request to the merge queue Feb 10, 2026
@mkroening mkroening removed this pull request from the merge queue due to a manual request Feb 10, 2026
@mkroening mkroening added this pull request to the merge queue Feb 10, 2026
Merged via the queue into main with commit a4784de Feb 10, 2026
35 of 53 checks passed
@mkroening mkroening deleted the virtio-fs-isr branch February 10, 2026 10:32
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.

Hermit gets stuck with virtiofsd + netdev

1 participant