Jump to content

High Sierra slow booting with TRIM enabled

trim high Sierra slow boot APFS SSD

  • Please log in to reply
12 replies to this topic

#1
IUTniun

IUTniun

    InsanelyMac Protégé

  • Members
  • Pip
  • 46 posts
  • Gender:Male
  • Location:gohiyuhi
  • Interests:Computer Programming, Astronomy

The latest issue with APFS comes in the form of introducing an extra 15 seconds of booting time when Trim is enabled. It is currently believed that the filesystem is performing a routine Trim-related cleanup process during this time, which is causing boot times to increase for users who want their SSD’s to benefit from Trim.

Trim is an important feature for Solid State Drive performance and longevity. Some users who want to enable Trim on High Sierra may notice an increase in boot time for now. I am convinced this is an unintentional bug in APFS from Apple’s side that should be fixed in an upcoming version of High Sierra.



#2
Pavo

Pavo

    InsanelyMac Legend

  • Developers
  • 679 posts
  • Gender:Male
  • Location:Fort Gordon, GA

APFS has its own built-in "TRIM" garbage collection that is optimized for SSDs. No reason to enable normal TRIM feature on APFS formatted SSDs.



#3
ellaosx

ellaosx

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 498 posts
disble trim patch in HS if i got that right?

#4
piiggggg

piiggggg

    InsanelyMac Protégé

  • Members
  • PipPip
  • 90 posts
  • Gender:Male
  • Location:Vietnam

APFS has its own built-in "TRIM" garbage collection that is optimized for SSDs. No reason to enable normal TRIM feature on APFS formatted SSDs.

Any source for that? Maybe I'll switch to APFS next week.



#5
SeriusNtentions

SeriusNtentions

    InsanelyMac Protégé

  • Members
  • Pip
  • 5 posts

On 10.13.1 I was booting in about 20 seconds (trim enabled) . Now on 10.13.2 it it taking 2 minutes with trim enabled.

 

I just built my first Hackintosh and read the Clover wiki to gain a better understanding of the config.plist.  I am really stumped at this point as to why this is happening. I upgraded Lilu 1.2.1, fakeSMC, and the new apfs file as per the TonyMac86  and I am using Hackintosher's config.plist since 10.13 which has been working perfectly.

 

I tied resetting permissions, resetting kext cache, putting the kexts in other instead of 10.13. Nothing has worked so far.

 

If someone can take a look at my attached boot.log and point me in the right direction I would very much appreciate it!  I normally boot directly into macOS 10.3.2 and hide my preboot volumes, so I only see MacOS, Recovery and Windows 10.

 

Thank you!

 

EDIT: I disabled Trim, checked my BIOS settings and redid my EFI folder and config file.  I boot up fast as before, problem solved


Edited by SeriusNtentions, 13 December 2017 - 01:19 AM.


#6
Alcatraz_USMC

Alcatraz_USMC

    InsanelyMac Protégé

  • Members
  • Pip
  • 1 posts
  • Gender:Male

On my MacBook Pro 13 2012 as on pc with SSD Kingston SV300S37A120G (APFS) after enabling TRIM loading takes ~45 seconds, if TRIM disabled loading takes ~15 seconds.

 

APFS has its own built-in "TRIM" garbage collection that is optimized for SSDs. No reason to enable normal TRIM feature on APFS formatted SSDs.

 

 

That is on APFS not needed turn on TRIM, as APFS has something like own TRIM? Right?



#7
Pavo

Pavo

    InsanelyMac Legend

  • Developers
  • 679 posts
  • Gender:Male
  • Location:Fort Gordon, GA

Any source for that? Maybe I'll switch to APFS next week.

o APFS is optimized for solid-state drives (SSDs) and other all-flash storage devices https://support.appl.../en-us/HT208033

 

o TRIM operations are issued asynchronously from when files are deleted or free space is reclaimed, which ensures that these operations are performed only after metadata changes are persisted to stable storage. https://developer.ap...de/FAQ/FAQ.html

 

 

On 10.13.1 I was booting in about 20 seconds (trim enabled) . Now on 10.13.2 it it taking 2 minutes with trim enabled.

 

I just built my first Hackintosh and read the Clover wiki to gain a better understanding of the config.plist.  I am really stumped at this point as to why this is happening. I upgraded Lilu 1.2.1, fakeSMC, and the new apfs file as per the TonyMac86  and I am using Hackintosher's config.plist since 10.13 which has been working perfectly.

 

I tied resetting permissions, resetting kext cache, putting the kexts in other instead of 10.13. Nothing has worked so far.

 

If someone can take a look at my attached boot.log and point me in the right direction I would very much appreciate it!  I normally boot directly into macOS 10.3.2 and hide my preboot volumes, so I only see MacOS, Recovery and Windows 10.

 

Thank you!

 

First we do not support tonymac installations and second, stop using normal TRIM if you are going to use APFS



#8
SeriusNtentions

SeriusNtentions

    InsanelyMac Protégé

  • Members
  • Pip
  • 5 posts

o APFS is optimized for solid-state drives (SSDs) and other all-flash storage devices https://support.appl.../en-us/HT208033

 

o TRIM operations are issued asynchronously from when files are deleted or free space is reclaimed, which ensures that these operations are performed only after metadata changes are persisted to stable storage. https://developer.ap...de/FAQ/FAQ.html

 

 

 

First we do not support tonymac installations and second, stop using normal TRIM if you are going to use APFS

 

I fixed my problem. I redid my EFI (Hackintosher method) and verified my bios. TRIM is disabled. I boot quickly again! 



#9
chriz74

chriz74

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 269 posts

APFS has its own built-in "TRIM" garbage collection that is optimized for SSDs. No reason to enable normal TRIM feature on APFS formatted SSDs.

 

You are completely wrong.


 

EDIT: I disabled Trim, checked my BIOS settings and redid my EFI folder and config file.  I boot up fast as before, problem solved

 

what do you mean "redid my EFI folder"? If you disable TRIM boot will be fast but problem is not solved.

I solved it in 4 different systems 3 hackintosh and a macmini by backing up the entire system with time machine and restoring it to ssd. In all 4 cases boot time was 30 seconds faster with TRIM enabled and disk still in APFS.



#10
Pavo

Pavo

    InsanelyMac Legend

  • Developers
  • 679 posts
  • Gender:Male
  • Location:Fort Gordon, GA
Before saying someone is wrong please provide documentation, as you can see I provided the documentation showing APFS has its own “TRIM”

#11
ezsolt

ezsolt

    InsanelyMac Protégé

  • Members
  • Pip
  • 14 posts

I checked the documentation, the links you provided.

 

It seems to me that only apple products have the necessary hardware to running safely APFS

 

"... all Flash/SSD and hard disk drives used in Apple products use Error Correcting Code (ECC)

ECC checks for transmission errors, and when necessary, corrects on the fly. Apple File System uses a unique copy-on-write scheme to protect against data loss that can occur during a crash or loss of power."

 

So I think APSF has TRIm support but only on apple ssd-s.

I mean how can we be sure that our SSDs are compactible with the APFS -- ECC implentation apple uses?

 

 

 

 

 

Before saying someone is wrong please provide documentation, as you can see I provided the documentation showing APFS has its own “TRIM”



#12
chriz74

chriz74

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 269 posts

Before saying someone is wrong please provide documentation, as you can see I provided the documentation showing APFS has its own “TRIM”

 

The links you provided don't tell anywhere that APFS performs TRIM ops on it's own. 

The disk and the file system don't know 'horse manure' of what files your are deleting and what sectors to flag as unused. The command is issued by the OS not by the file system.

"APFS supports TRIM" means it can handle the TRIM commands issued by the OS. If you disable TRIM in the OS then you are not trimming anything.

 

"A trim command (known as TRIM in the ATA command set, and UNMAP in the SCSI command set) allows an operating system to inform a solid-state drive (SSD) which blocks of data are no longer considered in use and can be wiped internally."

 

https://en.wikipedia.org/wiki/Trim_(computing)

 

"The APFS code, like the HFS+ code, uses the TRIM command, for better space management and performance."

 

The command is issued by the OS both for HFS+ and APFS (or NTFS, etc..), if you disable it TRIM is gone.

 

https://en.wikipedia...ple_File_System


I checked the documentation, the links you provided.

 

It seems to me that only apple products have the necessary hardware to running safely APFS

 

"... all Flash/SSD and hard disk drives used in Apple products use Error Correcting Code (ECC)

ECC checks for transmission errors, and when necessary, corrects on the fly. Apple File System uses a unique copy-on-write scheme to protect against data loss that can occur during a crash or loss of power."

 

So I think APSF has TRIm support but only on apple ssd-s.

I mean how can we be sure that our SSDs are compactible with the APFS -- ECC implentation apple uses?

 

TRIM command is issued by the OS regardless of APFS or HFS or what SSD you have on your system. If you disable it you don't get TRIM at all, pure and simple. 

 

More on ATA TRIM:

 

https://www.thomas-k...n/wiki/ATA_Trim

 

In order for ATA Trim to work, the following components must be supported:

  • by the SSD itself
  • by the operating system (Windows 7, for example)[2] or Linux kernels as of version 2.6.33[3])
  • by the file system


#13
chriz74

chriz74

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 269 posts
Also from the Samsung FAQ on SSDs:

What is TRIM?

TRIM is a facility by which the OS can notify the SSD when data is either marked for erase or no longer valid.
TRIM helps to make Garbage Collection more efficient by preparing invalid data for deletion. When the OS “deletes” data, the data does not actually go anywhere.
The space in which it resides is simply marked as “free space” that may be used later.
By default, the OS doesn't let the SSD know which data is now free.
TRIM allows the OS to inform the SSD which data is no longer valid, allowing the SSD to skip over invalid data when performing Garbage Collection.

Does Windows XP support TRIM?

No, only Windows 7 and above supports the TRIM feature.
The Samsung SSD Magician software enables you to manually use TRIM on both Windows XP and Windows Vista.

As you can see TRIM is OS dependent. XP uses NTFS and even VISTA does but TRIM is only supported from Windows 7.

http://www.samsung.c...upport/faqs-03/






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2017 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy