Come funziona TRIM Enabler?

8

Recentemente ho acquistato un SSD di terza parte (OCZ) e ho usato Trim Enabler per, bene, abilitare TRIM. Ho notato che alcuni aggiornamenti software possono rendere TRIM disabilitato e sono quindi curioso di sapere come funziona TRIM Enabler.

  • Sostituisce qualche KEXT predefinito con uno personalizzato per supportare TRIM o semplicemente alterna qualche impostazione PLIST?
  • In entrambi i casi, c'è un file che, se bloccato, può garantire che TRIM rimanga abilitato (senza conseguenze negative)?
posta Alexander 08.04.2013 - 23:34
fonte

3 risposte

9

Il componente Enabler di correzione applica il seguente file Kext

/System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

che controlla se ssd è un SSD di terze parti o Apple:

puoiancheabilitareilritagliomanualmentecercandotutteleoccorrenze"Apple" nel file e applicandole in un editor esadecimale o tramite terminale:

##1. Backup old file
    $sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
/System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original

##2. Patch the file to enable TRIM support
    $sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x51)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

##3. Clear the system kernel extension cache

   $sudo kextcache -system-prelinked-kernel

   $sudo kextcache -system-caches
    
risposta data 16.06.2013 - 03:54
fonte
2

L'unica informazione che posso trovare su questo è da una voce FAQ / blogpost

A: Trim Enabler patches a native OSX Trim driver, which works in the background even when the app is closed or removed. This patch is reset on system updates, so it might be a good idea to keep the app however.

    
risposta data 09.04.2013 - 00:00
fonte
2

Gli SSD OCZ utilizzano un controller Sandforce che ha incorporato la garbage collection in primo piano che ritarda la necessità di cancellare i blocchi, riducendo ma senza rimuovere la necessità del supporto TRIM. Trim può essere considerato un aiuto per la garbage collection.

Trim VS Garbage Collection

For the short explanation flash memory is organized in groups of pages where data can be written. Once a page is written, it cannot be rewritten until it is erased. But a page can only be erased within a group of typically 128 pages called a block. The complexity of writing data really starts to escalate in the case of random writes replacing previously written data. Random writes put the new data in previously erased pages elsewhere, peppering a block of valid data with “patches of invalid data.” In order to write new data to these patches, the whole block – all 128 pages – must be erased. But first all surrounding pages with valid data must be read and then rewritten to blank pages. The newly erased block of blank pages is then ready to save new data.

[…] All NAND Flash-based SSDs use GC. Some use foreground GC and some use background or idle-time GC. The difference between them is covered in my blog http://blog.lsi.com/dont-let-ssds-throw-away-your-gold/ . In simple terms background garbage collection will increase write amplification (WA) and wear out the SSD sooner. Foreground GC is harder to achieve and I believe only the SandForce controller is able to do it today

[…] TRIM is beneficial to all SSDs regardless of what kind of garbage collection is used. I talk about how TRIM came into existence and why it is necessary in my blog http://blog.lsi.com/did-you-know-hdds-do-not-have-a-del… . The TRIM command is sent by the OS to the SSD to identify what pages of data can be ignored during garbage collection. The SSD cannot tell what files have been deleted until the OS uses the same sectors to store new files, but by that time the SSD has already wasted cycles by garbage collecting data that was invalid, but known to the SS.

Sapevi che gli HDD non hanno un comando Delete? Ecco perché gli SSD hanno bisogno di TRIM

Keeping your SSD TRIM A number of years ago, the storage industry got together and developed a solution between the OS and the SSD by creating a new SATA command called TRIM. It is not a command that forces the SSD to immediately erase data like some people believe. Actually the TRIM command can be thought of as a message from the OS about what previously used addresses on the SSD are no longer holding valid data. The SSD takes those addresses and updates its own internal map of its flash memory to mark those locations as invalid. With this information, the SSD no longer moves that invalid data during the GC process, eliminating wasted time rewriting invalid data to new flash pages. It also reduces the number of write cycles on the flash, increasing the SSDs endurance. Another benefit of the TRIM command is that more space is available for dynamic OP.

    
risposta data 21.12.2014 - 22:19
fonte

Leggi altre domande sui tag