Macos – SSD Garbage Collection OS X

hfs+macmacosssd

Does the SandForce controller have garbage collection
and does it work with the HFS+ filesystem?

Does garbage collection
have a significant effect on new SSD controllers on OS's without
TRIM support (OS X)?

Best Answer

How does it know what blocks that are junk and which belongs to files without support from the filesystem?

I think this is an important question that nobody's really answered. The drive cannot know which blocks are valid and which blocks are valid without either understanding the filesystem being used or by getting additional information (e.g. from TRIM).

Our conventional understanding of garbage collection is that blocks that partially contain invalid data are consolidated to free up entire blocks* that can be written quickly (without having to read existing valid data and writing back with the new data). Without knowing which blocks are valid and which blocks are invalid, this process cannot occur.

AnandTech speculates a bit on this:

It either works by looking at the data on the drive and organizing it into a less fragmented state, or by looking at the file system on the drive and attempting to TRIM based on what it finds. Both Indilinx and Samsung have attempted to implement this sort of idle garbage collection and it appears they do it in different ways. While the end result is the same, how they get there determines the usefulness of this feature.

In the first scenario, this is not simply TRIMing the contents of the drive, the drive doesn’t know what to TRIM; it must still keep track of all data. Instead, the drive is re-organizing its data to maximize performance.

The second scenario requires a compatible file system (allegedly NTFS for the Samsung drives) and then the data is actually TRIMed as it would be with the TRIM instruction.

We already discussed the second scenario, which probably does not work for HFS+. The first scenario is more puzzling to me, and I have not been able to locate any good information about how it works, or how effective it is on HFS+.

Related Question