I just purchased an SSD ! What is TRIM ? Do I need it ?

Discussion in 'MacBook Pro' started by hamiltonDSi, Apr 17, 2013.

  1. hamiltonDSi macrumors 65832

    hamiltonDSi

    Joined:
    Jul 29, 2012
    Location:
    Romania
    #1
    Hello,

    Tomorrow morning my first SSD wil arrive and I am going to put in in my 13" Late 2011 Macbook Pro.

    I read that if I am going to install OS X on an SSD I need a app called Trim Enabler (or smth like that) because Apple only supports TRIM on the SSDs they sell.

    I have 3 questions :

    1. What is TRIM ?
    2. What happens if I don't install TRIM Enabler ?
    3. Do I need it ?

    Oh, and I read somewhere that some SSDs come with TRIM enabled (like some HDDs come with sudden motion sensor) and I don't need to enable it in OS X.
    My SSD is a Flash SSD Kingston V300 2.5", 120GB, SATA 3, does it comes with TRIM enabled or do I need to enable it in OS X ?
    Also, this SSD has a 5 star rating...is it that good ? does it make your battery life better ?

    Thank you !
     
  2. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #2
  3. hamiltonDSi thread starter macrumors 65832

    hamiltonDSi

    Joined:
    Jul 29, 2012
    Location:
    Romania
    #3
    Thank you, kind Sir !

    :)

    I am going to enable TRIM asap...
    Any thoughts about the SSD I purchased ?
     
  4. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #4
    a TRIM allows the operating system to inform the SSD that blocks are no linger considered in use. This allows the drive to mark them as such. If they don't the drive needs to execute 2 IO operations, one to wipe the data block and then second to write to the block.

    Then potentially the drive will slow down in time (if the drive in question doesn't have garbage collection which it internally handles the clearing of unused blocks)

    If your drive doesn't have garbage collection it would be better for the performance if you do enable though nothing bad will occur if you don't enable it. If your drive does have garbage collection then its better to not enable TRIM as it will compete with the drives garbage collection routines.
     
  5. hamiltonDSi thread starter macrumors 65832

    hamiltonDSi

    Joined:
    Jul 29, 2012
    Location:
    Romania
    #5
    Thank you !

    I went on kingston.com and I read about my SSD, it has garbage collection.
    " Flash recycling and garbage collection to maximize consistent performance over the life of the drive."
    So it's best that I do not enable TRIM ?
     
  6. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #6
    Many people have found that if you enable TRIM on drives with garbage collection (particularly those that use the sandforce controller) to actually degrade performance.

    If your drive has garbage collection then imo, there's no need to enable TRIM and you risk slowing the drive down.
     
  7. hamiltonDSi thread starter macrumors 65832

    hamiltonDSi

    Joined:
    Jul 29, 2012
    Location:
    Romania
    #7
    I see.
    Well, I'll give it a go half a year without TRIM enabled and see what happens.
    If it slows down I will enable it.
     
  8. Orlandoech macrumors 68040

    Orlandoech

    Joined:
    Jun 2, 2011
    Location:
    Salt Lake City, UT
  9. hamiltonDSi thread starter macrumors 65832

    hamiltonDSi

    Joined:
    Jul 29, 2012
    Location:
    Romania
    #9
    Thank you !
     
  10. dusk007 macrumors 68040

    dusk007

    Joined:
    Dec 5, 2009
    #10
    That is completely wrong.
    GC needs Trim to work properly. Otherwise you are eventually dealing with a drive that is permanently in a 100% filled state Minus spare area. Even if it looks to you as 80% empty.
    GC only consolidates data so whole pages don't have small empty parts in them which leads to really slow write performance, as it has to read the page or more write it in full somewhere else just to fit a bit of data in.
    Only with Trim does the drive actually know what data is deleted and can be considered deleted. GC without Trim only knows that data is not needed anymore when the OS tells it to write something over LBA 958 which already had data in it.
    Trim without garbage collection would do nothing as Trim is only the command that says what data is deleted but if there is no consolidation of pages at some point due to this data, well then nothing happens. Garbage collection without Trim is really inefficient and like using an SSD at 100% fill level which only turns out well if the drive has a huge spare area. Some of the early SSDs had big spare areas but more modern ones usually don't. The M4 has partically none. The Samsungs also have only single digit %. They rely on that they get Trim support from an OS nowadays.
     
  11. hamiltonDSi thread starter macrumors 65832

    hamiltonDSi

    Joined:
    Jul 29, 2012
    Location:
    Romania
    #11
    I enabled TRIM. I hope the SSD will work at it's full speed.
     

    Attached Files:

  12. peejack macrumors 6502a

    Joined:
    Aug 7, 2007
    #12
    So you do have to enable trim or not? Getting one of these next week and 50% say do 50% say don't.
     
  13. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #13
    Its not that TRIM lets you use the drive at full speed but rather avoid unnecessary IO operations to delete the SSD pages prior to a write cycle. Brand new SSDs won't have this issue since they're unused. TRIM allows continued performance, i.e., avoid performance degradation as time goes on.
     
  14. peejack macrumors 6502a

    Joined:
    Aug 7, 2007
    #14
    I emailed Samsung about this as there seems so many conflicting opinions and it seems even Samsung can't advise either way: :confused:

    ---

    thank you for your email.

    Unfortunately I'm not able to give you a very clear answer. Trim is OS based and Mac has not trim automatically enabled. We know that it exists a 3rd party software that allows you to enable Trim on Mac, but being a 3rd party we cannot take the responsability to suggest it to you.

    Reading on forums and hearing from our customer, this software has no problems and permets to keep the SSD healthy.

    Here below the link

    http://www.hardmac.com/news/2011/03/27/the-universal-solution-to-activate-trim

    Maybe you can contact Apple to check if they suggest it or not.

    On a Windows PC we suggests to enable Trim and if this is not possible like in Windows XP, we suggests to run from time to time the performance optimization (in Magician Tool, only Windows compatible). Unfortunately I cannot go further and the decision is up to you.

    For any other doubt, please feel free to contact me directly at xxx@hanaro.eu



    Kind Regards

    Samsung Memory Team

    SMA305
     
  15. peejack macrumors 6502a

    Joined:
    Aug 7, 2007
    #15
    Ok spoke to a technical advisor at Crucial just now and here is his take:

    CRUCIAL : TRIM is a Windows based feature and works best in a Windows machine. All of our drives have built in garbage collection which functions in the same way as TRIM does.

    ME: so enabling TRIM makes no effect on a Mac system? and not having it activate doesn't stop the garbage collector from working properly or shorten the life of the drive or slow speeds?

    CRUCIAL : It isn't advantageous to turn TRIM on in a MAC. It is best to run garbage collection. This has no material effect on the lifespan of your drive and will be fine.

    :D
     
  16. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #16
    I don't think you will get the clear answer you are looking for with this.

    Although I have yet to see anybody report they have lost data due to the TRIM "hack" with third party SSDs, a part of me is reluctant to hack system kext files. You will just have to read up on the pros/cons and decide for yourself.

    Let me just add this. Even if you do not enable TRIM all that will ever happen is the write speed of the SSD might slow down some over time. Your SSD will not be harmed by not having TRIM.

    So let's say you do not enable TRIM and you do some speed tests when the drive is new... then you do more speed tests in a few months and you see that write speeds have slowed measurably. If that occurs all you do is enable the TRIM hack and command-s key boot to single user mode then run the command "fsck -fy" (without the quotes). This will TRIM all unused space on the SSD and restore it back to like new performance. You can then either leave the TRIM hack enabled, or disable it again if you are more comfortable that way.

    Hope this helps with your decision.
     
  17. peejack macrumors 6502a

    Joined:
    Aug 7, 2007
    #17
    Thanks for the advice.

    I think for the time being at least i'm going to leave it as it and not Hack it for TRIM. I'm sure it will be just fine. :)
     
  18. dusk007 macrumors 68040

    dusk007

    Joined:
    Dec 5, 2009
    #18
    Since you are interested in Samsung.
    http://www.anandtech.com/show/6553/sandisk-ultra-plus-ssd-review-256gb/7

    Most support personal don't understand much more of the matter than people in forums like this one, unfortunately.
    If you want to understand the subject read stuff like on anandtech they had a few articles explaining in detail what GC and Trim does.

    Generally there are differences in SSDs and somethings that are always true.
    If there is enough space actually free than GC can do its magic well. You can rely on the firmware defined over provisioning or do it yourself by not partitioning a part of the drive. Old SSDs like from Sandforce started with 28% over provisioning. So even if you had it 100% filled with incompressible data it was only 2/3 full and overwriting LBAs works. Next they got down to 13% on consumer drives and is now at 7%. Curcial with the M4 is almost a 0%.
    What they mean by GC usually is just non real time GC. But GC simply cannot possibly know what it is allowed to collect until an LBA is overwritten or a Trim command marks an LBA as deleted.


    Put simple say you got 4 pages a 4 blocks (only to keep the example simple).
    Your performance eventually sucks if you have to many small writes into empty space that used to be deleted.
    -xx- -x-- xx-- xxx-
    All GC does is (ie. when the SSD starts hitting a 85% fill level) to combine blocks of data so it got more full empty blocks.
    xxxx ---- ---- xxxx
    That is really all it does. Works fine with enough free space used to be provided by over provisioning.
    Now if you have Trim and delete stuff the SSD knows that is deleted. It still needs to actually delete the data which it might not do right away.
    -ee- -x-- xx-- xxx-
    GC can go to work and do this when it feels like it.
    ---- ---- xx-- xxx-
    Without Trim you can delete all you want the SSD doesn't know. You add maybe more data but the OS doesn't write it into the same LBAs. Eventually the drive will be practically 100% full all the empty space being over provisioning.
    -xx- xxxx x-xx xxxx
    If you want to write some new data and over write some old.
    -xn- nnxx x-xx xxxx
    It needs to read the second block before it can write to it.
    kind of like
    read xxRR save it in memory.
    write nnxx write the extra n somewhere and mark the one as empty
    -xe- nnxx xnxx xxxx
    If there was Trim it could have just written in the empty first block because it already new maybe that that block is empty.
    -ee- xxxx x-xx xxxx
    write into the empty block
    nnn- eexx x-xx xxxx
    much faster.

    The thing is SSD don't write to specific locations. They have a big tree in memory where they can see where there are empty cells and where there aren't. With small writes you inevitable and up splattering data all over. GC just cleans that up but it will always be less efficient if there isn't enough space to work with.
    Most consumers write big files, often use Windows with Trim and thus drives like the M4, Samsung have practically no need for too much overprovisioning better to sell them as 256GB rather than 240. Intel is more conservative. Sandforce used to be too. Also Sandforce had once a firmware that was buggy with Trim but not anymore.
    So generally there will be enough free space or too few random sprinkled small files. If all you save is movies you just won't have a problem. Overwriting xxxx is just as fast whether it is empty or not. It is only slower if there is a bit of data in it that must not be overwritten because you can only write by deleting the whole block and next write stuff and if you need to not overwrite a part of it you need to read it first and write it elsewhere.
    Trim simply helps the whole process because you deal with a drive that is effectively only as filled up as it seems to you and as the OS reports. It doesn't matter how much over provisioning there is if you keep 20% free most of the time. Without Trim the drive may effectively be 95% filled even though it looks to you like a 40% full drive. But the performance is as if it was 95% full and not what it seems to you.

    I used an M4 for a while (3-4 months) without Trim and it suffered horribly. I got a pretty write heavy workload (get about 20GB a day for some reason on average) and would not recommend using that drive without Trim. The Samsung should be quite similar in how it operates.
    Sandforce has the benefit of compression as I believe the data cells not needed due to compressed data go effectively towards over provisioning. Small writes are quite often compressible. Sandforce simply stands a greater chance of being less filled than it should be.
    Intel is different as they do GC usually immediately after writes and still use quite a bit of spare area.

    This article explains the whole thing in more detail.
    http://www.anandtech.com/show/2829

    Trim doesn't hurt unless the firmware is broken and has a bug which none do nowadays. I would always enable it especially with Curcial/Toshiba/Samsung drives and Vertex 4
     
  19. A7ibaba macrumors regular

    A7ibaba

    Joined:
    Apr 19, 2012
    Location:
    Sweden
    #19
    TRIM is the software command from the OS to "tell" SSD which cells are free. Garbage collector is the same thing as TRIM except the same command is issued from the SSD drive firmware. So basically,SSD with GC takes care by himself of free cells. This is the hard fact and all others explanation are false.
     
  20. paul-n macrumors regular

    Joined:
    Jul 12, 2012
    #20
    You always have GC but with TRIM GC can work more efficient, because there is much more free space to work with. A SSD without TRIM is like dusk007 wrote filled with 95%. This ends in moving data which is already deleted and causes performance loss.
     
  21. dusk007 macrumors 68040

    dusk007

    Joined:
    Dec 5, 2009
    #21
    No that is just plain wrong. Actually read some of the material. GC is nothing more than block consolidation. GC is not a command it is a routine.
    Inform yourself about the subject matter before pretending to know better or refrain from posting.

    Here is a good start easy for anyone to understand.
    http://thessdreview.com/daily-news/...ion-and-trim-in-ssds-explained-an-ssd-primer/

    Key benefits or enabled Trim:
    • Lower write amplification. Less data is re-written and more free space is available during GC (more space to write equals fewer writes needed);
    • Higher throughput. With the TRIM command, there is less data to move during GC and the drive runs faster. Throughput is bottlenecked at the flash an SSD is only as fast as it can write to the flash memory. During the time it is doing GC, the drive has to stop some of the data transfer from the host while it moves data around. This is why it’s beneficial for the SSD to know which data is invalid so it doesn’t have to be moved during GC.
    • Improved endurance, because the drive is writing less to the flash by not rewriting invalid data.

    Ergo especially a good idea with a TLC SSD like Samsung 840. Trim is good because it has the same effect as over provisioning without usually the need of setting aside so much unused space.
    [​IMG]The problem being that 28% is nowhere near the number they use today.
     

Share This Page