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.
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.
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... :(
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.
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).
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.
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.
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.
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.
> 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:
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.
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.
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.
30 comments
[ 3.1 ms ] story [ 73.7 ms ] threadThat said, I don't think any laptop has a PCIe to PCI bridge. This should only affect some desktops and servers.
https://en.wikipedia.org/wiki/Active_State_Power_Management
https://www.cnx-software.com/2019/06/29/new-raspberry-pi-4-v...
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.
It's made me consider installing Windows and developing inside VirtualBox.
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.
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.
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...
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.
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.
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.