Slashdot Mirror


Samsung Creates New File System F2Fs For Linux & Android

sfcrazy writes "Samsung has created a new Linux file system called F2FS. Jaegeuk Kim of Samsung writes on the Linux Kernel Mailing List: F2FS is a new file system carefully designed for the NAND flash memory-based storage devices. We chose a log structure file system approach, but we tried to adapt it to the new form of storage. Also we remedy some known issues of the very old log structured file system, such as snowball effect of wandering tree and high cleaning overhead."

41 of 140 comments (clear)

  1. SSD Drives by Terry+Pearson · · Score: 4, Interesting

    While the primary benefit will initially be for Android devices, this will be great news for solid state drives as well. Great job Samsung!

    1. Re:SSD Drives by Anonymous Coward · · Score: 5, Informative

      No. SSDs present themselves to the OS as contiguous block devices. Filesystems intended for bare NAND flash like jffs(2), yaffs, and this new F2Fs would be totally useless for SSDs. They're intended for bare NAND, which SSDs are not.

    2. Re:SSD Drives by gumpish · · Score: 5, Funny

      Did you get the money to buy your SSD drive by going to the ATM machine and entering your PIN number?

    3. Re:SSD Drives by Terry+Pearson · · Score: 4, Interesting

      I am not 100% clear on NAND tech, but Samsung had an announcement about a NAND based SSD last week. I believe this is related to the F2FS announcement today. http://www.anandtech.com/show/6329/samsung-releases-tlc-nand-based-840-ssd

    4. Re:SSD Drives by Anonymous Coward · · Score: 3, Informative

      SSDs are NAND, but they are not bare NAND. They have control circuitry which manages the problems with NAND (e.g. bad blocks), and presents the drive as a contiguous block of good storage.

      These filesystems are all for bare NAND, not SSDs, which include NAND, but are not bare NAND.

    5. Re:SSD Drives by Dekker3D · · Score: 2

      So it's a drive you put solid state disks into?
      Not just a pedantic joke.. I actually like that thought. Twenty-first century diskdrives :D

    6. Re:SSD Drives by bogolisk · · Score: 3, Insightful

      SSDs are NAND, but they are not bare NAND. They have control circuitry which manages the problems with NAND (e.g. bad blocks), and presents the drive as a contiguous block of good storage.

      These filesystems are all for bare NAND, not SSDs, which include NAND, but are not bare NAND.

      How can this be "Informative", it's plain wrong. f2fs works on top of block devices.

      --
      Bogus
    7. Re:SSD Drives by repvik · · Score: 3, Informative

      Bare NAND is presented as a block device. NAND SSDs are also presented as block devices. That does not imply that they are equal. SSDs have a controller that does remapping on the fly, in many cases on the fly compression, bad block handlling and much more. Bare NAND does not have that layer. That is why the ACs comment should be moderated informative, and you should be moderated "plain wrong".

  2. Keyword: Android by GeneralTurgidson · · Score: 2, Insightful

    I don't think Samsung would've created this if Android wasn't a huge driver behind their mobile success.

    1. Re:Keyword: Android by Anonymous Coward · · Score: 4, Insightful

      Well yeah, McDonalds isn't going to going to manufacture couches when it has no benefit to them.

    2. Re:Keyword: Android by Xtifr · · Score: 5, Insightful

      Sure, and they might not have released it to the public if it weren't for the GPL. On the other hand, they've developed something that looks like it may be very useful, and have released it without batting an eye. They're one of only seven Platinum members of the Linux Foundation. I think it's clear they understand how the ecosystem works, and they're happy to participate. Hard to fault them for that.

      And actually, as I understand it, they use Linux for a lot more than just Android devices. They also have embedded Linux in other systems, like TVs.

    3. Re:Keyword: Android by Anonymous Coward · · Score: 4, Interesting

      Some freezers too. They are actually involved with the development of the ELF end the enlightenment windows manager.

      I think Samsung likes Linux a lot

    4. Re:Keyword: Android by MobileTatsu-NJG · · Score: 5, Funny

      And actually, as I understand it, they use Linux for a lot more than just Android devices. They also have embedded Linux in other systems, like TVs.

      Really? Well that explains why my Samsung TV has such a horrible interface*.

      * Kidding. :P

      --

      "I like to lick butts!" by MobileTatsu-NJG (#32700246) (Score:5, Informative)

    5. Re:Keyword: Android by GT66 · · Score: 5, Funny

      The irony being that a McDonalds couch would likely contain more actual meat than one of their hamburgers.

    6. Re:Keyword: Android by Xtifr · · Score: 5, Interesting

      I think Samsung likes Linux a lot

      Considering that a Platinum membership in the Linux Foundation requires plopping down at least half a million bucks, I suspect you're probably right. :)

      Heck, Google only has a Gold membership, and we know they like Linux. Samsung is in elite territory with corporations like IBM and Intel.

    7. Re:Keyword: Android by Xtifr · · Score: 4, Interesting

      I know you're kidding, but I should point out that Linux is not a requirement for building bad interfaces (though one might claim that it helps). TV engineers in general seem to have some impressive skills at building bad interfaces. My last three TVs all had terrible interfaces, and none of them were Linux-based. :)

    8. Re:Keyword: Android by maxdread · · Score: 4, Insightful

      Well considering the vast size of Samsung, they probably do far more work with Linux than Google does as well.

      People forget we're talking about a company that not only builds products in pretty much every home electronics category but also ships, CCTV, aircraft (for a while), artillery and automated turrets. None of this counting the bits and pieces they research and build that go into each of those products.

    9. Re:Keyword: Android by beelsebob · · Score: 3, Insightful

      Actually, it's not for bare nand like you find in android devices... it's for SSDs like their recently released 840 series.

  3. Better hurry to the Patent Office by bobthesungeek76036 · · Score: 2

    Glad to see proof that Samsung does innovate and not steal everything from AAPL like all Apple Fanboys think.

    --
    Karma: Bad
    1. Re:Better hurry to the Patent Office by Anonymous Coward · · Score: 5, Funny

      Glad to see proof that Samsung does innovate and not steal everything from AAPL like all Apple Fanboys think.

      What are you talking about? This is clearly a copy of Apple's original filesystem concept THAT THEY INVENTED when they created HFS! Why doesn't Samdung ACTUALLY innovate and find a new way to store data on a collection of sectors instead of just copying Apple all the time.

      The worst part is that Samdung didn't also copy the MARVELOUS AND CLEARLY CORRECT INVENTION of hiding the filesystem (which Apple invented) from the users. They're so far behind Apple that they can only BLATANTLY STEAL the easy parts!

    2. Re:Better hurry to the Patent Office by Anonymous Coward · · Score: 5, Funny

      Apple created the LFS, Litigation File System. The unique innovation looks ahead for a user copying a file from one directory to another, blocks the request, and transfers the operation to a county in Texas to be tied up in I/O for years.

  4. Remember when this was unthinkable? by Anonymous Coward · · Score: 4, Interesting

    Commercial hardware companies contributing to open-source and the kernel, I mean.

    It’s nice to see that Linux and the open-source philosophy more and more just is generally accepted.

    Let's hope it.s because they have seen the advantages of humans working together, helping each other out... and not just for nefarious dog-eat-dog (aka capitalist aka "free market" aka law of the jungle*) purposes.

    * Don’t worry. I know they're not supposed to be the same. The point I want to make, is that nowadays it gets all used to describe the same thing.

    1. Re:Remember when this was unthinkable? by Xtifr · · Score: 4, Informative

      No, I don't. I remember when it was rare, but not when it was unthinkable. Even if you mean copyleft as opposed to merely open-source (there was and is a lot more reluctance about copyleft), commercial hardware companies were contributing to the GNU project even before the Linux kernel sprang into existence. GCC has always had the backing of hardware companies. The GCC Ada backend was fully funded by commercial companies several years before Linus went public with his experimental kernel.

      Heck, some companies even recognized that the GPL protected their own code, even before Linux appeared. The GPL'd versions of Ghostscript existed because Aladdin recognized that the GPL prevented others from taking unfair advantage of their code, while still allowing the community to contribute.

  5. exactly by manicpop · · Score: 3, Insightful

    That's the beauty of the open source model. People and businesses contribute things that benefit them directly, but they benefit everyone indirectly. Large companies don't contribute to the Linux kernel to be nice guys, they generally contribute code and patches to benefit their own products and systems. Their contributions benefit everyone, however.

    1. Re:exactly by ZeroSumHappiness · · Score: 5, Interesting

      Because it's legally required to trickle down perhaps?

    2. Re:exactly by DragonWriter · · Score: 2

      Because it's legally required to trickle down perhaps?

      Well, no, because it works in open source even outside of the copyleft world, and its only required in the copyleft world.

      Copyleft probably was critical in establishing the benefits of big interests participating in the open source world rather than locking everything up, to be sure, but once it was established there's been quite a lot of stuff that has come down to the public in open source form even when no legal mandate existed.

  6. Re:Samsung Innovating? by MobileTatsu-NJG · · Score: 2

    Watch out, Apple.. we have a FILE SYSTEM!!!

    --

    "I like to lick butts!" by MobileTatsu-NJG (#32700246) (Score:5, Informative)

  7. Innovation by PRMan · · Score: 4, Funny

    Hope Apple wasn't planning on using this in their iPads...

    --
    Peter predicted that you would "deliberately forget" creation 2000 years ago...
    1. Re:Innovation by Dupple · · Score: 2

      I'm sure apple weren't. Why would they?

      However, the MS lawyers will be working all weekend to find ways of recovering potentially lost licence fees...

      --
      Watch those corners
  8. It's not for bare NAND by bogolisk · · Score: 5, Informative

    No. SSDs present themselves to the OS as contiguous block devices. Filesystems intended for bare NAND flash like jffs(2), yaffs, and this new F2Fs would be totally useless for SSDs. They're intended for bare NAND, which SSDs are not.

    You're wrong

    f2fs work on top of block devices. f2fs sends TRIM (ATA command) down to the device. Bare NAND flash doesn't grok ATA commands.

    --
    Bogus
    1. Re:It's not for bare NAND by romiz · · Score: 5, Informative

      The problem is that even with a translation layer for block access, flash-based devices have limitations, which means that different usage patterns can dramatically change the performance of the device.

      For a (simplified) example, to write a file in ext3, you need to store the new data for the file, but you also need to store other metadata: the location of the data blocks themselves in the inode, the file size in the directory, the journaling data. This means that you have four 'internal block descriptors' open for writing at the same time.

      But block descriptors are a limited resource in SSDs, and even more so for low-cost eMMC devices. This means that with only two or three open files with regular writing, you could quite easily lead to some kind of thrashing state, with the device quickly opening and closing descriptors. Since flash memory writing is strongly constrained, this means that a whole block (2 MiB block size is common) containing a descriptor will need to be erased before its next use. As a result, each block only contains little interesting data, and writing only a small amount of data leads to a lot of flash write and erase access. This problem is called write amplification, and reduces both the disk's performance and its durability.

      The F2FS design is a log-based design, where all files on the disk share 6 common writing areas, for each kind of stored data, where the information is stored as it arrives. This will have a very positive effect against the write amplification problem, and is an example of how an adapted file system can have a positive impact, even on block-based devices.

  9. when you use GPL, you're driving with Stalin by Thud457 · · Score: 3, Funny

    Watch out, Apple.. we have a FILE SYSTEM!!!

    You know who else had a filesystem?...

    --

    the preceding comment is my own and in no way reflects the opinion of the Joint Chiefs of Staff

  10. Re:Too late, I already patent my FSF by jones_supa · · Score: 2

    Actually you should say "Samsung-ssi" or "Samsung sunsengnim" in Korean. The -san is a Japanese thing. :)

  11. Re:I wonder how it is to be used by Jerome+H · · Score: 4, Informative

    You can find a lot of details in the txt file: https://lwn.net/Articles/518719/

    --
    int main() { while(1) fork(); }
  12. Re:I wonder how it is to be used by Lordrashmi · · Score: 2

    I'm not a filesystem expert, but this is what I believe they are referring too: http://en.wikipedia.org/wiki/Log-structured_file_system

  13. Re:I wonder how it is to be used by shutdown+-p+now · · Score: 3, Interesting

    This cannot replace FAT, since the whole point of FAT is to be interoperable with all those Windows machines out there. For as long as Windows only understands FAT and NTFS on removable devices, any consumer device will use those (and specifically FAT, for certain other reasons) in any of its memory that is directly exposed to be mounted as a block device.

    On the other hand, for internal device memory, Android has already moved to a high-level protocol (MTP) to expose that to PCs, so they don't care what file system backs it internally. I haven't checked, but I'd expect that any 4.x device has its internal memory fully in ext4 or other Linux native FS already.

  14. Re:I wonder how it is to be used by shutdown+-p+now · · Score: 2

    The move to MTP is something I've been speculating has to do with moving away from the FAT patent licensing issues that Microsoft is using to bilk Android manufacturers

    There may be that angle to it, but I think the main reason is because it removes the requirement for the phone to unmount the device to allow the PC to mount it - this can wreck havoc on any app that has files on the unmounted partitions open, requiring them to be aware of this scenario (and for many apps that pretty much means that they have to shut down - e.g. mapping apps that store their map cache there), and it also means that manufacturers have to carve out two partitions - one for the OS and other non-PC-mountable data, the other one for user data - and decide on how large each one should be, which they often get wrong.

    You don't need it to be treated as a block device to get your OS (and Python etc) to access it as a normal filesystem. You just need a filesystem driver that wraps MTP. Since you're on Linux, you can just use mtpfs or go-mtfps with FUSE, and get the best experience of any desktop OS out there.

  15. Re:I wonder how it is to be used by shutdown+-p+now · · Score: 3, Informative

    Windows has some built-in support for MTP (at least since Vista), though it's not on FS level - instead, it's hooked up into Shell/Explorer, much like Libraries in 7. So if you're content with Explorer, or some file manager that's using Shell interfaces, then it should just work.

    For automation, when you actually want to see it as FS, yeah, it's a mess. Ideally a driver-source-compatible port of FUSE would solve this, and people have made several attempts at FUSE-Win32, but apparently writing Win32 FS drivers is not for the faint of heart, so I don't know of anything stable.

  16. RFS by thegarbz · · Score: 4, Informative

    While the primary benefit will initially be for Android devices, this will be great news for solid state drives as well. Great job Samsung!

    Before you go congratulating them on a great job, remember this is the second time they did this. The original attempt was called Robust File System. It was an abortion based on FAT16/32 with a duplicated file allocation table and some sort of journalling hacked on top.

    It was claimed to be optimised for NAND devices and all that other good stuff, but the community quickly came to rename it Really Fucking Slow.

    This file system was so slow that on the original Galaxy S the kernel would think software locked up while writing to the disk and prompt the user to force close the device. Search for "lagfix" if you're interested in what a disaster this was. There were users world wide trying to find fixes for the slow system performance, and the fix was often in the form of a kernel which supported ext4 or yaffs and a utility which converted the entire /system and /data partitions in the phone to the more common file systems.

    I don't have high hopes in Samsung's competence here.

  17. Rehash by Bozovision · · Score: 3, Interesting

    It looks to me like most the problems they are solving have already been solved. There are already several open source log-structured file systems. This list excludes experimental and similar software from educational institutions:
          - Yaffs - http://www.yaffs.net/ - designed from the ground up for NAND
          - JFFS2 - http://sourceware.org/jffs2/jffs2-html/jffs2-html.html - ditto.
          - NANDFS - http://wiki.freebsd.org/NAND - BSD style licence

    Plus there's Ext4 - which is used in Android now - not designed for NAND, but seems to work ok.

    This work by Samsung fixes the problems with their previous file system. It's good, but it's not unique. Good PR though.

  18. Re:Google like leeching from Linux by Patch86 · · Score: 2

    They donate at least $100,000 to the Linux Foundation a year, if nothing else. Pocket money to Google, maybe. But No small chunk of change to the Linux Foundation. Creating and releasing an extremely popular and novel Linux-based OS has got to count for something, too.

    Samsung donates at least $500,000 a year, so they do still win in "we love Linux" top trumps.