Skip to content

Commit

Permalink
install: Disable fsync() in repo when pulling
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
cgwalters committed Jun 29, 2024
1 parent 8b30128 commit 6c81a40
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,14 @@ async fn initialize_ostree_root_from_self(
imgref: src_imageref,
};

// Pull the container image into the target root filesystem.
// Pull the container image into the target root filesystem. Since this is
// an install path, we don't need to fsync() individual layers.
{
let spec_imgref = ImageReference::from(src_imageref.clone());
crate::deploy::pull(&sysroot.repo(), &spec_imgref, false).await?;
let repo = &sysroot.repo();
repo.set_disable_fsync(true);
crate::deploy::pull(repo, &spec_imgref, false).await?;
repo.set_disable_fsync(false);
}

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

0 comments on commit 6c81a40

Please sign in to comment.