LWN: Comments on "JFFS2, UBIFS, and the growth of flash storage" https://lwn.net/Articles/528617/ This is a special feed containing comments posted to the individual LWN article titled "JFFS2, UBIFS, and the growth of flash storage". en-us Sat, 11 Oct 2025 23:42:12 +0000 Sat, 11 Oct 2025 23:42:12 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net missed JFFS2's Erase Block Summary (EBS) feature ? https://lwn.net/Articles/539957/ https://lwn.net/Articles/539957/ vapier <div class="FormattedComment"> JFFS2 has had Erase Block Summary (EBS) support for quite a long time which drastically speeds up mount time:<br> <a href="http://www.linux-mtd.infradead.org/doc/jffs2.html">http://www.linux-mtd.infradead.org/doc/jffs2.html</a><br> <p> some actual performance numbers shows this can easily be a 6x speed increase:<br> <a href="http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:jffs#jffs2_mount_process_speedup">http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel...</a><br> <p> covering yaffs would also have been cool :).<br> <p> i wonder if the changes you made to block2mtd result in numbers that are really comparable. by faking out the erase steps (which in a real flash is not free -- erasing tends to be the slowest operation), ubifs is no longer resilient to power losses right ? unlike the others which would be able to recover. so you've given a nice speed increase to ubifs w/out any such grant to the others. or am i missing something obvious ?<br> </div> Tue, 26 Feb 2013 06:02:11 +0000 JFFS2, UBIFS, and the growth of flash storage https://lwn.net/Articles/532919/ https://lwn.net/Articles/532919/ meuh <cite>for a PC-style file attribute table</cite><br/> erk ! <br/> This is <i>Disk Operating System (DOS)</i> filesystem style if you want, but not tied to a particuliar hardware. Thu, 17 Jan 2013 11:21:46 +0000 JFFS2, UBIFS, and the growth of flash storage https://lwn.net/Articles/532373/ https://lwn.net/Articles/532373/ oak <div class="FormattedComment"> This article doesn't mention which compression algorithm was used with UBIFS.<br> <p> Compression algorithm has a large effect on the speed. For example LZO is very fast at uncompressing and compression is also fast, although that depends on what LZO compression level is used.<br> <p> Whereas ZLIB compression is significantly slower for both, but provides better compression results.<br> <p> Which one to choose depends on:<br> * What kind of data is being stored<br> * Flash write and read speeds<br> * Algorithm compression and uncompression speed compared to those (which depends on CPU speed)<br> <p> Article mentions using high speed PC, so for it algorithm with best compression ratio would probably be best. On Nokia's Maemo devices low level LZO compression was used at run-time, but pre-made root file systems were compressed using highest LZO compression level (this explains why apt-get upgrade could leave less disk space although binaries were same size).<br> <p> As to data types, non-compressable data like music, videos etc is typically user data and it can even be on a separate partition / storage media (on Maemo devices, SD card) with different file system, than the root file system which contains the binary data, logs etc.<br> <p> </div> Fri, 11 Jan 2013 11:38:47 +0000 JFFS2, UBIFS, and the growth of flash storage https://lwn.net/Articles/529285/ https://lwn.net/Articles/529285/ marcH <div class="FormattedComment"> <font class="QuotedText">&gt; Getting raw access to flash devices (bypassing vendor FTLs) is indeed the best possible scenario, because this gives way to open development of reliable and high-performance algorithms to manage those.</font><br> <p> With current flash technologies and their rate of progress this would practically require writing one different driver per flash chip.<br> <p> Maybe what's required is something in the middle: some kind of new, more evolved standard interface, something block+page based?<br> <p> Anyone having worked on MTD should know.<br> <p> </div> Sat, 15 Dec 2012 23:26:20 +0000 JFFS2, UBIFS, and the growth of flash storage https://lwn.net/Articles/529244/ https://lwn.net/Articles/529244/ wookey <div class="FormattedComment"> Yes, it has that strange business model where most users use it for free under the GPL, but some (largely the ones that actually pay money and make the business viable use) it in other contexts (bootloaders, proprietary OSes, in-house 'stuff'). GPL users sometimes pay for enhancements too, and it was GPL users that paid for most of the initial development.<br> <p> Yes this wasn't really discussed as part of the mainlining - as it's not technical and thus not really very relevant. The point was made that the FS wasn't only used with Linux and keeping it working for the others (from a single, or at least very similar, codebase) was important.<br> <p> It's not quite as black and white as a "a choice between mainlining it and not continuing to make a living", it was just that there was a point beyond which the advantages of mainlining (saving maintenance effort, wider exposure, making life a bit easier for linux users) were not sufficient to justify the disadvantages (extra maintenance effort due to divergence) from the author's POV. He decided he'd given it his best shot and been rebuffed. He's not a pushy guy.<br> <p> It seems no-one else has cared enough to try again in the couple of years since then, probably at least partly because they don't feel they have the moral right to do that. <br> </div> Fri, 14 Dec 2012 18:25:07 +0000 JFFS2, UBIFS, and the growth of flash storage https://lwn.net/Articles/529237/ https://lwn.net/Articles/529237/ plougher <div class="FormattedComment"> Your comment that "Yaffs continues in its little niche making a living for a couple of people" now helps me better understand why in the mainlining process there was such insistence on behalf of the author to keep the support for other OSes.<br> <p> Dare I say it but the clear implication is Yaffs makes money but only on the other OSes, and the insistence by the "kernel people" to loose the other OS support was forcing a choice between mainlining it and not continuing to make a living, or making a living by keeping it out of mainline.<br> <p> Strangely I cannot recall that point being made in the mainlining process? Was it made and I missed it, or was it felt inappropriate and unlikely to further the mainlining process? Either way, I now think the author make the "right choice" in not continuing to mainline it.<br> <p> I like YAFFS and it was the first workable flash filesystem I used in ~ 2002 back at a time when JFFS2 was worse than useless. The fact YAFFS tends to get written out of Linux kernel history, and the abortive mainlining process doesn't tend to show the kernel community in much glory. <br> </div> Fri, 14 Dec 2012 17:13:19 +0000 JFFS2, UBIFS, and the growth of flash storage https://lwn.net/Articles/529121/ https://lwn.net/Articles/529121/ wookey <div class="FormattedComment"> Nice article. It would have been interesting to include YAFFS in this comparison too as it too was also written to overcome some of the limitations of JFFS2 (with respect to NAND), starting few years before UBI. I know it never made it to mainline despite efforts to do that in 2010/2011 (<a href="http://linux.derkeiler.com/Mailing-Lists/Kernel/2011-01/msg05318.html">http://linux.derkeiler.com/Mailing-Lists/Kernel/2011-01/m...</a>), but it has been quite widely used, especially in early android releases, and is still is. The differences between it and JFFS2 and UBIFS are interesting. It is probably true that it offers no real advantages over UBI any more (unless you want to use it with not-linux), but it was fastest in the last set of benchmarks I saw a couple of years back.<br> <p> The tale of its development, the mainlining attempt and why ultimately it failed, and its continued existence in its little niche, making a living for a couple of people, is interesting in itself.<br> <p> Ultimately the problem was that the kernel people wouldn't take anything less than a rewrite to exclusively use standard kernel features, but the author, who still needed to support it on other OSes, wasn't prepared to remove the compatibility features that made that work. Nearly everything could be munged to satisfy both sides, but a few things were sticking pints. It didn't seem to be possible to reach agreement without forking the codebases and no-one really wanted to do that.<br> </div> Thu, 13 Dec 2012 18:59:23 +0000 JFFS2, UBIFS, and the growth of flash storage https://lwn.net/Articles/529126/ https://lwn.net/Articles/529126/ yoush <div class="FormattedComment"> When running ubi over block2mtd over FTLed flash, FTL in flash still operates, and affects both performance and reliability (i.e. wear-leveling).<br> <p> UBI guaranteed wear-leveling is effectively turned into random thing.<br> <p> FTLs are known to start badly misbehave after some time if they don't get information about which blocks are free. So unless TRIM commands are used, "ubi over block2mtd over FTLed flash" will badly degrade in time.<br> <p> Getting raw access to flash devices (bypassing vendor FTLs) is indeed the best possible scenario, because this gives way to open development of reliable and high-performance algorithms to manage those.<br> </div> Thu, 13 Dec 2012 18:39:17 +0000 JFFS2, UBIFS, and the growth of flash storage https://lwn.net/Articles/528947/ https://lwn.net/Articles/528947/ arnd <div class="FormattedComment"> Thanks for the new data point. Running with active_logs=4 obviously adds some overhead in the file system because the f2fs garbage collection becomes less efficient and it has to rewrite stuff more. It's not clear whether we get into the case I described but I think you have shown that the extra overhead in the file system is larger than what we save in the device.<br> <p> I agree on the read numbers, they are probably just in the noise because in theory there is no difference at all based on the mount option.<br> <p> One thing that would make a very significant difference though is whether the file system is aged and how full it is, but that is true for all of the tests you did.<br> </div> Wed, 12 Dec 2012 21:14:09 +0000 JFFS2, UBIFS, and the growth of flash storage https://lwn.net/Articles/528945/ https://lwn.net/Articles/528945/ arnd <div class="FormattedComment"> I believe all of the interesting block devices for this (SD, CF, eMMC, USB) are not actually asynchronous, unlike modern SSDs that would not benefit as much because they have less leaky abstractions and don't require you to write on erase block boundaries for best performance.<br> </div> Wed, 12 Dec 2012 21:08:17 +0000 TRIM? https://lwn.net/Articles/528943/ https://lwn.net/Articles/528943/ arnd <div class="FormattedComment"> I think the cards can either return all-zero or all-one but have to report in the configuration registers which of the two they do. Of course, you could<br> in theory reverse all bits in software to get the behavior you want, but that has a nonzero performance impact.<br> <p> Note that sending the erase command to the SD card can also help performance as it might avoid expensive garbage collection, aside from being faster than writes.<br> </div> Wed, 12 Dec 2012 21:05:07 +0000 JFFS2, UBIFS, and the growth of flash storage https://lwn.net/Articles/528885/ https://lwn.net/Articles/528885/ dedekind <div class="FormattedComment"> Nail, thanks for an interesting article. You are right about buds. We thought that "bud" would be and obvious and self-describing terminology, but it apparently is not that obvious :-)<br> <p> And yes, we really did not target block devices, but only raw flashes. There was a project to try UBIFS on block devices. Using it "as-is" will of course sucks, because UBI cannot really utilize the asynchronous I/O of the block layer. This is fixable though, but needs some work. I think the benchmark results would be a lot better in that case.<br> </div> Wed, 12 Dec 2012 15:46:45 +0000 TRIM? https://lwn.net/Articles/528875/ https://lwn.net/Articles/528875/ yann.morin.1998 <div class="FormattedComment"> <font class="QuotedText">&gt; When you read from a region that was TRIMed the result is either undefined or all-zeros, whereas when you read from a region that was mtd_erase()d, the result is all-ones.</font><br> <font class="QuotedText">&gt; So it wouldn't really be useful to make mtd_erase() to TRIM. They do seem similar but they have quite different semantics.</font><br> <p> What about combining your catch-erased-sections-and-return-0xFF with TRIMing the underlying storage (if it supports TRIMing)?<br> <p> Regards,<br> Yann E. MORIN.<br> </div> Wed, 12 Dec 2012 13:32:03 +0000 TRIM? https://lwn.net/Articles/528871/ https://lwn.net/Articles/528871/ sperl <div class="FormattedComment"> As far as I remember SD-Card Specs, it is not necessarily defined, that SD cards always have to return 0xff for erased (=trimmed) blocks...<br> <p> At least it mention that the behavior may depend on the type of technology (NAND/NOR/...) that is used on the HW-level.<br> <p> So the behavior of expected return may also be open to implementation for SSDs... (I have not read the spec there though)<br> <p> </div> Wed, 12 Dec 2012 13:18:08 +0000 JFFS2, UBIFS, and the growth of flash storage https://lwn.net/Articles/528846/ https://lwn.net/Articles/528846/ nhippi <div class="FormattedComment"> I hope there would some effort to create an "MMC-direct" extension to the MMC/SD standards, allowing bypassing the FTL layer. Or at least giving the erase block sizes and other bits of information needed to to tune the filesystem to work on it optimally.<br> <p> This would be especially useful for the eMMC storages that are soldered on board, and thus don't need FAT to be compatible to the world.<br> </div> Wed, 12 Dec 2012 07:38:20 +0000 JFFS2, UBIFS, and the growth of flash storage https://lwn.net/Articles/528845/ https://lwn.net/Articles/528845/ dgc <div class="FormattedComment"> Interesting article, Neil. :)<br> <p> When I see stuff like this, however:<br> <p> <font class="QuotedText">&gt; For testing I used a new class 10 16GB microSD card, which claims 10MB/s</font><br> <font class="QuotedText">&gt; throughput and seems to provide close to that for sequential IO.</font><br> <font class="QuotedText">&gt; According to the flashbench tool, the card appears to have an 8MB erase</font><br> <font class="QuotedText">&gt; block size; five erase blocks can be open at a time,</font><br> <p> I always wonder how well using XFS and tuning it's geometry to the flash characteristics would work. E.g. use a single stripe unit of the erase block size (8MB in this case) to align fixed metadata and large file allocation to 8MB boundaries. Then setting the number of AGs equal to the number of open erase blocks at a time (5 in this case) gives an appropriate number separate regions of activity in the filesystem to distribute the write loads.<br> <p> And then there's the dynamic inode allocation, which means inodes are also allocated in the same general locality as the parent directory blocks and their file data.<br> <p> It seems like these feature would provide are similar behaviours to what filesystems specifically designed for flash use, so I've always been curious as to whether it would make any significant difference to performance on a simple flash device like the above one you tested with...<br> <p> -Dave.<br> <p> </div> Wed, 12 Dec 2012 05:30:59 +0000 TRIM? https://lwn.net/Articles/528837/ https://lwn.net/Articles/528837/ neilbrown <div class="FormattedComment"> When you read from a region that was TRIMed the result is either undefined or all-zeros, whereas when you read from a region that was mtd_erase()d, the result is all-ones.<br> <p> So it wouldn't really be useful to make mtd_erase() to TRIM. They do seem similar but they have quite different semantics.<br> </div> Wed, 12 Dec 2012 01:22:58 +0000 JFFS2, UBIFS, and the growth of flash storage https://lwn.net/Articles/528835/ https://lwn.net/Articles/528835/ neilbrown <p>Thanks for the suggestion. I hadn't used the active_logs mount option. I just ran my script with that option added and it didn't make much difference. <p> The numbers I get for the original and the active_logs=4 runs are: <pre> f2fs-default-2: write kernel 113.738 121.853 118.412 read kernel 150.369 270.465 175.724 du -s kernel 48.393 48.908 48.6091 rm -r kernel 0.333 0.384 0.36 write files 837.503 read files 571.196 f2fs-active_logs: write kernel 111.966 120.791 116.571 read kernel 148.364 238.796 163.316 du -s kernel 48.111 49.623 49.1534 rm -r kernel 0.335 0.365 0.3489 write files 1190.29 read files 563.56 </pre> Where there are 3 numbers they are min/max/mean of 10 runs. <p> Reading small files seems faster, but the numbers were already noisy - about half the individual results were within 5 seconds of the minimum. which is much the same in both cases. <p> The write-large-files test is quite a bit slower. I probably need to do a couple more runs before I know what that means. <p> So it looks like I wasn't hitting the possible too-many-erase-blocks-open case in this test. Wed, 12 Dec 2012 01:18:54 +0000 JFFS2, UBIFS, and the growth of flash storage https://lwn.net/Articles/528830/ https://lwn.net/Articles/528830/ masoncl <div class="FormattedComment"> Really interesting Neil, thanks. It's worth pointing out that btrfs by default will duplicate metadata. So we're doing 2x the IO on metadata updates. mkfs.btrfs -m single will turn that off, and it should get our delete times closer to ext4.<br> </div> Wed, 12 Dec 2012 00:17:50 +0000 TRIM? https://lwn.net/Articles/528828/ https://lwn.net/Articles/528828/ cibyr <div class="FormattedComment"> Could block2mtd translate mtd_erase() to TRIM commands where appropriate?<br> </div> Tue, 11 Dec 2012 23:34:22 +0000 JFFS2, UBIFS, and the growth of flash storage https://lwn.net/Articles/528820/ https://lwn.net/Articles/528820/ arnd <div class="FormattedComment"> Thank you very much for yet another very interesting article on this topic!<br> <p> One question: Since the SD card you measured can support only 5 erase blocks being written concurrently, did you mount f2fs using the "active_logs=4" option? With the default of 6 active logs plus another erase block being used for global metadata, you might otherwise get into a situation where you alternate between 7 blocks and the card needs to constantly garbage-collect.<br> </div> Tue, 11 Dec 2012 23:06:45 +0000