3

I'm in early investigation stages of adding a SSD drive to my Mac Pro. I'd like to configure the drive's active garbage collection to work with OS X, since it can help improve performance. There are a couple answers to this problem:

  1. TRIM - which is out because Apple has seen fit to disable it on non-Apple drives. I don't care to argue whether Apple did this out of greed or over-cautious technical concerns. I'm not wild about hacking a kext to allow code that wasn't tested against my drive model to stand between my data and non-volatile storage.

  2. Drive-based Garbage Collection (GC) - some drives are quite good at this given adequate over-provisioned scratch space.

Given that Apple disabled TRIM support for third-party drives, is there a way I can manually configure the over-provisioning on a drive? Is it as simple as partitioning the disk and leaving a portion of the disk unallocated? Is a specific partition table type required?

Solutions ranging from Disk Utility to fdisk are acceptable.

I can also be convinced that it's not necessary, but I'm still interested in the technical "how-to" of allocating extra over-provisioned space.

3 Answers 3

1

As a followup, I updated my 2011 MacBook Pro (not my Mac Pro) using an aftermarket SSD in December of 2014.

Drive Selection

Balancing budget vs performance vs reputation, I chose a Crucial M500 480GB — not a known high-performer, but with a decent reputation for reliability. I’m not sure the power loss protection capacitors are needed in a laptop, but I liked having them. It has on-drive garbage collection and TRIM support. The drive internally has 32GB of over-provisioning.

Drive Installation

I installed the drive as a direct replacement to the internal spinning disk.

I did NOT allocate any additional over-provisioning using partitions.

I did NOT install any TRIM-enabling hacks.

Drive Usage

The machine is used primarily for OS X/iOS development so there’s a large amount of churn on the disk of varying sized files as compiled object files, podcasts, training videos, etc are downloaded or created, used and deleted. Disk space usage ranges between 25-50%.

The difference in performance against the stock 7200RPM 750GB was pretty striking. I have misplaced my measurements so I can’t be precise in the comparison. “Striking” will have to do.

Performance

After 6 months of churning, performance still looks very good.

Tests using Blackmagic Disk Speed Test show a nearly identical read performance (-0.8%) and a very small decrease in write performance (-2.4%). Some of this could be partially attributed to variability that comes with real-world testing, but I'm pleased that I've experienced only negligible performance impact due to the inability to turn TRIM on for the drive.

Currently, I'm seeing 470MB/s read and 393MB/s write performance and using 26% of the drive. We’ll see how it holds up over the coming months.

Addendum:

As of OS X 10.10.4, Apple seems to have rendered this point moot. Yay!

http://arstechnica.com/apple/2015/06/latest-os-x-update-allows-you-to-enable-trim-for-third-party-ssds/

Addendum 2:

Some drives are known to have TRIM bugs which may have serious implications. This includes:

  • "Micron_M500*"
  • "Crucial_CTM500"
  • "Micron_M5[15]0*"
  • "Crucial_CTM550"
  • "Crucial_CTMX100"
  • "Samsung SSD 8*"
  • Sandforce drives such as OWC Electra

I personally am holding off on enabling until I can confirm firmware updates will address the vulnerability.

Addendum 3:

I found this little jewel for folks that still haven't enabled TRIM and are seeing performance issues on the Crucial drives.

If TRIM is present it will handle this background cleanup, but if for any reason TRIM can't reach the SSD, Active Garbage Collection is there to take care of the drive.

[...], you may simply need to force Active Garbage Collection to run on the drive by powering the SSD on and leaving it idle for 6 to 8 hours. After that, your drive’s functionality and performance should be restored.

Follow these steps to trigger Active Garbage Collection on your Crucial SSD:

[PC instructions]

On a Mac, press the Options key while powering on to enter the Startup Manager screen. Leaving the Mac on that screen provides the SSD with power but keeps it in an idle state so Garbage Collection can function, just like the BIOS screen on a Windows laptop.

Crucial Forums: My SSD used to be so much faster...

Furthermore, if you disable "Put the hard disk(s) to sleep when possible", the drives will have an opportunity to do Active Garbage Collection during idle periods.

Addendum 4:

A wonderfully educational article on arstechnica answers the original question of how to over-provision an SSD on OSX.

It's also possible to emulate the beneficial effects of over-provisioning by simply using less than the stated capacity of an SSD—for example, by purchasing a 90GB SSD, creating a 30GB partition, and leaving the rest unallocated. The controller itself doesn't care about the logical constructs built by the operating system—it will happily continue to write to new fresh pages as long as they're available.

Solid State Revolution

0

Dedicating available space to the SSD's controller for wear-leveling works by just leaving those blocks marked unused. Normally the operating won't write to blocks that aren't part of a partition, so just leaving some space unpartitioned or allocated to a partition marked as reserved should do the trick. If the drive has been used before, a TRIM command must be run on the affected blocks once to declare them free. However, you don't have to modify a kernel extension to enable TRIM on any third-party drive. Simply running sudo trimforce enable from a terminal will do. That way you always have the full capacity of your drive available while keeping all the free space available to controller to work with.

1
  • It's also worth noting that many drives include significant amounts of non-user-accessible NAND that's used for things like TRIM, garbage collection, wear leveling, and as an SLC cache. This is (part of) why you'll often see "480 GB" drives: they're 512 GB drives with 32 GB of additional space, reserved for the drive controller's use. Generally, it's not strictly necessary to overprovision further on these drives; if you want to maintain maximum performance, just keep a bit of free space around.
    – JMY1000
    Dec 2, 2023 at 22:16
0

Funny after all this time no one pointed out the premise is flawed. "Fragmentation problems can lead to serious performance problems on an SSD".

  1. Fragmentation causes a performance penalty on spinning media because of the physical relocation of the drive heads. On an SSD there is no benefit for contiguous files, and no performance penalty for fragmentation. Quite the opposite inn fact...

  2. An SSD is deigned to INTENTIONALLY fragment files. This fragmentation, known as "wear leveling", prevents wear and extends the life of the drive.

1
  • You're correct about fragmentation being effectively a non-issue on SSDs, and the original question is confusing in that regard. However, most of the OP's question is actually focused on a different issue: garbage collection, which is important on an SSD, since NAND cells must be zero'd before they can be written to.
    – JMY1000
    Dec 2, 2023 at 22:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .