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

  • kisjoink - Monday, August 31, 2009 - link

    "Intel doesn't need to touch the G1, the only thing faster than it is the G2."

    I've been an avid anandtech-reader since 1998, but this is the first time I'm commenting on an article. I just have to say how much I disagree with this quote!

    I've used the x25m since its launch (December 08) and at first I was very happy with the drive. Although really expensive, I got convinced to buy one after reading your first previews and review. And the performance was great, at least for the first 4-5 months. At that time I started noticing some 'hiccups' (system freeze). At first they were few and short. But over time they become more noticeable and now they're a real pain. Sometimes my system can freeze for more than 15 seconds. It usually happens when I edit a picture in photoshop, but it can also happen while writing something in Word, programming java in Eclipse or just surfing the web.

    The problem? I'm pretty sure its the Intel drive. After reading too many SSD-articles I immediately suspected the x25m when the I started noticing the hiccups. So I got used to running the "Windows Resource Monitor" in the background - studying the disk activity after every hiccup. Just take a look at this example (just started photoshop and did some light editing on a picture):
    http://img256.imageshack.us/img256/3073/hickup.jpg">http://img256.imageshack.us/img256/3073/hickup.jpg

    I'm sure there are many ways I could tune my system better. I've done a couple of things, like moved the internet temp folder to a mechanical drive etc. And the performance of the drive will probably recover if I do this special SSD-format - but it's a real pain to have to do complete OS installation 2-3 times a year when you claim it's possible for Intel to create a new firmware with TRIM-support. I mean - I really did pay premium price for this product (close to 800$ included VAT here in Norway for the 80GB version in December 08).

    So, to summarise - I got convinced to buy the drive after reading your articles (you write great reviews!) - and I understand that the problem that I (and others from what I've been reading on forums) is really difficult to recreate in a testing environment - but that doesn't mean that the problem doesn't exist. I just wish you could point this out. The expensive G1 has some really big performance issues that might force you to do a complete reinstall of your system a couple times a year - and although Intel could fix it they wont, because they have a new, better and cheaper product out - and people like me (altough we feel really screwed over by Intel) will buy their next device (as long as its the best device out there).
  • IntelUser2000 - Monday, August 31, 2009 - link

    Is that after you installed the firmware version 8820 or before?? That reduces the problem a lot unless you filled the drive to more than 70%.
  • kisjoink - Monday, August 31, 2009 - link

    Yes, I forgot to mention that - it's after I upgraded to the 8820 firmware. I don't think I've ever filled it up with more than 80%, usually I have about 30GB of free space
  • Anand Lal Shimpi - Monday, August 31, 2009 - link

    This is actually an interesting scenario that I've been investigating a bit myself. The 8820 firmware actually significantly changes the way the drive likes to store data compared to the original firmware. That's fine for a cleanly secure-erased drive, but what happens if you have data/fragmentation on the drive already?

    Every time you write to the drive the controller will look at the preferred state specified by the new firmware. It will see that your data is organized the way the old firmware liked it, but not the new firmware. Thus upon every...single...write it will try and reorganize the data until it gets to its happy state.

    I honestly have no idea how long this process will take, I can see it taking quite a bit of time but perhaps you could speed it up by writing a bunch of sequential files to fill up the drive? The safer bet would be to backup, secure erase and restore onto the drive. You shouldn't see it happen again.

    Think of it like this. I live in my house and I have everything organized a certain way. It takes me minimal time to find everything I need. Let's say tomorrow I leave my house and you move in. You look at how things are organized and it's quite different from how you like things setup. Whenever you go to grab a plate or book you try cleaning up a bit. Naturally it'll take a while before things get cleaned up and until then you won't be as quick as you're used to.

    Take care,
    Anand
  • jimhsu - Friday, September 11, 2009 - link

    The G2's I've discovered REALLY don't like to be filled up more than 80% or so. When I had 8GB free on the 80GB drive, seq write performance basically plummeted at random intervals (to levels like 30MB/s.) Random writes sometimes dropped down to 4MB/s. Now that I've freed 20GB and tried writing and deleting large ISO files to the drive, the performance is coming back slowly.
  • Dunk - Monday, August 31, 2009 - link

    Hi Anand,

    I'm blown away by your article series on SSD - absolutely fantastic.

    When new Intel firmware is launched with TRIM support for the G2, can I flash it without losing the drive and needing to reinstall everything?

    I'm happy using the out of the box MS driver for now in Win7, but would prefer to use Intel's TRIM version once available.

    Many thanks
    Duncan
  • Anand Lal Shimpi - Monday, August 31, 2009 - link

    If Intel follows the same pattern as what we saw with the G1's firmware update, you should be able to flash without destroying your data (although it's always a good idea to back up).

    Thank you for your comment :)

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

    Okay, single X25-M G2s can be updated without losing data. But I am considering two 80GB drives in RAID-0 to overcome the sequential write slowdown with Photoshop. How will updating work for the RAID-0 pair?

    Do you have an opinion about using a RAID pair for Photoshop?
  • Noteleet - Monday, August 31, 2009 - link

    Fantastic article, I'm definitely planning on getting a SSD next time I upgrade.

    I'm fairly interested in seeing some reviews for the Solid 2. If OCZ can get the kinks worked out I think the Intel flash and the Indilinx controller would make a winning combination for price to performance.
  • Visual - Monday, August 31, 2009 - link

    Where does the drive store the mapping between logical and physical pages and other system data it needs to operate? Does it use the same memory where user data is stored? If so, doesn't it need to write-balance that map data as well? And if that's true, doesn't it need to have a map for the map written somewhere? How is that circular logic broken?

    Or does the drive have some small amount of higher-quality, more reliable, maybe single-level-cell based flash memory for its system data?

Log in

Don't have an account? Sign up now