Repository navigation
image/machine: ext4 without orphan_file, inode tables zeroed at build, rootfstype=ext4 - #286
Merged
Merged
Conversation
Without it the root mount walks the registered block filesystems, and ext4's init registers ext3 and ext2 (EXT4_USE_FOR_EXT2) ahead of ext4: two refused mounts, each a superblock read after a block size change, before the one that works. The root is the image's ext4, or an overlay of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
orphan_file costs every mount, read-only included, ~73 sequential single-block reads in ext4_init_orphan_info, each a virtio round trip inside the root mount; it only scales concurrent unlinks of open files. Crash correctness is the classic orphan list's, as before 1.47. lazy_itable_init=0 marks every group ITABLE_ZEROED: mke2fs -d left them all unmarked, and each overlay's first read-write mount had ext4lazyinit write 16 MiB of zeroes into it within the first second of the boot. Measured with one --init /bin/sh boot (laptop): 16.06 MiB of zero clusters in the overlay before, none after. The image is 256 KiB smaller. Both are read back from the finished filesystem: no orphan_file in dumpe2fs's features, and ITABLE_ZEROED on as many groups as the header says there are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three cuts to the root mount, from a source-level read of Linux 7.3 and the image. The kernel's gap from the last initcall to "EXT4-fs (vda): mounted" is 6.8 ms nested, 5.0 metal.
orphan_file.ext4_init_orphan_info()read 73 blocks one at a time at every mount, a virtio round trip each. Crash handling falls back to the classic orphan list and the journal.lazy_itable_init=0).mke2fs -dmarked no groupITABLE_ZEROED, so every VM'sext4lazyinitwrote 16 MiB of zeroes into its own overlay about a second after boot, in the login's window. After one boot that overlay held 16.06 MiB of zero clusters; it now holds 0. The image costs nothing for it (−256 KiB), because qcow2 does not allocate zero clusters. The thread still starts, but only to prefetch bitmaps, which only reads.rootfstype=ext4. The root mount tried ext3 and ext2 first, re-reading the superblock each time.image/build.shasserts the outcome on the finished filesystem:orphan_fileis present;ITABLE_ZEROEDmust equal the group count computed from the header, so empty output fails too. Both checks were also run against images built to fail them.Checked:
boot:lockdown,boot:logind,boot:hotadd,task lintandgo test ./...pass.The bench measures the image once it is in a release (
boot:ssh-first,boot:restore-first), because the lab boots published images.🤖 Generated with Claude Code