-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Background & Problem
Currently, hvisor uses a custom signal (SIGHVI) to notify user space about Virtio interrupts. This approach suffers from high kernel overhead due to context switching, limited scalability, and poor compatibility with modern asynchronous I/O models.
Proposed Solution
Replace the signal mechanism with eventfd. This provides a lightweight, file-descriptor-based notification interface.
Crucially, this change is a prerequisite for future integration with io_uring, which will allow for high-performance asynchronous I/O.
Implementation Details
Kernel Space (driver/hvisor.c):
- Remove
SIGHVIgeneration andtasktracking. - Implement
eventfdcontext management. - Modify
virtio_irq_handlerto write to theeventfdcounter instead of sending signals. - Update
ioctlto initialize and bindeventfdfor user processes.
User Space (tools/virtio.c):
- Remove
sigwaitand signal handling logic. - Obtain the
eventfdviaioctl. - Update the main loop to wait on the
eventfd(currently via blockingread, preparing the logic for futureio_uringsubmission). - Process Virtio queues upon
eventfdreadability.
Expected Outcomes
- Performance: Reduced notification latency and system overhead.
- Architecture: Decoupled signal logic from driver code.
- Future-proofing: Ready for seamless migration to io_uring.
Metadata
Metadata
Assignees
Labels
No labels