Re: Filesystem for block devices using flash storage?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Chris Snook
Date: Wednesday, October 8, 2008 - 1:51 pm

Stefan Monnier wrote:

Unless you really know what you're doing, you should use a general-purpose disk 
filesystem.  You probably also want to use the relatime mount option, which is 
default on some distros.


Writes to magnetic disks are functionally atomic at the sector level.  With 
SSDs, writing requires an erase followed by rewriting the sectors that aren't 
changing.  This means that an ill-timed power loss can corrupt an entire erase 
block, which could be up to 256k on some MLC flash.  Unless you have a RAID card 
with a battery-backed write cache, your best bet is probably data journaling. 
On ext3, you can enable this with the data=journal mount option or the 
rootflags=data=journal kernel parameter for your root filesystem.  It's entirely 
possible that doing this will severely harm your performance, though it's also 
possible that it may actually help it if you use a larger-than-default journal, 
thanks to improved write coalescing.


logfs tries to solve the write amplification problem by forcing all write 
activity to be sequential.  I'm not sure how mature it is.


I hope not.  The proper fix is to have the devices report their physical 
topology via SCSI/ATA commands.  This allows dumb software to function 
correctly, albeit inefficiently, and allows smart software to optimize itself. 
This technique also helps with RAID arrays, large-sector disks, etc.

I suspect that in the long run, the problem will go away.  Erase blocks are a 
relic of the days when flash was used primarily for low-power, read-mostly 
applications.  As the SSD market heats up, the flash vendors will move to 
smaller erase blocks, possibly as small as the sector size.  Intel is already 
boasting that their new SSDs have a write amplification factor of only 1.1, 
which leaves very little room for improvement with erase-block-aware filesystems.

-- Chris
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Filesystem for block devices using flash storage?, Stefan Monnier, (Wed Oct 8, 9:38 am)
Re: Filesystem for block devices using flash storage?, Chris Snook, (Wed Oct 8, 1:51 pm)
Re: Filesystem for block devices using flash storage?, Pavel Machek, (Sat Oct 11, 7:35 am)
Re: Filesystem for block devices using flash storage?, Arjan van de Ven, (Sat Oct 11, 9:29 am)
Re: Filesystem for block devices using flash storage?, Pavel Machek, (Mon Oct 13, 3:57 am)
Re: Filesystem for block devices using flash storage?, Chris Snook, (Mon Oct 13, 10:30 am)
Re: Filesystem for block devices using flash storage?, Chris Snook, (Mon Oct 13, 11:38 am)
Re: Filesystem for block devices using flash storage?, Stefan Monnier, (Tue Oct 14, 6:05 am)
Re: Filesystem for block devices using flash storage?, Lennart Sorensen, (Tue Oct 14, 11:04 am)