Repository navigation
os/v3/puppy: boot with scsi_mod.scan=sync, so a stalled USB storage device does not hold the boot ~40 s - #3304
Merged
Conversation
…evice does not hold the boot ~40 s (engine#3286) A USB mass-storage device that does not answer (a JetKVM's virtual media on the AI MAX+ 395) made every boot of an installed system wait about 40 s. Traced on the board with timestamps written to /dev/kmsg: rc.sysinit's 'udevadm settle -t 20' ran 5.0 -> 25.3 s (its cap) and 'modprobe ec_su_axb35' (ADDLIST) ran 25.3 -> 45.4 s, both ending on the device's resets. The EC driver itself loaded in 0.3 s; with the module moved out of ADDLIST the next modprobes (battery, ac, thermal, tls) took the same wait. With async SCSI scanning the stuck scan sits in the global async queue, and module loading waits for that queue (do_init_module -> async_synchronize_full), which also stalls udev's own module loads and so settle. scsi_mod.scan=sync scans each usb-storage device in its own worker instead. Measured, with nothing else changed: installed boot 45.6 -> 8.8 s (settle ends at 8.4 s, the EC driver at 8.8 s, fans controlled, lemond up), live stick boot 51.6 -> 23.5 s (booting itself from sda2). mkimage now refuses a grub.cfg without it; 1bit-install copies the stick's boot lines, so an installed disk carries it too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
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.
Fixes #3286.
Cause, traced on the AI MAX+ 395 (timestamps written to
/dev/kmsgfromrc.sysinitandrc.services; JetKVM attached, its virtual media not answering):udevadm settle -t 20modprobe ec_su_axb35(ADDLIST)BOOTuptime), installedThe EC driver itself loaded in 0.3 s; with it taken out of ADDLIST the next module loads (battery, ac, thermal, tls) took the same 20 s. That is the async-scan wait: the stuck device's SCSI scan sits in the kernel's global async queue, and every module load waits for that queue before
modprobereturns (do_init_module→async_synchronize_full), including udev's own loads, which is whysettleran to its cap.Change.
scsi_mod.scan=syncon every boot linemkimage.shwrites: usb-storage then scans each device inside its own worker, and nothing else waits on it.mkimagerefuses agrub.cfgwithout it (the same guard the YMTC quirk has);1bit-installcopies the stick's boot lines, so the installed disk carries it.Measured with only this parameter changed (rc.sysinit and every init script stock): installed boot 8.8 s, EC driver at 8.8 s and the fans controlled, lemond up; the live stick still boots itself (
PUPSFS=sda2). Without a stalled USB storage device nothing changes (each device is still scanned, just not in the global queue).🤖 Generated with Claude Code