News for hackers. Stuff that matters.
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by segfaultbuserr on Friday May 22, 2020 @06:32AM (#23270564)
It's increasingly difficult to do power saving in modern laptops with highly integrated SoC - a single component can prevent the entire system from entering a deeper power saving state. In the old days, CPU and graphics were basically everything, but there can be an endless number of traps today, a SATA driver, an audio driver, or a PCI bridge in this case, not to mention that many subsystems are poorly documented. And even if the potential of power saving in a device driver is identified, it's often plagued with mysterious bugs (the Window driver may include nonstandard workarounds).

Only Intel knows everything, I guess even Microsoft doesn't (try running Windows without all the Intel chipset drivers installed...). If you take a modern laptop and put Linux on it, it's possible that you'll only able to get 50% of the battery life. And there's nothing you can do about it.

Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by frosted-flakes on Friday May 22, 2020 @08:25AM (#23271324)
Even Microsoft's own hardware can't get it right. I have a Surface Pro 3, and it will not stay in sleep mode. The screen frequently turns on for no reason at all, even if the keyboard cover is closed. I've taken to putting it in hibernate mode whenever I know I won't be using it for more than a few minutes, otherwise I'll come back to a dead battery.

But even hibernation doesn't always work. My custom-built desktop PC frequently wakes itself out of hibernation in the middle of the night. I don't even know how that's possible, because I thought hibernation was "off, with RAM saved to storage". Which is just wonderful when I'm sleeping in the same room.

Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by rcxdude on Friday May 22, 2020 @08:50AM (#23271471)
> But even hibernation doesn't always work. My custom-built desktop PC frequently wakes itself out of hibernation in the middle of the night. I don't even know how that's possible, because I thought hibernation was "off, with RAM saved to storage". Which is just wonderful when I'm sleeping in the same room.

This is generally using ACPI 'wake timers', which allow the RTC on the motherboard to wake up the system at a particular time (which I think is a useful feature, but only if explicitly requested by a user). Windows is particularly bad at this, since scheduled events are allowed to use this by default to wake up the PC when they are supposed to fire (and 'UpdateOrchastrator' has one which fires in the middle of the night). There's a decent bit of info on how to identify why this is happening and stop it here:

https://superuser.com/questions/1020768/laptop-wakes-up-from...

Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by rurban on Saturday May 23, 2020 @12:33AM (#23279915)
For me it's only my cat walking over the keyboard or mouse.

The third allowed option (Linux) is wake on lan, which is only triggered through my laptop. I automate WOL events sometimes over cronjobs, when the big machine needs to do some work overnight for some minutes, but very rarely, because it's too loud. But I do those wake up, sleep cycles occasionally automatically when the machine processes big events like the Berlinale, Cannes or Sundance Film Festivals.

Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by Fire-Dragon-DoL on Saturday May 23, 2020 @09:15AM (#23282668)
Oh god thanks. This issue plagued me for the last 5 years, to the point I joked my desktop was possessed.
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by wildmusings on Friday May 22, 2020 @08:32AM (#23271363)
I’ve had this same issue with a different laptop. On my machine, any change in WiFi network or Bluetooth device availability would cause the laptop to spin up, prevent sleep, and drain battery. One trick is to turn off connected standby and switch to “disconnected modern standby”. That disables the WiFi and Bluetooth chips during standby, which should solve your issues. The only downside I’m aware of is that the machine will take a few seconds upon awakening to reconnect to WiFi and Bluetooth peripherals.

Alternatively, you can disable connected/modern standby altogether and revert to traditional S3 sleep. You lose that instant-on tablet effect, but it should fix the excess battery drain too.

Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by daemin on Friday May 22, 2020 @10:29AM (#23272464)
I have that happen with hibernated desktops, where they would wake up randomly to do something then shut down again.

On some forums I read that people suspect its the virus scanner or some other scheduled task that is doing this. If someone knows why this is actually happening then that knowledge would be appreciated.

Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by wlesieutre on Friday May 22, 2020 @08:41AM (#23271410)
SP3 was their first experiment with "Connected Standby" and it showed. I had the same experience with sleep, as well as other problems like the wifi being unable to hold a connection. I wonder if newer models have gotten any better.
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by CyberDildonics on Friday May 22, 2020 @08:55AM (#23271497)
There are power mode settings in windows that you might be able to configure to alleviate some of the grief. I can't say how much of it will actually work, but if you haven't gone down that rabbit hole it's worth a try.
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by csharptwdec19 on Friday May 22, 2020 @09:23AM (#23271735)
Double checked WOL and/or wireless device wakeup settings?
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by throw4839 on Friday May 22, 2020 @06:36AM (#23270596)
AMD is now doing new power saving system basically from scratch. I really hope it will be linux friendly.
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by m463 on Friday May 22, 2020 @06:44AM (#23270637)
I've looked at code like that. It's amazing the kinds of rigamarole you have to do to prevent something waking up just because some a API call (like a status call) should be turned away instead of poking the chip.
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by TomMarius on Friday May 22, 2020 @06:38AM (#23270610)
My Dell XPS had less than 30% with latest Ubuntu (after powertop) :\
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by segfaultbuserr on Friday May 22, 2020 @06:46AM (#23270648)
I'd say powertop is almost useless today. It was designed in an era when individual devices were loosely-coupled, you could simply identify the power hogs one-by-one and fix them. Today, power management is tightly-coupled with many subtle interactions and dynamic behavior. The most-common failure mode today: something prevents the SoC from entering a deeper sleep mode - you can't fix it with powertop, better to start reverse engineering firmware and Windows drivers... :(
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by cesarb on Friday May 22, 2020 @07:00AM (#23270730)
I'd say powertop can be worse than useless today. Its suggestions are too aggressive, it suggests min_power which can cause data corruption, instead of med_power_with_dipm which is the recommended value nowadays.
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by motogpjimbo on Friday May 22, 2020 @07:25AM (#23270893)
We also use Dell XPS laptops with Ubuntu. We get about an hour of battery life and no hibernate or suspend.

It's made me consider installing Windows and developing inside VirtualBox.

Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by krastanov on Friday May 22, 2020 @08:37AM (#23271387)
Check `/sys/power/men_sleep`. For me its default setting was the source of poor battery life during suspend.
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by willis936 on Friday May 22, 2020 @09:05AM (#23271577)
If you don’t need a dm, I recommend Windows Subsystem for Linux (WSL). It’s been a joy to use so far. GUI applications can run via X11 server (I recommend VcXsrv).
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by MivLives on Friday May 22, 2020 @07:57AM (#23271132)
I actually did this for awhile. It was kinda nice from a distraction point of view, as the VM didnt have my bookmarks or other programs.
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by krastanov on Friday May 22, 2020 @08:36AM (#23271380)
Did you check `/sys/power/men_sleep`? it was the source of this problem for me on XPS.
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by clarry on Friday May 22, 2020 @05:54AM (#23270320)
To save you a click: There was code that disabled ASPM[1] when you have a PCI bridge connected downstream of PCIe. That code is gone now.

https://en.wikipedia.org/wiki/Active_State_Power_Management

Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by kees99 on Friday May 22, 2020 @06:59AM (#23270727)
Reminds me of the Raspberry pi 4 update, where enabling ASPM shaved something like 10% off the idle power consumption:

https://www.cnx-software.com/2019/06/29/new-raspberry-pi-4-v...

Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by baybal2 on Friday May 22, 2020 @08:38AM (#23271395)
I see this as a flaw of Linux development model, and how code from hardware vendors gets a free go.

When Linux was still small, each and every major hardware platform was worked on until mirror polish, and it worked "well."

Now, the only criteria, when Linux mainly relies on hardware maker programmers to do their job, is that the code compiles and works.

Without much pressure from users, there is nobody to push against "barely works" driver code.

Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by fred_is_fred on Friday May 22, 2020 @09:53AM (#23272065)
I don't think this is a specific PCI driver but core to how the PCI subsystem works.
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by manicdee on Friday May 22, 2020 @08:10AM (#23271230)
“Old patch disabling Active State Power Management deleted, significant energy savings expected on some ancient hardware.”
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by voltagex_ on Friday May 22, 2020 @05:30AM (#23270179)
So what's the cumulative amount of power wasted?
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by ggreer on Friday May 22, 2020 @06:28AM (#23270532)
Depends on the system. On newer Intel machines, it will prevent the SoC from going into lower power states than PC2. On my laptop, that means idling at 5 watts instead of 2ish watts.

That said, I don't think any laptop has a PCIe to PCI bridge. This should only affect some desktops and servers.

Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by jack95 on Friday May 22, 2020 @05:44AM (#23270255)
Clickbait title
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by MaxBarraclough on Friday May 22, 2020 @06:15AM (#23270441)
Agree. It would be better if it gave the maximum amount of technical detail possible given the space constraint.
Re:Deleting a Few LOC Can Yield “Significant” Power Savings ... by rbinv on Friday May 22, 2020 @05:51AM (#23270302)
Not really.