← Back to context

Comment by monocasa

4 years ago

In Apple's defense, they probably have enough power even in the worst case to limp along enough to flush in laptop form factor, even if the power management components refuse to power the main CCXs. Speccing out enough caps in the desktop case would be very Apple as well.

Apple do not have PLP on their desktop machines (at least not the Mac Mini). I've tested over 5 seconds of written but not FLUSHed data loss, and confirmed via hypervisor tracing that macOS doesn't do anything when you yank power. It just dies.

  • With truly no PLP I'd expect unrecovarable drives that have screwed up their FTL when you pull power.

    • You can design your FTL to be resilient to arbitrary power loss, as long as the NAND chips don't physically go off corrupting unrelated data on power down. That only requires extremely minimal capacitance. I believe Apple SSDs do have some of that in the NAND PMIC next to the storage chips themselves; it probably knows to detect falling voltage rails and trigger a stop of all writes to avoid any actual corruption due to out-of-spec voltages.

      3 replies →

Once voltage from the battery gets too low (despite reporting whatever % charge), you aren't getting anything from the battery.

  • It's the other way around. The PMIC cuts the main system off at a certain voltage, and even in the worse case you have the extra watt/sec to flush everything at that point.

    • I'm really hoping the battery has a low-voltage cutoff... I guess the question is: does the battery cut the power, or does the laptop? In the latter case, this may be "ok" for some definition of ok. The former, there's probably not enough juice to do anything.

      2 replies →

  • Batteries don't die instantly; you always have a few seconds where voltage is dropping fast and can take emergency action (shut down unnecessary power consumers, flush NVMe) before it's too late. Weak batteries die by having higher internal resistance; by lowering power consumption, you buy yourself time.

    I don't know if macOS explicitly does this, but it does try to hibernate whem the battery gets low, and that might be conservative enough to handle all normal cases.

    • That's why I gave the death at 8%. I imagine the OS controls the hibernation, so it probably won't think that is low enough to trigger hibernation, just a warning. My current laptop will die at 70%, and I have hibernation triggering at 80% just to be safe (it lasts about 10 minutes after being unplugged). From experience, when the power dies it just turns off. The OS has no idea the battery is about to die and when rebooting it requires an fsck (or whatever its called) to get back to normal. So I assume there is data loss.

      Also, thanks for all you're doing with Linux on the new macs. I love your blog posts!