Idea on how to implement TRIM in OS X.

Discussion in 'macOS' started by Evo-L, Sep 5, 2010.

  1. Evo-L macrumors member

    Feb 28, 2008
    Well, let me first off say this is some random idea that came into my head. I am no programmer or anything like that...

    Anyways, I was reading about TRIM and how Windows 7 supports it. Well, why cant we run boot camp partition with Windows 7 on it, and let that OS do the TRIM'ing for us?

    Im not entirely sure how TRIM works, or when it works, but if W7 supports it, shouldn't a boot camp version also?

    For example, every now and then, boot to W7 and let it TRIM our SSD's, then shut it down and resume on OS X.

    Seems to simple of an idea for it to actually work...

  2. Mr. Wonderful macrumors 6502a

    Feb 19, 2009
    You can only TRIM the NTFS partitions under Windows.
  3. lewis82 macrumors 68000


    Aug 26, 2009
    Totalitarian Republic of Northlandia
    Moreover, if you give Windows access to the OS X partition, you expose yourself to damage due to viruses, trojans, or any of that crap on the Windows side.
  4. LostSoul80 macrumors 68020


    Jan 25, 2009
    Technically there's no such risk, as Windows can't r/w any HFS partition. In order to do that you'd need some third party application, but then you'd be able to write the partition only through the program.
  5. larkost macrumors 6502a

    Oct 13, 2007
    You are making the huge assumption that MacOS X needs the TRIM functions, and that the SDD discs support those commands. Neither are givens.

    There are a number of other solutions to the same class of problems that TRIM solves, including solutions that require no intervention from the OS at all. It seems that the industry is moving towards TRIM as a standard solution when OS intervention is required, but none of this means that it is required on the hardware Apple ships.

    Now I have to include the caveat that I do not know if it is required on Apple's hardware. I will also put forth that I doubt that anyone on this forum knows this either. There are a lot of people who make blind assumptions that it is required, but I have never seen anyone run any valid tests[1] to see if this is the case or not.

    [1] I have seen one invalid test that said that it was not needed, but the methodology was so flawed as to be be worthless.
  6. Evo-L thread starter macrumors member

    Feb 28, 2008
    Most of the newest generation SSD's support TRIM. Why would you be under the assumption that OSX doesn't need it? TRIM is a process that helps with problems associated with an SSD drives architecture and processes.

    It makes sense as to why my idea would not work, I figured that much, but didn't think of that at the time.
  7. lewis82 macrumors 68000


    Aug 26, 2009
    Totalitarian Republic of Northlandia
    Read Wikipedia's article on TRIM. Very complete, lots of info.

    Or, long story short: when erasing on any kind of drive, the OS just marks the sectors of the drive as available. However, it does not erase the data on the drive.

    On magnetic drives, overwriting them is as simple as writing on an empty sector (kind of like an hypothetical "auto-erasing" pencil, that could erase before you write in a single operation), while a SSD needs to erase the sector before (erase the paper before writing on it with a normal pencil). Therefore, when the SSD becomes full, it always needs to do 2 operations instead of 1 when writing, as there are no more empty sectors.

    This goes independently of the OS.;)
  8. larkost macrumors 6502a

    Oct 13, 2007
    TRIM is coming out in new SSDs because Microsoft declared that it was the only solution to this problem that Windows would support. Not because it is the only solution to the problem.

    And why would you assume that Apple, who came out with SSD support well before TRIM was a concept, would necessarily require it. Why do you assume that Apple has been failing here for years now? They have some very smart people in their filesystem department, do you think that those folks have just been sticking their fingers in their ears for a couple of years ignoring glaring issues on their most expensive laptops?

    I have yet to see anyone come out with numbers showing that MacOS X on drives supplied by Apple suffers from the performance degradation that TRIM addresses. That simple lack of evidence for years now tends to tell me that this is not a problem. That is not the same as proof... but the burdon of proof is on those insisting that this is absolutely required.

    I have read the Wiki entry, and a lot more than that. I understand the block overwrite problem very well, thank you. And I also understand why TRIM is not the only way of solving this problem. I also understand how some drives avoid the problem in ways that the OS does not have to be involved in (because they change some of the underlying assumptions that are the problem here). Do you care to come out with anything to say that TRIM is the only way of handling this problem?
  9. aprouser macrumors newbie

    Oct 14, 2010
    After much research...

    I agree with this, to the point of "but the burden of proof is on those insisting that this is absolutely required." I had started a post on the Apple discussions ( after configuring a MBP (as a first time buyer). Ending my last post with:

    But, would it be that difficult for Apple to have a little "*" next to the SSD option and below in fine print say either, *"You may need to maintain the SSD, click here to find out why" OR *"OS X 10.6.4 doesn't do TRIM, but it does do "XYZ" or the SSDs we use do "XYZ" so you never have to be concerned about performance degradation."

    If anyone has actual experience with the SSD on the MBP OS X 10.6.4, understands the issues above, and can explain how the MBP works with an SSD beyond saying, "I took it out the box and it was lightning fast - buy an SSD", that would be much appreciated and think would lend allot of insight to the forum.​

    So, I don't doubt the "smarts" of the folks designing the MBP. But I think it is at least just as reasonable that the same "smarts" might lead them to answer my question above. Currently, the lack of information is costing them at least one customer to make an immediate purchase. I am sure Apple will survive if I don't buy from them, but it does tend to alienate an inquiring buyer when they do google "trim on osx" and this forum / subject is the first forum to come up, followed by, which also sheds no light on the issue, but only adds to the ambiguity.
  10. MikhailT macrumors 601

    Nov 12, 2007
    TRIM is coming to OS X, it’s just going to take some time for it to arrive, a lot of the coding for TRIM is already in the OS. Apple just needs to complete it, they are likely not going to do it for 10.6, might finish it by 10.7. Right now the IGC from the latest generation of SSDs does a good job but eventually IGC will fade away as TRIM takes over the job.

    @laskor, the SSDs are still in the early-adopter phase of the market adoption, all the technologies are still fairly immature and TRIM came out as the result of the serious performance issues noticed in the MLC chips, nothing to do with Microsoft. Also, TRIM is a “draft” standard of ATA standards, not a standard that MS created or “declared” as the only solution to this problem. As for Apple, Apple’s SSDs does not “suffer” from performance degradation because it starts out too slowly to even benefit from TRIM. TRIM is noticeable for quality SSDs, not conservative slow SSDs like Apple’s SSDs.

    The SSD market compared to HDD is still a very small market, Apple is not going to put in some new coding just because a small number of their hardware uses it. They just started selling iMacs with both SSDs and HDDs in the same system. Eventually over time as SSDs double in capacity and half in prices, Apple will start to take SSDs more seriously and finish off the TRIM implementation.
  11. aprouser macrumors newbie

    Oct 14, 2010
    Thank you very much - that makes perfect sense and clears up much ambiguity. I don't think I will purchase a MBP with an SSD now, but at least feel I can now make an informed decision on MBP with 7200 RPM HDD vs. competition. Thanks again.
  12. tibi08 macrumors 6502a


    Sep 17, 2007
    Brighton, UK
    Err, no it isn't????

    I agree with everything else you wrote though.... :)
  13. srgz macrumors member

    Aug 22, 2010
    Just some info -- Anandtech has claimed all the Apple OEM sold SSDs are either toshiba \ samsung and they _all_ run custom firmware. Further testing has found that even without TRIM, these Apple OEM drives do not suffer in performance over time...makes you wonder what that custom firmware is really doing? It's no surprise they don't support TRIM -- they want you to buy their overpriced SSDs. Not supporting TRIM is very smart on their part, it sort of forces you to get your SSD from them...although there are tests \ reports that a few drives (Such as the Kingston SSD Now V and V+ series) work very well on OS's without TRIM support and also don't degrade over time...and then there's SLC drives that (IMHO) don't really need TRIM.

    My personal experience? I used an X25-M on XP for awhile and it turned to crap after 6 months.
    Had to backup, secure erase, then restore to get it up par again.

    I also don't think Apple will implement TRIM, ever.
    They want you to get every piece of hardware directly from them...and doing things their own way despite industry standards is a great way of achieving profits and making sure this happens.
    It's been supported in every other modern OS in the world for over a year now, even free / community supported OS's (linux, open solaris), and it's not difficult to implement. All it does is send an ATA command directly to the SSD controller at the right times. It would take Apple's engineers about 12 hours to put it in, including testing, etc...but like I said, if you use an OEM'd Apple SSD, you don't even need it. I doubt their drives even support it anyways.
  14. larkost macrumors 6502a

    Oct 13, 2007
    Lets be clear about this: when Apple started supporting SSDs it was not clear what method would wind up winning the battle for dealing with the SSD fragmentation issue. When Microsoft chose TRIM the battle for an "industry standard" was pretty much over (note that means "dominant decision", and has nothing to do with actual standards).

    However, when that happened Apple already had a (presumably) thoroughly tested system in the field, and a lot of disks out there that had firmware that supported this method (which seems to be working fine) and not TRIM. So everyone who bought the hardware from Apple was already covered, and Apple has a solution that they have already paid for (licensing fees, testing costs, custom programing, etc...).

    So without making Apple the bad guy you already have lots of reasons that Apple does not need to change what they are doing. At some point they are probably going to make a change, and include TRIM, but they have no reason to hurry. The only people who are going to have any negative effect are those who replace the drives themselves, and in the scheme of things those people are a vanishingly small minority (we are talking about way under 1% here). That is not worth the engineering and licensing costs until some other factor makes it worth it. That will probably be commodity prices at some point... but since Apple is the largest single purchaser of flash memory chips at this point... they sort of set the tone there at the moment.

Share This Page