Fix HDD seek storm: sequential I/O + parallel crypto #5
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-zecoxao/ps4encdec!5
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-hdd-seek-storm"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Makes
ps4encdecuse all CPU cores for AES-XTS while keeping disk I/O sequential — important because the target images (e.g. a ~420 GBC:\hdd\12.img) live on mechanical drives.Design: sequential streaming + parallel crypto.
parallel for. Theaes_xtscontext is initialized once and only read while crypting, so it is shared read-only across threads (the AES tables arestatic const).OMP_NUM_THREADSor an optional[threads]argument:ps4encdec <keys> <input> <output> <ivoffset> [threads]Makefilegains-fopenmp.Latent bugs fixed along the way
unsigned long+ftellfor the size/offset, which wraps on files >4 GiB (exactly the 420 GB case). Streaming with a running 64-bit sector counter removes the whole 32-bit offset path.Verification (MinGW gcc 13,
-O2 -fopenmp)12.img.🤖 Generated with Claude Code