A common "gotcha" with computers can happen when power gets cut to the computer without warning. Because the system loses power suddenly, it doesn't have a chance to flush cached filesystem data to disk, which means that some recently-"written" user-data might not be present on the disk the next time the system is powered back on.
Journalling filesystems help mitigate this (i.e. they usually prevent the filesystem itself from being corrupted) but they don't guarantee that the user's files will all be completely retained.
I noticed that some desktop power supplies have a significant amount of "inertia"-- i.e. you can pull the computer's power-plug out of the wall, and the computer will remain running for a noticeable period (e.g. several seconds) before it finally powers off -- because it's operating on the power remaining inside the power supply's internal capacitors.
My question is, is there any protocol or standard (that is supported by Linux) by which the power supply hardware could notify the Linux OS that it has lost its input-AC-power, and therefore it is quite likely that it will fail in the next few seconds? Linux could then respond to that by doing a quick "emergency" flush of all dirty-filesystem-data to SSD, and hopefully get all that data onto the SSD before the system fails. (If any data doesn't make it to disk in time, OTOH, the situation is no worse than it would be without this feature)
Does such a feature exist? If so, what keywords should I feed into Google to learn about it?