Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Garbage Collection (SPIFFS_gc) Into Smaller Chunks #289

Open
peteman720 opened this issue Aug 10, 2022 · 0 comments
Open

Split Garbage Collection (SPIFFS_gc) Into Smaller Chunks #289

peteman720 opened this issue Aug 10, 2022 · 0 comments

Comments

@peteman720
Copy link

Hello,

I am running SPIFFS on an ARM M4F processor connected to an 8MB MX25R6435F SPI flash. SPIFFS is allocated 6MB of the external flash, and has been configured for 64KB blocks with 256B pages.

As the flash fills up, write performance degrades. I can improve write performance by manually running garbage collection, but SPIFFS_gc often requires several seconds to run when the flash is ~85% full and SPIFFS_GC_MAX_RUNS=1. I would like to run garbage collection in the background, but 3 seconds is far too long to block all IO in my application.

My question is thus: Is it possible to split up garbage collection into smaller chunks that can be interspersed between other, more important operations? A quick look at SPIFFS_gc shows that SPIFFS_LOCK is held during the entirety of spiffs_gc_check, which leads me to believe the that garbage collection must be done atomically.

I'd be interested to hear from anyone else who has encountered similar performance problems and found a way to run garbage collection in the background without blocking other filesystem IO for an extended period.

Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant