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

BRyken

macrumors 6502
Jul 17, 2008
266
0
My understanding is that Apple's goal is to use the SSD for as much data as it can handle. The way Ars describes, you're using the HDD to augment the capacity of the SSD, as opposed to standard caching, which uses the SSD to augment the speed of the HDD.

Jury is still out on some of the technical details, but generally speaking, writes always go to the SSD first. It will keep writing to the SSD until it is "full". I know that at least 4GB is reserved for a write cache on a 128GB drive. This may be a fluid amount based on the size of the SSD, I'm not sure. I also don't know if any other space is held back for any reason.

Once the write cache is filled, if you're still writing data, it will seamlessly spill over onto the HDD. Over time, the OS will determine what data would benefit from being "promoted" to the SSD, and what data can be demoted, and uses idle time to rearrange the data.

This should speak quite a bit to the kind of SSD (and controller) you should get. If the OCZ drives suffer from degraded performance when they are only 50% full, I would highly suggest not using that kind of drive in a Fusion setup. (I also wouldn't recommend that kind of drive at all, because that's a ludicrous limitation to have on any storage device.) Again, philosophy matters here. Your primary storage is always the SSD, and all writes will go to the SSD, so write speed is going to be a very important stat. Likewise, most data will be read from the SSD first.

That said, I'm using a relatively low performing drive (Crucial M4) compared to some on the market, but it was cheap, and still a massive performance boost compared to the stock 5400RPM drive, so even a mid-quality drive should yield positive results.

As to your other questions, TRIM and garbage collection are two sides of the same coin. In most cases, the firmware of the SSD will take care of those issues. In my case, the Crucial M4 really needs to have TRIM enabled, so I ran the TRIM Enabler at Groths, and that did the trick. Garbage collection is handled by OS X, as far as I'm aware. Generally speaking, though, the lifespan on these drives will likely outstrip the useful life of the computer itself, so I wouldn't stress this too much. Find out if your drive needs the TRIM Enabler (a Google search should do it), and after that, you'll just need to trust things are working as they're supposed to.

Thanks for this.
 

motrek

macrumors 68030
Sep 14, 2012
2,613
305
I have been an avid user of SuperDuper for a while. You have basically described my plan for this Mac Mini so we are on the same page. I am still not decided on whether to enable TRIM on this machine since the SSD will be Sandforce based and there seemed to be some beachball problems reported. Although it is not clear to me if those Sandforce issues were early in the development of Trim Enabler when it was copying an older kext rather than modifying the existing (which is how it does it now). Given that my SSD will probably only be about 25-30GB used out of 120GB TRIM is probably not required anyway.

Oh I think you're misunderstanding what TRIM does. Without TRIM, even if you only have 1GB of files on your drive, the controller will still consider the drive full if you've written 120GB of data to the drive over its lifetime (pretty easy to do). So just because you will only have 30GB of files on your drive doesn't mean you don't need TRIM. TRIM allows the OS to communicate to the drive which blocks are actually being used by files, vs. which blocks are not being used (basically deleted files). Then the drive can erase the blocks that aren't in use, so any data written to the drive can be done quickly because there's no need to erase the already-erased blocks.

So anyway, TRIM is important and useful. EXCEPT when you have a drive that's overprovisioned. For example, the 120GB drive it sounds like you're going to buy. That drive probably actually has 128GB of storage but keeps 8 of those GB erased, so you can always write to it at optimal speed (unless you're writing more than 8GB at once, which would be unusual for most people).

So I would say that if you're getting a 120GB drive then don't worry about TRIM and kexts and whatnot. Not worth the trouble. Just enjoy fast writes to your overprovisioned drive. :)
 

ibizan

macrumors newbie
Nov 1, 2012
21
0
So anyway, TRIM is important and useful. EXCEPT when you have a drive that's overprovisioned. For example, the 120GB drive it sounds like you're going to buy. That drive probably actually has 128GB of storage but keeps 8 of those GB erased, so you can always write to it at optimal speed (unless you're writing more than 8GB at once, which would be unusual for most people).

So I would say that if you're getting a 120GB drive then don't worry about TRIM and kexts and whatnot. Not worth the trouble. Just enjoy fast writes to your overprovisioned drive. :)

That's interesting—I have an Intel 520 480GB—is it safe to assume that the SSD actually has 512GB of storage with about 30GB over-provisioned, and doesn't need the TRIM function activated with TRIM Enabler? Or should I turn on TRIM anyway?
 

motrek

macrumors 68030
Sep 14, 2012
2,613
305
That's interesting—I have an Intel 520 480GB—is it safe to assume that the SSD actually has 512GB of storage with about 30GB over-provisioned, and doesn't need the TRIM function activated with TRIM Enabler? Or should I turn on TRIM anyway?

I can't say with 100% certainty. I suppose it's possible that these drives are sold with a faulty (and therefore disabled) 32GB chip, or they have a chip dedicated only to shoring up storage capacity when blocks go bad. MAYBE the space where the "missing" flash chip would go on the circuit board is taken up by the controller chip and cache.

But I think it's much more likely with these drives that don't have a power-of-two storage capacity that they really do have a bunch of free space for compensating for bad blocks AND for keeping erased and available for writes.

Personally I bought a 120GB drive with this rationale and haven't noticed any slowdown after using it for 1-2 years. Enabling TRIM on these drives seems hacky to me and I have zero interest in trying to do it when the drive seems to be working well.
 

Dadioh

macrumors 65816
Original poster
Feb 3, 2010
1,123
36
Canada Eh?
Oh I think you're misunderstanding what TRIM does. Without TRIM, even if you only have 1GB of files on your drive, the controller will still consider the drive full if you've written 120GB of data to the drive over its lifetime (pretty easy to do). So just because you will only have 30GB of files on your drive doesn't mean you don't need TRIM. TRIM allows the OS to communicate to the drive which blocks are actually being used by files, vs. which blocks are not being used (basically deleted files). Then the drive can erase the blocks that aren't in use, so any data written to the drive can be done quickly because there's no need to erase the already-erased blocks.

So anyway, TRIM is important and useful. EXCEPT when you have a drive that's overprovisioned. For example, the 120GB drive it sounds like you're going to buy. That drive probably actually has 128GB of storage but keeps 8 of those GB erased, so you can always write to it at optimal speed (unless you're writing more than 8GB at once, which would be unusual for most people).

So I would say that if you're getting a 120GB drive then don't worry about TRIM and kexts and whatnot. Not worth the trouble. Just enjoy fast writes to your overprovisioned drive. :)

Thanks. I guess I was assuming that if there was lots of free space then the ssd would have less chance of running into partially filled blocks which is where it gets into the slow down since it has to go through that extra erase cycle. Anyway, I was in the process of ordering a Kingston V+200 120gb sandforce based drive but the online store stalled 6 days and then said they were out of stock. So I cancelled the order and I am glad I did. Newegg just had the intel 330 180gb on sale here in Canada for $104 with free shipping. Snagged one of those. I paid $150 a month ago for the same drive which is now in my wife's imac 27.

So I am thinking I will not bother with trim enabler and I will probably keep the ssd and HDD separate in the Mac mini. Cheers.
 

ibizan

macrumors newbie
Nov 1, 2012
21
0
TRIM Enabler is problematic. Try Grant Parnells method.
http://digitaldj.net/2011/07/21/trim-enabler-for-lion/

Thanks for this link, enlightening.

I noticed Grant Pannell's post was from July 2011 and references the inadequacies of TRIM Enabler 1.1 and 1.2. He also mentioned that Oskar Groth was aware of the problem and had plans to integrate the fix into a future update of his software. Fast forward 1.5 years, TRIM Enabler is now at version 2.2—do you have any idea whether Groth's application now makes a duplicate of the kernel extension (i.e. does it integrate Pannell's original recommendation of patching vs. replacing)?
 

motrek

macrumors 68030
Sep 14, 2012
2,613
305
You need an SSD with a good Garbage Collection routine, TRIM and is over-provisioned. Over provisioning DOES NOT make up for the lack of TRIM support.
...

Sure it does. The whole point of TRIM is for the drive to be able to pre-erase unused blocks so they can be written to faster. If the drive is overprovisioned, then by definition it has a bunch of blocks it knows are unused and thus can pre-erase.

The end result is the same.

The only difference how many blocks are erased. Let's say you're only using half of a 120GB drive, assuming 8GB overprovisioning. With TRIM you'll have 68GB per-erased, whereas relying on overprovisioning alone you'll "only" have 8GB erased. That means you will see a performance difference if you write more than 8GB to the drive all at once... I think we can all agree that for most people that's a pretty uncommon operation.
 

MatthewAMEL

macrumors 6502
Oct 23, 2007
380
13
Orlando, FL
Sure it does. The whole point of TRIM is for the drive to be able to pre-erase unused blocks so they can be written to faster. If the drive is overprovisioned, then by definition it has a bunch of blocks it knows are unused and thus can pre-erase.

The end result is the same.

The only difference how many blocks are erased. Let's say you're only using half of a 120GB drive, assuming 8GB overprovisioning. With TRIM you'll have 68GB per-erased, whereas relying on overprovisioning alone you'll "only" have 8GB erased. That means you will see a performance difference if you write more than 8GB to the drive all at once... I think we can all agree that for most people that's a pretty uncommon operation.

Well, that's not how I understood it.

The over-provisioned space isn't reported to the OS, so it's never written to as a result of an OS request. Over-provisioned space isn't static, but a changeable beast that is spread out over the SSD and migrates as the various cleanup routines run.

Over-provisioning is a function of wear-leveling. Making sure the SSD doesn't constantly write to the same cells until they wear out (write amplification).
http://en.wikipedia.org/wiki/Write_amplification#Over-provisioning

TRIM is how the OS tells the drive 'i'm done with that file'

Garbage Collection is how the SSD resets deleted blocks to a ready state.
 

motrek

macrumors 68030
Sep 14, 2012
2,613
305
Well, that's not how I understood it.

The over-provisioned space isn't reported to the OS, so it's never written to as a result of an OS request. Over-provisioned space isn't static, but a changeable beast that is spread out over the SSD and migrates as the various cleanup routines run.

...

When you have overprovisioned space, you're exactly right, the OS will never write to that space (the blocks between 120GB and 128GB if you have a "120GB" drive).

Thus, the SSD controller can keep these unused blocks erased and they can be written to at optimal speed.

So when the OS says "write data X to block Y" then the SSD can write the data to an already-erased block and then remap the blocks so the OLD block (containing the old data) can now be erased and the data in the new block can be used in its place.

Thus, overprovisioning accomplishes the same thing as TRIM, i.e., making sure there are a bunch of erased blocks in your SSD so you can write to it quickly.
 

Maltz

macrumors member
Mar 31, 2011
60
5
Thanks for this link, enlightening.

I noticed Grant Pannell's post was from July 2011 and references the inadequacies of TRIM Enabler 1.1 and 1.2. He also mentioned that Oskar Groth was aware of the problem and had plans to integrate the fix into a future update of his software. Fast forward 1.5 years, TRIM Enabler is now at version 2.2—do you have any idea whether Groth's application now makes a duplicate of the kernel extension (i.e. does it integrate Pannell's original recommendation of patching vs. replacing)?

Current versions of TRIM Enabler (2.x) no longer replace the existing kernel extension with an older version. They patch the existing one in-place.

----------

When you have overprovisioned space, you're exactly right, the OS will never write to that space (the blocks between 120GB and 128GB if you have a "120GB" drive).

Thus, the SSD controller can keep these unused blocks erased and they can be written to at optimal speed.

So when the OS says "write data X to block Y" then the SSD can write the data to an already-erased block and then remap the blocks so the OLD block (containing the old data) can now be erased and the data in the new block can be used in its place.

Thus, overprovisioning accomplishes the same thing as TRIM, i.e., making sure there are a bunch of erased blocks in your SSD so you can write to it quickly.

That's all correct, but having more free space than just the over-provisioning does significantly affect performance.

http://www.anandtech.com/show/6489/playing-with-op

And the TRIM command is how the OS tells the SSD what blocks are in use and what blocks are not. Without TRIM, the SSD doesn't know how much "free space" is really free and drive is keeping and wear-leveling a lot of data that isn't in use anymore. That wear-leveling of deleted data increases write amplification, too, which decreases the life of the drive.

TRIM is always important, and it really bothers me that Apple doesn't enable it for drives other than stock Apple SSDs. The only reason I can think of is to actively try to make other drives appear slower. Much like the lack of support for AHCI when you're in Bootcamp - it makes HD's perform much worse when you're booting a non-Mac OS X operating system.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.