ateom-microvm: stop paying a 50ms tick waiting for virtiofsd - #849
Merged
Zoe Zhao (zoez7) merged 1 commit intoAug 11, 2026
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the socket waiting logic in StartVirtiofsd into a dedicated waitForSocket helper function and reduces the polling interval from 50ms to 1ms to improve restore times. It also adds comprehensive unit tests for this helper. The review feedback suggests replacing the use of time.After inside the polling loop with a reusable time.Ticker to prevent excessive memory allocations and garbage collection pressure due to the short 1ms interval.
Restoring an actor rebuilds its virtio-fs plumbing before the guest can come back, and part of that is waiting for virtiofsd to bind its socket. The wait polled every 50ms while virtiofsd binds in single-digit milliseconds, so what it cost was decided by the interval rather than the work: every restore paid a full tick, measured at a flat 51ms each time, against 5-10ms for the bind mounts beside it. Two shares are started per restore, so it was paid twice. Poll finely enough to notice instead, and pull the wait out into a helper so a test can pin the behaviour rather than the constant.
Benjamin Elder (BenTheElder)
force-pushed
the
microvm-virtiofsd-socket-wait
branch
from
August 11, 2026 05:58
fdf4e2a to
5472279
Compare
Zoe Zhao (zoez7)
approved these changes
Aug 11, 2026
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.
Restoring an actor rebuilds its virtio-fs plumbing before the guest can come back, and part of that is waiting for virtiofsd to bind its socket. The wait polled every 50ms while virtiofsd binds in single-digit milliseconds, so what it cost was decided by the interval rather than the work: every restore paid a full tick, measured at a flat 51ms each time, against 5-10ms for the bind mounts beside it. Two shares are started per restore, so it was paid twice.
Poll finely enough to notice instead, and pull the wait out into a helper so a test can pin the behavior rather than the constant.