
Deleting a Few LOC Can Yield “Significant” Power Savings on Some Linux Systems - Memosyne
https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.8-ASPM-PCIe-PCI-PCI-X
======
segfaultbuserr
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.

~~~
frosted-flakes
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.

~~~
rcxdude
> 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...](https://superuser.com/questions/1020768/laptop-wakes-up-from-sleep-
every-several-hours)

~~~
rurban
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.

------
clarry
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](https://en.wikipedia.org/wiki/Active_State_Power_Management)

~~~
kees99
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...](https://www.cnx-software.com/2019/06/29/new-raspberry-pi-4-vli-
firmware-lowers-temperature/)

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

~~~
fred_is_fred
I don't think this is a specific PCI driver but core to how the PCI subsystem
works.

------
manicdee
“Old patch disabling Active State Power Management deleted, significant energy
savings expected on some ancient hardware.”

------
voltagex_
So what's the cumulative amount of power wasted?

~~~
ggreer
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.

------
jack95
Clickbait title

~~~
MaxBarraclough
Agree. It would be better if it gave the maximum amount of technical detail
possible given the space constraint.

