Solid State Drives Tested With TRIM Support
Vigile writes "Despite the rising excitement over SSDs, some of it has been tempered by performance degradation issues. The promised land is supposed to be the mighty TRIM command — a way for the OS to indicate to the SSD a range of blocks that are no longer needed because of deleted files. Apparently Windows 7 will implement TRIM of some kind but for now you can use a proprietary TRIM tool on a few select SSDs using Indilinx controllers. A new article at PC Perspective evaluates performance on a pair of Indilinx drives as well as the TRIM utility and its efficacy."
I finally got the opportunity to test out SSDs this year. There may be the odd teething problem to get over, but in my mind there is no market in the future for mechanical drives except maybe as cheap low-speed devices for storing non-critical information... in much the same way as tape drives were used a few years ago.
Which Linux filesystem works best with SSDs? I don't intend to touch Win7.
My rights don't need management.
What in the world are you talking about? The nice things about SSDs is that yes, they do fail, but they fail (or are supposed to) in a predictable, non-catastrophic way that leaves the data readable just not writable. I have had two SSDs and haven't had either fail despite heavy usage, and I don't think you could patent SSDs because the technology is everywhere because it is flash memory and even if it is patented more companies make them than just one.
Taxation is legalized theft, no more, no less.
This older Slashdot post linked in the story links to a story that covers that topic very well: http://www.pcper.com/article.php?aid=669
Gamers, gamers, gamers and gamers. Seriously, the early adopters of any technology that is supposed to be faster on the consumer level will be gamers. Considering that most games are Windows-only it makes sense.
Taxation is legalized theft, no more, no less.
Because someone got paid to do it. You don't think /. editors work for free do you?
I'd go on a Vegan diet but the delivery time from Vega is too long. --brownkitty
Even the best consumer-level SSDs like the Intel x-25m/e use a volatile RAM cache to speed up the writes. In fact, with the cache disabled, random write IOPS drops to about 1200, which is only about three or four times as good as a 15k 2.5" drive. The more expensive truly-enterprise SSD drives which don't need a volatile write cache cost at LEAST $20/GB, so the $/(safe random write iop) ratio is actually still pretty close, and cheap SATA drives may actually be even on that metric as the fast enterprise SSDs. Granted, this shouldn't be the case in a year, but that's where it is right now. (Also, the performance-per-slot is a lot higher for SSDs, which can translate into different $ and power and space savings.)
Because, basically, flash drives are laid in levels.
When you delete, you simply map logical space as free.
If you go to use that free space later, you find that area, and drop shit into it. It's I dunno, a 32 KB block of memory called a page. If the page is full (to the point where you can't fit your new shit) of "deleted" files, you first need to write over those deleted files, then write your actual data.
If the logical space is full with good, fragmented (with deleted files interspersed) files, you need to read out to memory, reorder the living data and remove the deleted data, add in the full page back.
Think of it as having a notebook.
You can write to 1 page at a time, only.
Page 1 write
Page 2 write
Page 3 write
Page 2 delete
Page 2 write (still space)
Page 2 write (not enough space, write to page 4 instead)
Page 2 delete
Page 2 write (not enough space, no more blank pages, read page 2 and copy non-deleted shit to scratch paper, add new shit to scratch paper, cover page 2 in white out, copy scratch paper to whited-out page 2)
Disclaimer: I am not a SSD firmware author, although I've spoken to a few.*
As best I can understand it, the problem is that writes are scattered across the physical media by wear-leveling firmware on the disk. In order to do this, the firmware must have a "free list" of sorts that allows it to find an un-worn area for the next write. Of course, this unworn area also needs to not currently be storing any relevant data.
Now, consider a SSD in use. Initially, the whole disk is free, and writes can go anywhere at all. They do, too - you end up with meaningful (at some point) data covering the entirety of the physical memory cells pretty quickly (consider things like logfiles, pagefiles, hibernation data, temporary data, and so forth). Obviously, most of that data doesn't mean anything anymore - to the filesystem, only perhaps 20% of the SSD is actually used, after 6 months. However, the SSD's firmware things that every single part has now been used.
Obviously, the firmware needs to be able to detect when data on disk gets obsoleted, and can safely be deleted. The problems with this are that this leads to *very* complicated translation tables - logical disk blocks end up having no relation at all to physical ones, and the SSD needs to track those mappings. The other problem is that these tables get *huge* - a typical home system might have between 100K and 1M files on it after a few months of usage, but probably generates and deletes many thousands per day (consider web site cookies, for example - each time they get updated, the wear leveling will write that data to a new portion of the physical storage).
Maintaining the tables themselves is possible, and when a logical block gets overwritten to a new physical location, the old location can be freed. The problem is that this freeing comes at the same time that the SSD needs to find a new location to write to, and the only knowledge it has about physical blocks which can safely be overwritten is ones where the logical block has been overwritten already (to a different physical location). Obviously, the lookup into the table of active blocks has to be indexed by logical block, which may make it difficult to locate the oldest "free" physical blocks. This could lead to searches that, even with near-instant IO, result in noticeable slowdowns.
Enter the TRIM command, whereby an OS can tell the SSD that a given range of logical blocks (which haven't been overwritten yet) are now able to be recycled. This command allows the SSD to identify physical blocks which can safely be overwritten, and place them in its physical write queue, before the next write command comes down from the disk controller. It's unlikely to be a magic bullet, but should improve things substantially.
* As stated above, I don't personally write this stuff, so I may be mis-remembering or mis-interpreting. If anybody can explain it better, please do.
There's no place I could be, since I've found Serenity...
In very simple terms (because I'm no expert), it's because of the way SSDs deal with wear leveling and the fact that a single write is non-sequential. When it writes data, it is writing to multiple segments across multiple chips. It is very fast to do it this way, in fact the linear alternative creates heavy wear and is significantly slower (think single chip usb flash drives) than even spinning disk tech, and so this non-sequential write is essential.
Now, to achieve this, each chip is broken down into segments, and those segments are broken down into smaller segments, which are broken down into bytes, which are then broken down bits. When the SSD writes, it writes to the next available bit in the next available segment on each of the chips in the drive. Because it keeps track of exactly where it left off, this process is extremely fast, as all new data goes to the next place in line.
The problem comes when you fill up the hard drive and then delete data. When you delete data, you are deleting little bits spread all over the physical drive. Unless it is a tiny file, every chip will have a little bit of the file. What's worse, unless it was a massive file, you probably wont be clearing whole sequential segments on the drive. To add to that even further, the OS doesn't actually delete anything, it just flags it! So what this means is after you cleared a bunch of room on your hard drive, when writing new data your SSD is still massively fragmented, and to write new data the drive has to find free bits and clear them first. Think worst case scenario for spinning disk fragmentation and that's what you have - and you will get it every single time you fill up an SSD. You can actually re-format the drive and it won't necessarily fix the fragmentation problem, because formating won't reset the segments on the chip to factory state and update the internal drive index in such a way that it maximizes speed again.
Now, because the SSD is sort of like a very large RAID array with very tiny disks, even in this state is still faster than a conventional spinning-disk hard drive. But it is nowhere near as fast it was when it was clean and new.
Thus, the TRIM functions that have been mentioned. Basically these go through and do a de-frag of the data, which requires maximising the space at the "back" of each chip, then re-setting those free segments to the factory state. Depending on how much needs to be moved, this can have wear concerns, so you don't really want to do this all the time. The idea with SSDs is to fill them all the way up, then clear out as much room as you possibly can before trimming the drive. Once trimmed the drive should be back to pre-fragmentation speeds, but you have also just written many more times to some bits on the drive than others, which raises wear concers if the process has to be repeated too many times.
Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller
That's a statistic that doesn't make any sense.
20% under what conditions, and in what timeframe? Over a long enough time period everything has a 100% failure rate.
Normal hard disks also will eventually fail, due to physical wear.
Also if it lasts long enough, at some point, reliability will stop being important. Even if it still works, very few people will want to use a 100MB hard disk from 15 years ago.
Something as simple as deleting the wrong partition becomes an irreversible operation if you do it using a tool that supports TRIM on TRIM-enabled hardware.
Even if you restore the partition table from a backup, you will likely suffer silent file system corruption, which may even not be apparent until it's too late.
If TRIM support is actually implemented on the device, the device is free to 'lose' data on TRIMmed blocks until they are written at least once.
throw new SuccessException("Sig read successfully");
I've never heard of a 20% fail rate for SSDs. I've heard of wear concerns, as each little bit on the drive can only be written a set number of times (it's at 10,000 or so, if I remember correctly). However, thanks to the majic of wear leveling and the large amount of separate chips in an SSD drive, you can fill up your drive completely and you will have only written to each bit exactly once. That means you could theoretically fill your SSD up 10,000 times before you would expect failure. Reality is a bit lower than that, maybe 3,000-5,000 times due to having to TRIM to re-arrange the bits, but it's still significant.
Of course, even with the performance hit TFA talks about after filling your SSD (which is fixed with the TRIM function TFA also talks about) the fastest spinning disks are still much much slower than all but the very worst SSDs out there.
Anyway, the 20% fail rate may have been a specific manufacturer of SSDs, there are already some really shitty ones out there.
Lastly,
Also doesn't one of the hardware manufactures (Samsung I think) have a patent on SSD so no one else can make the drives any way. Proprietary == Dead
You may need to get some more education about how patents work, because if that were true IBM would not have the fastest SSD on the markent. See, they do this thing called licensing, which basically means company Y purchases an agreement from company X to use their technology to manufacture a product. It creates an incentive for company X to allow other manufacturers to use their technology, flooding with the market with both quality and crap, but ultimately lowering the price and speeding innovation regardless of the high quality stuff (and improving the quality of the cheap stuff, it works both ways usually).
It's actually the reason patents exist. We only get in a fuss when people patent stuff that either a.) should never need a patent (which means the patentor can sue for damages for infringement) or b.) some company goes around buying patents from legitimate inventors for the sole purpose of hoping said patents become infringed upon by an unwitting third party. The former is a failure in the patent system, and the latter is patent trolling, which is an unethical and disgusting abuse of the process.
Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller
If you go to use that free space later, you find that area, and drop shit into it.
Knock it off with all the fancy jargon!
Don't blame me, I voted for Baltar.
For a thorough (RE: long) primer on SSDs and long term performance woes, Anand's overview is a must read.
No sig for you!!
Just a small tangential nitpick: we were already more than a factor of ten past that HDD capacity fifteen years ago. The 1GB barrier was broken very early in the Nineties. I still have an HP 1GB SCSI drive from about '91 or '92, IIRC.
As far as failure rates go, I still have ALL of my disk drives (one or two outright failed) from the 15-20 years, and every single one of them still functions at least nominally. I'm still more trusting of magnetic media than I am either rewritable optical or Flash-based media.
Very interesting, I assumed the problem was similar to fragmentation and wondered why nobody compared it as such.
Now, your explanation makes things much more clearer, the global problem is amplified by the additional problem you described.
Now would implementing the logic to control the SSD entirely at the OS/FS level be much slower than implementing it in silicon in the SSD itself ?
As you said, I now understand that the OS/FS would now have to be aware of the underlying media ;-)
Everything I write is lies, read between the lines.
Obviously, the firmware needs to be able to detect when data on disk gets obsoleted, and can safely be deleted. The problems with this are that this leads to *very* complicated translation tables - logical disk blocks end up having no relation at all to physical ones, and the SSD needs to track those mappings.
Would it solve the problem (or, I guess I should say, remove the symptoms... for a while, at least) to do a full backup, format the SSD, and restore? I know it's not an ideal solution but rsync or Time Machine would make it pretty painless.
Also, if I had an SSD and was browsing a lot I could see making a ramdisk for things like browser cache files. Too bad Safari and Firefox don't seem to let you specify where you want your cache to be anymore, like old browsers used to. I guess you could make a symlink or something but then you'd HAVE to have that drive mounted.
Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
I can buy a terabyte hard drive for around $100. For the same hundred dollars, the best SSD I can find is 32GB. On my computer, Steam's cache folder is bigger than 32GB. My music player has a 120GB drive, my DVR has a 350GB drive, and my backup server has a 1.5TB raid. Just because expensive mobile gadgets use expensive solid-state drives does not mean hard drives are dead, dying, or even decaying.
Just another "DOJ fascist authoritarian totalitarian bootlicker" -- Zeio
The problem isn't scanning metadata - the problem is relocating data prior to an erase. Flash memory is built into erase blocks that are quite large - 64k to 128k is typical. You can write to smaller regions, but to reset them for another write you have to pave over the neighborhood. However the OS is sending writes at the 512-byte sector granularity. So the drive has to essentially mark the old location for the data as obsolete, and place it somewhere else.
When the drive has been used enough, however, it may have trouble finding an empty, erased sector to write to. So it has to erase some erase block. But if all erase blocks still have good data (eg, each has half used, important data and half obsolete, overwritten data), you need to relocate some of that data elsewhere.
What the trim command does is tell the drive that it need not preserve the data of a given sector - otherwise, if you were to delete a file, the drive would still have to preserve its data each time one of these relocation operations occur, since it doesn't know anything about the filesystem's allocation maps. By using TRIM, the drive is aware of what data is deleted, and can thus be discarded when it's time to erase blocks. It also increases the percentage of truly unused flash sectors, increasing the probability that a write can go through without having to wait for a relocation.
Note that this is completely independent from filesystem fragmentation - indeed, a defrag can even make things worse, by making the flash drive think both old and new locations for some data need preserving.
Once upon a time, a technical subject on /. gave insightful and informative responses that were modded up. Time changes, I guess.
The "fragmentation" that SSD drive have don't really come from wear leveling, or from having to find some place to write things, but from the following properties:
* Filesystems read and write 4KiB pages.
* SSD can read many time 4KiB pages FAST, can write ONCE 4KiB pages FAST, but can only erase a whole 512KiB blocks SLOWLY.
When the drive is mostly empty, the SSD have no trouble finding blanks area to store the 4KiB write from the OS (he can even cheat with wear leveling to re-locate 4K pages to blank spaces when the OS re-write the same block). After some usage, ALL THE DRIVE HAVE BEEN WRITTEN TO ONCE. From the point of view of the SSD all the disk is full. From the point of view of the filesystem, there is unallocated space (for instance, space occupied for files that have been deleted).
At this point, when the OS send a write command to a specific page, the SSD is forced to to the following:
* read the 512KiB block that contain the page
* erase the block (SLOW)
* modify the page
* write back the 512KiB block
Of course, various kludges/caches are used to limit the issue, but the end result is here: writes are getting slow, and small writes are getting very slow.
The TRIM command is a command that tell the SSD drive that some 4KiB page can be safely erased (because it contains data from a delete file, for instance), and the SSD stores a map of the TRIM status of each page.
Then the SSD can do one of the following two things:
* If all the pages of a block are TRIMed, it can asynchronously erase the block. So, the next 4KiB write can be relocated to that block with free space, and also the 127 next 4KiB writes.
* If a write request come and there is no space to write data to, the drive can READ/ERASE/MODIFY/WRITE the block with most TRIMed space, which will speed up the next few writes.
(of course, you can have more complex algorithms to pre-erase at the cost of additional wear)
If you can afford an SSD, why would you waste it on swap? Why not just buy more RAM? If you ever actually need swap, you are doing something wrong.
Sam ty sig.
browser.cache.disk.parent_directory
How about hibernate to disk? If you have lots of good SSD that should be very fast shouldn't it?
=~ s,(.*),<sarcasm>$1</sarcasm>,g if any_point_you_wish();
Think of it as a luxury expense from the cash we save building our own systems.
The Goal: A long simple life filled with many complex toys.
It's extremely unfair to link to the print version of that article. Anand put an immense amount of time into that (and everything before it!) and scarred quite a few bridges to bring it to light for his readers - there are very, very few reviewers out there that would do that for their readerbase. The least you could do is offer him and his site _some_ respect.