Tuesday, December 15, 2009

Getting the SSD finally , but no TRIM yet

So finally I’m getting an SSD kudos to Mahen and Anusha (for dragging me into this :P). "SSD" (Solid state drive) might be an alien term for some of you; it’s a drive that is based on Flash memory cells (unlike your traditional hard disk which is based on a magnetic media). Which is quite fast in terms of sequential transfer speeds, random write/ read speeds and has an ultra low latency (~ 0.1ms) compared to your venerable hard drive (~ 13ms).

The new kid on the block: Kingston SSDNow 40GB MLC boot drive, in fact an Intel X25-M G2 drive in disguise. It comes in 2 retail versions one with the desktop bundle and the other with just the 2.5” (Notebook) drive. We opted to get it from Newegg and Mahen had ordered it through comgateway.com, but few days later we got to know Newegg has run out of stocks and had to search elsewhere. Dell had it but was out of stock, it’s the way it is, they are supposed to sell like hot cakes given the price tag. Then we tried Amazon, they had it but only the Notebook version was readily available, we had no chance but to opt out with it, besides you are not missing much, just the 2.5” to 3.5” enclosure, cables and the CD contains Acronis True Image ; not a deal breaker at all.

As of yet this drive doesn’t support the TRIM extension though Intel has already released a TRIM firmware for their X25-M G2 drives, Hopefully Kingston will release a TRIM firmware once Intel starts shipping their 40GB drives. SSDs degrade their write performance over time, once the cells started to fill up with your data + junk data that you deleted from the drive (you know that a hard drive doesn’t really delete data when you delete a file; same goes with SSD), Let me explain you the reason.

SSDs are made of zillion memory cells each cell holding a single bit, so these cells are grouped together to create a unit called a page (4KB usually). These pages are arranged to create a so called block which is usually 512KB (128 pages). You can write into these pages one by one but when you have to delete a single 4KB page you must erase the entire 512KB block, weird ha? That’s the way it is, you have no way of controlling it. Luckily the SSD controller applies wear-leveling algorithms and it ensures each and every memory cell of the SSD across the drive is used for writing data, thus eliminating writing to the same cell over and over again, but once every cell is used you have to overwrite the existing cells that are filled by junk data you had deleted from windows. This is where it gets interesting. Imagine you have a file to be written which is 256KB in size and imagine the block which is selected by the SSD controller has 256KB of valid and 128KB junk data, so you have 128KB of free space on the block. Your file needs 256KB and the block has 128KB of free space, so the controller needs to erase the 128KB junk data prior to writing your file, as I said earlier the controller can’t just erase a single page or couple of pages, it must erase the whole freakin 512KB block. So the controller reads the block, gets the 256KB of valid data and caches it in the controller cache/ DRAM memory. Now it erases the whole block and writes your file which is 256KB along with data on cache. Wait! What happened? Did the controller write 512KB worth data to the block? Yeah. Feel dizzy? LOL. You wanted to write a 256KB file and ended up reading old 256KB and writing 512KB of data which in turn crippled your write speed severely.

So technically your drive might become slower even when you have plenty of free space on it. TRIM to the rescue, though you need to have a TRIM supported OS (Win 7) and a TRIM supported firmware with your drive. When TRIM is enabled a simple delete operation you pass to the OS goes through the SATA controller of your motherboard from all the way up to the SSD controller and it really erases the deleted file from your drive. So your drive is free from junk data and it’s always ready for writing to it the absolute data you want. Delete operations may become slower since it has to do all the boring read-erase-write operations. That’s not a big deal. Remember if your drive doesn't support TRIM you have no way of regaining the full performance unless you secure erase the drive, formatting or partitioning cannot help here. So that's it for now, Sorry if it was boring to you. :D

Hopefully we will get the SSDs before this weekend and planning to visit Mahen’s place to eyewitness his Alienware-MX17, that’s a once in a lifetime chance for me I guess. catch ya' all later.

Peace out!