Sujet : Re: Shutdown - 25 Years Later
De : tnp (at) *nospam* invalid.invalid (The Natural Philosopher)
Groupes : comp.os.linux.miscDate : 22. Apr 2025, 14:29:30
Autres entêtes
Organisation : A little, after lunch
Message-ID : <vu85jq$llhs$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
User-Agent : Mozilla Thunderbird
On 22/04/2025 12:38, Pancho wrote:
On 4/22/25 12:13, The Natural Philosopher wrote:
On 22/04/2025 10:27, Carlos E.R. wrote:
On 2025-04-22 11:03, The Natural Philosopher wrote:
On 22/04/2025 09:35, Carlos E.R. wrote:
On 2025-04-21 02:29, Lawrence D'Oliveiro wrote:
On 21 Apr 2025 08:24:22 +1000, Computer Nerd Kev wrote:
>
It sounds like they're talking about the cache in the drive itself,
making sure data is physically written out before power-off.
>
Unfortunately, you could be right.
>
I say “unfortunately“, because I think it’s a dumb idea for drives to have
their own cache.
>
Not at all. There is a huge speed improvement.
>
The key is to have a large enough capacitor in the drive to flush all those caches on power off.
>
Or power off by command, not pulling the cable.
>
The reason you pull the cable is
>
(i) the electricity company did it for you
(ii) the power off button/command didn't work.
(iii) There was no swap left and you couldn't even log in to issue the shutdown command
>
>
My Orange Pi 5 freezes all the time. I don't know if the power off button is any better than pulling the power cable.
I have herd several tinmes that orange Pis are not as good as raspberry..
One thing I have been pondering, is a hardware heartbeat.
A watchdog timer?
I vaguely remember reading that such a thing exists. I wondered if it was possible to hang a clean-up routine off it. i.e if something stops the heartbeat try to flush writes to disk, before the power reset.
It depends on the architecture, In many cases the watchdog timer is an interrupt that cant issue a cleanup command itself.
It is probably a stupid idea, because by the time the computer was frozen enough to prevent the heartbeat, it is probably too sick to run any clean-up code, and/or the pending disk writes may still leave the disk in an inconsistent state.
Something has to reset the heartbeat. You need a loop and sleep that resets a variable and an ISR that counts down to zero,. If it gets there it means the main loop is permanently junked. But the problem there is that what can it do? foreground processes are by definition junked, and doing a disk flush command from an ISR is a bit iffy to say the least...
-- “The fundamental cause of the trouble in the modern world today is that the stupid are cocksure while the intelligent are full of doubt." - Bertrand Russell