How Does FileVault 2 Full Disk Encryption Affect SSD Garbage Collection

First off, SSD garbage collection and Trim are very different animals. Garbage collection is based on moving existing data, deleting stale data and creating empty blocks in which to write new data. The drive's understanding of the data is nothing more or less than data is there or it isn't. There is no concept of a file system in an SSD's controller. All writes are done at the block level rather than the page level and a block must be erased before it can be written. A drive's garbage collector knows nothing whatsoever about FileVault.

In basic garbage collection without Trim, when the OS deletes the file, it doesn't actually say anything to the controller about the data being stale and available for deletion. The OS merely tracks the address space. The drive will understand that the data is stale in that address if/as/when the OS gives the drive a write command for that address.

So, where Trim comes in is that when a file is deleted at the OS level, the controller on the drive is immediately given the information that the data at that particular address is stale. That enables the drive to handle its housekeeping as soon as convenient upon deletion. And that reduces write amplification.

The improvement of Trim on SSD performance is true even with SandForce. See:

http://forums.macrumors.com/attachment.php?attachmentid=345371&d=1340805193

The diagram clearly indicates that there is increased free space for garbage collection with Trim enabled even when using DuraWrite technology.

That out of the way, on to the meat of your question about FileVault 2: Because garbage collection occurs in the SSD without any knowledge of file systems, there is no difference to the SSD whether FV has been enabled or not. To the SSD, there is either valid data, stale data or no data at a particular address.

While whole-disk encryption gives the impression that the data is locked inside a suitcase. That isn't the case. FV2 is scrambling the bits being stored in the pages and blocks. The file allocation and structure of the file system itself remains the same whether FV2 is used or not. And this helps explain why a user can continue to use their system even when a disk is being encrypted or decrypted.

So, in summary, Trim is an enhancement to garbage collection and should be enabled regardless of the controller in use. FileVault 2 will not cause problems for SSDs and users can expect normal write amplification, performance degradation, etc. over time for FV2-encrypted SSDs versus non-encrypted SSDs of the same make on the same system with equivalent use. FV2 volumes will benefit from the use of Trim just as much as non-FV2 volumes.

My system: Early-2008 MacBook4,1; OS X Lion 10.7.5; Crucial M500 960GB SSD; FV2 encrypted; Trim enabled

Useful links for further reading:

http://blog.macsales.com/11051-to-trim-or-not-to-trim-owc-has-the-answer

Does FileVault 2 interfere with TRIM when using an SSD?

https://discussions.apple.com/thread/3202467?tstart=0

https://superuser.com/questions/315803/how-do-i-resize-a-filevault-2-encrypted-partition (not necessarily 100% related, but still interesting and relevant)