A Quick Flash Refresher

DRAM is very fast. Writes happen in nanoseconds as do CPU clock cycles, those two get along very well. The problem with DRAM is that it's volatile storage; if the charge stored in each DRAM cell isn't refreshed, it's lost. Pull the plug and whatever you stored in DRAM will eventually disappear (and unlike most other changes, eventually happens in fractions of a second).

Magnetic storage, on the other hand, is not very fast. It's faster than writing trillions of numbers down on paper, but compared to DRAM it plain sucks. For starters, magnetic disk storage is mechanical - things have to physically move to read and write. Now it's impressive how fast these things can move and how accurate and relatively reliable they are given their complexity, but to a CPU, they are slow.

The fastest consumer hard drives take 7 milliseconds to read data off of a platter. The fastest consumer CPUs can do something with that data in one hundred thousandth that time.

The only reason we put up with mechanical storage (HDDs) is because they are cheap, store tons of data and are non-volatile: the data is still there even when you turn em off.

NAND flash gives us the best of both worlds. They are effectively non-volatile (flash cells can lose their charge but after about a decade) and relatively fast (data accesses take microseconds, not milliseconds). Through electron tunneling a charge is inserted into an N-channel MOSFET. Once the charge is in there, it's there for good - no refreshing necessary.


N-Channel MOSFET. One per bit in a NAND flash chip.

One MOSFET is good for one bit. Group billions of these MOSFETs together, in silicon, and you've got a multi-gigabyte NAND flash chip.

The MOSFETs are organized into lines, and the lines into groups called pages. These days a page is usually 4KB in size. NAND flash can't be written to one bit at a time, it's written at the page level - so 4KB at a time. Once you write the data though, it's there for good. Erasing is a bit more complicated.

To coax the charge out of the MOSFETs requires a bit more effort and the way NAND flash works is that you can't discharge a single MOSFET, you have to erase in larger groups called blocks. NAND blocks are commonly 128 pages, that means if you want to re-write a page in flash you have to first erase it and all 127 adjacent pages first. And allow me to repeat myself: if you want to overwrite 4KB of data from a full block, you need to erase and re-write 512KB of data.

To make matters worse, every time you write to a flash page you reduce its lifespan. The JEDEC spec for MLC (multi-level cell) flash is 10,000 writes before the flash can start to fail.

Dealing with all of these issues requires that controllers get very crafty with how they manage writes. A good controller must split writes up among as many flash channels as possible, while avoiding writing to the same pages over and over again. It must also deal with the fact that some data is going to get frequently updated while others will remain stagnant for days, weeks, months or even years. It has to detect all of this and organize the drive in real time without knowing anything about how it is you're using your computer.

It's a tough job.

But not impossible.

Index Live Long and Prosper: The Logical Page
Comments Locked

295 Comments

