Windows 7 Behavior Using SSDs – Call It ‘Trim’ In Action

Posted by on Jan 3, 2010 | 10 Comments

When Microsoft introduced Windows 7, there was little fanfare about how the new OS supported SSD. For those of you who are not familiar with SSD [solid state drives] these will be the new drives of the future that will eventually replace mechanical drives currently used in most computers. The benefits of SSD are that they should be faster and more reliable. They should last longer than their mechanical counterparts that are subject to fail. I recently had the hard disk replaced in my wife’s new Toshiba laptop after only 2 months use.

Windows 7 Optimizations and Default Behavior Summary

As noted above, all of today’s SSDs have considerable work to do when presented with disk writes and disk flushes. Windows 7 tends to perform well on today’s SSDs, in part, because we made many engineering changes to reduce the frequency of writes and flushes. This benefits traditional HDDs as well, but is particularly helpful on today’s SSDs.

Windows 7 will disable disk defragmentation on SSD system drives. Because SSDs perform extremely well on random read operations, defragmenting files isn’t helpful enough to warrant the added disk writing defragmentation produces. The FAQ section below has some additional details.

Be default, Windows 7 will disable Superfetch, ReadyBoost, as well as boot and application launch prefetching on SSDs with good random read, random write and flush performance. These technologies were all designed to improve performance on traditional HDDs, where random read performance could easily be a major bottleneck. See the FAQ section for more details.

Since SSDs tend to perform at their best when the operating system’s partitions are created with the SSD’s alignment needs in mind, all of the partition-creating tools in Windows 7 place newly created partitions with the appropriate alignment.

This is how Microsoft describes their Trim operation:

Microsoft and SSD manufacturers are adopting the Trim operation. In Windows 7, if an SSD reports it supports the Trim attribute of the ATA protocol’s Data Set Management command, the NTFS file system will request the ATA driver to issue the new operation to the device when files are deleted and it is safe to erase the SSD pages backing the files. With this information, an SSD can plan to erase the relevant blocks opportunistically (and lazily) in the hope that subsequent writes will not require a blocking erase operation since erased pages are available for reuse.

As an added benefit, the Trim operation can help SSDs reduce wear by eliminating the need for many merge operations to occur. As an example, consider a single 128 KB SSD block that contained a 128 KB file. If the file is deleted and a Trim operation is requested, then the SSD can avoid having to mix bytes from the SSD block with any other bytes that are subsequently written to that block. This reduces wear.

Windows 7 requests the Trim operation for more than just file delete operations. The Trim operation is fully integrated with partition- and volume-level commands like Format and Delete, with file system commands relating to truncate and compression, and with the System Restore (aka Volume Snapshot) feature.

I am personally looking forward to SSD and their reliability factor. Whether or not they speed up a system won’t be known until the price of SSDs come down and they are more widely used.

Comments welcome.

Source – Microsoft

  • Dick

    Until the price comes Waaaaay down. Also, capacity must go way up before I consider them.
    BTW, if you write SSD drive isn’t that the same as writing “Solid State Drive Drive”?

  • http://wp3.lockergnome.com/nexus/blade/ Ron Schenone

    Hi Dick, I thought about that after I wrote SSD drive. I believe you are correct and have made the correction.

    Thanks, Ron

  • http://wp3.lockergnome.com/nexus/theoracle/ the oracle

    I can hardly wait until the first time a solid state drive is revealed to have delivered scads of information to someone it should not have because of the fact it was no properly erased in a write over or write through operation.

    The naysayers will have a field day. (I’ll be among them)

    Though there is the possibility of increased reliability, right now I don’t see it. If the drives already offered such increased longevity, the companies making them would not be worried about the few times these writes occur. The “wear” factor is something these companies really don’t yet understand, and until they do, the drive performance (failure) can be every bit as capricious in all cases where physical shock is not involved.

    The drives are basically the same technology as flash (thumb) drives. Over the last 2 years, I have had 2 fail for apparently no reason. Over my life’s usage of hard drives, I have only had two ever fail, out of over 100 (I did a count, these are drives I have used on my own machines, for my personal use). Those drives both failed because of physical shock. One was due to my son, then less than two, slamming into my computer tower, and the already 4 year old 40MB (!) WD starting clicking trying to retrieve some things where the head had crashed. The other was a silent expiration of a 30GB WD drive about 4 years ago, after a cat had done something similar to a computer tower (small tower, large cat).

    Obviously, not everyone’s experiences mirror mine, but hard drives for me have been very reliable, and flash based drives, not so much.

  • http://wp3.lockergnome.com/nexus/blade/ Ron Schenone

    Thanks Marc for the explanation and great points as well.

  • Ryan Farmer

    If NTFS performs well on an SSD, it’s not because Microsoft did anything special, it’s because the people making the SSDs knew that most filesystems have been written with a hard drive in mind and have taken special steps to correct for that. (It’s not any different than using ext2 or ext3 on Linux, which predate SSDs as well)

    You’re really not going to see performance take off until you format one of them with Btrfs (as soon as it’s stable!).

    (When I say existing file systems pretty much all corrected for, I mean in regards to things like wear leveling, which the SSD will do by itself if the file system isn’t aware.)

    Microsoft is patting themselves on the back for a 20 year old file system that’s being worked around by the logic controller in the drive. It’s everything I’ve come to expect.

  • http://www.-.com הברית החדשה

    wow! very interesting!

  • http://www.perivision.net/wordpress Christopher

    I’ve put 2 SSD’s in an old HP1100 tablet and my thinkpad x61 tablet and put win7 on both. The performance uptick and extended battery life was noticeable right off the bat. They are both 40g drives which in conjunction with external HD’s supports all the space I need.

  • http://wp3.lockergnome.com/nexus/blade/ Ron Schenone

    Thanks Christopher for sharing your experience with us. It is appreciated.

    Regards, Ron

  • Richie

    I recently bought a new PC custom built for me and i spent a considerable amount on it (£2,500) as i like a new PC to last me for a decent amount of time.
    I researched every component thoroughly and the one that gave me the biggest headache was whether to get a SDD for my OS drive.
    When i say a headache i should really say several migraines! The more i looked into them the more confused i became. Many people saying how fantastic they are and the great speeds they give and then there are others that have used them for a ‘decent’ amount of time and have found their speeds severely drop.
    In the end i was led by what i thought was a very good article that explained the downfalls of SSD’s at this current time.
    http://www.pcper.com/article.php?aid=669

    Also i am not a huge fan of having to update firmwares and doing complicated procedures to something ‘out of the box’
    and from what i understand looking at the great OCZ forum (which was the manufacturer of the SSD i was considering) these drives don’t come without their problems.

    After i weighed everything up i decided to go for a couple of WD Raptor drives in a raid config for windows. I am very happy for now and saved myself not only several £100 but also the extra headaches that come from being a guinea pig for such tech. That said i am looking forward to when SSD’s are not only more affordable but they are well tested and work out of the box as they should. When that day comes i will be 1st in line.

    Good article Ron with plenty to talk about in this field.

  • http://wp3.lockergnome.com/nexus/blade/ Ron Schenone

    Hi Richie,
    Thank you fro sharing your experience with us. I agree. SSD are still in the testing stages and still pricey. Like yourself, I’ll be the first in line when they tested and work without issues.

    Regards, Ron