On Tue, Feb 24, 2015 at 11:31 AM, Todd Goodman <t...@bonedaddy.net> wrote: > > But the device is still doing wear leveling and bad block > replacement so you're beholden to those algorithms and what you think > you're allocating as sequential blocks of the flash are not necessarily so. > > Of course any decent wear leveling algorithm is still going to work > fine, but it seems to me like the wear leveling is still occuring in the > device and the filesystem is beneficial for use on flash based devices > for other reasons. >
Sure, if the algorithm is brain-dead it can mess up the simple task that f2fs hands it. However, I don't think a good wear-leveling algorithm will do nearly as good a job as something like f2fs. Suppose you have 10% of the disk that gets heavily overwritten, and 90% that is fairly static. The drive will have to detect that and decide when to move some of the 90% around just to allow that area to wear evenly. With f2fs every block wears at the same rate by design. Sure, the wear-levelling algorithm can look at that block with 500 erases and look for someplace to relocate it, but it will find that all the other blocks on the disk have either 500 or 501 erases and hopefully the algorithm is smart enough to do nothing in that case. The real killer for SSDs is writes to a unit of space smaller than an erase block, because that requires copying and erasing. f2fs completely eliminates that scenario, and I believe SSD-aware filesystems like btrfs attempt to do this as well (since it doesn't overwrite anything in-place). Still, block reallocation at the device level shouldn't be a problem as long as the device relocates entire erase blocks at a time so that everything stays aligned, and I can't imagine why the designers of an SSD would want to do reallocation at anything other than the erase block level (or larger). I'd be interested if somebody has more hands-on experience with how these algorithms work together. Don't get me wrong - I agree that ultimately the device has the final say in what data gets written where. I just think that f2fs tends to promote data being written to disk in a manner that makes things optimal for the firmware. If the firmware authors assume that everything is FAT32 and that the first 10% of the disk needs to be moved around all the time regardless of actual write patterns, then sure you're disk won't wear right and will probably suffer performance-wise. -- Rich