View All Comments

  • Anand Lal Shimpi - Monday, August 31, 2009 - link

    Maybe I should compile these things into a book? :)

    Here are my answers about some stuff:

    1) There's a spec for how hard drive makers report capacity. They define 1GB as 1 billion bytes. This is technically correct (base 10 SI prefix as you correctly pointed out). The HDDs also physically have this much storage on them, they are made up of sequentially numbered sectors that are easily counted in a decimal number system.

    All other aspects of PC storage (e.g. cache, DRAM, NAND flash) however work in base 2 (like the rest of the PC). In these respects 1GB is defined as 1024^3 because we're dealing with a base 2 number system. There are reasons for this but it goes beyond the scope of what I'm posting :)

    Intel adheres to the same spec that the HDD makers use. But the X25-M is made up of flash, which as I just mentioned is addressed in a base 2 number system. There's more flash than user space on the drive, it's used as spare area, woohoo. I think we're both on the same page here, just saying things differently :)

    2) We'll see a 320GB drive, just not this year. I don't know that the demand is there especially given the weak economy.

    Dreams do sometimes come true... ;)

    3) Perhaps, but I don't like the idea of a drive doing anything but idling when it's supposed to be...idle. This does funny things to notebook battery life I'd think.

    4) This is true. There's also another thing you can do with the jumper (and perhaps some additional software): flash any indilinx drive with any firmware regardless of vendor :)

    5) I had to throw out a lot of data because of variations between runs. It ended up being a combination of immature drivers, immature benchmarks and some OS trickery. The setup I have now is very reliable and provides very repeatable results with very little variation. While I run everything three times, the runs are so close that you could technically do only one run per drive and still be fine.

    6) I wouldn't count WD and Seagate out just yet. It may take them a while but they won't go quietly...

    7) Samsung makes a ton of money from SSD sales to OEMs, they don't seem to care about the end user market as much. If end users start protesting Samsung drives however, things will change.

    In my opinion? Once Apple falls, the rest will follow. If Apple will migrate to Intel (possible) or Indilinx (less likely), we'll see the same from the other OEMs and Samsung will be forced to change.

    Or I could be too pessimistic and we'll see better performance from Samsung before then.

    8) Agreed :)

    I'll finish here too :)

    Take care,
    Anand
  • Reven - Monday, August 31, 2009 - link

    Anand, dont listen to the guys like blyndy who diss on the anthologies, I love them. You can find a basic review anywhere, its the in-depth yet simple to understand stuff like these anthologies that make me visit Anandtech all the time.

    Keep it up, dude!
  • Anand Lal Shimpi - Monday, August 31, 2009 - link

    Thank you :)
  • EasterEEL - Monday, August 31, 2009 - link

    I have a couple of questions regarding the Intel® SATA SSD Firmware Update Tool (2832KB) v1.3 8/24/2009.

    Does this firmware enable TRIM within the SSD to work with Windows 7?

    If AHCI is enabled in the BIOS (but not RAID) does Windows 7 use it's own drivers with TRIM? Or does it load Intel’s Matrix Storage Manager driver which does not support TRIM as per the article note below?

    "Unfortunately if you’re running an Intel controller in RAID mode (whether non-member RAID or not), Windows 7 loads Intel’s Matrix Storage Manager driver, which presently does not pass the TRIM command. Intel is working on a solution to this and I'd expect that it'll get fixed after the release of Intel's 34nm TRIM firmware in Q4 of this year."

  • Anand Lal Shimpi - Monday, August 31, 2009 - link

    That update does not enable TRIM. The TRIM firmware is in testing now and it will be out sometime in Q4 of this year (October - December).

    If AHCI is enabled in the BIOS and you haven't loaded Intel's MSM drivers then it will use the Windows 7 driver and TRIM will be supported.

    Take care,
    Anand
  • uberowo - Monday, August 31, 2009 - link

    I do have a question however. :D

    I am building a gaming pc, and I am buying ssd disk/s. Would I benefit from getting 2x80gb intel gen2s and using raid0? Or should I stick with a single 160gb?
  • Anand Lal Shimpi - Monday, August 31, 2009 - link

    While I haven't tested 2 x 80GB drives in RAID-0, my feeling is that a single SSD is going to be better than two in RAID going forward. As of now I don't know that anyone's TRIM firmware is going to work if you've got two drives in RAID-0.

    The perceived performance gains in RAID-0 also aren't that great on SSDs from what I've seen.

    Take care,
    Anand
  • Ardax - Monday, August 31, 2009 - link

    A naive guess would be that it depends on the workload. For lots of sequential transfers a RAID-0 should shine -- particularly on reads -- because you're spreading the transfers out over multiple SATA channels.

    Losing TRIM is a problem. Finding a controller than can handle the performance is entirely likely to be another.
  • uberowo - Monday, August 31, 2009 - link

    Thanks a lot for taking the time to answer. Not to mention making this awesome site. :)
  • Anand Lal Shimpi - Monday, August 31, 2009 - link

    You guys take the time to read it and make some truly wonderful comments, it's the least I can do :)

    -A

Log in

Don't have an account? Sign up now