You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trim is a standard feature of modern SSD drives which allows the slow block erase to be performed "in the background". Future writes can complete much faster if the media they use has already been erased.
Hopefully littlefs could do this too? Testing with NOR flash chips seems to show most of the waiting is spent in erase(). Like with modern SSD drives, if we could have the filesystem provide this information about when used blocks are no longer needed, low level drivers could be created to use the trim info to pre-erase those blocks.
The text was updated successfully, but these errors were encountered:
Unfortunately littlefs wouldn't be able to take advantage of trim as is. A large part of how littlefs works is that it doesn't actually know when blocks stop being referenced. When a file is opened, the underlying blocks are copied-on-write and share references to other possibly in-use blocks. When a file is synced littlefs doesn't bother to check what blocks have been freed, instead leaving it up to the block allocator to figure out which blocks are unused later.
Though it may be worth reconsidering when the allocator gets its much-needed redesign (#75).
I'd like to propose adding an optional trim function, which would allow low-level driver code to pre-erase blocks.
Trim is a standard feature of modern SSD drives which allows the slow block erase to be performed "in the background". Future writes can complete much faster if the media they use has already been erased.
Hopefully littlefs could do this too? Testing with NOR flash chips seems to show most of the waiting is spent in erase(). Like with modern SSD drives, if we could have the filesystem provide this information about when used blocks are no longer needed, low level drivers could be created to use the trim info to pre-erase those blocks.
The text was updated successfully, but these errors were encountered: