top | item 45333075

(no title)

maverwa | 5 months ago

The complaint about power usage in suspend is especially sad because it’s pretty much a common problem for Linux on laptops. Not sure if that’s what applies here, but the numbers about match what I see with my Framework. Basically: if you want to use secure boot you usually also want kernel lockdown mode, and you cannot hibernate a lockdowned kernel. At least not without out-of-tree patches.

IMHO that’s a giant issue. If you can’t hibernate (aka suspend to disk) you will never be able to get that power consumption low. And telling people to not run secure boot or lockdown is not really a good answer either. Especially since the default installer already sets those things up. I get that „Linux on laptops“ is not a priority big enough to get a proper fix for that. And that it’s not an easy issue to fix. But the current state is really really sad.

discuss

order

Throwaway123129|5 months ago

This is not a Linux issue (Though the hibernate issues are!). It's a PC issue. Microsoft went on a crusade making hardware vendors implement S0 next to S3 but most hardware vendors now _only_ implement S0. So that the laptop can keep phoning home and download updates etc whilst closed. Which means it's impossible to turn off the CPU during suspend. it's always on.

PC as a laptop platform is a complete joke.

goku12|5 months ago

Shouldn't that mean that the relatively open platforms like Framework should work better, since they lack the incentive to defy the user/owner like the locked-down platforms do? What would prevent Framework or anything similar from implementing the other sleep states?

whyoh|5 months ago

>So that the laptop can keep phoning home and download updates etc whilst closed.

On Windows, network connectivity in S0 standby is optional: https://www.tenforums.com/tutorials/146593-enable-disable-ne...

>Which means it's impossible to turn off the CPU during suspend. it's always on.

Hibernation is still an option, if you don't mind a slower resume.

UK-Al05|5 months ago

Ok but windows has better battery life.

l11r|5 months ago

S0 is a step forward. Disabling CPU entirely is just a "workaround". Both S3 and hibernation has a lot of security implications which S0 solves. Apple uses their own S0 alternative and it works... Perfectly?

The real problem is that both AMD and Intel S0 implementations are mediocre at best and this is what they should fix. Also most vendors are dickheads and cannot even verify that their system even goes to S0ix states without any problem before releasing it. Because of their laziness you can buy brand new certified "Linux ready" machine which won't even achieve S0ix states out of the box.

teekert|5 months ago

Wasn't Apple the one to start with this? And it seems to work well there...?

port11|5 months ago

Wouldn't that mean that Intel Macs would have a much worse battery life than they did while suspended? Even suspended they did better than the same laptop running Linux.

aiisthefiture|5 months ago

Microsoft is not to blame for Linux’s abysmal battery lift. Linux has never ever had good battery life. It’s the only issue preventing me from replacing my MacBook.

koolala|5 months ago

So this is why my parents laptop is constantly running it's fans while 'asleep'?

jjice|5 months ago

My personal machine is a Framework 13 AMD (first gen of AMD for them) and my work machine is a MB Pro M4. The Mac Book just keeps battery _forever_ while suspended, where as I've found the Framework (running Ubuntu 24) loses about 1% an hour while suspended. 1% per hour is acceptable for me, but the Mac Book's power to performance ration is just insane.

I can't blame Framework, of course. Upstart laptop manufacturer that is open about repair vs tech giant who's spent years optimizing hardware and batteries.

All that said, I'm optimistic for better batteries, better suspend software/hardware support, and more efficient mobile processors outside of the Apple ecosystem in the coming years. The M-series Apple processors are definitely kicking others in the industry into gear.

vladvasiliu|5 months ago

I don’t think there’s much framework can do about this. The same happens with Windows on HP and Dell laptops, except windows tends to quickly enter hibernation (if it doesn’t somehow hang and burn up your bag).

We used to have better suspend before, when s3 was thing, on both Linux and windows. Maybe not as great as Macs, but way better than the current shitshow. Now I’m not saying pcs are great hardware, but I think this particular issue should be pinned on Microsoft, who tried to copy apple’s power nap, only doing it halfassedly as they usually do.

fpoling|5 months ago

I really do not understand why hibernate under secure boot is not implemented on Linux and this continues for years.

It is as if the features are implemented by completely different people. But this is not obviously the case since systemd supports both and actively improving both.

Note for me hibernation is a security measure and not about saving battery. I am traveling sometimes with the laptop and risk of theft is non-trivial. If it is hibernated, then it is just a property loss. But with just suspend there is a chance that the data can be extracted. So I configured it to hibernate automatically after 15 minutes in suspension. Surprisingly it has been working reliably with Linux.

beeflet|5 months ago

I have secure boot, hibernation, and full disk encryption working fine on linux, but I have never heard of kernel lockdown.

The solution I found involves making a custom initramfs to support hibernation and compiling the kernel into a signed EFI stub.

anon7000|5 months ago

> It is as if the features are implemented by completely different people

This is almost definitely true considering it’s an massive open source project

orbisvicis|5 months ago

I have looked into this. It is possible, and documented on the Arch wiki. My main concern is constantly writing a large file to a small SSD.

kelvie|5 months ago

https://lore.kernel.org/linux-pm/20231114022503.6310-1-kelvi...

I authored a patch (I still use it to this day, and I think others do too) that allows this, and sent it to the LKML as an RFC, and was rejected, for some background.

someguyiguess|5 months ago

"I've got to warn you that I have an allergic reaction to arguments that start with "the right solution is really hard, so let's pick the easier, worse solution." ;)"

Proceeds to continue enforcing objectively worse solution (evidenced by the existence of this entire thread).

nrp|5 months ago

Out of box hibernation support in popular Linux distros is also something we want badly. We’re watching this one eagerly: https://github.com/basecamp/omarchy/pull/1417

chatmasta|5 months ago

Let’s see how long DHH & co can keep harvesting low hanging fruit of Linux laptop problems. I’d expect they’ll plateau soon but I would love to be surprised.

I’m torn between my instinct to classify anything from DHH as mostly hype, my faith in Linux kernel developers, and my cynicism toward Linux kernel developers.

izacus|5 months ago

The thing is - a lot if power saving is achieved by hybrid sleep (computer hibernating after a timeout).

Setting that up is pure hell on Linux, with poor documentation and security people actively fighting against making this easy.

On Windows/macOS it just works, on Linux you'll probably break secure boot with it.

ndiddy|5 months ago

> On Windows/macOS it just works, on Linux you'll probably break secure boot with it.

The way it works on my Windows laptop is it’ll stay in sleep overnight, then when I open the laptop in the morning it’ll wake up, then hibernate itself, then I have to wait for the computer to turn itself back on. Thankfully this feature can be turned off.

terribleperson|5 months ago

Maybe it just works on MacOS, but it's prone to all kinds of breakage on Windows.

heavyset_go|5 months ago

You edit one line in a file to enable hybrid sleep. Uncomment one line in /etc/systemd/sleep.conf:

AllowHybridSleep=true

Your Linux installer will also set everything up needed for it.

It's also a GUI option in KDE's System Settings.

astrange|5 months ago

macOS mostly doesn't hibernate. Apple Silicon is just good enough to not need it.

It will do it eventually, though if you don't have enough free disk space it'll fail.

gwd|5 months ago

What's exasperating is that this has been going on for literally 20 years:

> Pretty much exactly 19 years ago I got on a train to Oxford and made Mark Shuttleworth's laptop successfully suspend and resume using ACPI and that was the turning point in my entire career [1]

[1] https://nondeterministic.computer/@mjg59/111249766634985812

10 years after that I bought a Macbook Air, and haven't gone back to Linux on a laptop since.

pjmlp|5 months ago

Windows on my case, since Windows 7, although I kept a netbook with Linux around until it died.

While I can understand random Joe and Jane are at the mercy of reverse engineering while installing a Linux distro over the weekend, I expect that anyone selling Linux laptops as OEM, to actually get the specifications and have everything working as any other hardware vendor.

fooker|5 months ago

This is also something that is ideally fixed in hardware. Suspend to RAM should take extremely low energy (about 10 milliwatts). Apple has this down to an art while other laptops have quite of bit of random power draw from motherboard components. A laptop battery should be able to power suspend to RAM for months.

It does not make any sense to write 32 or 64G data to secondary memory every time you close your laptop lid, that will accelerate the lifespan of most SSDs.

lenkite|5 months ago

This is a seriously annoying Linux problem that never get acknowledged by hardcore Desktop Linux fans. On any Linux thread on HN, one can argue till one is blue in the face, but they will always finally deflect with: it works fine for me on X hardware. Usually, the first response is that suspend works completely fine on Linux and it is Windows that is worse.

didibus|5 months ago

> If you can’t hibernate (aka suspend to disk) you will never be able to get that power consumption low

Does Mac hibernate? Because if it does, the wake up is literally under 100ms, it's just imperceptible. You open the lid and it's already awake.

acchow|5 months ago

> Does Mac hibernate?

Not by default. If you just shut the lid on your macbook and put it in your backpack for 2 days, it does not hibernate.

Which is why waking is instant.

bzzzt|5 months ago

Mac M series don't do hibernation, probably because sleep has so little impact on battery life (my MacBook lasts for about a month in sleep mode) and Apple doesn't like to burden users with questions like 'what sleep mode to use'.

