Optimizing sysfs and procfs
summary
Observed that ~40% of sysfs/procfs entries get accessed at boot, leaving many inodes/dentries resident; applying DCACHE_DONTCACHE to all entries reduces inode/dentry usage from ~11k to ~2.8k and frees ~11–12 MB but raises lookup calls from ~10k to ~45k and slows boot (8.43s → 8.73s). Changing strategy to apply DCACHE_DONTCACHE only to files preserves directory dentries, cuts inode/dentry usage and saves ~6–7 MB while keeping boot time near baseline (8.43s → 8.60s). Results come from boot-time access traces and lookup/inode counters.
AI-written summary · about
chapters (9)
- 0:00Introduction to sysfs and procfs
- 3:40File access walkthrough in sysfs
- 6:32Memory retention problem in sysfs
- 7:58Proposed solution with dcache don't cache
- 12:50Benchmark results and trade-offs
- 16:04Optimizing for files only
- 20:03Discussion and community feedback
- 27:04Trivia on procfs read behavior
- 33:09User space control over caching policy
related talks
37mAccelerating Linux Boot Time: Techniques and Strategies for Optimal Performance
39mTiming Boot Time Reduction Techniques
42mImproving Linux Boot Time for Automotive Use Cases
17mCoFS: A Filesystem for Fast Container Startup
31mDesign and implementation of Autocaching for CXLSSD
19mKdump memory usage
12mRethinking File Mapping for Persistent Memory
38mDeferred Memblocks Init for Boot Time Reduction
