Repository navigation
Conversation
- Replace the 10 ms sleep loops with poll(2) on a self-pipe. - Signal handler writes to the pipe to wake the wait. - Listener mode also wakes on a pending connection. - Idle microVM cost: ~2.5% to ~0.2% of a core. Closes #6071 Signed-off-by: Divesh <dgude@nvidia.com>
Signed-off-by: divesh <dgude@nvidia.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An idle sandbox boundary woke every 10 ms to check its termination flag. It now sleeps in
poll(2)until a SIGTERM/SIGINT arrives or, in listener mode, a connection is pending. In a microVM each of those wakeups is a VM exit.Related Issue
Closes #6071
Changes
poll(2)on that pipe (plus the listener fd) instead ofsleep(10ms), with a 1 s fallback timeout.Testing
Measured on a Docker-backed gateway (Linux 6.8, arm64) with an idle sandbox. Wakeups are context switches across all boundary threads over 10 s.
docker stop(SIGTERM)mainAn unrelated idle sandbox on the same host stayed at about 97 wakeups/s in both runs.
openshell-sandboxboundary_servertests pass on Linux (69 passed), including the new pending-connection wakeup test;cargo fmtandclippy -D warnings(withperf-harness) are cleanChecklist