Hacker News new | ask | show | jobs
by PragmaticPulp 1868 days ago
I’m also frequently confused when people refer to Windows laptops as in a different league of battery life. Modern Windows laptops do just fine. M1 is a cycle ahead, but the Ryzen mobile parts are actually very good too.
3 comments

Lots of people buy 15 inchers with dedicated graphics etc. Or like... run Linux (which hoses the battery on a lot of stuff if you just use it out of the box without tweaking stuff).

Also really cheap laptops aren't as great about battery life just cuz of reasons. I think there's a lot of selection bias (like people who have a lot of money will buy macbooks in general cuz that's what everyone says to do)

I've used various distros on my recentish Dell laptop. I get the advertised 8-10hrs without configuring anything.

It just werks.

I configured my Thinkpad X280 under Arch to run at roughly 3 Joules/second. Which gives me way over 12 hours of active use time.

Linux is far superior to windows in this regard.

Unless, unfortunately, you've got switchable nVidia graphics. As of last year, at least, without some real gross stuff you're looking either at awful multi-monitor performance on AC power (because the dGPU is permanently switched off) or awful battery life (because you're using the nVidia chipset and it eats batteries for breakfast, lunch, and dinner).
Nvidia's Linux support story has been crummy for the last half decade, if you bought a laptop with an Nvidia dGPU and are expecting it to work efficiently in Linux then you need an expectation reset.
Yeah, for graphics it sucks. OTOH, for CUDA it's literally just plug-and-play (at least on Ubuntu 20.04).

Makes a nice change from five years ago, when I kept breaking my display in order to make CUDA work.

> Joules/second

aka Watts

To be fair the laptop is rated for 16.5 hrs.
Yes, in some weird lab setting with 12% screen brightness and no user activity.
a friend got X250 with no tuning to work continuously for something like 26 hours.

But thinkpads didn't tend to remove batteries to get slimmer then.

how's the keyboard compared to 2015 macbooks?
It's very much OK. It's different but it's still good. I prefer the MBP (provided 2015 is still the old non-butterfly mechanism) but I would have no problem with switching 100% to the TP keyboard.
Why isn't Linux configured to better preserve battery life on laptops by default? Power usage has been an issue for over a decade. If it's just a matter of a few tweaks, surely it could be done?
It's not a matter of just a few tweaks. It's a few new tweaks each generation, as Microsoft and Intel keep changing their minds on what the "right" way is to put devices into low-power modes, and then not thoroughly documenting those changes let alone upstream them for inclusion in standards documents.

And then there are the hardware bugs which require workarounds in firmware or drivers, and the firmware bugs which require workarounds in drivers, all of which are only developed and tested against Windows.

The set of power management options that Windows 10 exposes to the user has been steadily dwindling to the point that on a new laptop you basically only get to customize how long before the screen shuts off and how long before it goes to sleep. All the more detailed options you had in early Windows 10 or in Windows 7 are no longer exposed, because there's no consistent way to map such controls onto the ever-shifting set of underlying platform features.

Distros don't even automatically install and configure TLP when they detect an internal battery. So yeah, it is 'Linux' that is the problem on laptops.

That and automatically activating a 'small speaker' EQ for when a device is detected to be portable / be a laptop and have internal speakers would be a massive user experience improvement for laptop Linux users.

> Distros don't even automatically install and configure TLP when they detect an internal battery.

TLP isn't magic. More than half of its documented options are inapplicable to current hardware or kernels, and a fair number of the remaining options that could still have an effect are not safe for distros to ship as defaults, usually because they'll trigger firmware or hardware bugs. Installing TLP by default would be far from an actual solution, and isn't even that great a first step toward solving platform power management inadequacies.

A few tweaks for each different model of laptop. Consumes a lot of volunteer effort very quickly, that.
And some of the tweaks can cause instability or data loss on different models with different quirks.
Mostly speculation, but I think a big part of it is that MacOS will heavily throttle as it needs to, and I imagine that Windows laptop drivers get a lot of love in that space too since the manufacturers want to get good battery life in their machines as well.

I'm sure a huge component of it is just people-hours spent in figuring out the right balance of defaults that don't just mess people's setups up.

It's up to each distribution to provide a kernel build + configuration that suits some specific use-case.
Pop OS has it's own power management that is pretty decent. I can almost get through a whole day of work without plugging in.
I suspect it has todo with getting decked out machines. If you've got the >1tb ssd and the >=32GB RAM model, you will see your OS simply use the ressources for caching and speeding up the machine, which in turn will use more battery.

At least that's my pet theory, running an 4750U with 64GB of RAM installed ;)

The RAM probably uses more power just by having more installed, but it shouldn't be causing more expensive work. If anything, being able to use RAM cached content should allow the SSD and its IO channels to idle more often. A "decked out" laptop might also have a more powerful GPU with nowhere near as good idle power characteristics.

But, the largest differences are probably in idle power management, with the phone having much lower power IO channels and better zoned power management to really reduce idle power. A laptop often has the system in a much higher power level with off-chip resources powered up, including WiFi, screen refresh, data buses, and backlight driving a much larger screen area.

Edit to add: I've noticed on laptops with Linux that vastly different battery life from "similar" machines come from differences in how the software and firmware interact to reach different powersaving modes for screen on but idle states, such as with a browser open on a page that has already rendered and awaits user input.

That’s not quite accurate. When you’re talking about standby time in suspend-to-ram, RAM refresh is actually a non-trivial battery cost because it’s basically you’re only active power draw remaining. Which DIMMs have active memory pages is a partial function of memory usage.

So if your kernel woke up (let’s say after 30 min of suspend to ram) to try and see if it can reclaim physical DIMMs and mark them unused (shrink caches, reorganize pages, etc) you could get quite a big win on standby time. The trick is how to do this without actually hurting battery life (waking up can be expensive and there’s no guarantee you’ll be able to free up DIMMs) and preserving wake from suspend performance (if you’re phone is laggy on wake that’s an experience users will switch away from + you could eat your entire power savings paging back in).

Is the memory controller aware of unused pages in physical RAM that thus can be safely skipped during refresh? That would surprise me. In stand-by the self-refresh mode is used, and I believe partial refresh is only supported by the low-power (LPDDRx) standards and is very coarse-grained.
No. What I heard proposed was just at the DIMM level. The memory controller has no concept of memory usage.
The refresh costs you are talking about are what I meant by the RAM has cost by being installed on a typical laptop. The power is used because the machine is in an active-idle power state with that much RAM installed, not because the OS has decided to burn more CPU time in the presence of more RAM as someone suggested earlier in the chain. Most of the idle power consumption is all the ancillary system controllers, not the CPU cores themselves. These are the things that are better managed on a typical smartphone SoC platform.

And, I am referring to active idle, not suspend-to-ram scenarios. I think people are talking about screen-on time for battery life, not lid closed and suspended nor lid open but screen disabled. Precious few people are enjoying a laptop that successfully performs a suspend to RAM sleep state while keeping the display alive. Often, the integrated GPU is continuously scanning framebuffers in system RAM and outputting pixel data to the embedded display port even though nothing is changing on screen. Frequently, drivers have disabled LCD panel self refresh modes due to unresolved glitches and artifacts in the graphics stack.

Yup. One of the major reasons cell phones outperform laptops on battery life is because they go to suspend to RAM aggressively. I think a similarly aggressive mode would be needed for laptops on battery power to compete effectively (& might require OS optimizations to make the wake scenario to be as instant as it is on mobile).
It's a reality distortion field and maybe effect of not blocking OSX's default "go to sleep the moment you stop looking at it" policy. Macs were stuck at (marketing) 10h battery lifetime for so long (for comparison - Xeon mobile workstations with few times the power regularly hit 10h on battery without tuning), that M1 feels like huge jump out of nowhere.