Does Snow Leopard support the *critical* SSD "TRIM" command?

Discussion in 'MacBook Pro' started by winterspan, Jul 12, 2009.

  1. winterspan macrumors 65816

    Jun 12, 2007
    For the unaware, a great explanation of TRIM is offered by here:

    Basically, how I understand it is that one of the issues with modern MLC SSDs right now is that they can slow down over time as the drive is used.

    This phenomenon is caused by the fact that MLC NAND flash cells have to be erased before they can be written to. For a cell that is not storing data (e.g. it is fresh from a format), data can be written directly to it with no problem. If the cell has previously been written to and the data it currently stores needs to be updated or overwritten, it has to be erased first. This erasure process consumes far more time than a regular write operation to an empty cell. Over time, after all of the cells have been used, every subsequent data write needs to have an erase operation proceed it.

    The main problem in this issue is that current operating systems like Windows XP/Vista and OSX 10.5 Leopard and their file systems are created with traditional hard drives in mind.

    When you delete a file on your computer, the actual data is not erased (this is how special utilities recover your 'deleted' data). The file system just "forgets" that the file exists and marks that specific location on the disk as unused. Critically, it does NOT tell the hard drive to physically erase the data that is stored at the now deleted file's physical location. At some point in the future, that storage location will be overwritten with new data when a new file is created in it's place. But until that time comes, that specific storage block remains written to. This process is employed because storage cells in traditional hard drives do not have to be erased before they can be written to again.

    You should now understand the problem that occurs with SSDs: when a user deletes a file, the flash memory cells that were holding the data to that file are not being erased and therefore remain in a "written" state. Later on, when a new file is stored in that same location, the memory cells have to first be "wiped clean" before the new data can be written, and this erase process significantly slows down the whole operation. This results in a slowdown of an SSD drive over time as all of its memory cells are used.

    // Note: This should not deter you from buying an SSD. SSDs still provide the most dramatic increase in everyday performance of any upgrade. Far more than even a 1000Mhz boost in processor speed or a bunch more RAM. This issue is not a crippling problem and most heavily-used SSDs will still far outpace a traditional harddrive, but everyone wants the best performance. As far as I've read, we are talking about a 20-30% reduction in speed at most, and this ONLY affects the write speed, whereas random read speed is the predominant factor in providing the major boost to system performance for most users.

    Currently, some of the leading SSD manufacturers provide a software utility that, when run, goes through the entire drive and erases the unused cells that are no longer needed by the file system. Even though you can setup a simple script to run this utility intermittently, it is still basically a manual process, and definitely a stop-gap until proper support for SSDs is added at the operating system / file system level.

    A new SSD command, called "TRIM", was designed explicitly for mitigating this problem.

    From Anandtech:
    Since that article, it has been confirmed that Microsoft's Windows 7 will provide TRIM support, and I'm sure it will readily be integrated into popular Linux distributions like Ubuntu, RedHat, etc.

    The only question left is will OS 10.6 Snow Leopard support TRIM? Hopefully, the fact that you can buy Mac laptops with SSDs right from Apple means that they will do everything they can to provide OS optimization for SSDs, and TRIM should be a big part of it.

    Does anyone have information about TRIM being implemented in Snow Leopard?
  2. vant macrumors 65816

    Jul 1, 2009
    It probably will not. TRIM will only delay the inevitable.
  3. bbadalucco macrumors 6502

    Jan 4, 2009
    So are you saying we shouldn't worry about TRIM??? I think most people who know much about SSDs would argue that.

    Will Windows 7 support it?
  4. winterspan thread starter macrumors 65816

    Jun 12, 2007
    "delay the inevitable." What inevitable? Your response doesn't make sense at all. Can you please elaborate?

    Yes, it has already been verified. Google it..
  5. bbadalucco macrumors 6502

    Jan 4, 2009
    I was trying to make the point that I hope SL will because W7 will. Thanks though.
  6. nard macrumors newbie

    Jun 26, 2009
    is there a list of ssd's that currently support the TRIM command?
  7. winterspan thread starter macrumors 65816

    Jun 12, 2007
    Not that I know of, but I know for a fact that OCZ provides a utility for their SSDs like the Vertex that does the same thing as TRIM, but you have to run it manually.

    Once Windows 7 is out and TRIM is supported natively, I'd assume that most SSD manufacturers would issue firmware updates.
  8. raymondu999 macrumors 65816

    Feb 11, 2008
    a bit off-topic here, but shouldn't this more appropriately be in the "Mac OS X" forum?
  9. fpnc macrumors 68000

    Oct 30, 2002
    San Diego, CA
    If I had to guess I'd say that the TRIM command will NOT be in Snow Leopard. IMO, this isn't the type of technology that Apple will likely be the first (or even early) to support.
  10. bolen macrumors 6502


    Jul 22, 2008
    Unfortunately I think that you're correct here. I would love to see the TRIM support in SL though..
  11. RealEvil macrumors 6502

    Aug 5, 2007
    Somebody *please* correct me if I am wrong but I think OSX users might be screwed right now.

    According to the latest PC Perspective podcast, all 'TRIM' utilities - e.g. wiper.exe and the the inbuilt trimming which Samsung controlled SSDs have they all ONLY work with NTFS or (AFAIK FAT 32).

    I am not totally sure about Intel's...
  12. Frosties macrumors 6502a


    Jun 12, 2009
    That sound a bit funny to me as Trim also is in development for Linux. intel likes to give Linux support so don't see why BSD i.e OSX wouldn't get Trim. An interesting blog article about Should Filesystems Be Optimized for SSD’s?
  13. ocztony macrumors newbie

    Jul 6, 2009

    Vertex and Agility have Idle time garbage collection also, it was built into FW1.30 and is called Nand Launderer by Indilinx. Samsung based drives have it with FW18C moving forward, if you have 1801 on yer drive it looks like you have not. Note Samsung control the dice on this one, all vendors selling their drives have no say over FW at this time.
  14. MikhailT macrumors 601

    Nov 12, 2007
    Nobody except for Apple knows if TRIM is supported in SL. Most likely it is not, since SSD and TRIM are too immature for Apple to include right now in a major release like 10.6. They may add support in a minor update or next major version. 10.7 is more likely as SSD technology will continue to grow at faster rate with cheaper, larger and faster drives.

    As for current SSDs, all Indilinx SSD devices can do TRIM naively with a firmware update easily and Intel is likely to add TRIM support via firmware update as well.

    W7 is definitely supporting TRIM command, Linux will support it once TRIM gets out of the experimental status which is likely to be in within a year.

    I think 10.7 may come with a new file system or a new version of HFS+ which is most likely to focus on SSD improvements as well.

    Nothing to worry about. Those TRIM utilities are not how it is suppose to work, those are just hacks right now to get TRIM working on unsupported file systems like the Pre-W7 OS including Vista and XP. Linux can add it anytime the TRIM command is ready to be migrated to the kernel.

    The real native TRIM command does not require the tool, just the file system support.
  15. nuckinfutz macrumors 603


    Jul 3, 2002
    Middle Earth
    I'm guessing a 10.6.x update will bring TRIM.

    SSD still aren't close to becoming mainstream yet and until they do I doubt Apple's going to be beta testing TRIM on people's production drives.
  16. Deutschländer macrumors newbie

    Jul 13, 2009
    Sure, but Apple is offering solid state drives since the release of the MacBook Air, so I think it would just be consequent to implement support for TRIM as fast as possible (at least for the drives they offer by themselves).

    What I was wondering about is: if I run a tool like OCZ wiper.exe to handle the TRIM issue on a BootCamp partition running Windows 7, will then the entire disk will be affected or only the Windows partition?

    If so it would be an acceptable compromise to me because I want Windows 7 to install separately and not running it virtual anyway.

    Thanks and best regards from old Europe.
  17. MikhailT macrumors 601

    Nov 12, 2007
    None of the Apple supplied SSDs support TRIM anyway, it wouldn't matter.

    As for TRIM on Bootcamp, it would only work on memory cells that was used by that Windows partition. It will not work throughout the whole drive at all.
  18. raymondu999 macrumors 65816

    Feb 11, 2008
    couldn't TRIM also be done from the software level as opposed to actual hardware firmware level?
  19. MikhailT macrumors 601

    Nov 12, 2007
    What are you asking, exactly?

    You seem to not understand what TRIM is for, it is to help the SSDs recover the initial performance speed by resetting the memory cells back to fresh state (this is the simplified way to explain). TRIM is a command from the file system that tells the SSD's controller which logical data blocks has been deleted, so that the controllers can reset those memory cells that was used up by those deleted blocks. Without the help of the file system, the SSD's controller has no way of knowing which data has been deleted.

    Data is data, even deleted data is still data to the controllers, no way of knowing the difference between them.

    TRIM requires cooperation from both end of the channel, meaning the file systems and the controllers (in RAID setups, the RAID controllers themselves must support TRIM also).
  20. raymondu999 macrumors 65816

    Feb 11, 2008
    as in, does it have to be reset by the controller? Couldn't the file system reset the cell, or erase it in prep for future use?
  21. MikhailT macrumors 601

    Nov 12, 2007
    "Erase it in prep" is TRIM, basically. You still need TRIM support in the file system AND in the SSDs, they have to understand what TRIM command means.
  22. raymondu999 macrumors 65816

    Feb 11, 2008
    what I meant is, if the SSD doesn't understand TRIM, can the filesystem step in and substitute for the function?
  23. MikhailT macrumors 601

    Nov 12, 2007
    No. The hardware has to understand the logic and that requires the firmware to know what the file system is trying to do. The file system can emulate TRIM all it wants, the hardware will simply ignore it since it has no logic to follow through with.
  24. raymondu999 macrumors 65816

    Feb 11, 2008
  25. RealEvil macrumors 6502

    Aug 5, 2007
    I will say it again - the latest PC Per podcast stated that the 'garbage collection' done by the Samsung (and I think Indilinx) controllers ONLY work for Windows based file systems. I could you have misheard but I dont think I did. This means there are no TRIM exes, and no in built protection against slow down.

    I hope this is not correct.

Share This Page