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
fs: Add async filesystem import with parallel verity computation
Previously, we had a lot of synchronous code for interacting
with the local filesystem, but the tar processing used by OCI was
async. This created a need to do "the same thing" in two different ways.
But importing from a local filesystem is equally amenable to being
async! Replacing that with a model where we read the filesystem
metadata synchronously, but defer fsverity computation and object
import to worker threads results in *dramatic* speedup for
large filesystem trees.
Computing the composefs digest of the 40G `target/` directory I have
locally is 1m20s before this patch, and 8s after (32 cores, so
a lot more CPU time used of course).
Three optimized paths depending on context:
- Secure repo: std::io::copy (uses copy_file_range for reflinks on CoW
filesystems) then kernel fsverity enable + measure
- Insecure repo: tee through FsVerityHasher while copying to tmpfile,
computing the digest in a single pass
- No repo: incremental FsVerityHasher from fd, one block at a time
Also: the composefs-http ensure_object call is migrated to ensure_object_async
which it should have been using in the first place! This is
a clear advantage of having one way to do it.
Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <walters@verbum.org>
0 commit comments