#
✕ nick:marcan
#asahi-dev · 2022-02-17 10:08
marcanwell this is interesting
#asahi-dev · 2022-02-17 08:39
marcanhard to say without the real schematic
#asahi-dev · 2022-02-17 08:39
marcanwonder if there's some PGOOD thing that could still work...
#asahi-dev · 2022-02-17 08:39
marcanso I suspect the PSU just keeps it up then immediately kills power...
#asahi-dev · 2022-02-17 08:38
marcandottedmag: polling the main primary voltage rail voltage, it updates once a second, but I caught it updating immediately before shutdown after pulling the plug and it wasn't drooping
#asahi-dev · 2022-02-17 08:37
marcanI suspect there is no such mechanism
#asahi-dev · 2022-02-17 08:37
marcandottedmag: not seeing anything in SMC, quick look at the MBA schematic (they often have hints as to other variants) doesn't show any place that signal would go
#asahi-dev · 2022-02-17 08:33
marcanthough there might still be some info
#asahi-dev · 2022-02-17 08:32
marcanah wait, I don't have the Mini ones, derp
#asahi-dev · 2022-02-17 08:32
marcanlet me look at the schematics for a bit...
#asahi-dev · 2022-02-17 08:32
marcanthough I imagine if there were Apple would be using it?
#asahi-dev · 2022-02-17 08:32
marcanvery good question. no idea.
#asahi-dev · 2022-02-17 08:27
marcanit's just amazingly nonobvious for the rest of us
#asahi-dev · 2022-02-17 08:27
marcanar: indeed, the database folks knew about this for a while
#asahi-dev · 2022-02-17 08:27
marcanwell, this is #10 on hacker news now, so... who knows, maybe Apple will fix it :-)
#asahi-dev · 2022-02-17 08:02
marcanrepro'd on the Mac Mini pulling the plug; there is definitely no (working) last-gasp mechanism
#asahi-dev · 2022-02-17 07:46
marcanwould it be fair to say that if I make I release within this month I should keep simpledrmfb for now?
#asahi-dev · 2022-02-17 07:45
marcanack, I'll defer then. I was on the fence about that
#asahi-dev · 2022-02-17 07:34
marcanand yeah, translating fsync()s to write barriers would likely avoid corruption, if the drive can do that
#asahi-dev · 2022-02-17 07:25
marcanand this might be a good reason to try to rescue that kind of feature...
#asahi-dev · 2022-02-17 07:25
marcanI'm not sure if NVMe itself provides barriers; axboe might know
#asahi-dev · 2022-02-17 07:05
marcanit's a problem for e.g. databases
#asahi-dev · 2022-02-17 07:00
marcanand 20000 without
#asahi-dev · 2022-02-17 06:59
marcanon my iMac with a WD SSD, I get more like 2000 IOPS with proper flushes
#asahi-dev · 2022-02-17 06:59
marcansigh
#asahi-dev · 2022-02-17 06:59
marcanso even this mSATA SSD does better than Apple's NVMe
#asahi-dev · 2022-02-17 06:59
marcanso on a Samsung SSD 860 EVO mSATA on my laptop, I get 10K IOPS with the same write cache hack, and ~330 without (and fsync)
#asahi-dev · 2022-02-17 06:56
marcangiven the default dirty writeback on Linux is 5 seconds and macOS is losing more than 5 seconds worth of data with this, it *effectively* is like doing nothing on Linux, modulo writeback pressure
#asahi-dev · 2022-02-17 06:55
marcanso it's not a no-op but it's not good enough
#asahi-dev · 2022-02-17 06:55
marcan(fake set)
#asahi-dev · 2022-02-17 06:55
marcanit's like fsync on Linux with the write cache set to write-through
#asahi-dev · 2022-02-17 06:51
marcanyup
#asahi-dev · 2022-02-17 06:50
marcanooookay then, time to make some noise on twitter
#asahi-dev · 2022-02-17 06:50
marcanand indeed with a dumb repeated write test I get ~46 IOPS with that, vs. 40000 with plain fsync
#asahi-dev · 2022-02-17 06:47
marcanF_FULLFSYNC indeed works
#asahi-dev · 2022-02-17 06:43
marcanso I guess it deleted the "unsaved" project but didn't commit the "last open" state to restore on boot
#asahi-dev · 2022-02-17 06:43
marcanin fact I even managed to trigger an inconsistency in an Apple app by accident: I had GarageBand open, and closed it before the test, not saving data. on reboot, it tried to restore the now-nonexistent file, and threw up an error about corruption/invalid project
#asahi-dev · 2022-02-17 06:42
marcanwrite is gone
#asahi-dev · 2022-02-17 06:42
marcanI wait 5 seconds after the write/sync, then reboot via USB-PD command
#asahi-dev · 2022-02-17 06:42
marcansimple python script writing to a file (using raw os. calls) and doing fsync() on it, then sleeping
#asahi-dev · 2022-02-17 06:42
marcanok, can confirm macOS absolutely loses data if you do a plain fsync
#asahi-dev · 2022-02-17 06:24
marcanif that's how it works, maybe fio should be changed on macos so it stops lying... :p
#asahi-dev · 2022-02-17 05:04
marcanthe consumer line has enough caps to avoid corruption on power yank; the enterprise line has enough to save the entire cache
#asahi-dev · 2022-02-17 05:03
marcansee e.g https://www.micron.com/-/media/client/global/documents/products/white-paper/ssd_power_loss_protection_white_paper_lo.pdf
#asahi-dev · 2022-02-17 05:01
marcanI think at the lower end they only flush enough to make sure the FTL is consistent, but not necessarily all the data
#asahi-dev · 2022-02-17 05:00
marcanand enterprise lines certainly like to advertise that feature
#asahi-dev · 2022-02-17 05:00
marcanthough these days they're mostly given up onthat, but Micron/Crucial ones used to be like that
#asahi-dev · 2022-02-17 05:00
marcanit's not that hard with how fast SSDs are
#asahi-dev · 2022-02-17 05:00
marcanmilek7_: yes, some SSDs (even some consumer lines) have enough capacitors to flush the cache on plug pulls
#asahi-dev · 2022-02-17 04:53
marcanthen apple listens :D

plus ›