Garbage Collection Algorithms Coming For SSDs
MojoKid writes "A common concern with the current crop of Solid State Drives is the performance penalty associated with block-rewriting. Flash memory is comprised
of cells that usually contain 4KB pages that are arranged in blocks of 512KB. When a cell is unused, data can be written to it relatively quickly. But if a cell already contains some data, even if it fills only a single page in the block, the entire block must be re-written. This means that whatever data is already present in the block must be read, then it must be combined or replaced, and the entire block is then re-written. This process takes much longer than simply writing data straight to an empty block. This isn't a concern on fresh, new SSDs, but over time, as files are written, moved, deleted, or replaced, many blocks are a left holding what is essentially orphaned or garbage data, and their long-term performance degrades because of it. To mitigate this problem, virtually all SSD manufacturers have incorporated, or soon will incorporate, garbage collection schemes into their SSD firmware which actively seek out and remove the garbage data. OCZ, in combination with Indilinx, is poised to release new firmware for their entire line-up of Vertex Series SSDs that performs active garbage collection while the drives are idle, in order to restore performance to like-new condition, even on a severely 'dirtied' drive."
A weakness was found in first generation drives, the second generation drives fixed it.
Film at 11.
No sig today...
It seems like this function should be performed in the operating system. The firmware should just make available the info and commands an OS needs to do the right thing.
"Garbage collection" has already quite different usage in CS. And while what has to be done to those SSDs isn't technically the same as defragmentation on HDDs, it is still "performing drive maintenance to combat performance-degrading results of prolonged usage, deletion of files".
One that hath name thou can not otter
If you have an app that needs SSD, when will the drives ever be idle ?
I want to delete my account but Slashdot doesn't allow it.
So what does this do when forensics are being done on one of these drives? Is the firmware just doing a better job of marking a dirty block available or do the dirty blocks have to be zeroed at some point. Even if the blocks are just marked will they output zeros if 'dd'ed by an OS?
I don't want my porn garbage collected thank you very much. Who died and made you king of deciding what's garbage.
These posts express my own personal views, not those of my employer
Wouldn't the drive benefit from a real understanding of the filesystem for this sort of thing? If it knew a sector was unallocated on a filesystem level, it would know that sectors were empty/unneeded, even if they had been written to nicely. Or should computers now have a way of tagging a sector as "empty" on the drive?
Either way, it looks like an OS interaction would be very helpful here.
Or are modern systems already doing this, and I'm just behind the times?
The Garbage collector restores performance of the drive. Nothing comes free, so a question - at what cost?
In theory there is no difference between theory and practice. In practice there is. - Yogi Berra
The new drive deleted all my %INSERT_POPSTAR% songs!
Captcha is "tragedy", how fitting...
Not necessarily. An SSD has to collect garbage sometime; whether it GCs proactively or lazily causes the same wear.
Comment removed based on user account deletion
Imagine that. Integrated obsolescence disguised as a feature.
What ever will they think of next?
Not on your life! Unless I've got Aslan to help me, of course.
No, not MILFs.
http://www.linux-mag.com/cache/7345/1.html
This GC stuff is only needed as long as the FS uses small blocks. File systems should be able to use arbitrarily sized blocks.
Hopefully btrfs will be able to use large blocks efficiently too.
thegodmovie.com - watch it
Is this what dreams are for ?
I feel like my brain goes 'garbage collecting' every night...
An SSD does have to collect garbage sometime, but waiting until an entire section is marked obsolete until you do the wipe is the cheapest/least wearing method. Remember - SSD can be written to in small increments, but only erased in large increments, and once an increment has been written to it must be erased to be written to again. And each increment can only be erased a certain number of times before it dies.
Let's say we have erasable blocks of 512K with 512 writable sectors of 1K each. A proactive algorithm might move data into unused blocks when, say, half the block has "garbage" and the other half has good data. So when we hit more than 256K of garbage in the sector, we move the good stuff off it and wipe it.
So we take the good data out of two blocks, and write it all to a single new block, then we can wipe both old blocks safely.
But in doing so, we've "used up" a fresh block for no good purpose except to free up space. A noble goal, but I presume it's pretty obvious that if we had waited until each block was down to 128K of good data, we could have copied the good data out of FOUR old blocks to a single block, thereby cutting the "maintenance wear" by half.
Garbage collection of an SSD drive is a continuous choice between:
- allowing the drive to get clogged up with junk data and being as lazy about maintenance as possible (which statistically will extend drive life, but will mean there are times when you have to wait to do a write because the drive has to find the most-garbagey chunks available and clear them to make room). If you put this task off as long as possible, when you DO wipe a block it's more likely to be mostly garbage, so you're moving good data around as little as possible.
and
- obsessively keeping all garbage data off the drive by moving all data from ANY partially-used sectors to new sectors so all garbage can be kept out (which optimizes continuous performance, but means you may wipe an entire block when only a small percentage of it was actual garbage, so you're moving a lot of data around frequently and burning out sectors faster). If you do this task quickly and frequently, you move a lot of good data around from place to place. But you do ensure that free blocks are always available.
The ideal is somewhere around the middle. You pick a point at which you consider a specific block to be "too garbagey" and you clean those up as you go. Where is that point? Depends on your needs, how full the drive really is, and your relative values on performance versus reliability or drive longevity.
"This post contains words, known to the State of California to cause thought. Wash brain thoroughly after reading."
I see OCZ already released some sort of garbage collection tool, but it only works on Windows. Kind of annoying since I bought their "Mac Edition" drive for my MacBook. Hopefully they'll put this in a firmware update, too, and hopefully I won't have to boot DOS on my Mac to update the firmware with a utility that blows over my partition table this time. That was a lot of fun going from version 1.10 to 1.30 firmware.
In the article it says
But if a cell already contains some data--no matter how little, even if it fills only a single page in the block--the entire block must be re-written
Is this correct?
From whatever I read in AnandTech, it looked like we need not rewrite the entire block unless the available data is less than total - (obsolete + valid) data.
Also, the article is light in details. How are they doing the GC? Do they wait till the overall performance of the disk is less than a threshold and rewrite everything in a single stretch or do they rewrite based on local optima? If the former, what sort of algorithms are used (and are the best for it) ?
rajmohan_h@yahoo.com
No, OCZ released wiper, which is a trim tool. Trim and GC are different; in particular, GC requires no tools or OS support.
Next time you write into that block, this operation will be performed anyway. This is why some SSDs have huge delays on writes, because they delay your write until the data merging is done. Also, not every block needs merging anyway, an area of a file that spans 512K (128 pages) is written in one chunk anyway and never needs re-merging.
To be honest, the data retention time on NAND (where the data just drains out like DRAM) is becoming as big a factor as write wear anyway. You're going to have to move the data around a little to make sure it stays valid.
Honestly, I'm pretty spooked about SSDs right now, the only reason I use one is a friend gave it to me for free to test.
http://lkml.org/lkml/2005/8/20/95
from the take-out-the-tash dept.
Is "tash" a play on words regarding SSD's, or does the taking-out-the-TRASH department have a job opening for a grammar nazi?
What ever will they think of next?
Why, they'll think of disguising integrated obsolescence as a feature next, but they'll call it a Data Relocation Mechanism (DRM).
Oh Wow, SSDs still have issues. Hey it's new technology, it's still very expensive relative to the technology it replaces, we haven't yet seen how well it holds up long term, and everyone who jumped to it early because it was the new bright and shiny thing should consider being a bit more cautious next time.
"It's the height of ridiculousness to say for those 9 lines you get hundreds of millions."
How would this affect camcorders that record to flash memory? I'm interested in getting a camcorder that uses flash memory for its inherent ruggedness and low power consumption. If the memory ages with time is it better not to get the ones with built-in memory that are not easily replaced by simply inserting a new memory stick? Does it mean that the memory at the beginning of the stick will age more, given that it will be overwritten more?
....defrag, anyone?
I also wonder, does this impact battery life in a laptop with these SSDs?
no comment
I have been working closely with OCZ on this new firmware and wanted to clear things up a bit. This new firmware *does not*, *in any way at all*, remove or eliminate orphaned data, deleted files, or anything of the like. It does not reach into the partition $bitmap and figure out what clusters are unused (like newer Samsung firmwares). It does not even use Windows 7 TRIM to purge unused LBA remap table entries upon file deletions.
What it *does* do is re-arrange in-place data that was previously write-combined (i.e. by earlier small random writes taking place). If data was written to every LBA of the drive, then all files were subsequently deleted, all data would remain associated with those LBAs. This actually puts OCZ above most of the pack, because their algorithm restores performance without needing to reclaim unused flash blocks, and does so completely independent of the data / partition type used. This is particularly useful for those concerned with data recovery of deleted files, since the data is never purged or TRIMmed.
Slashdot-specific Translation: This firmware will enable an OCZ Vertex to maintain full speed (~160 MB/sec) sequential writes and good IOPS performance when used under Mac and Linux.
Hardware-nut Translation: This firmware will enable OCZ Vertex to maintain full performance when used in RAID configurations.
I'll have my full evaluation of this firmware up at PC Perspective later today. Once available, it will appear at this link:
http://www.pcper.com/article.php?aid=760
Regards,
Allyn Malventano
Storage Editor, PC Perspective
this sig was brought to you by the letter
An entire article and posts about garbage files and not one person mentions Ellingston Mineral and it's Gibson computers....I am dissapoint.
Nothing like a crazy, off-topic, poorly written wall-of-text comment with scores of unnecessary bold and caps to get your point across.
especially when the point is that you don't exist to write pointless wall-of-text-comments
bravo, sir
:x
You'd need a separate memory to keep a table of pointers, just like an object table in some OO language implementations. This way, you wouldn't need Garbage Collection so much as just plain old compaction. The extra level of indirection wouldn't be so bad, because it's Flash -- random low-latency access is what it's good at.
(The separate memory would have a granularity of just 64 bits, so rewriting just one pointer will have less overhead.)