Remix.run Logo
▲ goodmythical 21 hours ago

>This gives the kernel more time to finish capturing its kernel dump

But why does it need more than 10 seconds?

Even a mechanical hard drive is doing >150MB/s, so that's a gig and a half, and SSDs/NVMEs are doing multiples of that meaning you could write potentially write the entire RAM allocation to disk.

▲cshokie an hour ago | parent | next [-]

A full kernel dump is indeed writing the entire contents of RAM to disk. If you have 64GB of RAM then it is writing 64GB to disk.

Also it doesn’t get the full ten seconds. The power button timer is ~5 seconds before dump collection is even triggered. That is then racing the 10 seconds before the hardware restarts.

Five seconds to write potentially tens of GB to disk is not much time, even with an NVME SSD.

▲justsomehnguy 19 hours ago | parent | prev [-]

> Even a mechanical hard drive is doing >150MB/s,

Only in a sequential read/write operations and only for 3.5" and 2.5" 10k drives. 2.5" can do it on the outside tracks sometimes.

Now add the fragmentation of the filesystem and now it's sub 10MB/s.

> SSDs/NVMEs are doing multiples of that

Only in 'good' conditions. Fragmentation of the filesystem, fragmentation of the flash itself, size of the erase block, write amplification - all of these can plummet the performance[0] of a flash drive. And some cheap tablets/2-in-1 are using eMMC which is way worse than even a SATA SSD.=

[0] https://ssd.userbenchmark.com/SpeedTest/1218310/Samsung-SSD-... scroll to "User Benchmarks" under "Average Bench", look at "Random 4k" - oops, average is ~50MB/s

▲goodmythical 18 hours ago | parent [-]

Sure, sure, but the question stands.

When I hold the power button for 10 seconds on my linux machine because I want it off 'now' and not 'when it's good and ready', it is off very shortly after 10 seconds. When I did so on the same device when it was running Windows a year ago, there was no "please give us a sec".

So the "why" is "why does this (the machine turns off gracefully in the time I ask it to) not hold for only the most recent versions of a Windows machine"? What is the Windows machine doing now that it didn't do before that it cannot accomplish in the timeframe it's had for a very long time? Is there no optimization that can be done to avoid yet another userspace interruption? Is it that it needs some extra time for telemetry? That it needs some new undocumented verification step? That it's calling home to check for updates it could apply during this 'unscheduled' shutdown? What? What is it? Why? Why is it?

This just rings of the old "eject your USB" thing where the only reason to do so was the OS deciding to cache writes for the future instead of doing them at or as near as possible to the time the user requested them. The only reason my USB wouldn't have the files I expected it to is if the OS is behaving counter to the expectation that it'd already set for me of files being written at the time the button/script was executed.

There is no reason that we couldn't get a "your device is ensuring synchronization with the USB device" message back then, and no reason we can't get a "your machine may experience issues if you continue to hold the power button" message now.

As it stands, there is no reason to suspect (from only the message) that there will be any issues, and so users will ignore it. There is no reason in either the USB case or this one to not include a sentence detailing potential ramifications to allow the user to decide whether or not the requested action is genuinely required.

▲zitterbewegung an hour ago | parent | next [-]

Linux doesn’t care about you shutting down before the whole kernel dump and or a clean shutoff. Even macOS doesn’t do this. A clean shutoff though might prevent file system integrity . This is also an aside but macOS can reserve some RAM so you can close an application or process that is exhausting your RAM.

▲toast0 an hour ago | parent | prev | next [-]

> What is the Windows machine doing now that it didn't do before that it cannot accomplish in the timeframe it's had for a very long time?

Windows really wants to shut down cleanly. Shutting down cleanly often took more than 10 seconds, or you wouldn't be holding the button.

Now it's detecting you are holding the power button, and at least it triggers user messaging. Maybe it tries to shutdown again, with feeling? Maybe it includes a memory dump or other telemetry?

> There is no reason in either the USB case or this one to not include a sentence detailing potential ramifications to allow the user to decide whether or not the requested action is genuinely required.

I mean, brutual experience has taught developers that users will not read any information provided to them. For shutdown, you get a message to please let it shut down nicely, and then you'll get another message when you start it up telling you it's taking longer and you may have lost data because you did it wrong.

For USB, it's similar, when you insert it after you removed it uncleanly, it takes longer and yells at you some more.

▲justsomehnguy 7 hours ago | parent | prev [-]

First of all you are comparing very different OSes with very different behaviours under the boot. You can't translate how it goes in one OS to another one.[0]

Also, "10 seconds" are clearly related to the laptops because they don't have the proper power button and need both the "ACPI shutdown" and "Force power-off". The latter should be controlled by the BMC but considering this is a tablet...

And to clarify:

> This is how I understand it: Windows now gets a signal whenever the user holds the power button

in the TFA is exactly the ACPI shutdown signal received by the OS from BMC.

Now:

> What is the Windows machine doing now that it didn't do before that it cannot accomplish in the timeframe it's had for a very long time?

Well, considering this is happening at the attempt to force a power-off then I can suggest this:

- there were enough edge cases when the user needed to perform a forced power-off

- quite unsurprisingly there not a lot of things still working when the shutdown sequence already initiated

- there was some addition telemetry added to capture these edge cases but the forced power-off prevented the capture of the data would could help to diagnose the issue => plead was added

And the things aren't fast because:

- the last thing you want to do when you are writing the telemetry at the shutdown is to mess up the filesystem, up to the unusable state => so you do write it with the write caching turned off. This is slow even on SSD, just check it

- (maybe, I don't know) this is a bit more than just a 'memory dump' so the system actually runs some tests - these take time despite all the bazillions of IOPS in tehe normal operations environment

So you have at least:

- the half of the OS aren't running - it's shutdown sequence

- things aren't right in the first place - that's why the user is holding the power button!

- things aren't fast because you don't want them to get even worse

- last, but not least: at least previously there were the Surface tablets with the eMMC. These are slow.

Now add the last ingredient to the mix: Average Joe who doesn't understand shit. He doesn't care about 'write buffers aren't flushed', he only notices the files he wrote to a thumbdrive aren't there - and blames the OS, Gates personally and whoever else - but not himself. Capisce?

[0] even more amusing what you are thinking what Linux is just good and fast OS. I have a lot of different servers running different distros and versions - and most of them aren't shutting down fast nor even try to.