Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

winterspan

macrumors 65816
Original poster
Jun 12, 2007
1,008
0
For the unaware, a great explanation of TRIM is offered by Anandtech.com here:
http://www.anandtech.com/storage/showdoc.aspx?i=3531&p=10

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:
"There’s a command you may have heard of called TRIM. The command [requires] proper OS and drive support, but with it you could effectively let the OS tell the SSD to wipe invalid pages before they are overwritten. The process works like this:

First, a TRIM-supporting OS (e.g. Windows 7 will support TRIM at some point) queries the hard drive for its rotational speed. If the drive responds by saying 0, the OS knows it’s a SSD and turns off features like defrag. It also enables the use of the TRIM command.

When you delete a file, the OS sends a trim command for the LBAs covered by the file to the SSD controller. The controller will then copy the block to cache, wipe the deleted pages, and write the new block with freshly cleaned pages to the drive.

Now when you go to write a file to that block you’ve got empty pages to write to and your write performance will be closer to what it should be. "

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?
 

winterspan

macrumors 65816
Original poster
Jun 12, 2007
1,008
0
It probably will not. TRIM will only delay the inevitable.

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

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?

Yes, it has already been verified. Google it..
 

winterspan

macrumors 65816
Original poster
Jun 12, 2007
1,008
0
is there a list of ssd's that currently support the TRIM command?

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.
 

fpnc

macrumors 68000
Oct 30, 2002
1,979
134
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.
 

bolen

macrumors 6502
Jul 22, 2008
351
0
Sweden
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.

Unfortunately I think that you're correct here. I would love to see the TRIM support in SL though..
 

RealEvil

macrumors 6502
Aug 5, 2007
333
23
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...
 

ocztony

macrumors newbie
Jul 6, 2009
11
0
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...


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.
 

MikhailT

macrumors 601
Nov 12, 2007
4,582
1,325
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.

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...

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.
 

nuckinfutz

macrumors 603
Jul 3, 2002
5,539
406
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.
 

Deutschländer

macrumors newbie
Jul 13, 2009
1
0
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.
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.
 

MikhailT

macrumors 601
Nov 12, 2007
4,582
1,325
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.

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.
 

MikhailT

macrumors 601
Nov 12, 2007
4,582
1,325
couldn't TRIM also be done from the software level as opposed to actual hardware firmware level?

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).
 

raymondu999

macrumors 65816
Feb 11, 2008
1,009
1
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?
 

MikhailT

macrumors 601
Nov 12, 2007
4,582
1,325
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?

"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.
 

raymondu999

macrumors 65816
Feb 11, 2008
1,009
1
what I meant is, if the SSD doesn't understand TRIM, can the filesystem step in and substitute for the function?
 

MikhailT

macrumors 601
Nov 12, 2007
4,582
1,325
what I meant is, if the SSD doesn't understand TRIM, can the filesystem step in and substitute for the function?

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.
 

RealEvil

macrumors 6502
Aug 5, 2007
333
23
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.

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.