News for hackers. Stuff that matters.
Re:Samsung Creates New File System F2FS For Linux, Good News... by jackowayed on Saturday October 06, 2012 @05:22PM (#4621755)
Can anyone explain why a log-structured file system is a good fit for flash? It seems that a lot of the benefits of an LFS are that it reduces disk seeks.
Re:Samsung Creates New File System F2FS For Linux, Good News... by hristov on Saturday October 06, 2012 @06:43PM (#4621998)
It has to do with the way flash does writes. In flash it actually takes longer to overwrite a bit of data, than to write that bit on a 'blank', or previously initialized cell.

Furthermore if you are going to overwrite something in flash it usually behooves you to overwrite an entire block at a time. For these reasons flash systems tend to try to often write changes in a log manner, wait for a lot of changes to pile up and then incorporate those changes back into the original by rewriting entire blocks. The log can be placed in an initialized section of the memory where overwrites are not necessary.

Re:Samsung Creates New File System F2FS For Linux, Good News... by Tuna-Fish on Sunday October 07, 2012 @03:47AM (#4622854)
> Furthermore if you are going to overwrite something in flash it usually behooves you to overwrite an entire block at a time.

Well, all block devices are written a block at a time. The way flash differs is that there are two internal block sizes -- called pages (4-8kB), and eraseblocks (256kB-4MB).

There are two states a page can be in: clear, or used. You can write at a page granularity, but only to clear pages. To clear used pages, you need to clear the entire eraseblock at a time. Eraseblock sizes are now limited by fundamental physical limits -- on every NAND node shrink from now, the eraseblocks are going to double in size. And they are already really huge in modern devices.

Re:Samsung Creates New File System F2FS For Linux, Good News... by mvgoogler on Saturday October 06, 2012 @06:38PM (#4621980)
You want writes to flash to be as sequential as possible. Random writes to flash result in more wear and worse performance due to GC overhead.

Log-structured file systems tend to write data sequentially since the writes append to the log (yes - that's a gross over simplification).

File systems like ext4 maintain separate data structures for data and metadata and generate more random writes.

Re:Samsung Creates New File System F2FS For Linux, Good News... by zurn on Sunday October 07, 2012 @05:58AM (#4623002)
LFS recudes seeks on writes but requires more seeks on reads. This was bad for general purpouse use so they didn't become popular with rotating media.

It's a perfect fit for flash, because there read seeks are (almost) free, and the overwrite-less, sequential writes are a perfect fit. Flash only supports read, erase, and write-on-erased operations, the exact set that LFS uses.

Re:Samsung Creates New File System F2FS For Linux, Good News... by trotsky on Saturday October 06, 2012 @06:39PM (#4621986)
That article is pretty light on the details, but one thing to note is that most sd card storage is relatively poor at random seeks, having been optimized for media type usage.
Re:Samsung Creates New File System F2FS For Linux, Good News... by lmm on Sunday October 07, 2012 @05:33AM (#4622981)
The cost of random seeks is still going to be lower than on hard drives, which is what most current filesystems were optimized for.