Skip to content

Commit 6c81a40

Browse files
committed
install: Disable fsync() in repo when pulling
This more than doubles the copy phase speed for me. We rely on a final fsync/flush of the disks when unmounting. Signed-off-by: Colin Walters <[email protected]>
1 parent 8b30128 commit 6c81a40

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/src/install.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,10 +652,14 @@ async fn initialize_ostree_root_from_self(
652652
imgref: src_imageref,
653653
};
654654

655-
// Pull the container image into the target root filesystem.
655+
// Pull the container image into the target root filesystem. Since this is
656+
// an install path, we don't need to fsync() individual layers.
656657
{
657658
let spec_imgref = ImageReference::from(src_imageref.clone());
658-
crate::deploy::pull(&sysroot.repo(), &spec_imgref, false).await?;
659+
let repo = &sysroot.repo();
660+
repo.set_disable_fsync(true);
661+
crate::deploy::pull(repo, &spec_imgref, false).await?;
662+
repo.set_disable_fsync(false);
659663
}
660664

661665
// Load the kargs from the /usr/lib/bootc/kargs.d from the running root,

0 commit comments

Comments
 (0)