-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Is your feature request related to a problem? Please describe.
Yes. The newer flash file system in NuttX, mnemofs, is a great architectural addition but is currently marked as experimental and contains several structural inefficiencies and incomplete POSIX compliance features. As noted in multiple TODO and FUTURE TODO comments across fs/mnemofs/, the current implementation suffers from:
- Inefficient Directory Traversal:
mnemofs_fsobj.ccurrently performs double traversals for path resolution, creating overhead. - Missing Timestamps: POSIX
mtime,atime, andctimeare not fully implemented/updated during journal atomic commits (noted inmnemofs.candmnemofs_journal.c). - Memory Leaks during Block Flush: The
flushoperation has known issues ("does not work properly, and causes memory [leaks]"), which is critical for flash wear-leveling and system stability in long-running embedded IoT applications.
Describe the solution you'd like
I propose a comprehensive stabilization pass over mnemofs focusing on robustness, POSIX standard compliance, and maintaining strict self-compatibility. The planned solution includes:
- Single Traversal Refactoring: Rewriting the directory lookup mechanisms to utilize a single-pass traversal, decoupling the LRU cache dependencies from Journal atomic commits to increase lookup throughput without increasing RAM footprint.
- Timestamping Integration: Properly passing POSIX time references down through the VFS inode layer into the
mnemofsmaster nodes, updating timestamps gracefully without causing massive flash rewrite amplification. - Flush Mechanism Overhaul: Investigating and rewriting the block flush mechanism to permanently resolve memory leaks, verifying stability under heavy multi-threaded write loads over long periods.
- Hardware Validation: Adding extensive runtime test coverage using
apps/ostestandapps/fs/fstestsverified on real hardware, generating complete build and runtime logs to prove zero regressions.
This work will be done iteratively through small, highly-focused, non-breaking Pull Requests to allow manageable reviews by the maintainers.
Describe alternatives you've considered
I propose a comprehensive stabilization pass over mnemofs focusing on robustness, POSIX standard compliance, and maintaining strict self-compatibility. The planned solution includes:
- Single Traversal Refactoring: Rewriting the directory lookup mechanisms to utilize a single-pass traversal, decoupling the LRU cache dependencies from Journal atomic commits to increase lookup throughput without increasing RAM footprint.
- Timestamping Integration: Properly passing POSIX time references down through the VFS inode layer into the
mnemofsmaster nodes, updating timestamps gracefully without causing massive flash rewrite amplification. - Flush Mechanism Overhaul: Investigating and rewriting the block flush mechanism to permanently resolve memory leaks, verifying stability under heavy multi-threaded write loads over long periods.
- Hardware Validation: Adding extensive runtime test coverage using
apps/ostestandapps/fs/fstestsverified on real hardware, generating complete build and runtime logs to prove zero regressions.
This work will be done iteratively through small, highly-focused, non-breaking Pull Requests to allow manageable reviews by the maintainers.
Verification
- I have verified before submitting the report.