8 ms·
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 her
by maverwa 1y 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.
- jeffbee 1y 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.
- N-Krause 1y agoAnd 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.
- nagisa 1y agoWhile I don't have any suggestions on how to look at the relevant metrics, a big part of the issue is the parts selection and having them power off properly. 1%/h is just 0.5W (for a 50Wh battery) which isn't a lot, but fail to bring a component or two to shutdown or sufficiently low power state and you'll observe exactly this behaviour. Of course some drain is going to be almost inevitable just to keep memory contents sufficiently refreshed, but with proper power-saving states memory can go appreciably below 0.5W.
- chongli 1y agoTimer coalescing, idle wakeup minimization, race-to-idle optimization, etc. It's not a single oversight, it's a massive project that needs to be carried out throughout an operating system. Linux's usual advantage of decentralization and wide distro variety with massive customization potential is a disadvantage here. To have a power-efficient system you need all of the software to be working toward the same goal. One bad actor process can completely hose the system's power efficiency.
- valleyer 1y ago> Timer coalescing, idle wakeup minimization, race-to-idle optimization These are important things, but they do not matter for power consumption in sleep, when the CPU is not executing instructions.
- chongli 1y agoThat's a hardware issue.
- AnthonyMouse 1y ago> Linux's usual advantage of decentralization and wide distro variety with massive customization potential is a disadvantage here. How so? You need each thing to do its part, but that decentralizes perfectly well because it isn't actually integration at all, it's just a hundred different pieces each doing it right. And open source has the further advantage that you're not beholden to the maintainer. If Framework notices that piece #37 is wasting power, they have the code and can fix it themselves. If the upstream isn't completely asleep at the switch they'll accept the patch, and even if they are you can still ship it on your own device. Where this can get messed up is in one of two ways. The first is if something is not open source and then the vendor fails to fix it but also fails to supply anyone else with the capacity to fix it. But this isn't a problem with integration, it's a problem with filthy knuckleheads not keeping their heads on straight and calls for some new competitors to show them how to do it. The second is something like an actual trade off, e.g. if you want the machine to be able to wake via network packet or pressing a key on the keyboard then you'd need the network controller or USB controller to stay in a low power state instead of being dead off. And then that might cost you half a watt, but you're paying it in order to get something, and then somebody has to decide if Linux users would typically want a default where that feature works or one where the battery can last a month in standby, since it's one or the other.
- maverwa 1y agoThanks, 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".
- heavyset_go 1y agoKeeping memory alive is how sleep worked for over a decade and is incredibly power efficient. The issue is that Modern Standby goes ones step further and keeps the CPU and peripherals in low power states instead of just the memory. This will use more power than S3 sleep by default, and each SoC will need deep integration with the kernel for that to ever be power efficient. That means it will require heavy investment from AMD and Intel to enable efficient Modern Standby in Linux, along with heavy vendor investment to ensure each model they sell implements Modern Standby efficiently. It isn't a matter of Framework dropping the ball, it's matter of hardware platforms being shitty and platform owners not investing as much resources into Linux as they do Windows.
- trinsic2 1y agoI dunno man Windows is pretty bad with drain in modern stand by too.
- hackyhacky 1y agoCorrect. 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.
- deleted 1y ago[deleted]
- jes5199 1y agoand yet my M1 manages to drain the battery in suspend mode in just a few hours
- maleldil 1y agoSomething's wrong. Maybe a setting or a random app is preventing your laptop from sleeping properly. You have many threads here saying that MacBooks can go weeks on sleep, and that's also my experience (M1 Pro).
- vladvasiliu 1y agoThere was a thread about just this issue another day. I don't daily drive an MBP anymore, only occasionally. But I had one for a week or so, and once or twice I've noticed that my backlit keyboard still had its lights on, which is unusual when the computer sleeps. The screen was dark, though, so it can be confusing.
- rikkert 1y agoLet me guess, you use docker?
- jjice 1y agoMy 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 1y agoI 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.
- charcircuit 1y ago>I don’t think there’s much framework can do The MacBook is an existence proof that there is something they can do.
- mcny 1y agoDoes Framework operate at the same abstraction level as Apple? I thought because of scale, Apple can dictate terms from its suppliers to get everything custom. I would imagine Dell, Lenovo, and HP simply don't care enough and Framework and System 76 and the like don't have enough scale to get custom parts or custom code from vendors?
- izacus 1y agoThe 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.
- terribleperson 1y agoMaybe it just works on MacOS, but it's prone to all kinds of breakage on Windows.
- saratogacx 1y agoThat's because MSFT doesn't really do hibernate any more but does "modern sleep" where it functions like a phone with the screen off. It keeps active network connections, downloads patches and keeps checking for notifications and other such nonsense. BIOS support for proper hibernation has been getting worse too because with MSFT demanding it, there is little reason to continue support. I've had older laptops that do the sleep->hibernate setup without too much issue but now it is a crap-shoot on if it is even supported in the hardware.
- izacus 1y agoNo, Hybrid Sleep is when the Windows machine goes from Modern Standy to full shutdown and power off. All laptops support that though it's not always enabled as a feature by default.
- Grazester 1y agoInteresting. I have yet to come across a computer that I couldn't hibernate in Window.
- heavyset_go 1y agoYou used to be able to edit ACPI tables to reenable S3 sleep but these days they're stripping the functionality from firmware entirely. For example, HP's enterprise lines have S3 stubs in their firmware. If you enable them, nothing happens, because someone deliberately removed the S3 blobs entirely.
- 0x38B 1y agoI was excited to see news about AMD beginning work on ACPI C4 in the Linux kernel (1) – my Framework loses about 10% a day in suspend, sometimes more, which is OK for me but of course I’d love for it to be better! 1: https://www.phoronix.com/news/AMD-ACPI-C4-Linux-Kernel-Code https://www.phoronix.com/news/AMD-ACPI-C4-Linux-Kernel-Code
- deepsun 1y agoNo, 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.
- mort96 1y agoHow long does it keep its charge in sleep mode? Weeks or days?
- rv3392 1y agoI believe they mean it lasts 14+ hours in sleep.
- deepsun 1y agoNo, in work mode. I'd keep using it if not for the keyboard (kept messing PgUp/Left and PgDown/Right).
- heavyset_go 1y agoSystem76 edits firmware to enable S3 sleep on their machines. S3 sleep uses less power than Modern Standby.
- ben-schaaf 1y agoI've heard this isn't possible on AMD unfortunately.
- heavyset_go 1y agoI'm on an AMD machine that System76 wrote the firmware for, and they specifically wrote in S3 sleep functionality despite the base firmware missing it.
- j45 1y agoHopefully it can find it's way to Framework.
- fpoling 1y agoI 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.
- anon7000 1y 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
- beeflet 1y agoI 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.
- fpoling 1y agoDoes the system use a boot loader? Or does it boot directly into kernel bypassing bootloaders?
- beeflet 1y agoIt boots directly into the kernel without a bootloader. You can specify built-in command line options when you're compiling the kernel. To dual-boot, I boot from a removable USB drive on my keychain. When it's not plugged in, it boots windows instead.
- vladvasiliu 1y ago
- billfor 1y agoI thought the issue with suspend on Linux was that swap had to be encrypted, but you could do it without kernel changes. There are some instructions here: https://techblog.dev/posts/2023/08/encrypted-swap-partition-support-hibernation-suspend-resume-linux/ https://techblog.dev/posts/2023/08/encrypted-swap-partition-...
- heavyset_go 1y agoEncrypted swap is a solved problem and has been for a long time
- worble 1y agoWhile 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.
- GZGavinZhao 1y agoThere 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.
- worble 1y agoLet me preface this reply with that I'm not trying to preach or tell you how to live your digital life - everyone is different and if you have setup that works for you then great, keep on trucking. That said, I worked the same way many years ago, with browser tabs and desktop sessions that were precious and I didn't want to drop them. But what I ended up realizing was that the stress of losing that state due to random power failures or software bugs was too much. I found it far better for my sanity and actual productivity to instead make sure I had a sane note taking system, where I could track what was actually important to me. It was a great relief to my mental state and general stress to allow myself to shut down all processes and start clean every day.
- Implicated 1y agoWhile I understand your perspective here - let me counter with mine. I have the same issue where I maintain a 'state' that I'd prefer to maintain but my interest in maintaining it does have this anxiety you describe. It's just a huge waste of time to get it all back. I see it no different than being in the middle of a heavy coding/mental task and being interrupted to the point that you have to 'start over' in the sense of getting all that context back in the right places. Sure, I _could_ neatly close everything out and have a pristine perfect work/desktop environment. But, personally, when I see the work/desk environment of someone and it's absolutely pristine all I can think about is how they're spending energy to maintain that. To give another example - in my workshop (woodworking), if I'm in the middle of something and need to take a break/leave the shop... I'm not putting _anything_ away. I turn off the lights and walk out. That way when I return I don't have to set everything back up. Now - when I finish something, then I go through and clean up and organize and get the state freshened up. Same thing with my laptop/computer. Zero anxiety about it all - it's not about losing anything but time. And that's what's most important.
- fsckboy 1y 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 1y agoHave you tried an apple silicon macbook?
- heavyset_go 1y agoIf 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.
- nrp 1y agoOut 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 https://github.com/basecamp/omarchy/pull/1417
- chatmasta 1y agoLet’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.
- deleted 1y ago[deleted]
- karel-3d 1y agoI will be very surprised if DHH fixes something that hasn't been properly solved in mainline Linux distros for years. (decades?)
- yunohn 1y agoAt the very minimum, omarchy and omakub already provide out of the box seamless fixes for all the common issues that are “fixed” but need tedious involved configuration nonetheless.
- osigurdson 1y agoIs the Mac actually hibernating though?
- saagarjha 1y agoTypically a Mac will only hibernate if you ask it to or it's out of battery.
- didibus 1y 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.
- bzzzt 1y agoMac 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'.
- izacus 1y agoThat's just plainly not true. Apple calls it "Safe Sleep" (https://support.apple.com/en-gb/guide/mac-help/mh10328/mac https://support.apple.com/en-gb/guide/mac-help/mh10328/mac) and you get a progress bar when it wakes from it. Yes, even on magical Ms.
- bzzzt 1y agoInteresting, never heard of that specific mode before. Does it save the entire RAM or just the OS state and open files?
- saagarjha 1y agoIt's proper hibernation with all your RAM
- acchow 1y agoMost people don't encounter this. It only happens when your macbook battery is about to die while in sleep mode.
- didibus 1y agoAh yes, I think I've seen this before, it still resumes impressively fast from it, and I think since I normally notice the battery is almost dead it gives itself a good excuse.
- fooker 1y agoThis 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.
- kelvie 1y agohttps://lore.kernel.org/linux-pm/20231114022503.6310-1-kelvie@kelvie.ca/T/#u 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 1y 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).
- Throwaway123129 1y agoThis 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 1y agoShouldn'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?
- maeln 1y agoAs I remember, sleep state are mostly implemented by the CPU (or require the CPU collaboration), and neither intel nor AMD does s3 sleep on their proc anymore.
- vaylian 1y agoFramework doesn't produce it's own CPUs. It buys them directly from Intel. Producing your own CPU is really difficult, if you want it to be competitive with other state-of-the-art CPUs.
- FirmwareBurner 1y agoThey don't need to make their own CPUs for that. Framework can write its own BIOS and ACPI drivers for Windows and Linux to have proper sleep support. But that's more R&D expenditure they probably can't afford. For example, for my home lab, I bought a used Intel 12th gen industrial PC from a specialized Taiwanese embedded systems company, whose BIOS allows very granular control of all sleep states plus individual power control of most peripherals, probably because that's a must-have for customers in that space over stuff like benchmark scores and bang for the buck. So technically, IT IS possible to do, just probably not very cost effective for consumer devices.
- lenkite 1y agoThis 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.
- gwd 1y agoWhat'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 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 1y agoWindows 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.
- acchow 1y ago> and you cannot hibernate a lockdowned kernel Why do you need hibernation? Apple gets the ultra low power without suspending to disk?