system: mkfs work disks with lazy_itable_init + lazy_journal_init
mkfs.ext4 zeroes the entire inode table and journal at format time unless told otherwise. On an 8 GiB work disk that's roughly 500-700ms of host CPU/IO per 'banger vm create', for a one-time small per-write penalty inside the guest the first time it touches an unwritten inode that nobody can perceive. Centralise the canonical mkfs -E option list as system.MkfsExtraOptions and use it everywhere banger calls mkfs.ext4 on a VM-internal image: the no-seed work disk, MaterializeWorkDisk, BuildWorkSeedImage, and the imagepull rootfs builder. The work-disk paths feed vm create directly; the others are one-off but still benefit from the faster format. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
74e5a7cedb
commit
74a2d064fd
3 changed files with 18 additions and 7 deletions
|
|
@ -122,7 +122,7 @@ func (s *VMService) ensureWorkDisk(ctx context.Context, vm *model.VMRecord, imag
|
|||
if _, err := s.runner.Run(ctx, "truncate", "-s", strconv.FormatInt(vm.Spec.WorkDiskSizeBytes, 10), vm.Runtime.WorkDiskPath); err != nil {
|
||||
return workDiskPreparation{}, err
|
||||
}
|
||||
if _, err := s.runner.Run(ctx, "mkfs.ext4", "-F", "-E", "root_owner=0:0", vm.Runtime.WorkDiskPath); err != nil {
|
||||
if _, err := s.runner.Run(ctx, "mkfs.ext4", "-F", "-E", system.MkfsExtraOptions, vm.Runtime.WorkDiskPath); err != nil {
|
||||
return workDiskPreparation{}, err
|
||||
}
|
||||
return workDiskPreparation{}, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue