Repository navigation
NAND root: writeback settings and a root watchdog for Apple's raw NAND - #312
Merged
Merged
Conversation
The 32-bit boards' internal storage is raw NAND behind the SFTL translation layer (applesftl). Its own queue orders the I/O, so it runs without a scheduler, with a 512 KiB read-ahead, and with small dirty-page limits (16 MiB background, 64 MiB hard) so writeback comes in bursts the NAND absorbs instead of stalls of the desktop. [Orchard: from #264 (257c376, configure-nand-root); keyed on the applesftl device in the package's udev rules instead of written into the ARMv7 image, so every board with that storage gets it, installed ones too; the dirty limits set by the same rule] Assisted-by: LLM
With the root on Apple's raw NAND, a wedged NAND controller leaves PID 1 running in RAM while every program that needs the root hangs: the device looks alive and does nothing. omarchy-nand-rootcheck reads one random 4 KiB block of the root past the page cache every 10 s and feeds the service's watchdog only when the read succeeds; a hung read misses the 60 s watchdog, an I/O error fails the service at once, and either way FailureAction=reboot-force restarts the device. It only reads, so the NAND sees no extra page programs. [Orchard: from #264 (2ada1dd, n42-rootcheck); renamed for every board with that storage and started by udev when an applesftl disk appears instead of enabled in the ARMv7 image; it ends successfully when the root is not on the NAND (a RAM boot), so it can never restart such a boot. Not taken: the emergency-mode reboot (it would cut a USB serial rescue session), the global hardware watchdog and the sleep target masks (for every board, not keyed on the NAND)] Assisted-by: LLM
Assisted-by: LLM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings Berkay's NAND root work from his iPhone 5 integration branch (#264) to every board with Apple's raw NAND (applesftl), with his authorship kept.
What a user notices:
Changed from #264: keyed on the applesftl device through the package's udev rules instead of written into the ARMv7 image, so installed devices get it too; the check ends at once when the root is elsewhere (a RAM boot), so it can't restart such a boot.
Not taken: the 128 MiB /tmp cap (Henrik turned a /tmp cap down in #214), the emergency-mode reboot (it would cut a USB serial rescue session), the global hardware watchdog and sleep target masks (they'd apply to every board, not keyed on the NAND). The N42 shutdown check waits for the kernel's SFTL checkpoint interface, which isn't on main yet. The ARMv7 input event fix is already covered by the C power daemon (#231).
Assisted-by: LLM