Remix.run Logo
▲ mzajc a day ago

> So if it knows it won’t finish its jobs by ten seconds, it pleads with the user to stop pressing the button.

Might be related to https://devblogs.microsoft.com/oldnewthing/20261029-00/?p=11...:

> I believe that on Windows Insider builds of Windows, you get a message that says something like “Please let go of the power button so we can collect more information, and then we will turn off the computer.” This gives the kernel more time to finish capturing its kernel dump

▲humblefly 31 minutes ago | parent | next [-]

Given the report that a user had this message on the screen for two hours, this still feels like shoddy engineering. Even on the off chance that the OS can't wrap it up in 10 seconds and that capturing a dump is really that important (why?), it should obviously give up and at least hide the message (but ideally, power off) if it can't get stuff done for, say, 30 secs.

▲goodmythical 21 hours ago | parent | prev | next [-]

>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 20 hours ago | parent | prev | next [-]

> 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 8 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.

▲Den_VR 15 minutes ago | parent | prev [-]

Sounds like an on-access situation “antivirus” is famous for

▲user_7832 21 hours ago | parent | prev | next [-]

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

How large is the dump and how slow is the storage for it to take so much time? A modern SSD can write several megabytes in a fraction of a second; in a few seconds it can easily write 10s of MB even for garbage tier SSDs.

The skeptic in me says it's just MS doing a lazy job instead of trying to optimise their systems.

▲myself248 21 hours ago | parent | next [-]

I wonder if, in case of certain types of crashes, it falls back to some sort of "safe mode" non-optimized drivers to minimize the chances of the dump being corrupted by the same problem that caused the crash.

If such drivers exist, I wouldn't be surprised if they were (as those of us old enough to remember 32BitDiskAccess=ON can readily tell you) at least an order of magnitude slower.

▲63stack 21 hours ago | parent | prev | next [-]

Just to give a sense of scale, copying a file between two nvme ssds is easily 1gb/s, even on your home computer, so this is now general and not lab numbers.

▲pooploop64 17 hours ago | parent | prev [-]

[dead]

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

It would be a lot more effective (or less effective … depending on users’ latent psychopathy) if the computer started screaming at the 5 second mark.

▲thaumasiotes a day ago | parent | prev [-]

>> If you hold a PC’s power button for 12 seconds, it will turn off at the hardware level without notifying the operating system. This is a safety feature so that you can turn of the computer even if the operating system’s “Shut down” command isn’t working.

You know what would work even better than that?

A power switch, where if you set it to "off", there's no power.

▲pfooti a day ago | parent | next [-]

My desktop has this feature- the power supply has its own switch that will cut power to everything. Ofc I could also just unplug it. But I bumped it once and it took me a little while to figure out why my computer wouldn't turn on.

▲Terr_ 21 hours ago | parent [-]

IMO that's a necessary feature for any time when the wall-power stops being reliable.

For example, of the power goes out, I switch it to Off until it seems to be reliably back. Otherwise it might get cycled multiple times or damaged by brownouts.

▲myself248 21 hours ago | parent [-]

I go upstream to the whole power strip or UPS in this case, but yeah, on the bench it's certainly nice to be able to kill the input and know +5VSB is truly off, etc.

▲rcxdude a day ago | parent | prev | next [-]

A bit less useful in normal circumstances, though.

▲happymellon 2 hours ago | parent | prev | next [-]

It would probably be less of an issue if Windows would reliably give feedback.

But shutdown doesn't.

Copy has improved, but we all remember progress bars that went backwards.

1 second remaining for 30 mins+.

Microsoft burnt trust over decades and continues with dark patterns. No wonder people don't believe them when they claim to be saving state.

▲trashcan_man 21 hours ago | parent | prev | next [-]

This is dangerous thinking - a slippery slope into a world where words mean something. :)

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

You would really like it on a laptop, do you? Especially the ones with Power button in the place of Delete button.