fix(loongarch64): Fix Virtio using too much CPU - #382
Conversation
align LS3A5000 VirtIO IRQ and make HWI lock per-CPU
|
I made this follow-up change for two reasons:
The refactor replaces the atomic bitmap and separate lock with a per-CPU |
|
Thanks for the contribution! This PR improves LoongArch VirtIO interrupt handling by addressing excessive CPU usage, aligning the LS3A5000 VirtIO IRQ configuration, and moving guest HWI synchronization to per-CPU locking. These changes make interrupt delivery more accurate and reduce unnecessary cross-CPU contention. Appreciate the work on this! |
Thanks for the explanation. I reviewed the refactor, and it matches the original intent. Combining the guest HWI bitmap with the per-CPU mutex makes the locking contract clearer while preserving the existing local synchronization and remote IPI behavior. |
Summary
Fix excessive VirtIO backend CPU usage on LoongArch64.
hvisor-virtioto sleep inepoll_wait()when idle.Tested by building hvisor, hvisor-tool, and hvisor.ko for LoongArch64.