fix(disks): eliminate DragonFly disklabel fan-out and md phantoms#28
Merged
Conversation
The DragonFly disks/partitions probe spawned disklabel on device+s1..s4 for
every kern.disks device (~660 spawns on a 132-device guest, 127 of them empty
md memory disks) and leaked those md disks into the disks fact as 9.77 MB
phantoms.
- dragonFlyPseudoDisk skips md/cd pseudo-devices (driver class) in both the
disks list and the partition probe.
- dragonFlyDisklabelTargets now globs the slice nodes that actually exist
(/dev/<dev>s<N>) instead of the fixed s1..s4, and drops the never-productive
whole-disk target (the DragonFly label lives on the slice).
- currentDragonFlyPartitions takes s.glob; unattached vn is handled by the
existing size gate + empty glob, attached vn is kept.
Scope is DragonFly-only: nlab ground truth shows OpenBSD/NetBSD hw.disknames is
kernel-curated to attached instances (no md/rd/cd leak), and filtering rd there
would be harmful in a bsd.rd root boot.
Validated on the nlab DragonFly guest: gate green, disks={da0} only,
partitions unchanged, discovery 1m42s->0.65s, disklabel spawns ~660->~1.
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.
Summary
The DragonFly
disks/partitionsprobe had two independent problems, both confirmed on the nlab DragonFly guest while diagnosing the CI timeout:dragonFlyDisklabelTargetsblindly probeddevice + s1..s4(plus the whole disk) for every device inkern.disks. The guest lists 132 devices (da0,vn0..3,md0..md126), so one discovery spawned ~660disklabelprocesses, of which exactly one (disklabel da0s1) was productive.mdmemory disks leaked into thedisksfact as phantom 9.77 MB disks (diskinfo /dev/md0returns a positive size).What changed (DragonFly only)
dragonFlyPseudoDiskskipsmd/cdpseudo-devices (matched by driver class — name with trailing digits stripped) in both the disks list and the partition probe.dragonFlyDisklabelTargetsnow globs the slice nodes that actually exist (/dev/<dev>s<N>) instead of the fixeds1..s4, and drops the never-productive whole-disk target (the DragonFly label lives on the slice;disklabel da0returnsOperation not supported).currentDragonFlyPartitionstakess.glob. Unattachedvnis handled by the existing size gate + empty glob; attachedvnis kept.Why DragonFly-only (ground truth from nlab)
hw.disknames/kern.disksmd1..md126 da0 vn0..3 md0mdphantoms, ~660 spawnssd0:<duid>,fd0:rd0/cd0not listed;fd0errors outsd0 dk0 dk1md0/cd0not listed;dkwedges already handledOpenBSD/NetBSD
hw.disknamesis kernel-curated to attached instances, so pseudo-devices never enter the probe. Filteringrdthere would be dead code — and harmful in absd.rdrecovery boot whererd0is the root disk. So this change does not touch their code paths; their facts are byte-identical by construction. Ruby Facter has no BSD disks resolver, so there is no parity constraint.Validation (nlab DragonFly guest)
disks={da0}only — the 127mdphantoms are gone.partitions=/dev/da0s1a(/boot),s1b(swap),s1d(/) — unchanged.disks partitions: 1m42s system time → 0.65s.disklabelspawns: ~660 → ~1.Review
--audience agent): 0 comments.vntest) was fixed.Implements OpenSpec change
optimize-bsd-disks-probe.