deepsun|5 months ago

No, Linux is not the issue -- my System76 Lemur holds 14+ hours. Haven't used X1 Carbon for a while, but it also held way longer than Framework.

devjab|5 months ago

As I understand it, the complaint isn't about battery life during usage. The issue compared to a mac is that I could close the lid on the macbook air m1 that I'm typing this on mid sentence, and then open the lid in two weeks, and have lost basically 0% battery.

I'm not sure if that's possible on windows. I know my work laptop doesn't work that way, but then, it probably runs all sorts of enterprise settings.

mort96|5 months ago

How long does it keep its charge in sleep mode? Weeks or days?

mbac32768|5 months ago

Um, more details? My Lemur has never lasted anywhere near this long, though it's a few years old.

jeffbee|5 months ago

> If you can’t hibernate (aka suspend to disk) you will never be able to get that power consumption low.

This is cope. An Apple Silicon Macbook does not need to suspend to block devices to save energy (they only do this when the battery is empty). ChromeOS doesn't offer hibernate at all. The only reason that a Framework can't have good battery life in an operating state is that nobody is paying attention to the details.

hackyhacky|5 months ago

Correct. I've got a ThinkPad T480s. Hibernation is disabled, but suspend works great. Keeps charge for at least a week. Running recent Debian. I think that Lenovo, for all their faults, just does better with Linux than Framework.

maverwa|5 months ago

Thanks, I did not knew that. My understanding was that keeping the memory alive for suspend-to-idle was the main issue here. But that also might be something a vertically integrated Apple Silicon can win vs. that x86 madness there every day.

And to be sure, I do not claim that there is nothing to gain in s2idle. I bet theres still a lot of headroom to safe energy. Its just that it would be easy to safe a lot of power if s2disk "just worked".

N-Krause|5 months ago

And what are those details? Sounds like you know specifics that I'd like to also know.

If you're claiming it is just an oversight, then please back it up.

jes5199|5 months ago

and yet my M1 manages to drain the battery in suspend mode in just a few hours

heavyset_go|5 months ago

If the swap file is encrypted and memory encryption is turned on, I don't see why lockdown shouldn't be allowed.

You're already relying on the hardware platform for Secure Boot, it's not far fetched to apply the same view to hibernate if the platform protects memory and disk.

That said, S3 is still a viable option, and IMO, the best option. Some hardware vendors still implement S3 sleep for their Linux laptops.

osigurdson|5 months ago

Is the Mac actually hibernating though?

saagarjha|5 months ago

Typically a Mac will only hibernate if you ask it to or it's out of battery.

acchow|5 months ago

> and you cannot hibernate a lockdowned kernel

Why do you need hibernation? Apple gets the ultra low power without suspending to disk?

fsckboy|5 months ago

>power usage in suspend is especially sad because it’s pretty much a common problem for Linux on laptops

I don't know what you're talking about, is this an apple Silcon marketing ploy? my linux laptops lose less battery in suspend than my macbooks do powered down

acchow|5 months ago

Have you tried an apple silicon macbook?

worble|5 months ago

While I don't deny that suspend is an issue on Linux I've just never seen this as a major problem? I simply turn off my laptop and turn it on when I need it - boot times are less than a minute so it really isn't a issue for me, just flick the power switch, wait for a bit then I'm good to go.

fizwidget|5 months ago

“Less than a minute” is going to feel horribly slow to people that are used to instant-resume and not having to think about shutdown vs. sleep.

You might be okay with it, but I suspect most consumers today won’t be.

heavyset_go|5 months ago

S3 sleep is a solved problem and security issues around it are solved by Secure Boot and memory and disk encryption.

The issue is that firmware vendors disable S3 sleep in favor of s0ix/Modern Standby instead, which just puts hardware into low power states instead of stopping them entirely. This will inherently drain more power over time than just keeping memory powered in S3 sleep.

Modern Standby requires heavy integration with the OS to be power efficient. Turns out that takes a lot of reverse engineering because vendors will not release documentation or tune the kernel for their firmware.

lukeschlather|5 months ago

My main use for laptops is as a notepad. If it takes a minute to start when I need it it's vastly inferior to a sheet of paper. If it can't remember what page I was on that's doubly so. Windows works more or less like a sheet of paper (though automatic reboots to apply security updates are a point in favor of paper that has no such issues.)

And I often use my laptop for things where seconds matter. I've got things on the stove that could burn, I may not have 5 seconds to spare locating the next step in the recipe.

GZGavinZhao|5 months ago

There are often browser tabs and other documents windows I would like to keep openers and I want to jump back to exactly where I left off as soon as possible.