Skip to content

perf(loongarch64): bypass event queue for virtual ipi - #393

Merged
li041 merged 3 commits into
syswonder:devfrom
li041:virtio-ipi
Sep 14, 2026
Merged

li041 merged 3 commits into
syswonder:devfrom
li041:virtio-ipi

Conversation

@li041

@li041 li041 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Update the virtual IPI pending-status bitmap before notifying the target CPU.
  • Use a dedicated physical IPI doorbell (bit 4) for virtual IPI delivery instead of allocating a generic event.
  • Preserve generic event-queue processing for other queued work by draining it only when events are pending.

Close #383

Motivation

Virtual IPI delivery previously allocated a generic event solely to trigger virtual IPI line synchronization. This added unnecessary event-queue traffic and coupled posted virtual IPI state to generic event handling.

This change treats virtual IPI status as posted state: the status bitmap is updated first, and the target CPU is notified through the dedicated doorbell. Generic events remain available for wakeups and other deferred work. However, from a design perspective, the generic event handling mechanism incurs non-negligible overhead, and really requires a refactor.

Verification

  • Hardware validation on the LoongArch 3A6000 board
  • cyclictest with hackbench backend
image

Risks and Limitations

  • The dedicated virtual IPI doorbell and related interrupt handling are currently specific to the LoongArch64 implementation.
  • Generic events still use the per-CPU FIFO and retain its synchronization and processing overhead; this change only removes virtual IPI notifications from that path.

@li041
li041 marked this pull request as draft September 9, 2026 12:51
Deliver virtual IPI status through the dedicated doorbell while retaining generic event handling for queued work.
@li041
li041 marked this pull request as ready for review September 13, 2026 15:55
@li041
li041 requested a review from agicy September 14, 2026 02:51
Comment thread src/arch/loongarch64/trap.rs Outdated

@agicy agicy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

@li041
li041 merged commit 2ab6663 into syswonder:dev Sep 14, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loongson 3A6000 Real‑Time Stress Test Bug

2 participants