Docs: Fix SetApfsTrimTimeout description

This commit is contained in:
PMheart 2022-04-04 20:20:33 +02:00
parent 8f60fd29d8
commit 95596f336a
8 changed files with 19 additions and 11 deletions

View File

@ -1 +1 @@
d0ca24f6995d72c340b8ee894ddf5882
4e5a5fbb0a57ee29804ed531403c8eb6

Binary file not shown.

View File

@ -2776,7 +2776,7 @@ blocking.
One way to workaround the problem is to increase the timeout to an extremely
high value, which at the cost of slow boot times (extra minutes) will
ensure that all the blocks are trimmed. Setting this option to a high value,
such as \texttt{4294967295} (a.k.a. \texttt{-1}) ensures that all blocks are trimmed.
such as \texttt{4294967295} ensures that all blocks are trimmed.
Alternatively, use over-provisioning, if supported, or create
a dedicated unmapped partition where the reserve blocks can be found
by the controller. Conversely, the trim operation can be mostly disabled by
@ -2784,10 +2784,13 @@ blocking.
\href{https://interface31.ru/tech_it/2015/04/mozhno-li-effektivno-ispolzovat-ssd-bez-podderzhki-trim.html}{article}
for details.
On macOS 12.0 and above, it is no longer possible to specify trim timeout.
\emph{Note}: The failsafe value \texttt{-1} indicates that this patch will not be applied,
such that \texttt{apfs.kext} will remain untouched.
\emph{Note 2}: On macOS 12.0 and above, it is no longer possible to specify trim timeout.
However, it can be disabled by setting \texttt{0}.
\emph{Note}: Trim operations are \emph{only} affected at booting phase when the startup volume is mounted.
\emph{Note 3}: Trim operations are \emph{only} affected at booting phase when the startup volume is mounted.
Either specifying timeout, or completely disabling trim with \texttt{0}, will not affect normal macOS running.
\item

Binary file not shown.

View File

@ -1,7 +1,7 @@
\documentclass[]{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Thu Mar 10 21:36:27 2022
%DIF ADD ../Configuration.tex Mon Apr 4 13:04:33 2022
%DIF ADD ../Configuration.tex Mon Apr 4 20:16:05 2022
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
@ -2843,7 +2843,7 @@ blocking.
One way to workaround the problem is to increase the timeout to an extremely
high value, which at the cost of slow boot times (extra minutes) will
ensure that all the blocks are trimmed. \DIFdelbegin \DIFdel{Set }\DIFdelend \DIFaddbegin \DIFadd{Setting }\DIFaddend this option to a high value,
such as \texttt{4294967295} \DIFdelbegin \DIFdel{, to ensure }\DIFdelend \DIFaddbegin \DIFadd{(a.k.a. }\texttt{\DIFadd{-1}}\DIFadd{) ensures }\DIFaddend that all blocks are trimmed.
such as \texttt{4294967295} \DIFdelbegin \DIFdel{, to ensure }\DIFdelend \DIFaddbegin \DIFadd{ensures }\DIFaddend that all blocks are trimmed.
Alternatively, use over-provisioning, if supported, or create
a dedicated unmapped partition where the reserve blocks can be found
by the controller. Conversely, the trim operation can be \DIFaddbegin \DIFadd{mostly }\DIFaddend disabled by
@ -2852,10 +2852,14 @@ blocking.
\href{https://interface31.ru/tech_it/2015/04/mozhno-li-effektivno-ispolzovat-ssd-bez-podderzhki-trim.html}{article}
for details.
On macOS \DIFdelbegin \DIFdel{12+}\DIFdelend \DIFaddbegin \DIFadd{12.0 and above}\DIFaddend , it is no longer possible to \DIFdelbegin \DIFdel{set trim timeoutfor APFS filesystems}\DIFdelend \DIFaddbegin \DIFadd{specify trim timeout}\DIFaddend .
\DIFdelbegin \DIFdel{On macOS 12+}\DIFdelend \DIFaddbegin \emph{\DIFadd{Note}}\DIFadd{: The failsafe value }\texttt{\DIFadd{-1}} \DIFadd{indicates that this patch will not be applied,
such that }\texttt{\DIFadd{apfs.kext}} \DIFadd{will remain untouched.
}
\emph{\DIFadd{Note 2}}\DIFadd{: On macOS 12.0 and above}\DIFaddend , it is no longer possible to \DIFdelbegin \DIFdel{set trim timeoutfor APFS filesystems}\DIFdelend \DIFaddbegin \DIFadd{specify trim timeout}\DIFaddend .
However, \DIFdelbegin \DIFdel{trim }\DIFdelend \DIFaddbegin \DIFadd{it }\DIFaddend can be disabled \DIFdelbegin \DIFdel{when the timeout value is set to }\DIFdelend \DIFaddbegin \DIFadd{by setting }\DIFaddend \texttt{0}.
\DIFaddbegin \emph{\DIFadd{Note}}\DIFadd{: Trim operations are }\emph{\DIFadd{only}} \DIFadd{affected at booting phase when the startup volume is mounted.
\DIFaddbegin \emph{\DIFadd{Note 3}}\DIFadd{: Trim operations are }\emph{\DIFadd{only}} \DIFadd{affected at booting phase when the startup volume is mounted.
Either specifying timeout, or completely disabling trim with }\texttt{\DIFadd{0}}\DIFadd{, will not affect normal macOS running.
}

Binary file not shown.

View File

@ -2136,8 +2136,6 @@ PatchSetApfsTrimTimeout (
return Status;
}
//
// FIXME: This is wrong! At least from 11.6.1, mApfsTimeoutPatch cannot be applied anymore.
//
// It is only possible to specify trim timeout value from 10.14 to 11.x.
// Starting at 12.0 this is no longer possible.
@ -2153,7 +2151,7 @@ PatchSetApfsTrimTimeout (
return Status;
}
DEBUG ((DEBUG_INFO, "OCAK: Skipping SetApfsTrimTimeout on macOS 12.0+, set 0 to disable trim instead\n"));
DEBUG ((DEBUG_INFO, "OCAK: Skipping SetApfsTrimTimeout on macOS 12.0+\n"));
return EFI_SUCCESS;
}

View File

@ -282,6 +282,9 @@ OcKernelApplyPatches (
}
}
//
// Ignore timeout -1.
//
if (Config->Kernel.Quirks.SetApfsTrimTimeout >= 0) {
PatchSetApfsTimeout ((UINT32) Config->Kernel.Quirks.SetApfsTrimTimeout);
OcKernelApplyQuirk (KernelQuirkSetApfsTrimTimeout, CacheType, DarwinVersion, Context, NULL);