On Thursday 23 September 2010, Loïc Minier wrote:
On Mon, Sep 20, 2010, Arnd Bergmann wrote:
Right. Having an intelligent file system is the only way I can see for getting good speedups, by avoiding erase-cycles inside the SD card, which commonly happen when you write to sectors at random addresses.
There has been a lot of research in optimizing for regular NAND flash, at least some of which should apply to SD cards as well, although their naive wear-levelling algorithms might easily get in the way.
This sounds like a relatively large task; do you think that's something we could build on existing infrastructure like some ubi bits or some btrfs bits?
Definitely. I wasn't suggesting we reinvent the wheel, but there may a lot of value in comparing what's there today (logfs, ubifs, btrfs, nilfs2) to see if any of them does the job, and possibly adding a few extensions.
The current state is mostly that people put unaligned partitions on their SD card, stick an ext3 fs on a partition and watch performance suck while destroying their cards.
I'm worried that we don't really know what the SD wear-levelling is doing, and it might change over time; I'm not sure whether we can introspect the way the controllers do it, or whether we'd have some fragile heuristics to decide that this or that SD card manufacturer uses this kind of algorithm :-/
Also, do we know enough about the underlying hardware to basically override what the manufacturer is trying to do?
There has been a study by Thomas Gleixner on what CF cards do, which basically showed that they all use the same broken algorithm. It may be interesting to do the same for SD cards. We could also ask the Samsung people in Linaro to find out more technical details than are currently known publically about Samsung SD cards.
Arnd