You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Optimization: Don't stat every cached gofer file during checkpoint when restore does not validate metadata #16208
During PrepareSave, the gofer filesystem gets fresh metadata for each cached regular file whose cached metadata is not authoritative (for example, on shared mounts). This is one stat per file, done in series while the sandbox is paused. The result is used only to validate file size and mtime during restore, and runsc never enables that validation.
Do the stat calls only when a save option says that restore will validate metadata. Keep the option off by default.
Evidence
pkg/sentry/fsimpl/gofer/save_restore.go:124-130, 180-187: stat calls in PrepareSave.
pkg/sentry/fsimpl/gofer/gofer.go:1085-1086: metadata is not authoritative on shared mounts.
runsc/boot/restore.go:546: restore passes &vfs.CompleteRestoreOptions{}, so both validation options are false.
Related: syncRemoteFileLocked drops fsync errors during save (gofer.go:2326-2343).
Performance impact
Not measured yet. The cost grows with the number of cached files on shared mounts.
How to verify
Checkpoint a sandbox with many open files on a shared bind mount. Compare the time from "Sandbox save started" to "Kernel save took", before and after, to significance (n=32, benchstat).
Activity
DARSHANR007 commentedon Oct 24, 2026
Hi @milantracy I'd like to work on this
gofer: do not stat cached regular files during PrepareSave by default
gofer: do not stat cached regular files during PrepareSave by default
gofer: do not stat cached regular files during PrepareSave by default
gofer: do not stat cached regular files during PrepareSave by default
gofer: do not stat cached regular files during PrepareSave by default